Skip to content

Commit a721627

Browse files
committed
Actually fade in
1 parent c8b5862 commit a721627

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/components/blog-page/blog-card-picture.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ export function BlogCardPicture({
111111
}
112112

113113
draw()
114+
115+
canvas.dataset.visible = "true"
114116
}, [seed])
115117

116118
return (
@@ -124,7 +126,7 @@ export function BlogCardPicture({
124126
<canvas
125127
ref={canvasRef}
126128
aria-hidden="true"
127-
className="animate-fade-in pointer-events-none absolute inset-0 !size-full"
129+
className="data-[visible]:animate-fade-in pointer-events-none absolute inset-0 !size-full"
128130
/>
129131
{children ? <div className="relative z-10 p-4">{children}</div> : null}
130132
</div>

tailwind.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const config: Config = {
8080
"arrow-left var(--animation-duration, .75s) var(--animation-direction, forwards) ease infinite",
8181
"show-overflow":
8282
"show-overflow var(--animation-duration, 12s) var(--animation-delay, 1s) var(--animation-direction, forwards) ease infinite",
83-
"fade-in": "fade-in var(--animation-duration, 100ms) ease-out forwards",
83+
"fade-in": "fade-in var(--animation-duration, 200ms) ease-out forwards",
8484
},
8585
keyframes: {
8686
scroll: {
@@ -105,6 +105,7 @@ const config: Config = {
105105
},
106106
},
107107
"fade-in": {
108+
from: { opacity: "0" },
108109
to: { opacity: "1" },
109110
},
110111
},

0 commit comments

Comments
 (0)