Skip to content

Commit 32e2a75

Browse files
committed
feat(website): minor improvements
1 parent a8c5c90 commit 32e2a75

File tree

3 files changed

+109
-110
lines changed

3 files changed

+109
-110
lines changed

apps/website/components/EffectLayer.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable perfectionist/sort-objects */
21
"use client";
32

43
import type { PropsWithChildren } from "react";
@@ -217,7 +216,7 @@ export type EffectLayerProps = PropsWithChildren<{
217216
}>;
218217

219218
export function EffectLayer({ children, className }: EffectLayerProps) {
220-
const rRaf = useRef<number>(null);
219+
const rRaf = useRef<number>(-1);
221220
const rRoot = useRef<HTMLDivElement>(null);
222221
const rCanvas = useRef<HTMLCanvasElement>(null);
223222
const isActive = useRef<boolean>(false);
@@ -265,13 +264,13 @@ export function EffectLayer({ children, className }: EffectLayerProps) {
265264

266265
ro.observe(root);
267266
rRaf.current = requestAnimationFrame(update);
268-
canvas.style.opacity = "1";
267+
canvas.style.opacity = "0.5";
269268
isActive.current = true;
270269

271270
return () => {
272271
isActive.current = false;
273272
canvas.style.opacity = "0";
274-
if (rRaf.current != null) cancelAnimationFrame(rRaf.current);
273+
cancelAnimationFrame(rRaf.current);
275274
ro.disconnect();
276275
};
277276
}, []);
@@ -291,16 +290,16 @@ export function EffectLayer({ children, className }: EffectLayerProps) {
291290
}
292291

293292
const styles = {
294-
root: cn(
295-
"z-[0]",
296-
"absolute",
297-
"inset-[0]",
298-
"pointer-events-none",
299-
),
300293
canvas: cn(
301294
"w-full",
302295
"h-full",
303296
"pointer-events-none",
304297
"opacity-0",
305298
),
299+
root: cn(
300+
"z-[0]",
301+
"absolute",
302+
"inset-[0]",
303+
"pointer-events-none",
304+
),
306305
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"@typescript-eslint/rule-tester": "^8.31.1",
6767
"@typescript-eslint/types": "^8.31.1",
6868
"ansis": "^3.17.0",
69-
"cspell": "^8.19.3",
69+
"cspell": "^8.19.4",
7070
"dedent": "^1.6.0",
7171
"dprint": "^0.49.1",
7272
"esbuild": "^0.25.3",

pnpm-lock.yaml

Lines changed: 99 additions & 99 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)