Slide 1

Slide 1 text

View-Transition-API and Scroll-Driven Animations Gamechanger for hybrid app-development Sascha Lehmann @derLehmann_S Consultant

Slide 2

Slide 2 text

Consultant @ Thinktecture AG Sascha Lehmann @derLehmann_S [email protected] https://www.thinktecture.com/thinktects/sascha-lehmann/ View-Transition-API and Scroll-Driven Animations Gamechanger for hybrid app-development

Slide 3

Slide 3 text

X-Platform development? View-Transition-API and Scroll-Driven Animations Gamechanger for hybrid app-development

Slide 4

Slide 4 text

Native Web X-Platform … View-Transition-API and Scroll-Driven Animations Gamechanger for hybrid app-development

Slide 5

Slide 5 text

What is the problem? View-Transition-API and Scroll-Driven Animations Gamechanger for hybrid app-development

Slide 6

Slide 6 text

https://goo.gle/fugu-api-tracker View-Transition-API and Scroll-Driven Animations Gamechanger for hybrid app-development

Slide 7

Slide 7 text

Container-Transforms View-Transition-API and Scroll-Driven Animations Gamechanger for hybrid app-development

Slide 8

Slide 8 text

View-Transition-API 111+ 18 X View-Transition-API and Scroll-Driven Animations Gamechanger for hybrid app-development

Slide 9

Slide 9 text

Trigger Process of a View-Transition View-Transition-API and Scroll-Driven Animations Gamechanger for hybrid app-development

Slide 10

Slide 10 text

What happens behind the scenes User Perspective Browser Perspective Screenshot (old) Perform DOM changes Live-View (new) Crossfade Old -> New startViewTransition(…) View-Transition-API and Scroll-Driven Animations Gamechanger for hybrid app-development Process of a View-Transition

Slide 11

Slide 11 text

Pseudo DOM Tree • New Top-Layer • Default animation: Cross-fade • Elements only exist during the View-Transition Process of a View-Transition View-Transition-API and Scroll-Driven Animations Gamechanger for hybrid app-development

Slide 12

Slide 12 text

Pseudo Elemente ::view-transition Overlay root element that sits above all other DOM elements in order to exclude genetic interference ::view-transition-group Root-Element of the View-Transition ::view-transition-image-pair Container of the before and after snapshot ::view-transition-old/-new Elements that show the before and after DOM states as a Snapshot or live view Jedes Pseudo-Element ist separat per CSS stylebar Process of a View-Transition View-Transition-API and Scroll-Driven Animations Gamechanger for hybrid app-development

Slide 13

Slide 13 text

The snapshots are ”just” images – Not real DOM Elements ATTENTION! Has no effect! View-Transition-API and Scroll-Driven Animations Gamechanger for hybrid app-development

Slide 14

Slide 14 text

Beispielanwendung animieren

Slide 15

Slide 15 text

Browser Stylesheet Where does the magic come from? View-Transition-API and Scroll-Driven Animations Gamechanger for hybrid app-development

Slide 16

Slide 16 text

What happens behind the scenes „Cutting out“ additional parts User Perspective Browser Perspective Screenshot (old) Perform DOM changes Live-View (new) Crossfade Old -> New startViewTransition(…) View-Transition-API and Scroll-Driven Animations Gamechanger for hybrid app-development

Slide 17

Slide 17 text

What happens behind the scenes „Cutting out“ additional parts User Perspective Browser Perspective Perform DOM changes Live-View (new) Crossfade Root - animiere Header separat startViewTransition(…) Screenshot-Header (old) View-Transition-API and Scroll-Driven Animations Gamechanger for hybrid app-development

Slide 18

Slide 18 text

DOM-Elemente Zusätzliche Teile “ausschneiden” View-Transition-API and Scroll-Driven Animations Gamechanger for hybrid app-development

Slide 19

Slide 19 text

Beispielanwendung animieren

Slide 20

Slide 20 text

Scroll-Driven-Animations 115+ X X View-Transition-API and Scroll-Driven Animations Gamechanger for hybrid app-development

Slide 21

Slide 21 text

Default – Document Timeline Animation-Timelines • Represents the default Document-Timeline • Time progresses continuously from the time the document was initially loaded View-Transition-API and Scroll-Driven Animations Gamechanger for hybrid app-development

Slide 22

Slide 22 text

Scroll Progress Timeline • Scroller: Element, to determine the scroll progress • nearest (default) • root • self • Axis: Scroll-axis that is used • block (default) • inline • X • Y Animation-Timelines • Time advances by scolling a scollable element (scroller) • The scroll position is converted into percentage values from 0 - 100 View-Transition-API and Scroll-Driven Animations Gamechanger for hybrid app-development

Slide 23

Slide 23 text

View Progress Timeline • Axis: Scroll-axis that is used • block (default) • inline • X • Y • Inset: To define insets or outsets that determine when the element is in the viewport • start (top-offset) • end (bottom-offset) Animation-Timelines • Time progresses through the visibility of an element (subject) • The visibility of the element in the viewport is converted into percentage values from 0 - 100 • Is always tracked depending on the next best scrollable element View-Transition-API and Scroll-Driven Animations Gamechanger for hybrid app-development

Slide 24

Slide 24 text

View Progress Timeline • Alternative spelling for view( start end) • Additional key words for animation-range • entry: Equals 0% • exit: Equals 100% • Additional key words for animation-range-start and animation-range-end • cover: As soon as only part of the element is visible in the viewport • contain: The entire element must be visible in the viewport • Very suitable, for example, for cases with images of different heights Animation-Timelines View-Transition-API and Scroll-Driven Animations Gamechanger for hybrid app-development

Slide 25

Slide 25 text

Beispielanwendung animieren

Slide 26

Slide 26 text

A look … … into the future View-Transition-API and Scroll-Driven Animations Gamechanger for hybrid app-development

Slide 27

Slide 27 text

Sascha Lehmann [email protected] Thank you! @derLehmann_S [email protected] https://www.thinktecture.com/thinktects/sascha-lehmann/

Slide 28

Slide 28 text

Demos / Repo Links • https://scroll-driven-animations.style/ • https://codepen.io/argyleink/pen/VwBKjwj • https://codepen.io/bramus/full/xxmozvN • https://github.com/thinktecture-labs/view-transition-api-scroll-driven-animations- webinar