-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(landing): TwistySection lazy loading
- Loading branch information
Showing
2 changed files
with
36 additions
and
31 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
src/features/landing/sections/HeroSection/TwistySection.lazy.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ( | ||
<> | ||
<TwistyCube player={player} className='mb-2 h-full w-full flex-1' /> | ||
<TwistyScrubber player={player} className='mb-1 w-full px-12' /> | ||
<TwistyControls player={player} className='w-full px-8' size='sm' /> | ||
</> | ||
) | ||
} | ||
|
||
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", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters