From 90f343e5bddb663f061a2c2f40eac352b52601b8 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Thu, 30 Aug 2012 00:59:51 -0400 Subject: [PATCH] add theme config option, add sky theme, fix line-height of --- css/main.css | 3 +- css/theme/sky.css | 169 ++++++++++++++++++++++++++++++++++++++++++++++ index.html | 19 +++++- js/reveal.js | 10 ++- js/reveal.min.js | 21 +++--- 5 files changed, 209 insertions(+), 13 deletions(-) create mode 100644 css/theme/sky.css diff --git a/css/main.css b/css/main.css index 7f0555c0..691f47b3 100644 --- a/css/main.css +++ b/css/main.css @@ -233,8 +233,9 @@ body { } .reveal small { + display: inline-block; font-size: 0.6em; - line-height: 1em; + line-height: 1.2em; vertical-align: top; } diff --git a/css/theme/sky.css b/css/theme/sky.css new file mode 100644 index 00000000..99f0a7c7 --- /dev/null +++ b/css/theme/sky.css @@ -0,0 +1,169 @@ +/** + * Sky theme for reveal.js presentations. + * + * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se + */ + +/********************************************* + * FONT-FACE DEFINITIONS + *********************************************/ + +@import url(http://fonts.googleapis.com/css?family=Quicksand:400,700,400italic,700italic); +@import url(http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700); + + + +/********************************************* + * GLOBAL STYLES + *********************************************/ + +body { + font-family: 'Open Sans', sans-serif; + font-size: 36px; + font-weight: 200; + letter-spacing: -0.02em; + color: #333; + + background: #f7fbfc; + background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPHJhZGlhbEdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgY3g9IjUwJSIgY3k9IjUwJSIgcj0iNzUlIj4KICAgIDxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiNmN2ZiZmMiIHN0b3Atb3BhY2l0eT0iMSIvPgogICAgPHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSIjYWRkOWU0IiBzdG9wLW9wYWNpdHk9IjEiLz4KICA8L3JhZGlhbEdyYWRpZW50PgogIDxyZWN0IHg9Ii01MCIgeT0iLTUwIiB3aWR0aD0iMTAxIiBoZWlnaHQ9IjEwMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); + background: -moz-radial-gradient(center, ellipse cover, #f7fbfc 0%, #add9e4 100%); + background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,#f7fbfc), color-stop(100%,#add9e4)); + background: -webkit-radial-gradient(center, ellipse cover, #f7fbfc 0%,#add9e4 100%); + background: -o-radial-gradient(center, ellipse cover, #f7fbfc 0%,#add9e4 100%); + background: -ms-radial-gradient(center, ellipse cover, #f7fbfc 0%,#add9e4 100%); + background: radial-gradient(ellipse at center, #f7fbfc 0%,#add9e4 100%); +} + +::-moz-selection { + background:rgba(79, 64, 28, 0.99); + color: white; +} +::-webkit-selection { + background:rgba(79, 64, 28, 0.99); + color: white; +} +::selection { + background:rgba(79, 64, 28, 0.99); + color: white; +} + + +/********************************************* + * HEADERS + *********************************************/ + +.reveal h1, +.reveal h2, +.reveal h3, +.reveal h4, +.reveal h5, +.reveal h6 { + margin: 0 0 20px 0; + color: #333; + font-family: 'Quicksand', sans-serif; + line-height: 0.9em; + letter-spacing: -0.08em; + + text-transform: uppercase; +} + + +/********************************************* + * LINKS + *********************************************/ + +.reveal a:not(.image) { + color: #3b759e; + text-decoration: none; + + -webkit-transition: color .15s ease; + -moz-transition: color .15s ease; + -ms-transition: color .15s ease; + -o-transition: color .15s ease; + transition: color .15s ease; +} + .reveal a:not(.image):hover { + text-shadow: none; + border: none; + border-radius: 2px; + } + +.reveal .roll span:after { + color: #fff; + background: #3b759e; +} + + +/********************************************* + * MISC + *********************************************/ + +.reveal section img { + margin: 30px 0 0 0; + background: rgba(255,255,255,0.12); + border: 1px solid #ddd; + + -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); + -moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); + box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); + + -webkit-transition: all .2s linear; + -moz-transition: all .2s linear; + -ms-transition: all .2s linear; + -o-transition: all .2s linear; + transition: all .2s linear; +} + + .reveal a:hover img { + background: rgba(255,255,255,0.2); + border-color: #3b759e; + + -webkit-box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); + -moz-box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); + box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); + } + +.reveal blockquote { + background: rgba(255, 255, 255, 0.4); +} + +.reveal code { + background: rgba(255, 255, 255, 0.6); +} + +.reveal p { + margin-bottom: 20px; +} + + +/********************************************* + * NAVIGATION CONTROLS + *********************************************/ + +.reveal .controls a { + color: #fff; +} + .reveal .controls a.enabled { + color: #3b759e; + text-shadow: 0px 0px 2px hsla(185, 45%, 70%, 0.3); + } + + +/********************************************* + * PROGRESS BAR + *********************************************/ + +.reveal .progress { + background: rgba(0,0,0,0.2); +} + .reveal .progress span { + background: #3b759e; + + -webkit-transition: width 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985); + -moz-transition: width 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985); + -ms-transition: width 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985); + -o-transition: width 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985); + transition: width 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985); + } + + diff --git a/index.html b/index.html index 72783fcd..a07d1829 100644 --- a/index.html +++ b/index.html @@ -15,7 +15,7 @@ - + @@ -151,6 +151,22 @@ +
+

Themes

+

+ Reveal.js comes with a few themes built in:
+ Sky | + Beige | + Simple | + Default +

+

+ + * Theme demos are loaded after the presentation which leads to flicker. In production you should load your theme in the <head> using a <link>. + +

+
+

Global State

@@ -296,6 +312,7 @@ function linkify( selector ) { progress: true, history: true, + theme: Reveal.getQueryHash().theme || 'default', // available themes are in /css/theme transition: Reveal.getQueryHash().transition || 'default', // default/cube/page/concave/linear(2d) // Optional libraries used to extend on reveal.js diff --git a/js/reveal.js b/js/reveal.js index 9c26f293..31b9bf12 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -1,5 +1,5 @@ /*! - * reveal.js 2.0 r20 + * reveal.js 2.0 r21 * http://lab.hakim.se/reveal-js * MIT licensed * @@ -39,6 +39,9 @@ var Reveal = (function(){ // Apply a 3D roll to links on hover rollingLinks: true, + // Transition style (see /css/theme) + theme: 'default', + // Transition style transition: 'default', // default/cube/page/concave/linear(2d), @@ -111,6 +114,7 @@ var Reveal = (function(){ extend( config, options ); // Cache references to DOM elements + dom.theme = document.querySelector( '#theme' ); dom.wrapper = document.querySelector( '.reveal' ); dom.progress = document.querySelector( '.reveal .progress' ); dom.progressbar = document.querySelector( '.reveal .progress span' ); @@ -222,6 +226,10 @@ var Reveal = (function(){ dom.progress.style.display = 'block'; } + if( config.theme && dom.theme ) { + dom.theme.setAttribute( 'href', 'css/theme/' + config.theme + '.css' ); + } + if( config.transition !== 'default' ) { dom.wrapper.classList.add( config.transition ); } diff --git a/js/reveal.min.js b/js/reveal.min.js index 4c2a4b8e..cdc904a0 100644 --- a/js/reveal.min.js +++ b/js/reveal.min.js @@ -1,19 +1,20 @@ /*! - * reveal.js 2.0 r20 + * reveal.js 2.0 r21 * http://lab.hakim.se/reveal-js * MIT licensed * * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se */ -var Reveal=(function(){var k=".reveal .slides>section",b=".reveal .slides>section.present>section",e=!!("ontouchstart" in window),N={controls:true,progress:true,history:false,keyboard:true,loop:false,autoSlide:0,mouseWheel:true,rollingLinks:true,transition:"default",dependencies:[]},l=0,c=0,w,E,ac=[],d={},P="WebkitPerspective" in document.body.style||"MozPerspective" in document.body.style||"msPerspective" in document.body.style||"OPerspective" in document.body.style||"perspective" in document.body.style,m="WebkitTransform" in document.body.style||"MozTransform" in document.body.style||"msTransform" in document.body.style||"OTransform" in document.body.style||"transform" in document.body.style,x=0,j=0,B=0,W={startX:0,startY:0,startSpan:0,startCount:0,handled:false,threshold:40}; -function h(ad){if((!m&&!P)){document.body.setAttribute("class","no-transforms");return;}r(N,ad);d.wrapper=document.querySelector(".reveal");d.progress=document.querySelector(".reveal .progress"); -d.progressbar=document.querySelector(".reveal .progress span");if(N.controls){d.controls=document.querySelector(".reveal .controls");d.controlsLeft=document.querySelector(".reveal .controls .left"); -d.controlsRight=document.querySelector(".reveal .controls .right");d.controlsUp=document.querySelector(".reveal .controls .up");d.controlsDown=document.querySelector(".reveal .controls .down"); -}R();if(navigator.userAgent.match(/(iphone|ipod|android)/i)){document.documentElement.style.overflow="scroll";document.body.style.height="120%";window.addEventListener("load",X,false); -window.addEventListener("orientationchange",X,false);}}function R(){var ae=[],ai=[];for(var af=0,ad=N.dependencies.length;af