diff --git a/src/features/landing/sections/HeroSection/TwistySection.lazy.tsx b/src/features/landing/sections/HeroSection/TwistySection.lazy.tsx new file mode 100644 index 0000000..628e046 --- /dev/null +++ b/src/features/landing/sections/HeroSection/TwistySection.lazy.tsx @@ -0,0 +1,26 @@ +import { useTwistyPlayer, TwistyCube, TwistyControls, TwistyScrubber } from '@/shared/twisty' +import { useEffect } from 'react' + +export default function TwistySection() { + const player = useTwistyPlayer(VALK_474_WR) + + useEffect(() => player?.play(), [player]) + + if (!player) { + return null + } + + return ( + <> + + + + + ) +} + +const VALK_474_WR = { + scramble: "F2 U2 R2 F' L2 F2 U' R F D U F2 U R B R2 U B' R'", + solution: + "z r' D R2 R U' R' U' L' U' L U' U' R U R' d' U' R U R' d' U' R U' R' L U' L' y' U' U' R' U2 R U' U' R' U R' F R F' U R U", +} diff --git a/src/features/landing/sections/HeroSection.tsx b/src/features/landing/sections/HeroSection/index.tsx similarity index 87% rename from src/features/landing/sections/HeroSection.tsx rename to src/features/landing/sections/HeroSection/index.tsx index 54c80b8..19f8766 100644 --- a/src/features/landing/sections/HeroSection.tsx +++ b/src/features/landing/sections/HeroSection/index.tsx @@ -1,11 +1,11 @@ import { LoadingSpinner } from '@/components/ui' -import { StopwatchIcon } from '../shared/icons' -import { TwistyControls, TwistyCube, TwistyScrubber, useTwistyPlayer } from '@/shared/twisty' +import { StopwatchIcon } from '../../shared/icons' import { KEY_MAP, KeyMapTile } from '@/shared/KeyMapDialog' -import { useEffect } from 'react' -import { Container } from '../shared/Container' -import { AnimatedBlob } from '../shared/AnimatedBlob' -import { StaticLinkToApp } from '../shared/LinkToApp' +import { Container } from '../../shared/Container' +import { AnimatedBlob } from '../../shared/AnimatedBlob' +import { StaticLinkToApp } from '../../shared/LinkToApp' +import { Suspense, lazy } from 'react' +const TwistySection = lazy(() => import('./TwistySection.lazy')) export function HeroSection() { return ( @@ -31,8 +31,11 @@ export function HeroSection() {

+
- + }> + +
@@ -82,30 +85,6 @@ function AnimatedBackground() { ) } -function TwistySection() { - const player = useTwistyPlayer(VALK_474_WR) - - useEffect(() => player?.play(), [player]) - - if (!player) { - return - } - - return ( - <> - - - - - ) -} - -const VALK_474_WR = { - scramble: "F2 U2 R2 F' L2 F2 U' R F D U F2 U R B R2 U B' R'", - solution: - "z r' D R2 R U' R' U' L' U' L U' U' R U R' d' U' R U R' d' U' R U' R' L U' L' y' U' U' R' U2 R U' U' R' U R' F R F' U R U", -} - const CLIP_PATH_POLYGON = `polygon( calc(100% - 24px) 0px, 24px 0px,