1
1
import { ArrowDown } from 'lucide-react'
2
2
import ChartColumn from '../components/ChartColumn'
3
3
import Code from '../components/Code'
4
- import CodeBlock from '../components/CodeBlock'
5
- import Paragraph from '../components/Paragraph'
6
4
import TimelineMarker from '../components/TimelineMarker'
7
5
import CenterLayout from '../layouts/CenterLayout'
8
6
@@ -19,13 +17,7 @@ const columns = [
19
17
20
18
const gradient = `<div class="animate-gradient timeline range/0,2000px"></div>`
21
19
const html = `<div class="animate-reveal timeline-view"></div>`
22
- const chart = `<div class="animate-rise timeline/chart range-on-entry/60px,320px"></div>`
23
- const css = `@keyframes reveal {
24
- 50% {
25
- opacity: 1;
26
- transform: scale(3);
27
- }
28
- }`
20
+ const chart = `<div class="animate-rise timeline/chart range-on-entry/60px,80dvh"></div>`
29
21
30
22
const HeroAnim = ( ) => {
31
23
return (
@@ -35,27 +27,41 @@ const HeroAnim = () => {
35
27
< ArrowDown size = { 24 } className = "animate-bounce" />
36
28
</ div >
37
29
</ CenterLayout >
38
- < div className = "h-[2000px]" >
39
- < CenterLayout className = "animate-gradient timeline range/0,2000px sticky top-40 bg-gradient-to-r from-violet-200/0 via-red-400/70 to-cyan-300/0 bg-clip-text bg-no-repeat pb-12 text-5xl font-bold text-transparent dark:via-red-600/70 sm:text-7xl md:text-9xl" >
40
- Scroll Superpower.
41
- </ CenterLayout >
42
- </ div >
30
+ < CenterLayout className = "h-[2000px]" >
31
+ < div className = "relative h-full w-full" >
32
+ < TimelineMarker
33
+ textStart = "timeline"
34
+ textEnd = "from 0"
35
+ className = "absolute left-0 top-24 w-full"
36
+ />
37
+ < div className = "animate-gradient no-animations:opacity-100 timeline range/0,2000px sticky top-40 bg-gradient-to-r from-violet-200/0 via-red-400/70 to-cyan-300/0 bg-clip-text bg-no-repeat pb-12 text-5xl font-bold text-transparent opacity-0 dark:via-red-600/70 sm:text-7xl md:text-9xl" >
38
+ Scroll Superpower.
39
+ </ div >
40
+ < TimelineMarker
41
+ textStart = "timeline"
42
+ textEnd = "to 2000px"
43
+ className = "absolute left-0 bottom-8 w-full"
44
+ />
45
+ </ div >
46
+ </ CenterLayout >
43
47
< CenterLayout >
44
- < Code language = "html" className = "mx-auto mb-48 block w-fit" >
48
+ < Code language = "html" className = "mx-auto mb-72 block w-fit" >
45
49
{ gradient }
46
50
</ Code >
47
51
</ CenterLayout >
48
- < div >
49
- < div className = "h-dvh sticky top-0 w-full bg-gradient-to-r from-slate-200/0 via-zinc-400/50 to-cyan-300/10 " >
50
- < CenterLayout className = "h-dvh relative flex flex-col justify-between px-4 py-14 sm:px-8" >
52
+ < div className = "mb-72" >
53
+ < div className = "h-dvh sticky top-0 w-full" >
54
+ < CenterLayout className = "h-dvh relative flex flex-col justify-between px-4 py-16 sm:px-8" >
51
55
< TimelineMarker textStart = "timeline-view" textEnd = { '100%' } />
56
+ < TimelineMarker textEnd = { '75%' } />
52
57
< TimelineMarker textEnd = { '50%' } />
58
+ < TimelineMarker textEnd = { '25%' } />
53
59
< TimelineMarker textStart = "timeline-view" textEnd = { '0%' } />
54
60
</ CenterLayout >
55
61
</ div >
56
62
< div className = "min-h-dvh" >
57
63
< CenterLayout className = "relative z-20" >
58
- < div className = "animate-reveal timeline-view mx-auto w-fit text-center opacity-0" >
64
+ < div className = "animate-reveal timeline-view no-animations:opacity-100 mx-auto w-fit text-center opacity-0" >
59
65
< div className = "text-md text-zinc-950 w-full font-medium dark:text-zinc-200 sm:text-lg md:text-xl" >
60
66
'Luke, he is your father.'
61
67
</ div >
@@ -66,41 +72,36 @@ const HeroAnim = () => {
66
72
</ CenterLayout >
67
73
</ div >
68
74
</ div >
69
- < div >
70
- < div className = "h-dvh scope/chart sticky top-0 mt-20 flex w-full items-center bg-gradient-to-t from-fuchsia-200/50 to-red-300/0 " >
75
+ < div className = "mb-72" >
76
+ < div className = "h-dvh scope/chart sticky top-0 mt-20 flex w-full items-center" >
71
77
< CenterLayout className = "h-dvh flex flex-col items-center justify-center px-20" >
72
- < div className = "relative flex h-2/3 w-full items-center justify-between py-2.5 pl-20 pr-2 " >
78
+ < div className = "relative flex h-2/3 w-full items-center justify-between py-2.5 pl-32 pr-20 " >
73
79
{ columns . map ( ( column , i ) => (
74
80
< ChartColumn className = { column } key = { i } />
75
81
) ) }
76
- < TimelineMarker textStart = "100%" className = "absolute left-0 top-0 w-full" />
77
82
< TimelineMarker
78
- textStart = "50%"
83
+ textStart = "entry + 80dvh"
84
+ textEnd = "100%"
85
+ className = "absolute left-0 top-0 w-full"
86
+ />
87
+ < TimelineMarker
88
+ textEnd = "50%"
79
89
className = "top-50% absolute left-0 w-full -translate-y-1"
80
90
/>
81
- < TimelineMarker textStart = "0%" className = "absolute left-0 bottom-0 w-full" />
91
+ < TimelineMarker
92
+ textStart = "entry +60px"
93
+ textEnd = "0%"
94
+ className = "absolute left-0 bottom-0 w-full"
95
+ />
96
+ < TimelineMarker textStart = "entry" className = "absolute left-0 -bottom-12 w-full" />
82
97
</ div >
83
- < Code className = "view-timeline/chart mx-auto mt-12 block w-fit" language = "html" >
98
+ < Code className = "view-timeline/chart mx-auto mt-14 block w-fit" language = "html" >
84
99
{ chart }
85
100
</ Code >
86
101
</ CenterLayout >
87
102
</ div >
88
103
< div className = "min-h-dvh" > </ div >
89
104
</ div >
90
- < div >
91
- < CenterLayout >
92
- < CodeBlock language = "css" className = "backdrop-blur-sm" >
93
- { css }
94
- </ CodeBlock >
95
- < CodeBlock language = "html" className = "backdrop-blur-sm" >
96
- { html }
97
- </ CodeBlock >
98
- < Paragraph >
99
- Unofficial plugin for Tailwind CSS v3.4+ that provides utilities for scroll-driven
100
- animations.
101
- </ Paragraph >
102
- </ CenterLayout >
103
- </ div >
104
105
</ >
105
106
)
106
107
}
0 commit comments