diff --git a/scroll-animations-1/Overview.bs b/scroll-animations-1/Overview.bs index 3b7ae00a785..4498bf44a95 100755 --- a/scroll-animations-1/Overview.bs +++ b/scroll-animations-1/Overview.bs @@ -666,7 +666,7 @@ if (window.matchMedia('(prefers-reduced-motion: no-preference)').matches) { }); const slideIn = target.animate({ - transform: ['translateX(0)',q 'translateX(50vw)'], + transform: ['translateX(0)', 'translateX(50vw)'], opacity: [0, 1] }, { timeline:timeline, @@ -676,6 +676,37 @@ if (window.matchMedia('(prefers-reduced-motion: no-preference)').matches) { } +The same logic can be done in CSS markup: +
+@media (prefers-reduced-motion: no-preference) {
+
+ @keyframes slide-in {
+ from {
+ transform: translateX(0);
+ opacity: 0;
+ }
+
+ to {
+ transform: translateX(50vw);
+ opacity: 1;
+ }
+ }
+
+ @scroll-timeline image-in-scrollport {
+ source: selector(#container);
+ start: selector(#image) end;
+ end: selector(#image) start;
+ }
+
+ #target {
+ animation-name: slide-in;
+ animation-duration: 1s;
+ animation-timeline: image-in-scrollport;
+ }
+
+}
+
+
@@ -843,7 +874,7 @@ Issue(5167): This will likely change in the future.
Name: source For: @scroll-timeline - Value: selector(<@@ -883,17 +914,44 @@ instead of document's scrolling Element for>) | auto | none + Value: selector( < > ) | auto | none Initial: auto
auto.
Name: start For: @scroll-timeline - Value: auto | <'start' descriptor determines the scroll timeline's {{start}}. +[=Scroll timeline offsets=] in CSS are represented by the +<> + Value: < > Initial: auto
+<scroll-timeline-offset> = auto | <+ +The offset type depends on the value of <> | < > +<element-offset> = selector( < > ) [< > || < >]? +<element-offset-edge> = start | end +
Name: end For: @scroll-timeline - Value: auto | <> + Value: < > Initial: auto