File tree 4 files changed +22
-7
lines changed 4 files changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -138,9 +138,9 @@ const Tasks = () => {
138
138
key = { date . date }
139
139
layoutId = { `day-${ date . date } ` }
140
140
className = { cn (
141
- "flex flex-col gap-1 items-center hover:bg-muted-foreground/10 rounded-xl p-2 cursor-pointer text-primary/70" ,
141
+ "flex flex-col items-center hover:bg-muted-foreground/10 rounded-xl p-2 cursor-pointer text-primary/70 relative " ,
142
142
selected ?. date === date . date &&
143
- "bg-muted-foreground/10 text-primary"
143
+ "bg-background text-primary border hover:bg-background/80 "
144
144
) }
145
145
onClick = { ( ) => setSelected ( date ) }
146
146
whileHover = { { scale : 1.03 } }
@@ -149,6 +149,12 @@ const Tasks = () => {
149
149
< h2 > { date . month } </ h2 >
150
150
< p className = "font-bold" > { date . date } </ p >
151
151
< p > { date . day } </ p >
152
+ { selected ?. date === date . date && (
153
+ < m . div
154
+ className = "absolute size-2 bg-red-500 -top-1 rounded-xl bg-background"
155
+ layoutId = "day-selected-active"
156
+ />
157
+ ) }
152
158
</ m . div >
153
159
) ) }
154
160
</ div >
Original file line number Diff line number Diff line change 1
1
import { buttonVariants } from "@/components/ui/button" ;
2
- import { COMPONENTS } from "@/constants/components" ;
3
2
import { siteConfig } from "@/lib/config" ;
4
3
import { motion } from "motion/react" ;
5
4
import { Icons } from "./icons" ;
6
5
import Logo from "./logo" ;
7
6
8
- const Hero = ( { hidden } : { hidden : boolean } ) => {
7
+ const Hero = ( { hidden, count } : { hidden : boolean ; count : number } ) => {
9
8
return (
10
9
< div className = "w-full md:border-b bg-background" >
11
10
< div className = "flex flex-col items-center justify-center pt-40 pb-20 gap-10 mx-auto w-full max-w-screen-lg bg-background md:border-x relative" >
@@ -25,7 +24,7 @@ const Hero = ({ hidden }: { hidden: boolean }) => {
25
24
className = { buttonVariants ( { size : "lg" , className : "!rounded-md" } ) }
26
25
>
27
26
< motion . span layoutId = "home-chat-button-text" >
28
- Browse { COMPONENTS . filter ( ( c ) => ! c . notReady ) . length } Components
27
+ Browse { count } Components
29
28
</ motion . span >
30
29
</ motion . button >
31
30
) : (
Original file line number Diff line number Diff line change 1
1
import * as Animated from "@/components/animations" ;
2
2
3
- export const COMPONENTS = [
3
+ type Component = {
4
+ name : string ;
5
+ component : React . ComponentType < any > ;
6
+ href : string ;
7
+ notReady ?: boolean ;
8
+ height ?: number ;
9
+ } ;
10
+
11
+ export const COMPONENTS : Component [ ] = [
4
12
{
5
13
name : "Task View" ,
14
+ notReady : false ,
6
15
component : Animated . Tasks ,
7
16
href : "https://x.com/alisamadi__/status/1914333366394212708" ,
8
17
} ,
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import { COMPONENTS } from "@/constants/components";
11
11
const Home = ( ) => {
12
12
const [ isHidden , setIsHidden ] = useState ( false ) ;
13
13
const { scrollY } = useScroll ( ) ;
14
+ const readyComponents = COMPONENTS . filter ( ( c ) => ! c . notReady ) ;
14
15
15
16
useMotionValueEvent ( scrollY , "change" , ( y ) => {
16
17
if ( y > 100 ) {
@@ -23,7 +24,7 @@ const Home = () => {
23
24
return (
24
25
< div className = "min-h-screen flex flex-col gap-20 items-center justify-center lg:px-0 px-10 overflow-x-clip" >
25
26
< div className = "h-screen fixed top-0 max-w-screen-lg inset-x-0 w-full mx-auto border-x border -z-10 candy-bg hidden md:block" />
26
- < Hero hidden = { isHidden } />
27
+ < Hero hidden = { isHidden } count = { readyComponents . length } />
27
28
< Feedback hidden = { isHidden } />
28
29
{ COMPONENTS . map ( ( component ) => (
29
30
< ComponentPreview
You can’t perform that action at this time.
0 commit comments