Skip to content

Commit

Permalink
feat(landing): FeaturesSection results animation
Browse files Browse the repository at this point in the history
  • Loading branch information
bohdancho committed Aug 23, 2024
1 parent 37ed9ac commit 87d8542
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 17 deletions.
25 changes: 20 additions & 5 deletions src/features/landing/sections/FeaturesSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function ResultsAnimation() {
transitionLeft='-3%'
transitionTop='30%'
toRotation='11deg'
toLeft='-5%'
toLeft='0%'
toTop='52%'
>
Average time
Expand All @@ -86,8 +86,8 @@ function ResultsAnimation() {
transitionLeft='46%'
transitionTop='57%'
toRotation='-13deg'
toLeft='40%'
toTop='65%'
toLeft='42%'
toTop='78%'
>
Single time
</ResultsAnimationItem>
Expand All @@ -98,6 +98,9 @@ function ResultsAnimation() {
transitionRotation='-58deg'
transitionLeft='25%'
transitionTop='18%'
toRotation='30deg'
toLeft='30%'
toTop='49%'
>
Attempt 1
</ResultsAnimationItem>
Expand All @@ -108,6 +111,9 @@ function ResultsAnimation() {
transitionRotation='29deg'
transitionLeft='18%'
transitionTop='68%'
toRotation='-22deg'
toLeft='16%'
toTop='76%'
>
Attempt 2
</ResultsAnimationItem>
Expand All @@ -118,6 +124,9 @@ function ResultsAnimation() {
transitionRotation='-20deg'
transitionLeft='75%'
transitionTop='55%'
toRotation='16deg'
toLeft='75%'
toTop='74%'
>
Attempt 3
</ResultsAnimationItem>
Expand All @@ -126,8 +135,11 @@ function ResultsAnimation() {
fromLeft='58%'
fromTop='-120%'
transitionRotation='45deg'
transitionLeft='52%'
transitionLeft='50%'
transitionTop='15%'
toRotation='32deg'
toLeft='52.5%'
toTop='53.5%'
>
Attempt 4
</ResultsAnimationItem>
Expand All @@ -138,6 +150,9 @@ function ResultsAnimation() {
transitionRotation='-16.5deg'
transitionLeft='76%'
transitionTop='6%'
toRotation='-16.5deg'
toLeft='75%'
toTop='41%'
>
Attempt 5
</ResultsAnimationItem>
Expand Down Expand Up @@ -176,7 +191,7 @@ function ResultsAnimationItem(
'--to-rotation': props.toRotation,
} as CSSProperties
}
className='animate-landing-falling-text absolute whitespace-nowrap rounded-3xl border border-secondary-20 px-6 py-1 text-[0.875rem] text-grey-20'
className='absolute animate-landing-falling-text whitespace-nowrap rounded-3xl border border-secondary-20 px-6 py-1 text-[0.875rem] text-grey-20'
>
<div className='mb-[-.1em] pt-[.1em]'>{props.children}</div>
</div>
Expand Down
24 changes: 12 additions & 12 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,29 +80,29 @@ export default {
},
},
'landing-falling-text': {
'0%,100%': {
'0%': {
left: 'var(--from-left)',
top: 'var(--from-top)',
transform: 'rotate(var(--from-rotation))',
},
'66.6%': {
left: 'var(--transition-left)',
top: 'var(--transition-top)',
transform: 'rotate(var(--transition-rotation))',
},
// '66.6%': {
// left: 'var(--transition-left)',
// top: 'var(--transition-top)',
// transform: 'rotate(var(--transition-rotation))',
// },
// '100%': {
// left: 'var(--to-left)',
// top: 'var(--to-top)',
// transform: 'rotate(var(--to-rotation))',
// },
'100%': {
left: 'var(--to-left)',
top: 'var(--to-top)',
transform: 'rotate(var(--to-rotation))',
},
},
},
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 3s infinite',
'landing-falling-text': 'landing-falling-text 3s linear 3s forwards',
},
spacing: {
15: '3.75rem',
Expand Down

0 comments on commit 87d8542

Please sign in to comment.