From ef55a0aaf89434b78d0b902a745393f14aa7f015 Mon Sep 17 00:00:00 2001 From: Keith Vaughan Date: Fri, 20 Dec 2024 17:12:18 +0700 Subject: [PATCH] fixed animation logo --- src/components/CipherLoading.tsx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/CipherLoading.tsx b/src/components/CipherLoading.tsx index 37616e3..c926c28 100644 --- a/src/components/CipherLoading.tsx +++ b/src/components/CipherLoading.tsx @@ -7,7 +7,7 @@ import Image from 'next/image' import { usePathname } from 'next/navigation' const letters = [ - '零', '壱', '弐', '参', '肆', '伍', '陸', '質', '捌', '玖', + '零', '壱', '弐', '参', '肆', '伍', '陸', '質', '捌', '玖', 'ア', 'イ', 'ウ', 'エ', 'オ', 'カ', 'キ', 'ク', 'ケ', 'コ', '⟨', '⟩', '⟪', '⟫', '⌈', '⌉', '⌊', '⌋', '∮', '∯', '†', '‡', '§', '¶', '©', '®', '™', '⁂', '⁕', '⁜', @@ -36,7 +36,7 @@ function BackgroundMatrix() { const initialSymbols: MatrixSymbol[] = [] const symbolCount = Math.floor((window.innerWidth * window.innerHeight) / 10000) * 2 - + for (let i = 0; i < symbolCount; i++) { initialSymbols.push({ id: i, @@ -50,7 +50,7 @@ function BackgroundMatrix() { const animate = (time: number) => { if (previousTimeRef.current !== undefined) { - setSymbols(prevSymbols => + setSymbols(prevSymbols => prevSymbols.map(symbol => ({ ...symbol, char: Math.random() < 0.15 ? letters[Math.floor(Math.random() * letters.length)] : symbol.char, @@ -98,11 +98,11 @@ export default function CipherLoading() { const [isVisible, setIsVisible] = useState(true) const { setIsDark, setIsInitialLoading } = useBackground() const pathname = usePathname() - + useEffect(() => { // Force dark mode during loading setIsDark(true) - + const timeout = setTimeout(() => { setIsVisible(false) setIsInitialLoading(false) @@ -113,7 +113,7 @@ export default function CipherLoading() { setIsDark(false) } }, 1500) - + return () => { clearTimeout(timeout) // Ensure we maintain the correct state on cleanup @@ -122,7 +122,7 @@ export default function CipherLoading() { } } }, [setIsDark, setIsInitialLoading, pathname]) - + return ( {isVisible && ( @@ -133,8 +133,8 @@ export default function CipherLoading() { className="fixed inset-0 z-[100] flex items-center justify-center bg-black" > -