├── logo.png
├── img
└── rainbow-wood.jpg
├── README.markdown
├── sample-slideshow.css
├── license.txt
├── classList.js
├── slideshow.css
├── sample-slideshow.html
├── theme.css
├── slideshow.js
└── logo.svg
/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ttscoff/CSSS/master/logo.png
--------------------------------------------------------------------------------
/img/rainbow-wood.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ttscoff/CSSS/master/img/rainbow-wood.jpg
--------------------------------------------------------------------------------
/README.markdown:
--------------------------------------------------------------------------------
1 | # CSSS
2 | ### CSS-based SlideShow System
3 |
4 | Warning: Only works in latest Firefox, Opera, Safari or Chrome.
5 | For more information, see the [sample slideshow](http://leaverou.me/csss/sample-slideshow.html)
--------------------------------------------------------------------------------
/sample-slideshow.css:
--------------------------------------------------------------------------------
1 | #intro {
2 | background: rgba(0,0,0,.7);
3 | padding: 0;
4 | border: 0;
5 | }
6 |
7 | #intro h1 {
8 | width: 60%;
9 | min-height: 500px;
10 | margin: 5% auto 0;
11 | }
12 |
13 | #intro .attribution {
14 | font-family: Helvetica, sans-serif;
15 | font-weight: bold;
16 | text-align: center;
17 | font-size: 100%;
18 | line-height: .3;
19 | color: rgba(0,0,0,.7);
20 | text-shadow: none;
21 | background: url(img/rainbow-wood.jpg) bottom;
22 | padding:.6em 0 0;
23 | overflow: hidden;
24 | }
25 |
26 | @media only screen and (-webkit-min-device-pixel-ratio:0) {
27 | /* hack to avoid using the Object element in Safari/WebKit, due to WebKit Bug 27190 */
28 | object[type="image/svg+xml"] {
29 | display: none;
30 | }
31 |
32 | #intro h1 {
33 | background: url(logo.svg) no-repeat center;
34 | background-size:100% auto;
35 | }
36 | }
--------------------------------------------------------------------------------
/license.txt:
--------------------------------------------------------------------------------
1 | The MIT License
2 |
3 | Copyright (c) 2010 Lea Verou
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
--------------------------------------------------------------------------------
/classList.js:
--------------------------------------------------------------------------------
1 | /*
2 | * classList.js: Implements a cross-browser element.classList getter.
3 | * 2010-09-06
4 | *
5 | * By Eli Grey, http://eligrey.com
6 | * Public Domain.
7 | * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
8 | */
9 |
10 | "use strict";
11 |
12 | if (typeof Element !== "undefined") {
13 |
14 | (function () {
15 |
16 | var
17 | classListProp = "classList"
18 | , protoProp = "prototype"
19 | , elemCtrProto = Element[protoProp]
20 | , objCtr = Object
21 | ;
22 | if (!objCtr.hasOwnProperty.call(elemCtrProto, classListProp)) {
23 | var
24 | strTrim = String[protoProp].trim || function () {
25 | return this.replace(/^\s+|\s+$/g, "");
26 | }
27 | , arrIndexOf = Array[protoProp].indexOf || function (item) {
28 | for (var i = 0, len = this.length; i < len; i++) {
29 | if (i in this && this[i] === item) {
30 | return i;
31 | }
32 | }
33 | return -1;
34 | }
35 | , checkTokenAndGetIndex = function (classList, token) {
36 | if (token === "") {
37 | throw "SYNTAX_ERR";
38 | }
39 | if (/\s/.test(token)) {
40 | throw "INVALID_CHARACTER_ERR";
41 | }
42 | return arrIndexOf.call(classList, token);
43 | }
44 | , ClassList = function (elem) {
45 | var
46 | trimmedClasses = strTrim.call(elem.className)
47 | , classes = trimmedClasses ? trimmedClasses.split(/\s+/) : []
48 | ;
49 | for (var i = 0, len = classes.length; i < len; i++) {
50 | this.push(classes[i]);
51 | }
52 | this.updateClassName = function () {
53 | elem.className = this.toString();
54 | };
55 | }
56 | , classListProto = ClassList[protoProp] = []
57 | , classListGetter = function () {
58 | return new ClassList(this);
59 | }
60 | ;
61 | classListProto.item = function (i) {
62 | return this[i] || null;
63 | };
64 | classListProto.contains = function (token) {
65 | token += "";
66 | return checkTokenAndGetIndex(this, token) !== -1;
67 | };
68 | classListProto.add = function (token) {
69 | token += "";
70 | if (checkTokenAndGetIndex(this, token) === -1) {
71 | this.push(token);
72 | this.updateClassName();
73 | }
74 | };
75 | classListProto.remove = function (token) {
76 | token += "";
77 | var index = checkTokenAndGetIndex(this, token);
78 | if (index !== -1) {
79 | this.splice(index, 1);
80 | this.updateClassName();
81 | }
82 | };
83 | classListProto.toggle = function (token) {
84 | token += "";
85 | if (checkTokenAndGetIndex(this, token) === -1) {
86 | this.add(token);
87 | } else {
88 | this.remove(token);
89 | }
90 | };
91 | classListProto.toString = function () {
92 | return this.join(" ");
93 | };
94 |
95 | if (objCtr.defineProperty) {
96 | var classListDescriptor = {
97 | get: classListGetter
98 | , enumerable: true
99 | , configurable: true
100 | };
101 | try {
102 | objCtr.defineProperty(elemCtrProto, classListProp, classListDescriptor);
103 | } catch (ex) { // IE 8 doesn't support enumerable:true
104 | if (ex.number === -0x7FF5EC54) {
105 | classListDescriptor.enumerable = false;
106 | objCtr.defineProperty(elemCtrProto, classListProp, classListDescriptor);
107 | }
108 | }
109 | } else if (objCtr[protoProp].__defineGetter__) {
110 | elemCtrProto.__defineGetter__(classListProp, classListGetter);
111 | }
112 | }
113 |
114 | }());
115 |
116 | }
--------------------------------------------------------------------------------
/slideshow.css:
--------------------------------------------------------------------------------
1 | /**
2 | Basic CSS so that the slideshow script functions as a slideshow
3 | @author Lea Verou
4 | @version 1.0
5 | */
6 |
7 | body {
8 | counter-reset: slide;
9 | }
10 |
11 | .slide {
12 | position:absolute;
13 | top:0;
14 | right:0;
15 | bottom:0;
16 | left:0;
17 | z-index:1;
18 |
19 | font-size:250%;
20 | line-height:1.6;
21 |
22 | opacity:0;
23 | height:0;
24 | width:0;
25 | overflow:hidden;
26 |
27 | counter-increment: slide;
28 |
29 | -webkit-transition:1s opacity, 1s -webkit-transform;
30 | -moz-transition:1s opacity, 1s -moz-transform;
31 | -o-transition:1s opacity, 1s -o-transform;
32 | transition:1s opacity, 1s transform;
33 | }
34 |
35 | .slide:target {
36 | z-index:100;
37 | opacity:1;
38 | height:auto;
39 | width: auto;
40 | overflow: visible;
41 | }
42 |
43 | /**
44 | Slide numbers
45 | */
46 | .slide:target::before {
47 | content: counter(slide);
48 | position: absolute;
49 | top: .05in;
50 | right: .5em;
51 | z-index: 1010;
52 |
53 | font-size: .15in;
54 | color: white;
55 | background: rgba(0,0,0,.25);
56 | font-weight: 900;
57 | text-shadow: .05em .05em .1em black;
58 | text-align: center;
59 | padding: .1em .3em 0;
60 | min-width: 1.6em;
61 | -moz-box-sizing: border-box;
62 | -webkit-box-sizing: border-box;
63 | box-sizing: border-box;
64 |
65 | -moz-border-radius: 50%;
66 | -webkit-border-radius: 50%;
67 | border-radius: 50%;
68 | }
69 |
70 | /* If there's nothing selected, show the first */
71 | .slide:first-child {
72 | z-index:2;
73 | }
74 |
75 | /* Delayed items that are shown incrementally after the slide is */
76 | .slide .delayed {
77 | opacity: 0;
78 |
79 | -webkit-transition:.7s opacity;
80 | -moz-transition:.7s opacity;
81 | -o-transition:.7s opacity;
82 | transition:.7s opacity;
83 | }
84 |
85 | .slide .delayed.displayed {
86 | opacity: .3;
87 | }
88 |
89 | .slide .delayed.current,
90 | .slide .delayed.displayed.non-dismissable {
91 | opacity: 1;
92 | }
93 |
94 | /**
95 | Show thumbnails
96 | */
97 |
98 | .show-thumbnails {
99 | overflow-x: hidden;
100 | }
101 |
102 | .show-thumbnails .slide {
103 | width: 1024px;
104 | height: 768px;
105 | -moz-box-sizing: border-box;
106 | -webkit-box-sizing: border-box;
107 | box-sizing: border-box;
108 |
109 | float: left;
110 | overflow: hidden;
111 | position: static;
112 | opacity: 1;
113 | margin:-292px -395px;
114 | cursor: pointer;
115 |
116 | -moz-transform: scale(.2, .2);
117 | -o-transform: scale(.2, .2);
118 | -webkit-transform: scale(.2, .2);
119 | transform: scale(.2, .2);
120 |
121 | -webkit-transition:1s -webkit-transform;
122 | -moz-transition:1s -moz-transform;
123 | -o-transition:1s -o-transform;
124 | transition:1s transform;
125 | }
126 |
127 | .show-thumbnails .slide .delayed {
128 | opacity: 1;
129 | }
130 |
131 | .show-thumbnails .slide:hover,
132 | .show-thumbnails .slide:target {
133 | outline: 20px solid rgba(255, 255, 255, .6);
134 | -moz-outline-radius:5px;
135 |
136 | box-shadow: 5px 5px 10px black;
137 | }
138 |
139 | .show-thumbnails .slide:target {
140 | outline-color: rgba(255, 255, 255, .3);
141 | }
142 |
143 | .show-thumbnails .slide:target:hover {
144 | outline-color: rgba(255, 255, 255, .9);
145 | }
146 |
147 | /* Display titles */
148 | .show-thumbnails .slide[data-title]:after {
149 | content: attr(data-title);
150 | position: absolute;
151 | left: 0;
152 | right: 0;
153 | bottom: 0;
154 | padding: .1em 0;
155 | background: rgba(0,0,0,.5);
156 | color: white;
157 | font-size: 250%;
158 | text-align: center;
159 | text-shadow: .05em .05em .1em black;
160 | }
161 |
162 | /* Hide all elements in slide by hitting Ctrl + J or Shift + J */
163 | .hide-elements .slide:target > * {
164 | opacity: 0;
165 |
166 | -moz-transition:.5s;
167 | -webkit-transition:.5s;
168 | -o-transition:.5s;
169 | transition:.5s;
170 | }
171 |
172 | /* Mark slides as incomplete to spot them easier */
173 | .incomplete.slide::after {
174 | content: 'INCOMPLETE';
175 | font-weight: bold;
176 | position: absolute;
177 | top: 40%;
178 | left: 30%;
179 | padding: .1em .4em 0;
180 | border: .1em solid;
181 | color: rgba(255, 0, 0, .8);
182 | font-size: 140%;
183 |
184 | -moz-border-radius: .2em;
185 | -webkit-border-radius: .2em;
186 | border-radius: .2em;
187 |
188 | -moz-transform: rotate(30deg);
189 | -o-transform: rotate(30deg);
190 | -webkit-transform: rotate(30deg);
191 | transform: rotate(30deg);
192 | }
--------------------------------------------------------------------------------
/sample-slideshow.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CSSS: A brief introduction
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
18 |
19 | By Lea Verou
20 |
21 |
22 |
23 |
What is it?
24 |
A simple framework for building presentations with modern web standards
25 |
26 | - An HTML file contains the whole presentation
27 | - Themes as CSS files
28 | - JavaScript handles what CSS can't (keyboard shortcuts etc)
29 |
30 |
31 |
32 |
33 |
History
34 |
35 | - I had to create a presentation for my talk at Front Trends 2010
36 | - The only web-based presentation system I knew of was the HTML5 presentation by Marcin Wichary which didn't fit my needs
37 | - …so I rolled up my own
38 | - FT2010 attendees asked me to release it
39 | - and here it is! ;-)
40 |
41 |
42 |
43 |
44 |
What about S5?
45 |
46 | - I found out about S5 afterwards, via Tantek Çelik
47 | - Seems to follow a similar approach to CSSS…
48 | - …but does a few things differently
49 | - So I guess even if I knew, I would still make my own
50 | - but take a look at it too, it's really good!
51 |
52 |
53 |
54 |
55 |
Navigation
56 |
57 | - → or ↓ to advance to the next slide or incrementally displayed item
58 | - ← or ↑ to go to the previous slide or incrementally displayed item
59 | - Ctrl* + → or Ctrl* + ↓ to jump to the next slide
60 | - Ctrl* + ← or Ctrl* + ↑ to jump to the previous slide
61 | - Home to go to the first slide, End to go to the last
62 | - Ctrl* + G to jump to an arbitrary slide (by slide number or identifier)
63 | - Ctrl* + H to see thumbnails of the slides and jump to one of them (really slow in every browser except Safari)
64 |
65 |
* Ctrl or Shift actually. Only Shift works in Opera.
66 |
67 |
68 |
69 |
Features
70 |
71 | - IDs are dynamically assigned by JavaScript…
72 | - …but you can also assign your own, bringing the best of both worlds
73 | - Incremental display of slide contents (just add
class="delayed")
74 | - Slide scaling based on window size (size everything you want to be scalable in ems)
75 | - Document.title changing according to slide title (fetched either from the
title attribute or the slide's heading)
76 |
77 |
78 |
79 |
80 |
Drawbacks
81 |
82 | - Only supports Firefox 3.6+, the latest Chrome/Safari or Opera 10.60+. Why?
83 |
84 | - More lightweight
85 | - Easier to understand code
86 | - It's a presentation, so the environment is controlled anyway
87 |
88 |
89 | - No mouse click to advance to the next slide. I consider it annoying.
90 |
91 |
92 |
93 |
103 |
104 |
105 |
106 |
109 |
110 |
111 |
--------------------------------------------------------------------------------
/theme.css:
--------------------------------------------------------------------------------
1 | /**
2 | CSSS basic slideshow theme
3 |
4 | @author Lea Verou
5 | @version 1.0
6 | */
7 |
8 | * {
9 | padding:0;
10 | margin:0;
11 | font:inherit;
12 | color:inherit;
13 | }
14 |
15 | html {
16 | background: black url(img/rainbow-wood.jpg) bottom center;
17 | background-size: cover;
18 | }
19 |
20 | body {
21 | font-family:Helvetica, Arial, sans-serif;
22 | background:black;
23 | }
24 |
25 | button {
26 | padding:.2em .5em;
27 | }
28 |
29 | a:hover {
30 | text-shadow: 0 0 .5em white, 0 0 1em white;
31 | }
32 |
33 | code, pre, style {
34 | font-family: Consolas, 'Andale Mono', 'Courier New', monospace;
35 | background:rgba(0,0,0,.4);
36 | }
37 |
38 | code {
39 | padding:.2em .2em .1em;
40 | white-space: nowrap;
41 |
42 | -moz-border-radius:.2em;
43 | -webkit-border-radius:.2em;
44 | border-radius:.2em;
45 |
46 | -moz-box-shadow:.05em .05em .3em black;
47 | -webkit-box-shadow:.05em .05em .3em black;
48 | box-shadow:.05em .05em .3em black;
49 |
50 | border: 1px solid rgba(0,0,0,0.5);
51 | background: rgba(0,0,0,0.25);
52 |
53 | -webkit-box-shadow: 0 2px 6px rgba(0,0,0,0.5), inset 0 1px rgba(255,255,255,0.3), inset 0 12px rgba(255,255,255,0.15), inset 0 10px 20px rgba(255,255,255,0.25), inset 0 -15px 30px rgba(0,0,0,0.3);
54 | -moz-box-shadow: 0 2px 6px rgba(0,0,0,0.5), inset 0 1px rgba(255,255,255,0.3), inset 0 12px rgba(255,255,255,0.15), inset 0 10px 20px rgba(255,255,255,0.25), inset 0 -15px 30px rgba(0,0,0,0.3);
55 | box-shadow: 0 2px 6px rgba(0,0,0,0.5), inset 0 1px rgba(255,255,255,0.3), inset 0 12px rgba(255,255,255,0.15), inset 0 10px 20px rgba(255,255,255,0.25), inset 0 -15px 30px rgba(0,0,0,0.3);
56 | }
57 |
58 | pre, style {
59 | padding:.3em .5em;
60 | margin-left: -.1em;
61 | border:2px solid rgba(255, 255, 255, .1);
62 |
63 | -webkit-box-shadow:.1em .1em .5em black inset;
64 | -moz-box-shadow:.1em .1em .5em black inset;
65 | box-shadow:.1em .1em .5em black inset;
66 | }
67 |
68 | strong, b {
69 | font-weight:bold;
70 | }
71 |
72 | pre strong {
73 | text-shadow: 0 0 .6em white;
74 | }
75 |
76 | .slide {
77 | padding:0 2.5% 2%;
78 | background: rgba(0,0,0,.5);
79 | background-clip: padding-box;
80 | -moz-background-clip: padding-box;
81 | text-shadow:.05em .05em .1em rgba(0,0,0,.4);
82 | color: white;
83 | border:30px solid transparent;
84 | }
85 |
86 | .slide:target::before {
87 | background: rgba(255, 255, 255, .6);
88 | color: black;
89 | text-shadow: .03em .03em .1em white;
90 | }
91 |
92 | .slide h2 {
93 | font-family: 'Helvetica Neue', Helvetica, sans-serif;
94 | font-weight: 100;
95 | font-size: 1.2in;
96 | }
97 |
98 | .slide p,
99 | .slide li {
100 | font-weight: bold;
101 | letter-spacing: -.03em;
102 | }
103 |
104 | .slide > ul {
105 | list-style:none;
106 | }
107 |
108 | .slide ol {
109 | margin-left:2em;
110 | }
111 |
112 | .slide > ul ul {
113 | margin-left:2em;
114 | list-style: none;
115 | }
116 |
117 | .slide li li {
118 | font-size:80%;
119 | }
120 |
121 | .slide li {
122 | margin:.2em 0;
123 | }
124 |
125 | .slide > ul > li:before {
126 | content:'\2714';
127 | color: #a0c12c;
128 | padding-right: .2em;
129 | }
130 |
131 | .slide li li:before {
132 | content: '\279C';
133 | color: #28bcbc;
134 | padding-right: .2em;
135 | }
136 |
137 | .slide .emphasis {
138 | padding: .4em .5em .3em;
139 | margin: .3em 0;
140 | background: #f80;
141 | background: -webkit-gradient(linear, left top, left bottom, from(#fa0), to(#f80));
142 | background: -moz-linear-gradient(#fa0, #f80);
143 | color: white;
144 | font-weight: bold;
145 | letter-spacing: -.05em;
146 | line-height: .85;
147 | text-shadow: .05em .05em .1em rgba(0,0,0,.4);
148 |
149 | -moz-border-radius: .3em;
150 | -webkit-border-radius: .3em;
151 | border-radius: .3em;
152 |
153 | -moz-box-shadow:.1em .1em .5em black;
154 | -webkit-box-shadow:.1em .1em .5em black;
155 | box-shadow:.1em .1em .5em black;
156 | }
157 |
158 | .light.slide .emphasis {
159 | -moz-box-shadow:.1em .1em .5em rgba(0,0,0,.4);
160 | -webkit-box-shadow:.1em .1em .5em rgba(0,0,0,.4);
161 | box-shadow:.1em .1em .5em rgba(0,0,0,.4);
162 | }
163 |
164 | .slide .emphasis::before {
165 | content: '\279C';
166 | color: rgba(255,255,255,.5);
167 | float: left;
168 | width: .75em;
169 | height: 0;
170 | padding: .45em 0 .3em;
171 | margin: -.2em .2em 0 -.25em;
172 | border: .12em solid;
173 | text-align: center;
174 | line-height: 0;
175 | font-size: 120%;
176 | font-family: inherit;
177 | text-shadow: none;
178 |
179 | -moz-border-radius:50%;
180 | -webkit-border-radius:50%;
181 | border-radius:50%;
182 |
183 | -moz-transform: rotate(45deg);
184 | -o-transform: rotate(45deg);
185 | -webkit-transform: rotate(45deg);
186 | transform: rotate(45deg);
187 | }
188 |
189 | .attribution {
190 | background: rgba(0,0,0,.8);
191 | color: white;
192 | display: block;
193 | position: absolute;
194 | left: 0;
195 | right: 0;
196 | bottom: 1em;
197 | padding: .5em 1em;
198 | font-size: 30%;
199 | text-shadow: .05em .05em .1em black;
200 | }
201 |
202 | .attribution a {
203 | text-decoration: none;
204 | }
205 |
206 | .attribution a::after {
207 | content: ' (' attr(href) ')';
208 | }
209 |
210 |
--------------------------------------------------------------------------------
/slideshow.js:
--------------------------------------------------------------------------------
1 | /**
2 | * CSSS javascript code
3 | * @author Lea Verou (http://leaverou.me)
4 | * @version 1.0
5 | */
6 |
7 | (function(){
8 | // Cache element, we may need it for slides that don't have titles
9 | var documentTitle = document.getElementsByTagName('title')[0].textContent;
10 |
11 | window.SlideShow = function(container, slide) {
12 | var me = this;
13 |
14 | container = container || document.body;
15 |
16 | // Current slide
17 | this.slide = slide || 0;
18 |
19 | // Current .delayed item in the slide
20 | this.item = 0;
21 |
22 | // Get the slide elements into an array
23 | this.slides = Array.prototype.slice.apply(container.querySelectorAll('.slide'));
24 |
25 | for(var i=0; i= 35 && evt.keyCode <= 40) {
122 | evt.preventDefault();
123 | }
124 |
125 | switch(evt.keyCode) {
126 | case 35: // end
127 | me.end();
128 | break;
129 | case 36: // home
130 | me.start();
131 | break;
132 | case 37: // <-
133 | case 38: // up arrow
134 | me.previous(evt.ctrlKey || evt.shiftKey);
135 | break;
136 | case 39: // ->
137 | case 40: // down arrow
138 | me.next(evt.ctrlKey || evt.shiftKey);
139 | break;
140 | }
141 | }
142 | }, false);
143 | }
144 |
145 | SlideShow.prototype = {
146 | start: function() {
147 | this.goto(0);
148 | },
149 |
150 | end: function() {
151 | this.goto(this.slides.length - 1);
152 | },
153 |
154 | /**
155 | @param hard {Boolean} Whether to advance to the next slide (true) or
156 | just the next step (which could very well be showing a list item)
157 | */
158 | next: function(hard) {
159 | if(!hard && this.items.length) {
160 | // If there's no current, then just mark the first one as such
161 | if(!this.item) {
162 | this.items[this.item++].classList.add('current');
163 | }
164 | // Add .current to current item if it exists, otherwise advance to next slide
165 | else if(this.item < this.items.length) {
166 | classes = this.items[this.item - 1].classList; // to speed up lookups
167 |
168 | classes.remove('current');
169 | classes.add('displayed');
170 |
171 | this.items[this.item++].classList.add('current');
172 | }
173 | else {
174 | this.item = 0;
175 | this.next(true);
176 | }
177 | }
178 | else {
179 | this.goto(this.slide + 1);
180 |
181 | this.item = 0;
182 |
183 | // Mark all items as not displayed, if there are any
184 | if(this.items.length) {
185 | for (var i=0; i 0) {
197 | var classes = this.items[this.item - 1].classList; // to speed up lookups
198 |
199 | classes.remove('current');
200 |
201 | if(this.item > 1) {
202 | classes = this.items[--this.item - 1].classList;
203 |
204 | classes.remove('displayed');
205 | classes.add('current');
206 | }
207 | else {
208 | this.item = 0;
209 | }
210 | }
211 | else {
212 |
213 | this.goto(this.slide - 1);
214 |
215 | this.item = this.items.length;
216 |
217 | // Mark all items as displayed, if there are any
218 | if(this.items.length) {
219 | for (var i=0; i innerHeight || scrollRoot.scrollWidth > innerWidth) && percent >= 35;
297 | percent-=5
298 | ) {
299 | bodyStyle.fontSize = percent + '%';
300 | }
301 |
302 | // Individual slide
303 |
304 | if(slide.clientHeight && slide.clientWidth) {
305 | // Strange FF bug: scrollHeight doesn't work properly with overflow:hidden
306 | slide.style.overflow = 'auto';
307 |
308 | for(
309 | ;
310 | (slide.scrollHeight > slide.clientHeight || slide.scrollWidth > slide.clientWidth) && percent >= 35;
311 | percent--
312 | ) {
313 | bodyStyle.fontSize = percent + '%';
314 | }
315 |
316 | slide.style.overflow = '';
317 | }
318 | }
319 | };
320 |
321 | })();
--------------------------------------------------------------------------------
/logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
53 |
--------------------------------------------------------------------------------