From 37ed9acbd7b3c197862f357c65b81fd1edd6f15a Mon Sep 17 00:00:00 2001 From: Bohdan Chornokondratenko Date: Fri, 23 Aug 2024 10:55:56 +0200 Subject: [PATCH] feat(landing): Features results animation WiP --- .../landing/sections/FeaturesSection.tsx | 128 +++++++++++++++++- tailwind.config.ts | 18 +++ 2 files changed, 143 insertions(+), 3 deletions(-) diff --git a/src/features/landing/sections/FeaturesSection.tsx b/src/features/landing/sections/FeaturesSection.tsx index f537436..9afa79e 100644 --- a/src/features/landing/sections/FeaturesSection.tsx +++ b/src/features/landing/sections/FeaturesSection.tsx @@ -1,18 +1,19 @@ import { ReactNode } from '@tanstack/react-router' import { Container } from '../shared/Container' import { LeaderboardIcon, ResultIcon, ScrambleIcon, ShareIcon } from '../shared/icons' +import { CSSProperties } from 'react' export function FeaturesSection({ className, id }: { className: string; id: string }) { return (

The problem we solve

-
    +
      } - visualization='visual' + visualization={} />
      {icon}
      -
      {visualization}
      +
      {visualization}

      {title}

      {description}

      ) } + +function ResultsAnimation() { + return ( +
      + + Average time + + + Single time + + + Attempt 1 + + + Attempt 2 + + + Attempt 3 + + + Attempt 4 + + + Attempt 5 + +
      + ) +} + +function ResultsAnimationItem( + props: Record< + | 'fromLeft' + | 'fromTop' + | 'fromRotation' + | 'transitionLeft' + | 'transitionTop' + | 'transitionRotation' + | 'toLeft' + | 'toTop' + | 'toRotation', + string + > & { + children: string + }, +) { + return ( +
      +
      {props.children}
      +
      + ) +} diff --git a/tailwind.config.ts b/tailwind.config.ts index 9f2e107..a037449 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -79,12 +79,30 @@ export default { top: 'var(--to-top)', }, }, + 'landing-falling-text': { + '0%,100%': { + 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))', + // }, + }, }, 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', }, spacing: { 15: '3.75rem',