Top Banner
13

CSS Parallax - DotCSS 2014

Jul 02, 2015

Download

Internet

Guido Bouman

Slides for my lightning talk during DotCSS 2014
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: CSS Parallax - DotCSS 2014
Page 2: CSS Parallax - DotCSS 2014
Page 3: CSS Parallax - DotCSS 2014

CSS parallax scrollingEnhanced scrolling done right.

Page 4: CSS Parallax - DotCSS 2014

Don’t use JavaScriptRepaints are evil.

Page 5: CSS Parallax - DotCSS 2014

Scrolling is sensitiveEnhance, don’t replace.

Page 6: CSS Parallax - DotCSS 2014

Keith ClarkOne smart dude.

Page 7: CSS Parallax - DotCSS 2014

Enter the third dimensionUse CSS3 perspective.

Page 8: CSS Parallax - DotCSS 2014

<body class="parallax"> <div class="parallax-layer parallax-layer-back"> ... </div> <div class="parallax-layer parallax-layer-base"> ... </div></body>

Page 9: CSS Parallax - DotCSS 2014

.parallax { height: 100vh; perspective: 1px; overflow: hidden; overflow-y: scroll;}

.parallax-layer { position: absolute; top: 0; right: 0; bottom: 0; left: 0;}

Page 10: CSS Parallax - DotCSS 2014

.parallax-layer-base { transform: translateZ(0);}.parallax-layer-back { transform: translateZ(-1px) scale(2);}

Page 11: CSS Parallax - DotCSS 2014

Any modern browserIE does not support nesting, duh.

Page 12: CSS Parallax - DotCSS 2014

More informationkeithclark.co.uk/articles/pure-css-parallax-websites/

Page 13: CSS Parallax - DotCSS 2014

Guido Boumanhttp://github.com/guidobouman