11'use client' ;
22
33import { useQuery } from '@tanstack/react-query' ;
4- import { motion } from 'framer- motion' ;
4+ import { motion } from 'motion/react ' ;
55import Image from 'next/image' ;
66import { useRouter } from 'next/navigation' ;
77import { slotStatusQuery } from '../_store/queries/slot-status.query' ;
88import { SlotsCounter } from './slots-counter' ;
99
10+ const STRONG_EASE_OUT = [ 0.23 , 1 , 0.32 , 1 ] as const ;
11+
1012export const HomeContent = ( ) => {
1113 const router = useRouter ( ) ;
1214 const { data : slotStatus } = useQuery ( slotStatusQuery ( ) ) ;
@@ -25,59 +27,59 @@ export const HomeContent = () => {
2527 < div className = 'fixed left-0 top-24 flex size-full flex-col items-center justify-start overflow-hidden sm:top-32 md:top-44' >
2628 < motion . h2
2729 className = 'text-center text-4xl font-black sm:text-6xl md:text-7xl'
28- initial = { { opacity : 0 , y : 20 } }
30+ initial = { { opacity : 0 , y : 12 } }
2931 animate = { { opacity : 1 , y : 0 } }
30- transition = { { duration : 0.6 } }
32+ transition = { { duration : 0.25 , ease : STRONG_EASE_OUT } }
3133 >
3234 Your Bookmarks, < span className = 'bg-yellow-200 px-2' > Reimagined</ span >
3335 </ motion . h2 >
3436 < motion . p
3537 className = 'mt-6 text-balance text-center text-sm text-gray-600 sm:text-xl md:text-2xl'
36- initial = { { opacity : 0 , y : 20 } }
38+ initial = { { opacity : 0 , y : 12 } }
3739 animate = { { opacity : 1 , y : 0 } }
38- transition = { { duration : 0.6 , delay : 0.2 } }
40+ transition = { { duration : 0.25 , delay : 0.05 , ease : STRONG_EASE_OUT } }
3941 >
4042 Organize, discover, and access your favorite sites in one place
4143 </ motion . p >
4244
4345 < motion . div
4446 className = 'mt-4'
45- initial = { { opacity : 0 , y : 20 } }
47+ initial = { { opacity : 0 , y : 12 } }
4648 animate = { { opacity : 1 , y : 0 } }
47- transition = { { duration : 0.6 , delay : 0.25 } }
49+ transition = { { duration : 0.25 , delay : 0.1 , ease : STRONG_EASE_OUT } }
4850 >
4951 < SlotsCounter />
5052 </ motion . div >
5153
5254 < motion . div
5355 className = 'mt-6 flex gap-4'
54- initial = { { opacity : 0 , y : 20 } }
56+ initial = { { opacity : 0 , y : 12 } }
5557 animate = { { opacity : 1 , y : 0 } }
56- transition = { { duration : 0.6 , delay : 0.3 } }
58+ transition = { { duration : 0.25 , delay : 0.15 , ease : STRONG_EASE_OUT } }
5759 >
58- < motion . button
60+ < button
5961 onClick = { handleJoinNowButtonClick }
6062 disabled = { ! slotStatus ?. canSignUp }
61- className = { `h-10 rounded-full px-5 text-sm font-bold transition-colors md:h-12 md:px-8 md:text-lg ${
63+ className = { `h-10 rounded-full px-5 text-sm font-bold transition-[transform,background-color] duration-150 ease-out active:scale-[0.97] disabled:active:scale-100 md:h-12 md:px-8 md:text-lg ${
6264 slotStatus ?. canSignUp
6365 ? 'bg-black text-white hover:bg-gray-800'
6466 : 'cursor-not-allowed bg-gray-400 text-white'
6567 } `}
6668 >
6769 { slotStatus ?. canSignUp ? 'Join Now' : 'Slots Full' }
68- </ motion . button >
69- < motion . button
70+ </ button >
71+ < button
7072 onClick = { handleGithubButtonClick }
71- className = 'h-10 rounded-full border-2 border-black px-5 text-sm font-bold transition-colors hover:bg-gray-100 md:h-12 md:px-8 md:text-lg'
73+ className = 'h-10 rounded-full border-2 border-black px-5 text-sm font-bold transition-[transform,background-color] duration-150 ease-out hover:bg-gray-100 active:scale-[0.97] md:h-12 md:px-8 md:text-lg'
7274 >
7375 Github
74- </ motion . button >
76+ </ button >
7577 </ motion . div >
7678
7779 < motion . div
78- initial = { { opacity : 0 , scale : 0.95 } }
80+ initial = { { opacity : 0 , scale : 0.97 } }
7981 animate = { { opacity : 1 , scale : 1 } }
80- transition = { { duration : 0.8 , delay : 0.5 } }
82+ transition = { { duration : 0.3 , delay : 0.2 , ease : STRONG_EASE_OUT } }
8183 className = 'flex justify-center'
8284 >
8385 < Image
0 commit comments