Skip to content

Commit 9f7f660

Browse files
committed
filip(fix): adjust animation timing and css name
1 parent b12535c commit 9f7f660

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

docs/website/helpers/media-queries.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ export const forLaptop = "(min-width: 1024px)";
88

99
export const forDesktop = "(min-width: 1280px)";
1010

11+
export const forLargeScreen = "(min-width: 1550px)";
12+
1113
export const forTabletOnly = `${forTablet} and (max-width: 1024px)`;

docs/website/src/components/WhyMithril.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ import React, { useEffect, useRef } from "react";
22
import Link from "@docusaurus/Link";
33
import { WhyMithrilContents } from "../../homepage-content/why-mithril";
44
import { cx } from "cva";
5+
import useMediaQuery from "../hooks/useMediaQuery";
6+
import { forLargeScreen } from "../../helpers/media-queries";
57

68
const WhyMithril = () => {
79
const containerRef = useRef<HTMLDivElement>(null);
810
const itemRefs = useRef<(HTMLDivElement | null)[]>([]);
11+
const isLargeScreen = useMediaQuery(forLargeScreen);
912

1013
useEffect(() => {
1114
let animationFrameId: number;
@@ -26,8 +29,8 @@ const WhyMithril = () => {
2629
itemRefs.current.forEach((el, index) => {
2730
if (!el) return;
2831

29-
const start = 0.07 + index * 0.07;
30-
const end = start + 0.5;
32+
const start = 0.07 + index * 0.08;
33+
const end = start + 0.75;
3134

3235
let localProgress = (scrollProgress - start) / (end - start);
3336
localProgress = Math.min(Math.max(localProgress, 0), 1);
@@ -70,7 +73,7 @@ const WhyMithril = () => {
7073
key={index}
7174
ref={(el) => (itemRefs.current[index] = el)}
7275
className={cx(
73-
"grid-item",
76+
"timeline-grid-item",
7477
item === "Basho" && "text-blue-highlight",
7578
)}
7679
style={{

docs/website/src/css/custom.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ a.menu__link {
303303
transform-style: preserve-3d;
304304
}
305305

306-
.grid-item {
306+
.timeline-grid-item {
307307
will-change: transform, opacity, filter;
308308
transition:
309309
opacity 0.1s ease,

0 commit comments

Comments
 (0)