body, #presentation { padding: 0; margin: 0; width: 100%; height: 100%; position: absolute; left: 0px; top: 0px; } #presentation { overflow: hidden; }
<div id="presentation"> <div id="slides"> <!-- slide --> <div class="slide normal"> <header><h1>Slide Header</h1></header> <section> <pre contenteditable>some code</pre> </section> </div> </div> </div> <script src="prefixfree.js"></script> <script src="slides.js"></script>
body, #presentation { padding: 0; margin: 0; width: 100%; height: 100%; position: absolute; left: 0px; top: 0px; } #presentation { overflow: hidden; }
.slide { width: 900px; height: 700px; background-color: #efefef; }
Refresh
.slide { position: absolute; left: 50%; top: 50%;}
Refresh
.slide { margin-top: -350px; margin-left: -450px; }
Refresh
add some prettiness and refresh again
.slide { padding: 20px; } body { font-family: sans-serif; }
.slide { display: none; overflow: hidden; } .past, .current, .future { display: block; } .slide.past { margin-left: -1400px;} .slide.current { margin-left: -450px;} .slide.future { margin-left: 500px;}
The slide deck now works, but it's ugly, and the transitions suck!
Border Properties: border-radius
.slide { border-radius: 50px; }
Can we use selectors to give different slides different corners?
.slide { border-radius: 50px 0; } .slide:nth-of-type(odd) { border-radius: 0 50px; }
#presentation { background-color: #000; }
.slide { border: 5px solid #fff; box-shadow: 0 0 20px rgba(0,0,0,0.6), inset 0 0 6px rgba(0,0,0,0.4); }
.slide { box-sizing: border-box; }
Font-size: rem units
:root { font-size: 162.5%; } h1 { font-size:1.8rem; } pre { font-size: 1.5rem; } p { font-size: 1.5rem; margin: 1rem 0 0 0; }
#presentation { background-image: linear-gradient(#b8c6df,#6d88b7); background-image: linear-gradient(to bottom, #b8c6df 0%, #6d88b7 100%); }
background-image: linear-gradient(left, rgba(0,0,0,0.2) 50%, transparent 50%), linear-gradient(left, transparent 40%, rgba(0,0,0,0.2) 40%), linear-gradient(left, transparent 60%, rgba(0,0,0,0.2) 60%), linear-gradient(left, transparent 50%, rgba(0,0,0,0.2) 50%), linear-gradient(left, transparent 40%, rgba(0,0,0,0.2) 40%), linear-gradient(left, transparent 60%, rgba(0,0,0,0.2) 60%), linear-gradient(left, transparent 50%, rgba(0,0,0,0.2) 50%), linear-gradient(left, transparent 40%, rgba(0,0,0,0.2) 40%), linear-gradient(left, transparent 60%, rgba(0,0,0,0.2) 60%), linear-gradient(left, red 14%, orange 15%, orange 28%, yellow 29%, yellow 42%, green 43%, green 56%, blue 57%, blue 70%, magenta 71%, magenta 85%, purple 86%); background-size: 1px 50%, 1px 50px, 32px, 120px, 80px, 60px, 90px, 110px, 70px, 500px; }
Transition properties
.slides {transition: 1s;}
.slide {opacity: 0.5;} .slide.far-past {margin-left: -2400px;} .slide.past {margin-left: -1400px;} .slide.current {margin-left: -450px; opacity: 1;} .slide.future {margin-left: 500px;} .slide.far-future {margin-left: 1500px;}
.slides {transition: margin-left 1s, opacity 2s;}
.slide {transform: scale(0.8); transition: margin-left 1s, transform 1s, opacity 2s;}
.slide.current {transform: scale(1);}
.slide {transition: all 1.2s linear;}