Skip to content

Commit

Permalink
m
Browse files Browse the repository at this point in the history
  • Loading branch information
julianbenegas committed Oct 10, 2023
1 parent 9e8a503 commit 08bcd89
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
visibility: hidden;
color: var(--color-white);

animation: fade-in 1s ease-out forwards;

&.initialized {
visibility: visible;
}
Expand Down Expand Up @@ -219,6 +221,17 @@
}
}

@keyframes fade-in {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0px);
}
}

.tween {
--duration-percentage: 0;
--start-offset-percentage: 0;
Expand Down
12 changes: 5 additions & 7 deletions website/src/app/components/cyllinder/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import Image from "next/image";

import s from "./cyllinder.module.scss";
import clsx from "clsx";
import { defaultConfig, useMapToCylinder } from "./helpers";
import { useMapToCylinder } from "./helpers";
import { Experiment } from "../../../lib/types";
import { useMedia } from "../../../hooks/use-media";
import Link from "next/link";
import { useViewportSize } from "~/hooks/use-viewport";

Expand All @@ -22,8 +21,7 @@ const itemsInViewAtOnce = 7;
const itemsPadding = 4;

export const Cyllinder: React.FC<CyllinderProps> = ({ experiments }) => {
const { height, aspect } = useViewportSize();
const isMobileSize = useMedia("(max-width: 768px)");
const { height } = useViewportSize();
const pinSpacerHeight = `calc(3 * ${itemHeight} * ${
Math.max(itemsInViewAtOnce, experiments.length) + itemsPadding
})`;
Expand Down Expand Up @@ -51,9 +49,9 @@ export const Cyllinder: React.FC<CyllinderProps> = ({ experiments }) => {
callbacks={{
onRefresh: () => update(progress.value),
}}
// debug={{
// label: "cylinder",
// }}
debug={{
label: "Cylinder",
}}
>
<div
className={s["section"]}
Expand Down
5 changes: 1 addition & 4 deletions website/src/app/sections/footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ export const Footer = () => {
const isDesktopSm = useMedia("(min-width: 1024px)");

return (
<Scrollytelling.Root
start="top 80%"
// debug={{ label: "footer" }}
>
<Scrollytelling.Root start="top 80%" debug={{ label: "Footer" }}>
<footer className={s.footer}>
<PreFooter />
<div className={s["imgs-container"]}>
Expand Down
2 changes: 2 additions & 0 deletions website/src/app/sections/hero/hero.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
.pin-spacer {
position: relative;
z-index: 1;
opacity: 0;
transition: opacity 1s ease-in-out;
}

.header {
Expand Down
20 changes: 20 additions & 0 deletions website/src/app/sections/hero/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,30 @@ import { LogoBasement } from "../../logos/logo";
import { CanvasWithMacModel } from "./mac-model";
import { toVw } from "~/lib/utils";
import { useMedia } from "~/hooks/use-media";
import { useEffect } from "react";

export const Hero = () => {
const isMobileSize = useMedia("(max-width: 768px)");

useEffect(() => {
const handleKeyDown = (e: KeyboardEvent) => {
if (e.key === "k") {
const el = document.querySelector<HTMLDivElement>(
`.${s["pin-spacer"]}`
);
if (el) {
el.style.opacity = "1";
}
}
};

window.addEventListener("keydown", handleKeyDown);

return () => {
window.removeEventListener("keydown", handleKeyDown);
};
}, []);

return (
<Scrollytelling.Root
defaults={{ ease: "linear" }}
Expand Down
2 changes: 1 addition & 1 deletion website/src/app/sections/last-parallax/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const LastParallax = () => {
<Scrollytelling.Root
start="top bottom"
scrub={0.75}
// debug={{ label: "last parallax" }}
debug={{ label: "Last Parallax" }}
>
<section className={s["section"]}>
<div className="wrapper">
Expand Down

0 comments on commit 08bcd89

Please sign in to comment.