@@ -5,16 +5,21 @@ import Heading from '../components/Heading'
55import Paragraph from '../components/Paragraph'
66import MultiRangeDemo from '../demos/MultiRangeDemo'
77import SupportsDemo from '../demos/SupportsDemo'
8- import TimelineOverrideDemo from '../demos/TimelineOverrideDemo'
98import {
10- keyframes101 ,
11- keyframes102 ,
12- keyframes103 ,
9+ appearDemo ,
10+ appearKeyframes ,
1311 multiRange ,
1412 multiRangeKeyframes ,
13+ progressBarDemo ,
14+ progressBarKeyframes ,
15+ rangeDemo ,
16+ rangeKeyframes ,
1517 supports ,
1618} from '../utils/demoExamples'
1719import DocsTable from './DocsTable'
20+ import ProgressBarDemo from '../demos/ProgressBarDemo'
21+ import AppearDemo from '../demos/AppearDemo'
22+ import RangeDemo from '../demos/RangeDemo'
1823
1924const animationTimelineClasses = [
2025 { className : 'timeline' , code : 'animation-timeline: scroll(y)' } ,
@@ -57,7 +62,7 @@ const supportsClasses = [
5762const Docs = ( ) => {
5863 return (
5964 < div >
60- < Heading size = { 2 } id = "documentation" >
65+ < Heading size = { 1 } id = "documentation" >
6166 Documentation
6267 </ Heading >
6368 < Paragraph >
@@ -81,78 +86,94 @@ const Docs = () => {
8186 < Code > timeline-scope</ Code >
8287 </ li >
8388 </ ul >
84- < Heading size = { 3 } id = "documentation-101" >
85- How to Make Your CSS Animation Scroll-driven
89+
90+ < Heading size = { 2 } id = "documentation-animation-timeline" >
91+ Animation Timeline
8692 </ Heading >
8793 < Paragraph >
88- CSS animations consist of two components, a set of keyframes and a style describing the
89- animation. Let's declare a simple < Code > @opacity</ Code > keyframe set and apply it to an
90- element we want to control by a scroll timeline.
94+ The single most impressive feature of scroll-driven animations is an anonymous animation
95+ timeline. It allows to easily trigger anything just by scrolling the page. Use the{ ' ' }
96+ < Code > timeline</ Code > utility which defaults to < Code > animation-timeline: scroll(y)</ Code > { ' ' }
97+ and also provides an option to set custom timeline name with a modifier.
9198 </ Paragraph >
92- < CodeBlock language = "css" > { keyframes101 } </ CodeBlock >
93- < CodeBlock language = "html" > { keyframes102 } </ CodeBlock >
99+ < DocsTable items = { animationTimelineClasses } / >
100+ < Heading size = { 3 } > Anonymous Scroll Timeline Demo </ Heading >
94101 < Paragraph >
95- To effectively control the animation, make sure to declare the timeline in the code after
96- the animation. By default, the shorthand < Code > animation</ Code > property sets the{ ' ' }
97- < Code > animation-timeline: auto</ Code > unless set otherwise. However, using this plugin and
98- Tailwind CSS animations ensures that the declaration order is correct.
102+ This demo showcases how to create a simple progress bar just by adding one utility class to
103+ the element. We define the anonymous scroll timeline by adding < Code > timeline</ Code > to the
104+ progress bar.
99105 </ Paragraph >
100- < CodeBlock language = "css" > { keyframes103 } </ CodeBlock >
101- < Paragraph > Scroll the container.</ Paragraph >
102- < TimelineOverrideDemo />
103- < Heading size = { 3 } href = "#timeline" hrefType = "demo" id = "documentation-animation-timeline" >
104- Animation Timeline
105- </ Heading >
106+ < ProgressBarDemo />
107+ < CodeBlock language = "html" > { progressBarDemo } </ CodeBlock >
108+ < CodeBlock language = "css" > { progressBarKeyframes } </ CodeBlock >
109+ < Heading size = { 3 } > Anonymous View Timeline Demo</ Heading >
106110 < Paragraph >
107- Utility class specifying the timeline that is used to control the progress of a CSS
108- animation .
111+ This demo showcases how to make the element appear after entering the view frame. We define
112+ the anonymous view timeline by adding < Code > timeline-view </ Code > to this element .
109113 </ Paragraph >
110- < DocsTable items = { animationTimelineClasses } />
111- < Heading size = { 3 } href = "#range" hrefType = "demo" id = "documentation-scroll-timeline" >
114+ < AppearDemo />
115+ < CodeBlock language = "html" > { appearDemo } </ CodeBlock >
116+ < CodeBlock language = "css" > { appearKeyframes } </ CodeBlock >
117+
118+ < Heading size = { 2 } > Named Timelines</ Heading >
119+ < Heading size = { 3 } id = "documentation-scroll-timeline" >
112120 Scroll Timeline
113121 </ Heading >
114122 < Paragraph >
115123 Utility class setting the named scroll progress timeline, which is set on a scrollable
116124 element.
117125 </ Paragraph >
118126 < DocsTable items = { scrollTimelineClasses } />
119- < Heading size = { 3 } href = "#range" hrefType = "demo" id = "documentation-view-timeline" >
127+ < Heading size = { 3 } id = "documentation-view-timeline" >
120128 View Timeline
121129 </ Heading >
122130 < Paragraph >
123131 Utility class setting the named view progress timeline, which is set on a subject inside
124132 another scrollable element.
125133 </ Paragraph >
126134 < DocsTable items = { viewTimelineClasses } />
127- < Heading size = { 3 } id = "documentation-range" >
135+ < Heading size = { 2 } id = "documentation-range" >
128136 Animation Range
129137 </ Heading >
130138 < Paragraph >
131139 Animation range start controls where along the timeline an animation will start. It is set
132140 on the animated element.
133141 </ Paragraph >
134142 < DocsTable items = { rangeClasses } />
135- < Paragraph className = "pt-6" >
143+ < Heading size = { 3 } > Animation Range Demo</ Heading >
144+ < Paragraph >
136145 Scroll the container to see each how range utility class affects the animation.
137146 </ Paragraph >
138147 < MultiRangeDemo />
139148 < CodeBlock language = "html" > { multiRange } </ CodeBlock >
140149 < CodeBlock language = "css" > { multiRangeKeyframes } </ CodeBlock >
141- < Heading size = { 3 } href = "#range" hrefType = "demo" id = "documentation-scope" >
150+ < Heading size = { 2 } id = "documentation-scope" >
142151 Timeline Scope
143152 </ Heading >
144153 < Paragraph >
145154 Timeline scope allows to control animations outside the element which defines the timeline.
146155 </ Paragraph >
147156 < DocsTable items = { scopeClasses } />
148- < Heading size = { 3 } id = "documentation-fallback" >
157+ < Heading size = { 3 } > Range, Scope and Animation Timeline Name Demo</ Heading >
158+ < Paragraph >
159+ This demo showcases the usage of the plugin to reveal the navigation bar. The{ ' ' }
160+ < Code > view-timeline/navbar</ Code > utility sets up the animation timeline, which is then
161+ scoped out of the defining element by < Code > scope/navbar</ Code > . The navigation bar is
162+ controlled by this timeline with the < Code > timeline/navbar</ Code > utility. Utility class{ ' ' }
163+ < Code > range-on-exit</ Code > is set to limit the timeline duration.
164+ </ Paragraph >
165+ < RangeDemo />
166+ < CodeBlock language = "html" > { rangeDemo } </ CodeBlock >
167+ < CodeBlock language = "css" > { rangeKeyframes } </ CodeBlock >
168+ < Heading size = { 2 } id = "documentation-fallback" >
149169 Fallback Styling
150170 </ Heading >
151171 < Paragraph >
152172 Use the < Code > no-animations</ Code > modifier to apply fallback styling in browsers which do
153173 not support scroll-driven animations yet.
154174 </ Paragraph >
155175 < DocsTable items = { supportsClasses } />
176+ < Heading size = { 3 } > Fallback Demo</ Heading >
156177 < SupportsDemo />
157178 < CodeBlock language = "html" > { supports } </ CodeBlock >
158179 </ div >
0 commit comments