From 9b185f03634441cf0ce918c13ee405836cfb293b Mon Sep 17 00:00:00 2001 From: Bohdan Chornokondratenko Date: Sun, 25 Aug 2024 12:33:38 +0200 Subject: [PATCH] feat(landing): ScramblesAnimation --- .../sections/FeaturesSection/ResultsAnimation.tsx | 2 +- .../FeaturesSection/ScramblesAnimation.tsx | 15 +++++++++++++++ .../landing/sections/FeaturesSection/index.tsx | 3 ++- tailwind.config.ts | 9 +++++++-- 4 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 src/features/landing/sections/FeaturesSection/ScramblesAnimation.tsx diff --git a/src/features/landing/sections/FeaturesSection/ResultsAnimation.tsx b/src/features/landing/sections/FeaturesSection/ResultsAnimation.tsx index e84c833..341657e 100644 --- a/src/features/landing/sections/FeaturesSection/ResultsAnimation.tsx +++ b/src/features/landing/sections/FeaturesSection/ResultsAnimation.tsx @@ -136,7 +136,7 @@ function ResultsAnimationItem( } as CSSProperties } className={cn( - 'absolute animate-landing-falling-text whitespace-nowrap rounded-3xl border border-secondary-20 px-6 py-1 text-[0.875rem] text-grey-20', + 'animate-landing-features-results absolute whitespace-nowrap rounded-3xl border border-secondary-20 px-6 py-1 text-[0.875rem] text-grey-20', )} >
{props.children}
diff --git a/src/features/landing/sections/FeaturesSection/ScramblesAnimation.tsx b/src/features/landing/sections/FeaturesSection/ScramblesAnimation.tsx new file mode 100644 index 0000000..6848c6a --- /dev/null +++ b/src/features/landing/sections/FeaturesSection/ScramblesAnimation.tsx @@ -0,0 +1,15 @@ +import { AnimationItem } from './animations' + +export function ScramblesAnimation() { + return ( +
+ + R' B U L' U' D2 R' U D2 B' U2 D2 L2 F' + +
+ ) +} diff --git a/src/features/landing/sections/FeaturesSection/index.tsx b/src/features/landing/sections/FeaturesSection/index.tsx index deb4718..86a7e96 100644 --- a/src/features/landing/sections/FeaturesSection/index.tsx +++ b/src/features/landing/sections/FeaturesSection/index.tsx @@ -3,6 +3,7 @@ import { Container } from '../../shared/Container' import { LeaderboardIcon, ResultIcon, ScrambleIcon, ShareIcon } from '../../shared/icons' import { AnimationsController, BlockIntersectionWrapper, AnimationItem } from './animations' import { ResultsAnimation } from './ResultsAnimation' +import { ScramblesAnimation } from './ScramblesAnimation' export type BlockType = 'results' | 'scrambles' | 'leaderboards' | 'sharing' export function FeaturesSection({ className, id }: { className: string; id: string }) { @@ -25,7 +26,7 @@ export function FeaturesSection({ className, id }: { className: string; id: stri title='Instant scrambles' description='Get your scrambles without any manual copy-pasting.' icon={} - visualization={} + visualization={} /> diff --git a/tailwind.config.ts b/tailwind.config.ts index 5ce1fce..1b58817 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -79,7 +79,7 @@ export default { top: 'var(--to-top)', }, }, - 'landing-falling-text': { + 'landing-features-results': { '0%': { left: 'var(--from-left)', top: 'var(--from-top)', @@ -100,13 +100,18 @@ export default { from: { backgroundColor: 'white' }, to: { backgroundColor: 'black' }, }, + 'landing-features-scrambles': { + from: { clipPath: 'inset(0 100% 0 0)' }, + to: { clipPath: 'inset(0 0% 0 0)' }, + }, }, animation: { 'accordion-down': 'accordion-down 0.2s ease-out', 'accordion-up': 'accordion-up 0.2s ease-out', 'landing-alternating-text': 'landing-alternating-text 6s linear infinite', 'landing-blobs': 'landing-blobs 20s linear infinite', - 'landing-falling-text': 'landing-falling-text linear 3s forwards', + 'landing-features-results': 'landing-features-results linear 3s forwards', + 'landing-features-scrambles': 'landing-features-scrambles linear 2.7s forwards', fake: 'fake linear 3s forwards', }, spacing: {