├── .gitignore
├── README.md
├── deck.js
├── CHANGELOG.md
├── MIT-license.txt
├── Makefile
├── README.md
├── boilerplate.html
├── core
│ ├── deck.core.css
│ ├── deck.core.js
│ ├── deck.core.scss
│ ├── print.css
│ └── print.scss
├── extensions
│ ├── goto
│ │ ├── deck.goto.css
│ │ ├── deck.goto.html
│ │ ├── deck.goto.js
│ │ └── deck.goto.scss
│ ├── menu
│ │ ├── deck.menu.css
│ │ ├── deck.menu.js
│ │ └── deck.menu.scss
│ ├── navigation
│ │ ├── deck.navigation.css
│ │ ├── deck.navigation.html
│ │ ├── deck.navigation.js
│ │ └── deck.navigation.scss
│ ├── scale
│ │ ├── deck.scale.css
│ │ ├── deck.scale.js
│ │ └── deck.scale.scss
│ └── status
│ │ ├── deck.status.css
│ │ ├── deck.status.html
│ │ ├── deck.status.js
│ │ └── deck.status.scss
├── introduction
│ └── index.html
├── jquery.min.js
├── modernizr.custom.js
├── test
│ ├── fixtures
│ │ ├── empty.html
│ │ ├── nesteds.html
│ │ └── standard.html
│ ├── index.html
│ ├── lib
│ │ ├── jasmine-html.js
│ │ ├── jasmine-jquery.js
│ │ ├── jasmine.css
│ │ └── jasmine.js
│ ├── settings.js
│ ├── spec.core.js
│ ├── spec.goto.js
│ ├── spec.menu.js
│ ├── spec.navigation.js
│ ├── spec.scale.js
│ └── spec.status.js
└── themes
│ ├── style
│ ├── _reset.scss
│ ├── neon.css
│ ├── neon.scss
│ ├── swiss.css
│ ├── swiss.scss
│ ├── web-2.0.css
│ └── web-2.0.scss
│ └── transition
│ ├── fade.css
│ ├── fade.scss
│ ├── horizontal-slide.css
│ ├── horizontal-slide.scss
│ ├── vertical-slide.css
│ └── vertical-slide.scss
├── iframes
├── UVs.html
├── camera.html
├── circle-animation.html
├── cube-title.html
├── cubemap.html
├── geometry.html
├── getting-started.html
├── helpers.html
├── hierarchy.html
├── images
│ ├── cube
│ │ └── Bridge2
│ │ │ ├── negx.jpg
│ │ │ ├── negy.jpg
│ │ │ ├── negz.jpg
│ │ │ ├── posx.jpg
│ │ │ ├── posy.jpg
│ │ │ ├── posz.jpg
│ │ │ └── readme.txt
│ ├── cursor-centered.png
│ └── planets
│ │ ├── all-maps.png
│ │ ├── earth_alpha_2048.jpg
│ │ ├── earth_atmos_2048.jpg
│ │ ├── earth_clouds_1024.png
│ │ ├── earth_normal_2048.jpg
│ │ ├── earth_specular_2048.jpg
│ │ ├── land_ocean_ice_cloud_2048.jpg
│ │ └── moon_1024.jpg
├── interactive-cubes-gui.html
├── interactive-cubes-helpers.html
├── lights-three-point.html
├── lights.html
├── loader.html
├── material-options.html
├── material.html
├── misc_controls_orbit.html
├── models
│ ├── pumpkin.js
│ ├── teapot.js
│ └── teapot.json
├── sprite.html
├── texture-mapping.html
├── three
│ ├── LegacyJSONLoader.js
│ ├── OrbitControls.js
│ ├── UVsDebug.js
│ ├── WebGL.js
│ ├── geometries
│ │ ├── TeapotBufferGeometry.js
│ │ └── hilbert3D.js
│ ├── libs
│ │ ├── dat.gui.min.js
│ │ └── tween.min.js
│ ├── three.js
│ └── three.min.js
├── transforms.html
├── tween.html
├── vertices.html
├── webgl_interactive_cubes.html
├── webgl_lines_colors.html
└── webgl_points_random.html
├── images
├── 300.jpg
├── 3d-software.png
├── cardboard-ingredients.png
├── geometry.png
├── interaction.png
├── marble.jpg
├── node-map.png
├── obj-json.png
├── octocat.png
├── orbit-all-the-things.jpg
├── sublime-completions.png
├── sunny-sky.jpg
├── surface-normal.png
├── threejs.png
├── tron-legacy.jpg
├── tween-graphs.png
├── twitter.png
├── unit-circle-radians.png
├── unit-circle-trig.png
├── unit-circle.png
└── webgl-browser-support.png
├── index.html
├── offline-extended.html
├── offline.html
├── resources
├── VRController.js
├── fonts.css
├── fonts
│ ├── source-code-pro
│ │ ├── SourceCodePro-Bold.eot
│ │ ├── SourceCodePro-Bold.svg
│ │ ├── SourceCodePro-Bold.woff
│ │ ├── SourceCodePro-Regular.eot
│ │ ├── SourceCodePro-Regular.svg
│ │ └── SourceCodePro-Regular.woff
│ └── source-sans-pro
│ │ ├── SourceSansPro-Bold.eot
│ │ ├── SourceSansPro-Bold.svg
│ │ ├── SourceSansPro-Bold.woff
│ │ ├── SourceSansPro-Regular.eot
│ │ ├── SourceSansPro-Regular.svg
│ │ └── SourceSansPro-Regular.woff
├── jquery-2.1.1.min.js
├── less
│ ├── fonts.less
│ ├── layout.less
│ ├── prism
│ │ ├── prism-base16-eighties.dark.less
│ │ └── prism-default.less
│ ├── theme.less
│ └── vendor-prefixes.less
├── prism.js
├── slides.js
└── theme.css
├── thumb-presentation.jpg
└── videos
├── cardboard.mp4
├── sublime-completions.mp4
└── webgl-demos.mp4
/.gitignore:
--------------------------------------------------------------------------------
1 | /dev
2 | .DS_Store
3 | *.codekit
4 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Intro to WebGL with Three.js
2 | ----------------------------
3 |
4 | * `index.html` – Front Porch Conference 2014, Dallas, Texas ([Slides](http://davidscottlyons.com/threejs-intro) | [Video](https://youtu.be/6eLl8yQnxHQ))
5 | * `offline-extended.html` – Dallas HTML5 User Group Meetup, November 2014 ([Slides](http://davidscottlyons.com/threejs-intro/offline-extended.html) | [Video](https://youtu.be/-L6WWbKthvw))
6 |
7 | WebGL presentation slides.
8 | Runs on [deck.js](https://github.com/imakewebthings/deck.js)
9 | Use the "m" key to open the menu for quick navigation between slides.
--------------------------------------------------------------------------------
/deck.js/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | ## v1.1.0
4 |
5 | - Expand `beforeInit` event to allow halting of init event.
6 | - Create alternative init signature with single options object using new `options.selectors.slides` option.
7 | - Added methods `getTopLevelSlides` and `getNestedSlides`.
8 | - Integrated hash plugin into core.
9 | - Allow for touch swiping to be axis specific or disabled.
10 | - Include ARIA attribute considerations in core and extensions.
11 |
--------------------------------------------------------------------------------
/deck.js/MIT-license.txt:
--------------------------------------------------------------------------------
1 | The MIT License
2 |
3 | Copyright (c) 2011-2014 Caleb Troughton
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.
22 |
--------------------------------------------------------------------------------
/deck.js/Makefile:
--------------------------------------------------------------------------------
1 | SASSOPTS=--scss --style expanded
2 |
3 | default: generate
4 |
5 | generate:
6 | sass --update ${SASSOPTS} .
7 |
8 | force:
9 | sass --update ${SASSOPTS} --force .
10 |
11 | watch:
12 | sass --watch ${SASSOPTS} .
13 |
--------------------------------------------------------------------------------
/deck.js/README.md:
--------------------------------------------------------------------------------
1 | #deck.js
2 |
3 | A JavaScript library for building modern HTML presentations. deck.js is flexible enough to let advanced CSS and JavaScript authors craft highly customized decks, but also provides templates and themes for the HTML novice to build a standard slideshow.
4 |
5 | ## Quick Start
6 |
7 | This repository includes a `boilerplate.html` as a starting point, with all the extensions included. Just [download it](https://github.com/imakewebthings/deck.js/archive/latest.zip), open `boilerplate.html`, and start editing your slides.
8 |
9 | ## Documentation
10 |
11 | Check out the [documentation page](http://imakewebthings.github.com/deck.js/docs) for more information on the methods, events, and options available in core and all the included extensions. A sample standard slide deck is included in the package under the `introduction` folder. You can also [view that sample deck](http://imakewebthings.github.com/deck.js/introduction) online to play with the available style and transition themes.
12 |
13 | ## Extensions, Themes, and Related Projects
14 |
15 | Take a look at [the wiki](https://github.com/imakewebthings/deck.js/wiki) for lists of extensions, themes, and other related goodies. If you have a publicly available project of your own, feel free to add to the list.
16 |
17 | ## Dependencies (included in this repository)
18 |
19 | - [jQuery](http://jquery.com)
20 | - [Modernizr](http://modernizr.com)
21 |
22 | ## Tests & Support
23 |
24 | Unit tests are written with [Jasmine](http://pivotal.github.com/jasmine/) and [jasmine-jquery](https://github.com/velesin/jasmine-jquery). You can [run them here](http://imakewebthings.github.com/deck.js/test).
25 |
26 | deck.js has been tested with jQuery 1.6+ and works in IE7+, Chrome, FF, Safari, and Opera. The more capable browsers receive greater enhancements, but a basic cutaway slideshow will work for all browsers listed above. Please don't give your presentations in IE6.
27 |
28 | For any questions or general discussion about deck.js please direct your attention to the [mailing list](http://groups.google.com/group/deckjs) (uses Google groups.) If you would like to report a bug, please see the [issues page](https://github.com/imakewebthings/deck.js/issues).
29 |
30 | ## Printing
31 |
32 | Core includes stripped down black and white print styles for the standard slide template that is suitable for handouts.
33 |
34 | ## Awesome Contributors
35 |
36 | - [jbuck](https://github.com/jbuck)
37 | - [cykod](https://github.com/cykod)
38 | - [dougireton](https://github.com/dougireton)
39 | - [awirick](https://github.com/awirick)
40 | - Daniel Knittl-Frank
41 | - [alexch](https://github.com/alexch)
42 | - [twitwi](https://github.com/twitwi)
43 |
44 | If you would like to contribute a patch to deck.js please do as much as you can of the following:
45 |
46 | - Add or amend Jasmine tests.
47 | - Add inline documentation.
48 | - If the standard snippet of an extension changes, please change it in both the introduction deck and the snippet html in the extension folder.
49 | - If the API changes, it would be awesome to receive a parallel pull request to the gh-pages branch which updates the public-facing documentation.
50 |
51 | ## License
52 |
53 | Copyright (c) 2011-2014 Caleb Troughton
54 |
55 | Licensed under the [MIT license](https://github.com/imakewebthings/deck.js/blob/master/MIT-license.txt)
56 |
57 | ## Donations
58 |
59 | [](https://www.gittip.com/imakewebthings/ "Donate weekly to this project using Gittip")
61 |
--------------------------------------------------------------------------------
/deck.js/boilerplate.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Your deck.js Presentation
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
40 |
41 |
44 |
45 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
58 |
59 |
60 |
61 |
62 | /
63 |
64 |
65 |
66 |
67 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
94 |
95 |
96 |
--------------------------------------------------------------------------------
/deck.js/core/deck.core.css:
--------------------------------------------------------------------------------
1 | html, body {
2 | height: 100%;
3 | padding: 0;
4 | margin: 0;
5 | }
6 |
7 | .deck-container {
8 | position: relative;
9 | min-height: 100%;
10 | margin: 0 auto;
11 | overflow: hidden;
12 | overflow-y: auto;
13 | }
14 | .js .deck-container {
15 | visibility: hidden;
16 | }
17 | .ready .deck-container {
18 | visibility: visible;
19 | }
20 | .touch .deck-container {
21 | -webkit-text-size-adjust: none;
22 | -moz-text-size-adjust: none;
23 | }
24 |
25 | .deck-loading {
26 | display: none;
27 | }
28 |
29 | .slide {
30 | width: auto;
31 | min-height: 100%;
32 | position: relative;
33 | }
34 |
35 | .deck-before, .deck-previous, .deck-next, .deck-after {
36 | position: absolute;
37 | left: -999em;
38 | top: -999em;
39 | }
40 |
41 | .deck-current {
42 | z-index: 2;
43 | }
44 |
45 | .slide .slide {
46 | visibility: hidden;
47 | position: static;
48 | min-height: 0;
49 | }
50 |
51 | .deck-child-current {
52 | position: static;
53 | z-index: 2;
54 | }
55 | .deck-child-current .slide {
56 | visibility: hidden;
57 | }
58 | .deck-child-current .deck-previous, .deck-child-current .deck-before, .deck-child-current .deck-current {
59 | visibility: visible;
60 | }
61 |
--------------------------------------------------------------------------------
/deck.js/core/deck.core.scss:
--------------------------------------------------------------------------------
1 | html, body {
2 | height:100%;
3 | padding:0;
4 | margin:0;
5 | }
6 |
7 | .deck-container {
8 | position:relative;
9 | min-height:100%;
10 | margin:0 auto;
11 | overflow:hidden;
12 | overflow-y:auto;
13 |
14 | .js & {
15 | visibility:hidden;
16 | }
17 |
18 | .ready & {
19 | visibility:visible;
20 | }
21 |
22 | .touch & {
23 | -webkit-text-size-adjust:none;
24 | -moz-text-size-adjust:none;
25 | }
26 | }
27 |
28 | .deck-loading {
29 | display:none;
30 | }
31 |
32 | .slide {
33 | width:auto;
34 | min-height:100%;
35 | position:relative;
36 | }
37 |
38 | .deck-before, .deck-previous, .deck-next, .deck-after {
39 | position:absolute;
40 | left:-999em;
41 | top:-999em;
42 | }
43 |
44 | .deck-current {
45 | z-index:2;
46 | }
47 |
48 | .slide .slide {
49 | visibility:hidden;
50 | position:static;
51 | min-height:0;
52 | }
53 |
54 | .deck-child-current {
55 | position:static;
56 | z-index:2;
57 |
58 | .slide {
59 | visibility:hidden;
60 | }
61 |
62 | .deck-previous, .deck-before, .deck-current {
63 | visibility:visible;
64 | }
65 | }
--------------------------------------------------------------------------------
/deck.js/core/print.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-size: 18pt;
3 | }
4 |
5 | h1 {
6 | font-size: 48pt;
7 | }
8 |
9 | h2 {
10 | font-size: 36pt;
11 | }
12 |
13 | h3 {
14 | font-size: 28pt;
15 | }
16 |
17 | pre {
18 | border: 1px solid #000;
19 | padding: 10px;
20 | white-space: pre-wrap;
21 | }
22 |
23 | .deck-container > .slide {
24 | page-break-after: always;
25 | }
26 |
--------------------------------------------------------------------------------
/deck.js/core/print.scss:
--------------------------------------------------------------------------------
1 | body { font-size:18pt; }
2 | h1 { font-size:48pt; }
3 | h2 { font-size:36pt; }
4 | h3 { font-size:28pt; }
5 |
6 | pre {
7 | border:1px solid #000;
8 | padding:10px;
9 | white-space:pre-wrap;
10 | }
11 |
12 | .deck-container > .slide {
13 | page-break-after: always;
14 | }
15 |
--------------------------------------------------------------------------------
/deck.js/extensions/goto/deck.goto.css:
--------------------------------------------------------------------------------
1 | .goto-form {
2 | position: absolute;
3 | z-index: 3;
4 | bottom: 10px;
5 | left: 50%;
6 | height: 1.75em;
7 | margin: 0 0 0 -9.125em;
8 | line-height: 1.75em;
9 | padding: 0.625em;
10 | display: none;
11 | background: #ccc;
12 | overflow: hidden;
13 | border-radius: 10px;
14 | }
15 | .goto-form label {
16 | font-weight: bold;
17 | }
18 | .goto-form label, .goto-form input {
19 | display: inline-block;
20 | font-family: inherit;
21 | }
22 | .deck-goto .goto-form {
23 | display: block;
24 | }
25 |
26 | #goto-slide {
27 | width: 8.375em;
28 | margin: 0 0.625em;
29 | height: 1.4375em;
30 | }
31 |
32 | @media print {
33 | .goto-form, #goto-slide {
34 | display: none;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/deck.js/extensions/goto/deck.goto.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/deck.js/extensions/goto/deck.goto.js:
--------------------------------------------------------------------------------
1 | /*!
2 | Deck JS - deck.goto
3 | Copyright (c) 2011-2014 Caleb Troughton
4 | Dual licensed under the MIT license.
5 | https://github.com/imakewebthings/deck.js/blob/master/MIT-license.txt
6 | */
7 |
8 | /*
9 | This module adds the necessary methods and key bindings to show and hide a form
10 | for jumping to any slide number/id in the deck (and processes that form
11 | accordingly). The form-showing state is indicated by the presence of a class on
12 | the deck container.
13 | */
14 | (function($, undefined) {
15 | var $document = $(document);
16 | var rootCounter;
17 |
18 | var bindKeyEvents = function() {
19 | $document.unbind('keydown.deckgoto');
20 | $document.bind('keydown.deckgoto', function(event) {
21 | var key = $.deck('getOptions').keys.goto;
22 | if (event.which === key || $.inArray(event.which, key) > -1) {
23 | event.preventDefault();
24 | $.deck('toggleGoTo');
25 | }
26 | });
27 | };
28 |
29 | var populateDatalist = function() {
30 | var options = $.deck('getOptions');
31 | var $datalist = $(options.selectors.gotoDatalist);
32 |
33 | $.each($.deck('getSlides'), function(i, $slide) {
34 | var id = $slide.attr('id');
35 | if (id) {
36 | $datalist.append('');
37 | }
38 | });
39 | };
40 |
41 | var markRootSlides = function() {
42 | var options = $.deck('getOptions');
43 | var slideTest = $.map([
44 | options.classes.before,
45 | options.classes.previous,
46 | options.classes.current,
47 | options.classes.next,
48 | options.classes.after
49 | ], function(el, i) {
50 | return '.' + el;
51 | }).join(', ');
52 |
53 | rootCounter = 0;
54 | $.each($.deck('getSlides'), function(i, $slide) {
55 | var $parentSlides = $slide.parentsUntil(
56 | options.selectors.container,
57 | slideTest
58 | );
59 |
60 | if ($parentSlides.length) {
61 | $slide.removeData('rootIndex');
62 | }
63 | else if (!options.countNested) {
64 | ++rootCounter;
65 | $slide.data('rootIndex', rootCounter);
66 | }
67 | });
68 | };
69 |
70 | var handleFormSubmit = function() {
71 | var options = $.deck('getOptions');
72 | var $form = $(options.selectors.gotoForm);
73 |
74 | $form.unbind('submit.deckgoto');
75 | $form.bind('submit.deckgoto', function(event) {
76 | var $field = $(options.selectors.gotoInput);
77 | var indexOrId = $field.val();
78 | var index = parseInt(indexOrId, 10);
79 |
80 | if (!options.countNested) {
81 | if (!isNaN(index) && index >= rootCounter) {
82 | return false;
83 | }
84 | $.each($.deck('getSlides'), function(i, $slide) {
85 | if ($slide.data('rootIndex') === index) {
86 | index = i + 1;
87 | return false;
88 | }
89 | });
90 | }
91 |
92 | $.deck('go', isNaN(index) ? indexOrId : index - 1);
93 | $.deck('hideGoTo');
94 | $field.val('');
95 | event.preventDefault();
96 | });
97 | };
98 |
99 | /*
100 | Extends defaults/options.
101 |
102 | options.classes.goto
103 | This class is added to the deck container when showing the Go To Slide
104 | form.
105 |
106 | options.selectors.gotoDatalist
107 | The element that matches this selector is the datalist element that will
108 | be populated with options for each of the slide ids. In browsers that
109 | support the datalist element, this provides a drop list of slide ids to
110 | aid the user in selecting a slide.
111 |
112 | options.selectors.gotoForm
113 | The element that matches this selector is the form that is submitted
114 | when a user hits enter after typing a slide number/id in the gotoInput
115 | element.
116 |
117 | options.selectors.gotoInput
118 | The element that matches this selector is the text input field for
119 | entering a slide number/id in the Go To Slide form.
120 |
121 | options.keys.goto
122 | The numeric keycode used to show the Go To Slide form.
123 |
124 | options.countNested
125 | If false, only top level slides will be counted when entering a
126 | slide number.
127 | */
128 | $.extend(true, $.deck.defaults, {
129 | classes: {
130 | goto: 'deck-goto'
131 | },
132 |
133 | selectors: {
134 | gotoDatalist: '#goto-datalist',
135 | gotoForm: '.goto-form',
136 | gotoInput: '#goto-slide'
137 | },
138 |
139 | keys: {
140 | goto: 71 // g
141 | },
142 |
143 | countNested: true
144 | });
145 |
146 | /*
147 | jQuery.deck('showGoTo')
148 |
149 | Shows the Go To Slide form by adding the class specified by the goto class
150 | option to the deck container.
151 | */
152 | $.deck('extend', 'showGoTo', function() {
153 | var options = $.deck('getOptions');
154 | $.deck('getContainer').addClass(options.classes.goto);
155 | $(options.selectors.gotoForm).attr('aria-hidden', false);
156 | $(options.selectors.gotoInput).focus();
157 | });
158 |
159 | /*
160 | jQuery.deck('hideGoTo')
161 |
162 | Hides the Go To Slide form by removing the class specified by the goto class
163 | option from the deck container.
164 | */
165 | $.deck('extend', 'hideGoTo', function() {
166 | var options = $.deck('getOptions');
167 | $(options.selectors.gotoInput).blur();
168 | $.deck('getContainer').removeClass(options.classes.goto);
169 | $(options.selectors.gotoForm).attr('aria-hidden', true);
170 | });
171 |
172 | /*
173 | jQuery.deck('toggleGoTo')
174 |
175 | Toggles between showing and hiding the Go To Slide form.
176 | */
177 | $.deck('extend', 'toggleGoTo', function() {
178 | var options = $.deck('getOptions');
179 | var hasGotoClass = $.deck('getContainer').hasClass(options.classes.goto);
180 | $.deck(hasGotoClass ? 'hideGoTo' : 'showGoTo');
181 | });
182 |
183 | $document.bind('deck.init', function() {
184 | bindKeyEvents();
185 | populateDatalist();
186 | markRootSlides();
187 | handleFormSubmit();
188 | });
189 | })(jQuery);
190 |
191 |
--------------------------------------------------------------------------------
/deck.js/extensions/goto/deck.goto.scss:
--------------------------------------------------------------------------------
1 | .goto-form {
2 | position:absolute;
3 | z-index:3;
4 | bottom:10px;
5 | left:50%;
6 | height:1.75em;
7 | margin:0 0 0 -9.125em;
8 | line-height:1.75em;
9 | padding:0.625em;
10 | display:none;
11 | background:#ccc;
12 | overflow:hidden;
13 | border-radius:10px;
14 |
15 | label {
16 | font-weight:bold;
17 | }
18 |
19 | label, input {
20 | display:inline-block;
21 | font-family:inherit;
22 | }
23 |
24 | .deck-goto & {
25 | display:block;
26 | }
27 | }
28 |
29 | #goto-slide {
30 | width:8.375em;
31 | margin:0 0.625em;
32 | height:1.4375em;
33 | }
34 |
35 | @media print {
36 | .goto-form, #goto-slide {
37 | display:none;
38 | }
39 | }
--------------------------------------------------------------------------------
/deck.js/extensions/menu/deck.menu.css:
--------------------------------------------------------------------------------
1 | .deck-menu {
2 | overflow: auto;
3 | }
4 | .deck-menu .slide {
5 | background: #eee;
6 | position: relative;
7 | left: 0;
8 | top: 0;
9 | visibility: visible;
10 | cursor: pointer;
11 | }
12 | .no-csstransforms .deck-menu > .slide {
13 | float: left;
14 | width: 22%;
15 | height: 22%;
16 | min-height: 0;
17 | margin: 1%;
18 | font-size: 0.22em;
19 | overflow: hidden;
20 | padding: 0 0.5%;
21 | }
22 | .csstransforms .deck-menu > .slide {
23 | -webkit-transform: scale(0.22) !important;
24 | -ms-transform: scale(0.22) !important;
25 | transform: scale(0.22) !important;
26 | -webkit-transform-origin: 0 0;
27 | -ms-transform-origin: 0 0;
28 | transform-origin: 0 0;
29 | -moz-box-sizing: border-box;
30 | box-sizing: border-box;
31 | width: 100%;
32 | height: 100%;
33 | overflow: hidden;
34 | padding: 0 48px;
35 | margin: 12px;
36 | }
37 | .deck-menu iframe, .deck-menu img, .deck-menu video {
38 | max-width: 100%;
39 | }
40 | .deck-menu .deck-current, .no-touch .deck-menu .slide:hover {
41 | background: #ddf;
42 | }
43 | .deck-menu.deck-container:hover .deck-prev-link, .deck-menu.deck-container:hover .deck-next-link {
44 | display: none;
45 | }
46 |
--------------------------------------------------------------------------------
/deck.js/extensions/menu/deck.menu.js:
--------------------------------------------------------------------------------
1 | /*!
2 | Deck JS - deck.menu
3 | Copyright (c) 2011-2014 Caleb Troughton
4 | Dual licensed under the MIT license.
5 | https://github.com/imakewebthings/deck.js/blob/master/MIT-license.txt
6 | */
7 |
8 | /*
9 | This module adds the methods and key binding to show and hide a menu of all
10 | slides in the deck. The deck menu state is indicated by the presence of a class
11 | on the deck container.
12 | */
13 | (function($, undefined) {
14 | var $document = $(document);
15 | var $html = $('html');
16 | var rootSlides;
17 |
18 | var populateRootSlidesArray = function() {
19 | var options = $.deck('getOptions');
20 | var slideTest = $.map([
21 | options.classes.before,
22 | options.classes.previous,
23 | options.classes.current,
24 | options.classes.next,
25 | options.classes.after
26 | ], function(el, i) {
27 | return '.' + el;
28 | }).join(', ');
29 |
30 | rootSlides = [];
31 | $.each($.deck('getSlides'), function(i, $slide) {
32 | var $parentSlides = $slide.parentsUntil(
33 | options.selectors.container,
34 | slideTest
35 | );
36 | if (!$parentSlides.length) {
37 | rootSlides.push($slide);
38 | }
39 | });
40 | };
41 |
42 | var bindKeyEvents = function() {
43 | var options = $.deck('getOptions');
44 | $document.unbind('keydown.deckmenu');
45 | $document.bind('keydown.deckmenu', function(event) {
46 | var isMenuKey = event.which === options.keys.menu;
47 | isMenuKey = isMenuKey || $.inArray(event.which, options.keys.menu) > -1;
48 | if (isMenuKey && !event.ctrlKey) {
49 | $.deck('toggleMenu');
50 | event.preventDefault();
51 | }
52 | });
53 | };
54 |
55 | var bindTouchEvents = function() {
56 | var $container = $.deck('getContainer');
57 | var options = $.deck('getOptions');
58 | var touchEndTime = 0;
59 | var currentSlide;
60 |
61 | $container.unbind('touchstart.deckmenu');
62 | $container.bind('touchstart.deckmenu', function() {
63 | currentSlide = $.deck('getSlide');
64 | });
65 | $container.unbind('touchend.deckmenu');
66 | $container.bind('touchend.deckmenu', function(event) {
67 | var now = Date.now();
68 | var isDoubletap = now - touchEndTime < options.touch.doubletapWindow;
69 |
70 | // Ignore this touch event if it caused a nav change (swipe)
71 | if (currentSlide !== $.deck('getSlide')) {
72 | return;
73 | }
74 | if (isDoubletap) {
75 | $.deck('toggleMenu');
76 | event.preventDefault();
77 | }
78 | touchEndTime = now;
79 | });
80 | };
81 |
82 | var setupMenuSlideSelection = function() {
83 | var options = $.deck('getOptions');
84 |
85 | $.each($.deck('getSlides'), function(i, $slide) {
86 | $slide.unbind('click.deckmenu');
87 | $slide.bind('click.deckmenu', function(event) {
88 | if (!$.deck('getContainer').hasClass(options.classes.menu)) {
89 | return;
90 | }
91 | $.deck('go', i);
92 | $.deck('hideMenu');
93 | event.stopPropagation();
94 | event.preventDefault();
95 | });
96 | });
97 | };
98 |
99 | /*
100 | Extends defaults/options.
101 |
102 | options.classes.menu
103 | This class is added to the deck container when showing the slide menu.
104 |
105 | options.keys.menu
106 | The numeric keycode used to toggle between showing and hiding the slide
107 | menu.
108 |
109 | options.touch.doubletapWindow
110 | Two consecutive touch events within this number of milliseconds will
111 | be considered a double tap, and will toggle the menu on touch devices.
112 | */
113 | $.extend(true, $.deck.defaults, {
114 | classes: {
115 | menu: 'deck-menu'
116 | },
117 |
118 | keys: {
119 | menu: 77 // m
120 | },
121 |
122 | touch: {
123 | doubletapWindow: 400
124 | }
125 | });
126 |
127 | /*
128 | jQuery.deck('showMenu')
129 |
130 | Shows the slide menu by adding the class specified by the menu class option
131 | to the deck container.
132 | */
133 | $.deck('extend', 'showMenu', function() {
134 | var $container = $.deck('getContainer');
135 | var options = $.deck('getOptions');
136 |
137 | if ($container.hasClass(options.classes.menu)) {
138 | return;
139 | }
140 |
141 | // Hide through loading class to short-circuit transitions (perf)
142 | $container.addClass([
143 | options.classes.loading,
144 | options.classes.menu
145 | ].join(' '));
146 |
147 | /* Forced to do this in JS until CSS learns second-grade math. Save old
148 | style value for restoration when menu is hidden. */
149 | if (Modernizr.csstransforms) {
150 | $.each(rootSlides, function(i, $slide) {
151 | $slide.data('oldStyle', $slide.attr('style'));
152 | $slide.css({
153 | 'position': 'absolute',
154 | 'left': ((i % 4) * 25) + '%',
155 | 'top': (Math.floor(i / 4) * 25) + '%'
156 | });
157 | });
158 | }
159 |
160 | // Need to ensure the loading class renders first, then remove
161 | window.setTimeout(function() {
162 | $container.removeClass(options.classes.loading);
163 | $container.scrollTop($.deck('getSlide').position().top);
164 | }, 0);
165 | });
166 |
167 | /*
168 | jQuery.deck('hideMenu')
169 |
170 | Hides the slide menu by removing the class specified by the menu class
171 | option from the deck container.
172 | */
173 | $.deck('extend', 'hideMenu', function() {
174 | var $container = $.deck('getContainer');
175 | var options = $.deck('getOptions');
176 |
177 | if (!$container.hasClass(options.classes.menu)) {
178 | return;
179 | }
180 |
181 | $container.removeClass(options.classes.menu);
182 | $container.addClass(options.classes.loading);
183 |
184 | /* Restore old style value */
185 | if (Modernizr.csstransforms) {
186 | $.each(rootSlides, function(i, $slide) {
187 | var oldStyle = $slide.data('oldStyle');
188 | $slide.attr('style', oldStyle ? oldStyle : '');
189 | });
190 | }
191 |
192 | window.setTimeout(function() {
193 | $container.removeClass(options.classes.loading);
194 | $container.scrollTop(0);
195 | }, 0);
196 | });
197 |
198 | /*
199 | jQuery.deck('toggleMenu')
200 |
201 | Toggles between showing and hiding the slide menu.
202 | */
203 | $.deck('extend', 'toggleMenu', function() {
204 | $.deck('getContainer').hasClass($.deck('getOptions').classes.menu) ?
205 | $.deck('hideMenu') : $.deck('showMenu');
206 | });
207 |
208 | $document.bind('deck.init', function() {
209 | populateRootSlidesArray();
210 | bindKeyEvents();
211 | bindTouchEvents();
212 | setupMenuSlideSelection();
213 | });
214 |
215 | $document.bind('deck.change', function(event, from, to) {
216 | var $container = $.deck('getContainer');
217 | var containerScroll, slideTop;
218 |
219 | if ($container.hasClass($.deck('getOptions').classes.menu)) {
220 | containerScroll = $container.scrollTop();
221 | slideTop = $.deck('getSlide', to).position().top;
222 | $container.scrollTop(containerScroll + slideTop);
223 | }
224 | });
225 | })(jQuery);
226 |
--------------------------------------------------------------------------------
/deck.js/extensions/menu/deck.menu.scss:
--------------------------------------------------------------------------------
1 | .deck-menu {
2 | overflow:auto;
3 |
4 | .slide {
5 | background:#eee;
6 | position:relative;
7 | left:0;
8 | top:0;
9 | visibility:visible;
10 | cursor:pointer;
11 | }
12 |
13 | > .slide {
14 | .no-csstransforms & {
15 | float:left;
16 | width:22%;
17 | height:22%;
18 | min-height:0;
19 | margin:1%;
20 | font-size:0.22em;
21 | overflow:hidden;
22 | padding:0 0.5%;
23 | }
24 |
25 | .csstransforms & {
26 | -webkit-transform:scale(.22) !important;
27 | -ms-transform:scale(.22) !important;
28 | transform:scale(.22) !important;
29 | -webkit-transform-origin:0 0;
30 | -ms-transform-origin:0 0;
31 | transform-origin:0 0;
32 | -moz-box-sizing: border-box;
33 | box-sizing: border-box;
34 | width:100%;
35 | height:100%;
36 | overflow:hidden;
37 | padding:0 48px;
38 | margin:12px;
39 | }
40 | }
41 |
42 | iframe, img, video {
43 | max-width:100%;
44 | }
45 |
46 | .deck-current, .no-touch & .slide:hover {
47 | background:#ddf;
48 | }
49 |
50 | &.deck-container:hover {
51 | .deck-prev-link, .deck-next-link {
52 | display:none;
53 | }
54 | }
55 | }
--------------------------------------------------------------------------------
/deck.js/extensions/navigation/deck.navigation.css:
--------------------------------------------------------------------------------
1 | .deck-prev-link, .deck-next-link {
2 | display: none;
3 | position: absolute;
4 | z-index: 3;
5 | top: 50%;
6 | width: 32px;
7 | height: 32px;
8 | margin-top: -16px;
9 | font-size: 20px;
10 | font-weight: bold;
11 | line-height: 32px;
12 | vertical-align: middle;
13 | text-align: center;
14 | text-decoration: none;
15 | color: #fff;
16 | background: #888;
17 | border-radius: 16px;
18 | }
19 | .deck-prev-link:hover, .deck-prev-link:focus, .deck-prev-link:active, .deck-prev-link:visited, .deck-next-link:hover, .deck-next-link:focus, .deck-next-link:active, .deck-next-link:visited {
20 | color: #fff;
21 | }
22 |
23 | .deck-prev-link {
24 | left: 8px;
25 | }
26 |
27 | .deck-next-link {
28 | right: 8px;
29 | }
30 |
31 | .deck-container:hover .deck-prev-link, .deck-container:hover .deck-next-link {
32 | display: block;
33 | }
34 | .deck-container:hover .deck-prev-link.deck-nav-disabled, .touch .deck-container:hover .deck-prev-link, .deck-container:hover .deck-next-link.deck-nav-disabled, .touch .deck-container:hover .deck-next-link {
35 | display: none;
36 | }
37 |
38 | @media print {
39 | .deck-prev-link, .deck-next-link {
40 | display: none !important;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/deck.js/extensions/navigation/deck.navigation.html:
--------------------------------------------------------------------------------
1 |
2 |
6 |
--------------------------------------------------------------------------------
/deck.js/extensions/navigation/deck.navigation.js:
--------------------------------------------------------------------------------
1 | /*!
2 | Deck JS - deck.navigation
3 | Copyright (c) 2011-2014 Caleb Troughton
4 | Dual licensed under the MIT license.
5 | https://github.com/imakewebthings/deck.js/blob/master/MIT-license.txt
6 | */
7 |
8 | /*
9 | This module adds clickable previous and next links to the deck.
10 | */
11 | (function($, undefined) {
12 | var $document = $(document);
13 |
14 | /* Updates link hrefs, and disabled states if last/first slide */
15 | var updateButtons = function(event, from, to) {
16 | var options = $.deck('getOptions');
17 | var lastIndex = $.deck('getSlides').length - 1;
18 | var $prevSlide = $.deck('getSlide', to - 1);
19 | var $nextSlide = $.deck('getSlide', to + 1);
20 | var hrefBase = window.location.href.replace(/#.*/, '');
21 | var prevId = $prevSlide ? $prevSlide.attr('id') : undefined;
22 | var nextId = $nextSlide ? $nextSlide.attr('id') : undefined;
23 | var $prevButton = $(options.selectors.previousLink);
24 | var $nextButton = $(options.selectors.nextLink);
25 |
26 | $prevButton.toggleClass(options.classes.navDisabled, to === 0);
27 | $prevButton.attr('aria-disabled', to === 0);
28 | $prevButton.attr('href', hrefBase + '#' + (prevId ? prevId : ''));
29 | $nextButton.toggleClass(options.classes.navDisabled, to === lastIndex);
30 | $nextButton.attr('aria-disabled', to === lastIndex);
31 | $nextButton.attr('href', hrefBase + '#' + (nextId ? nextId : ''));
32 | };
33 |
34 | /*
35 | Extends defaults/options.
36 |
37 | options.classes.navDisabled
38 | This class is added to a navigation link when that action is disabled.
39 | It is added to the previous link when on the first slide, and to the
40 | next link when on the last slide.
41 |
42 | options.selectors.nextLink
43 | The elements that match this selector will move the deck to the next
44 | slide when clicked.
45 |
46 | options.selectors.previousLink
47 | The elements that match this selector will move to deck to the previous
48 | slide when clicked.
49 | */
50 | $.extend(true, $.deck.defaults, {
51 | classes: {
52 | navDisabled: 'deck-nav-disabled'
53 | },
54 |
55 | selectors: {
56 | nextLink: '.deck-next-link',
57 | previousLink: '.deck-prev-link'
58 | }
59 | });
60 |
61 | $document.bind('deck.init', function() {
62 | var options = $.deck('getOptions');
63 | var slides = $.deck('getSlides');
64 | var $current = $.deck('getSlide');
65 | var $prevButton = $(options.selectors.previousLink);
66 | var $nextButton = $(options.selectors.nextLink);
67 | var index;
68 |
69 | // Setup prev/next link events
70 | $prevButton.unbind('click.decknavigation');
71 | $prevButton.bind('click.decknavigation', function(event) {
72 | $.deck('prev');
73 | event.preventDefault();
74 | });
75 |
76 | $nextButton.unbind('click.decknavigation');
77 | $nextButton.bind('click.decknavigation', function(event) {
78 | $.deck('next');
79 | event.preventDefault();
80 | });
81 |
82 | // Find where we started in the deck and set initial states
83 | $.each(slides, function(i, $slide) {
84 | if ($slide === $current) {
85 | index = i;
86 | return false;
87 | }
88 | });
89 | updateButtons(null, index, index);
90 | });
91 |
92 | $document.bind('deck.change', updateButtons);
93 | })(jQuery);
94 |
95 |
--------------------------------------------------------------------------------
/deck.js/extensions/navigation/deck.navigation.scss:
--------------------------------------------------------------------------------
1 | .deck-prev-link, .deck-next-link {
2 | display:none;
3 | position:absolute;
4 | z-index:3;
5 | top:50%;
6 | width:32px;
7 | height:32px;
8 | margin-top:-16px;
9 | font-size:20px;
10 | font-weight:bold;
11 | line-height:32px;
12 | vertical-align:middle;
13 | text-align:center;
14 | text-decoration:none;
15 | color:#fff;
16 | background:#888;
17 | border-radius:16px;
18 |
19 | &:hover, &:focus, &:active, &:visited {
20 | color:#fff;
21 | }
22 | }
23 |
24 | .deck-prev-link {
25 | left:8px;
26 | }
27 |
28 | .deck-next-link {
29 | right:8px;
30 | }
31 |
32 | .deck-container:hover .deck-prev-link, .deck-container:hover .deck-next-link {
33 | display:block;
34 |
35 | &.deck-nav-disabled, .touch & {
36 | display:none;
37 | }
38 | }
39 |
40 | @media print {
41 | .deck-prev-link, .deck-next-link {
42 | display:none !important;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/deck.js/extensions/scale/deck.scale.css:
--------------------------------------------------------------------------------
1 | .csstransforms .deck-container.deck-scale:not(.deck-menu) {
2 | overflow: hidden;
3 | }
4 | .csstransforms .deck-container.deck-scale:not(.deck-menu) > .slide {
5 | -moz-box-sizing: padding-box;
6 | box-sizing: padding-box;
7 | width: 100%;
8 | padding-bottom: 20px;
9 | }
10 | .csstransforms .deck-container.deck-scale:not(.deck-menu) > .slide > .deck-slide-scaler {
11 | -webkit-transform-origin: 50% 0;
12 | -ms-transform-origin: 50% 0;
13 | transform-origin: 50% 0;
14 | }
15 |
16 | .csstransforms .deck-container.deck-menu .deck-slide-scaler {
17 | -webkit-transform: none !important;
18 | -ms-transform: none !important;
19 | transform: none !important;
20 | }
21 |
--------------------------------------------------------------------------------
/deck.js/extensions/scale/deck.scale.js:
--------------------------------------------------------------------------------
1 | /*!
2 | Deck JS - deck.scale
3 | Copyright (c) 2011-2014 Caleb Troughton
4 | Dual licensed under the MIT license.
5 | https://github.com/imakewebthings/deck.js/blob/master/MIT-license.txt
6 | */
7 |
8 | /*
9 | This module adds automatic scaling to the deck. Slides are scaled down
10 | using CSS transforms to fit within the deck container. If the container is
11 | big enough to hold the slides without scaling, no scaling occurs. The user
12 | can disable and enable scaling with a keyboard shortcut.
13 |
14 | Note: CSS transforms may make Flash videos render incorrectly. Presenters
15 | that need to use video may want to disable scaling to play them. HTML5 video
16 | works fine.
17 | */
18 | (function($, undefined) {
19 | var $document = $(document);
20 | var $window = $(window);
21 | var baseHeight, timer, rootSlides;
22 |
23 | /*
24 | Internal function to do all the dirty work of scaling the slides.
25 | */
26 | var scaleDeck = function() {
27 | var options = $.deck('getOptions');
28 | var $container = $.deck('getContainer');
29 | var baseHeight = options.baseHeight;
30 |
31 | if (!baseHeight) {
32 | baseHeight = $container.height();
33 | }
34 |
35 | // Scale each slide down if necessary (but don't scale up)
36 | $.each(rootSlides, function(i, $slide) {
37 | var slideHeight = $slide.innerHeight();
38 | var $scaler = $slide.find('.' + options.classes.scaleSlideWrapper);
39 | var shouldScale = $container.hasClass(options.classes.scale);
40 | var scale = shouldScale ? baseHeight / slideHeight : 1;
41 |
42 | if (scale === 1) {
43 | $scaler.css('transform', '');
44 | }
45 | else {
46 | $scaler.css('transform', 'scale(' + scale + ')');
47 | window.setTimeout(function() {
48 | $container.scrollTop(0)
49 | }, 1);
50 | }
51 | });
52 | };
53 |
54 | var populateRootSlides = function() {
55 | var options = $.deck('getOptions');
56 | var slideTest = $.map([
57 | options.classes.before,
58 | options.classes.previous,
59 | options.classes.current,
60 | options.classes.next,
61 | options.classes.after
62 | ], function(el, i) {
63 | return '.' + el;
64 | }).join(', ');
65 |
66 | rootSlides = [];
67 | $.each($.deck('getSlides'), function(i, $slide) {
68 | var $parentSlides = $slide.parentsUntil(
69 | options.selectors.container,
70 | slideTest
71 | );
72 | if (!$parentSlides.length) {
73 | rootSlides.push($slide);
74 | }
75 | });
76 | };
77 |
78 | var wrapRootSlideContent = function() {
79 | var options = $.deck('getOptions');
80 | var wrap = '
';
81 | $.each(rootSlides, function(i, $slide) {
82 | $slide.children().wrapAll(wrap);
83 | });
84 | };
85 |
86 | var scaleOnResizeAndLoad = function() {
87 | var options = $.deck('getOptions');
88 |
89 | $window.unbind('resize.deckscale');
90 | $window.bind('resize.deckscale', function() {
91 | window.clearTimeout(timer);
92 | timer = window.setTimeout(scaleDeck, options.scaleDebounce);
93 | });
94 | $.deck('enableScale');
95 | $window.unbind('load.deckscale');
96 | $window.bind('load.deckscale', scaleDeck);
97 | };
98 |
99 | var bindKeyEvents = function() {
100 | var options = $.deck('getOptions');
101 | $document.unbind('keydown.deckscale');
102 | $document.bind('keydown.deckscale', function(event) {
103 | var isKey = event.which === options.keys.scale;
104 | isKey = isKey || $.inArray(event.which, options.keys.scale) > -1;
105 | if (isKey) {
106 | $.deck('toggleScale');
107 | event.preventDefault();
108 | }
109 | });
110 | };
111 |
112 | /*
113 | Extends defaults/options.
114 |
115 | options.classes.scale
116 | This class is added to the deck container when scaling is enabled.
117 | It is enabled by default when the module is included.
118 |
119 | options.classes.scaleSlideWrapper
120 | Scaling is done using a wrapper around the contents of each slide. This
121 | class is applied to that wrapper.
122 |
123 | options.keys.scale
124 | The numeric keycode used to toggle enabling and disabling scaling.
125 |
126 | options.baseHeight
127 | When baseHeight is falsy, as it is by default, the deck is scaled in
128 | proportion to the height of the deck container. You may instead specify
129 | a height as a number of px, and slides will be scaled against this
130 | height regardless of the container size.
131 |
132 | options.scaleDebounce
133 | Scaling on the browser resize event is debounced. This number is the
134 | threshold in milliseconds. You can learn more about debouncing here:
135 | http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
136 |
137 | */
138 | $.extend(true, $.deck.defaults, {
139 | classes: {
140 | scale: 'deck-scale',
141 | scaleSlideWrapper: 'deck-slide-scaler'
142 | },
143 |
144 | keys: {
145 | scale: 83 // s
146 | },
147 |
148 | baseHeight: null,
149 | scaleDebounce: 200
150 | });
151 |
152 | /*
153 | jQuery.deck('disableScale')
154 |
155 | Disables scaling and removes the scale class from the deck container.
156 | */
157 | $.deck('extend', 'disableScale', function() {
158 | $.deck('getContainer').removeClass($.deck('getOptions').classes.scale);
159 | scaleDeck();
160 | });
161 |
162 | /*
163 | jQuery.deck('enableScale')
164 |
165 | Enables scaling and adds the scale class to the deck container.
166 | */
167 | $.deck('extend', 'enableScale', function() {
168 | $.deck('getContainer').addClass($.deck('getOptions').classes.scale);
169 | scaleDeck();
170 | });
171 |
172 | /*
173 | jQuery.deck('toggleScale')
174 |
175 | Toggles between enabling and disabling scaling.
176 | */
177 | $.deck('extend', 'toggleScale', function() {
178 | var $container = $.deck('getContainer');
179 | var isScaled = $container.hasClass($.deck('getOptions').classes.scale);
180 | $.deck(isScaled? 'disableScale' : 'enableScale');
181 | });
182 |
183 | $document.bind('deck.init', function() {
184 | populateRootSlides();
185 | wrapRootSlideContent();
186 | scaleOnResizeAndLoad();
187 | bindKeyEvents();
188 | });
189 | })(jQuery, 'deck', this);
190 |
191 |
--------------------------------------------------------------------------------
/deck.js/extensions/scale/deck.scale.scss:
--------------------------------------------------------------------------------
1 | .csstransforms .deck-container.deck-scale:not(.deck-menu) {
2 | overflow:hidden;
3 |
4 | > .slide {
5 | -moz-box-sizing: padding-box;
6 | box-sizing: padding-box;
7 | width:100%;
8 | padding-bottom:20px;
9 |
10 | > .deck-slide-scaler {
11 | -webkit-transform-origin: 50% 0;
12 | -ms-transform-origin: 50% 0;
13 | transform-origin: 50% 0;
14 | }
15 | }
16 | }
17 |
18 | .csstransforms .deck-container.deck-menu .deck-slide-scaler {
19 | -webkit-transform:none !important;
20 | -ms-transform:none !important;
21 | transform:none !important;
22 | }
--------------------------------------------------------------------------------
/deck.js/extensions/status/deck.status.css:
--------------------------------------------------------------------------------
1 | .deck-status {
2 | position: absolute;
3 | bottom: 10px;
4 | right: 5px;
5 | color: #888;
6 | z-index: 3;
7 | margin: 0;
8 | }
9 |
10 | body > .deck-container .deck-status {
11 | position: fixed;
12 | }
13 |
14 | @media print {
15 | .deck-status {
16 | display: none;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/deck.js/extensions/status/deck.status.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | /
5 |
6 |
7 |
--------------------------------------------------------------------------------
/deck.js/extensions/status/deck.status.js:
--------------------------------------------------------------------------------
1 | /*!
2 | Deck JS - deck.status
3 | Copyright (c) 2011-2014 Caleb Troughton
4 | Dual licensed under the MIT license.
5 | https://github.com/imakewebthings/deck.js/blob/master/MIT-license.txt
6 | */
7 |
8 | /*
9 | This module adds a (current)/(total) style status indicator to the deck.
10 | */
11 | (function($, undefined) {
12 | var $document = $(document);
13 | var rootCounter;
14 |
15 | var updateCurrent = function(event, from, to) {
16 | var options = $.deck('getOptions');
17 | var currentSlideNumber = to + 1;
18 | if (!options.countNested) {
19 | currentSlideNumber = $.deck('getSlide', to).data('rootSlide');
20 | }
21 | $(options.selectors.statusCurrent).text(currentSlideNumber);
22 | };
23 |
24 | var markRootSlides = function() {
25 | var options = $.deck('getOptions');
26 | var slideTest = $.map([
27 | options.classes.before,
28 | options.classes.previous,
29 | options.classes.current,
30 | options.classes.next,
31 | options.classes.after
32 | ], function(el, i) {
33 | return '.' + el;
34 | }).join(', ');
35 |
36 | rootCounter = 0;
37 | $.each($.deck('getSlides'), function(i, $slide) {
38 | var $parentSlides = $slide.parentsUntil(
39 | options.selectors.container,
40 | slideTest
41 | );
42 |
43 | if ($parentSlides.length) {
44 | $slide.data('rootSlide', $parentSlides.last().data('rootSlide'));
45 | }
46 | else {
47 | ++rootCounter;
48 | $slide.data('rootSlide', rootCounter);
49 | }
50 | });
51 | };
52 |
53 | var setInitialSlideNumber = function() {
54 | var slides = $.deck('getSlides');
55 | var $currentSlide = $.deck('getSlide');
56 | var index;
57 |
58 | $.each(slides, function(i, $slide) {
59 | if ($slide === $currentSlide) {
60 | index = i;
61 | return false;
62 | }
63 | });
64 | updateCurrent(null, index, index);
65 | };
66 |
67 | var setTotalSlideNumber = function() {
68 | var options = $.deck('getOptions');
69 | var slides = $.deck('getSlides');
70 |
71 | if (options.countNested) {
72 | $(options.selectors.statusTotal).text(slides.length);
73 | }
74 | else {
75 | $(options.selectors.statusTotal).text(rootCounter);
76 | }
77 | };
78 |
79 | /*
80 | Extends defaults/options.
81 |
82 | options.selectors.statusCurrent
83 | The element matching this selector displays the current slide number.
84 |
85 | options.selectors.statusTotal
86 | The element matching this selector displays the total number of slides.
87 |
88 | options.countNested
89 | If false, only top level slides will be counted in the current and
90 | total numbers.
91 | */
92 | $.extend(true, $.deck.defaults, {
93 | selectors: {
94 | statusCurrent: '.deck-status-current',
95 | statusTotal: '.deck-status-total'
96 | },
97 |
98 | countNested: true
99 | });
100 |
101 | $document.bind('deck.init', function() {
102 | markRootSlides();
103 | setInitialSlideNumber();
104 | setTotalSlideNumber();
105 | });
106 | $document.bind('deck.change', updateCurrent);
107 | })(jQuery, 'deck');
108 |
109 |
--------------------------------------------------------------------------------
/deck.js/extensions/status/deck.status.scss:
--------------------------------------------------------------------------------
1 | .deck-status {
2 | position:absolute;
3 | bottom:10px;
4 | right:5px;
5 | color:#888;
6 | z-index:3;
7 | margin:0;
8 | }
9 |
10 | body > .deck-container .deck-status {
11 | position:fixed;
12 | }
13 |
14 | @media print {
15 | .deck-status {
16 | display:none;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/deck.js/test/fixtures/empty.html:
--------------------------------------------------------------------------------
1 |
22 |
--------------------------------------------------------------------------------
/deck.js/test/fixtures/nesteds.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | /
28 |
29 |
30 |
31 |
36 |
37 |
--------------------------------------------------------------------------------
/deck.js/test/fixtures/standard.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
16 |
17 |
18 |
19 | /
20 |
21 |
22 |
23 |
29 |
30 |
#
31 |
Internal Test Link
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/deck.js/test/index.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 | deck.js - Jasmine Test Runner
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/deck.js/test/lib/jasmine.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif;
3 | }
4 |
5 |
6 | .jasmine_reporter a:visited, .jasmine_reporter a {
7 | color: #303;
8 | }
9 |
10 | .jasmine_reporter a:hover, .jasmine_reporter a:active {
11 | color: blue;
12 | }
13 |
14 | .run_spec {
15 | float:right;
16 | padding-right: 5px;
17 | font-size: .8em;
18 | text-decoration: none;
19 | }
20 |
21 | .jasmine_reporter {
22 | margin: 0 5px;
23 | }
24 |
25 | .banner {
26 | color: #303;
27 | background-color: #fef;
28 | padding: 5px;
29 | }
30 |
31 | .logo {
32 | float: left;
33 | font-size: 1.1em;
34 | padding-left: 5px;
35 | }
36 |
37 | .logo .version {
38 | font-size: .6em;
39 | padding-left: 1em;
40 | }
41 |
42 | .runner.running {
43 | background-color: yellow;
44 | }
45 |
46 |
47 | .options {
48 | text-align: right;
49 | font-size: .8em;
50 | }
51 |
52 |
53 |
54 |
55 | .suite {
56 | border: 1px outset gray;
57 | margin: 5px 0;
58 | padding-left: 1em;
59 | }
60 |
61 | .suite .suite {
62 | margin: 5px;
63 | }
64 |
65 | .suite.passed {
66 | background-color: #dfd;
67 | }
68 |
69 | .suite.failed {
70 | background-color: #fdd;
71 | }
72 |
73 | .spec {
74 | margin: 5px;
75 | padding-left: 1em;
76 | clear: both;
77 | }
78 |
79 | .spec.failed, .spec.passed, .spec.skipped {
80 | padding-bottom: 5px;
81 | border: 1px solid gray;
82 | }
83 |
84 | .spec.failed {
85 | background-color: #fbb;
86 | border-color: red;
87 | }
88 |
89 | .spec.passed {
90 | background-color: #bfb;
91 | border-color: green;
92 | }
93 |
94 | .spec.skipped {
95 | background-color: #bbb;
96 | }
97 |
98 | .messages {
99 | border-left: 1px dashed gray;
100 | padding-left: 1em;
101 | padding-right: 1em;
102 | }
103 |
104 | .passed {
105 | background-color: #cfc;
106 | display: none;
107 | }
108 |
109 | .failed {
110 | background-color: #fbb;
111 | }
112 |
113 | .skipped {
114 | color: #777;
115 | background-color: #eee;
116 | display: none;
117 | }
118 |
119 |
120 | /*.resultMessage {*/
121 | /*white-space: pre;*/
122 | /*}*/
123 |
124 | .resultMessage span.result {
125 | display: block;
126 | line-height: 2em;
127 | color: black;
128 | }
129 |
130 | .resultMessage .mismatch {
131 | color: black;
132 | }
133 |
134 | .stackTrace {
135 | white-space: pre;
136 | font-size: .8em;
137 | margin-left: 10px;
138 | max-height: 5em;
139 | overflow: auto;
140 | border: 1px inset red;
141 | padding: 1em;
142 | background: #eef;
143 | }
144 |
145 | .finished-at {
146 | padding-left: 1em;
147 | font-size: .6em;
148 | }
149 |
150 | .show-passed .passed,
151 | .show-skipped .skipped {
152 | display: block;
153 | }
154 |
155 |
156 | #jasmine_content {
157 | position:fixed;
158 | right: 100%;
159 | }
160 |
161 | .runner {
162 | border: 1px solid gray;
163 | display: block;
164 | margin: 5px 0;
165 | padding: 2px 0 2px 10px;
166 | }
167 |
--------------------------------------------------------------------------------
/deck.js/test/settings.js:
--------------------------------------------------------------------------------
1 | // SETTINGS, VARS, UTILITY FUNCTIONS
2 | jasmine.getFixtures().fixturesPath = 'fixtures';
3 | var defaults = $.deck.defaults;
4 |
--------------------------------------------------------------------------------
/deck.js/test/spec.goto.js:
--------------------------------------------------------------------------------
1 | describe('Deck JS Quick Go-To', function() {
2 | var $d = $(document);
3 |
4 | beforeEach(function() {
5 | loadFixtures('standard.html');
6 | if (Modernizr.history) {
7 | history.replaceState({}, "", "#")
8 | }
9 | else {
10 | window.location.hash = '#';
11 | }
12 | $.deck('.slide');
13 | });
14 |
15 | describe('showGoTo()', function() {
16 | it('should show the go-to helper', function() {
17 | expect($(defaults.selectors.container)).not.toHaveClass(defaults.classes.goto);
18 | $.deck('showGoTo');
19 | expect($(defaults.selectors.container)).toHaveClass(defaults.classes.goto);
20 | });
21 |
22 | it('should focus the go-to input', function() {
23 | $.deck('showGoTo');
24 | expect($(defaults.selectors.gotoInput)[0]).toEqual(document.activeElement);
25 | });
26 |
27 | it('should set aria-hidden to false', function() {
28 | var $gotoForm = $(defaults.selectors.gotoForm);
29 | $.deck('showGoTo');
30 | expect($gotoForm).toHaveAttr('aria-hidden', 'false');
31 | });
32 | });
33 |
34 | describe('hideGoTo()', function() {
35 | beforeEach(function() {
36 | $.deck('showGoTo');
37 | $.deck('hideGoTo');
38 | });
39 |
40 | it('should hide the go-to helper', function() {
41 | expect($(defaults.selectors.container)).not.toHaveClass(defaults.classes.goto);
42 | });
43 |
44 | it('should blur the go-to input', function() {
45 | expect($(defaults.selectors.gotoInput)[0]).not.toEqual(document.activeElement);
46 | });
47 |
48 | it('should set aria-hidden to true', function() {
49 | var $gotoForm = $(defaults.selectors.gotoForm);
50 | $.deck('hideGoTo');
51 | expect($gotoForm).toHaveAttr('aria-hidden', 'true');
52 | });
53 | });
54 |
55 | describe('toggleGoTo()', function() {
56 | it('should toggle the go-to helper on and off', function() {
57 | expect($(defaults.selectors.container)).not.toHaveClass(defaults.classes.goto);
58 | $.deck('toggleGoTo');
59 | expect($(defaults.selectors.container)).toHaveClass(defaults.classes.goto);
60 | $.deck('toggleGoTo');
61 | expect($(defaults.selectors.container)).not.toHaveClass(defaults.classes.goto);
62 | });
63 | });
64 |
65 | describe('Go-To submit', function() {
66 | beforeEach(function() {
67 | $.deck('showGoTo');
68 | });
69 |
70 | it('should hide the go-to helper', function() {
71 | $(defaults.selectors.gotoInput).val('3');
72 | $(defaults.selectors.gotoForm).submit();
73 | expect($(defaults.selectors.container)).not.toHaveClass(defaults.classes.goto);
74 | });
75 |
76 | it('should go to the slide number entered', function() {
77 | $(defaults.selectors.gotoInput).val('3');
78 | $(defaults.selectors.gotoForm).submit();
79 | expect($.deck('getSlide')).toEqual($.deck('getSlide'), 2);
80 | });
81 |
82 | it('should go to the slide id entered', function() {
83 | $(defaults.selectors.gotoInput).val('custom-id');
84 | $(defaults.selectors.gotoForm).submit();
85 | expect($.deck('getSlide')).toEqual($.deck('getSlide'), 1);
86 | });
87 |
88 | it('should go nowhere if the number is negative', function() {
89 | $(defaults.selectors.gotoInput).val('-2');
90 | $(defaults.selectors.gotoForm).submit();
91 | expect($.deck('getSlide')).toEqual($.deck('getSlide'), 0);
92 | });
93 |
94 | it('should go nowhere if the number is greater than the number of slides', function() {
95 | $(defaults.selectors.gotoInput).val('9');
96 | $(defaults.selectors.gotoForm).submit();
97 | expect($.deck('getSlide')).toEqual($.deck('getSlide'), 0);
98 | });
99 |
100 | it('should go nowhere if the id does not exist', function() {
101 | $(defaults.selectors.gotoInput).val('do-not-exist');
102 | $(defaults.selectors.gotoForm).submit();
103 | expect($.deck('getSlide')).toEqual($.deck('getSlide'), 0);
104 | });
105 | });
106 |
107 | describe('Datalist population', function() {
108 | it('should fill in options with all the slide ids', function() {
109 | var $dataOptions = $(defaults.selectors.gotoDatalist).find('option');
110 | expect($dataOptions.length).toEqual(5);
111 | expect($dataOptions.eq(0).attr('value')).toEqual('slide-0');
112 | expect($dataOptions.eq(1).attr('value')).toEqual('custom-id');
113 | });
114 | });
115 |
116 | describe('key bindings', function() {
117 | var e;
118 |
119 | beforeEach(function() {
120 | e = jQuery.Event('keydown.deckgoto');
121 | });
122 |
123 | it('should toggle the go-to helper if the specified key is pressed', function() {
124 | e.which = 71; // g
125 | $d.trigger(e);
126 | expect($(defaults.selectors.container)).toHaveClass(defaults.classes.goto);
127 | $d.trigger(e);
128 | expect($(defaults.selectors.container)).not.toHaveClass(defaults.classes.goto);
129 | });
130 | });
131 |
132 | describe('countNested false', function() {
133 | beforeEach(function() {
134 | loadFixtures('nesteds.html');
135 | $.deck('.slide', {
136 | countNested: false
137 | });
138 | $.deck('showGoTo');
139 | });
140 |
141 | it('should ignore nested slides when given a slide number', function() {
142 | $(defaults.selectors.gotoInput).val('4');
143 | $(defaults.selectors.gotoForm).submit();
144 | expect($.deck('getSlide')).toHaveId('after');
145 | });
146 |
147 | it('should respect top side of new slide range', function() {
148 | $.deck('go', 0);
149 | $(defaults.selectors.gotoInput).val('6');
150 | $(defaults.selectors.gotoForm).submit();
151 | expect($.deck('getSlide')).toHaveId('slide-0');
152 | });
153 | });
154 | });
155 |
--------------------------------------------------------------------------------
/deck.js/test/spec.menu.js:
--------------------------------------------------------------------------------
1 | describe('Deck JS Menu', function() {
2 | var $d = $(document);
3 | var dsc = defaults.selectors.container;
4 |
5 | beforeEach(function() {
6 | loadFixtures('standard.html');
7 | if (Modernizr.history) {
8 | history.replaceState({}, "", "#")
9 | }
10 | else {
11 | window.location.hash = '#';
12 | }
13 | $.deck('.slide');
14 | });
15 |
16 | describe('showMenu()', function() {
17 | it('should show the menu', function() {
18 | expect($(dsc)).not.toHaveClass(defaults.classes.menu);
19 | $.deck('showMenu');
20 | expect($(dsc)).toHaveClass(defaults.classes.menu);
21 | });
22 |
23 | it('should do nothing if menu is already showing', function() {
24 | if (Modernizr.csstransforms) {
25 | $.deck('showMenu');
26 | $.deck('showMenu');
27 | $.deck('hideMenu');
28 | expect($('.slide').attr('style')).toBeFalsy();
29 | }
30 | });
31 | });
32 |
33 | describe('hideMenu()', function() {
34 | it('should hide the menu', function() {
35 | $.deck('showMenu');
36 | $.deck('hideMenu');
37 | expect($(dsc)).not.toHaveClass(defaults.classes.menu);
38 | });
39 | });
40 |
41 | describe('toggleMenu()', function() {
42 | it('should toggle menu on and off', function() {
43 | expect($(dsc)).not.toHaveClass(defaults.classes.menu);
44 | $.deck('toggleMenu');
45 | expect($(dsc)).toHaveClass(defaults.classes.menu);
46 | $.deck('toggleMenu');
47 | expect($(dsc)).not.toHaveClass(defaults.classes.menu);
48 | });
49 | });
50 |
51 | describe('key bindings', function() {
52 | var e;
53 |
54 | beforeEach(function() {
55 | e = jQuery.Event('keydown.deckmenu');
56 | });
57 |
58 | it('should toggle the menu if the specified key is pressed', function() {
59 | e.which = 77; // m
60 | $d.trigger(e);
61 | expect($(dsc)).toHaveClass(defaults.classes.menu);
62 | $d.trigger(e);
63 | expect($(dsc)).not.toHaveClass(defaults.classes.menu);
64 | });
65 | });
66 |
67 | describe('touch bindings', function() {
68 | var estart, eend;
69 |
70 | beforeEach(function() {
71 | estart = jQuery.Event('touchstart.deckmenu');
72 | eend = jQuery.Event('touchend.deckmenu');
73 | });
74 |
75 | it('should toggle the menu if the screen is touched', function() {
76 | $.deck('getOptions').touch.doubletapWindow = Date.now() + 100000;
77 | $.deck('getContainer').trigger(estart);
78 | $.deck('getContainer').trigger(eend);
79 | expect($(dsc)).toHaveClass(defaults.classes.menu);
80 | });
81 | });
82 |
83 | });
84 |
--------------------------------------------------------------------------------
/deck.js/test/spec.navigation.js:
--------------------------------------------------------------------------------
1 | describe('Deck JS Navigation Buttons', function() {
2 | beforeEach(function() {
3 | loadFixtures('standard.html');
4 | if (Modernizr.history) {
5 | history.replaceState({}, "", "#")
6 | }
7 | else {
8 | window.location.hash = '#';
9 | }
10 | $.deck('.slide');
11 | });
12 |
13 | it('should go to the next slide if next link is clicked', function() {
14 | $(defaults.selectors.nextLink).click();
15 | expect($.deck('getSlide')).toHaveClass('slide2');
16 | });
17 |
18 | it('should go to the previous slide if previous link is clicked', function() {
19 | $.deck('go', 2);
20 | $(defaults.selectors.previousLink).click();
21 | expect($.deck('getSlide')).toHaveClass('slide2');
22 | });
23 |
24 | it('should add the disabled class to the previous link if on first slide', function() {
25 | expect($(defaults.selectors.previousLink)).toHaveClass(defaults.classes.navDisabled);
26 | $(defaults.selectors.nextLink).click();
27 | expect($(defaults.selectors.previousLink)).not.toHaveClass(defaults.classes.navDisabled);
28 | $(defaults.selectors.previousLink).click();
29 | expect($(defaults.selectors.previousLink)).toHaveClass(defaults.classes.navDisabled);
30 | });
31 |
32 | it('should add aria-disabled to previous link if on first slide', function() {
33 | $.deck('go', 0);
34 | expect($(defaults.selectors.previousLink)).toHaveAttr('aria-disabled', 'true');
35 | });
36 |
37 | it('should add the disabled class to the next link if on last slide', function() {
38 | expect($(defaults.selectors.nextLink)).not.toHaveClass(defaults.classes.navDisabled);
39 | $.deck('go', $.deck('getSlides').length - 1);
40 | expect($(defaults.selectors.nextLink)).toHaveClass(defaults.classes.navDisabled);
41 | });
42 |
43 | it('should add aria-disabled to next link if on last slide', function() {
44 | $.deck('go', $.deck('getSlides').length - 1);
45 | expect($(defaults.selectors.nextLink)).toHaveAttr('aria-disabled', 'true');
46 | });
47 |
48 | it('should not start disabled if deck initialized in the middle', function() {
49 | $.deck('go', 2);
50 | $.deck('.slide');
51 | waitsFor(function() {
52 | return !$(defaults.selectors.previousLink).hasClass(defaults.classes.navDisabled);
53 | });
54 | });
55 |
56 | it('should update the links hrefs with real fragment ids', function() {
57 | expect($(defaults.selectors.previousLink).attr('href')).toMatch(/#$/);
58 | expect($(defaults.selectors.nextLink).attr('href')).toMatch('#custom-id');
59 | $.deck('go', 2);
60 | expect($(defaults.selectors.previousLink).attr('href')).toMatch('#custom-id');
61 | expect($(defaults.selectors.nextLink).attr('href')).toMatch('#slide-3');
62 | });
63 | });
64 |
--------------------------------------------------------------------------------
/deck.js/test/spec.scale.js:
--------------------------------------------------------------------------------
1 | describe('Deck JS Status Indicator', function() {
2 | beforeEach(function() {
3 | loadFixtures('standard.html');
4 | if (Modernizr.history) {
5 | history.replaceState({}, "", "#")
6 | }
7 | else {
8 | window.location.hash = '#';
9 | }
10 | $.deck('.slide');
11 | });
12 |
13 | it('should start with scaling enabled', function() {
14 | expect($.deck('getContainer')).toHaveClass(defaults.classes.scale);
15 | });
16 |
17 | describe('disableScale()', function() {
18 | it('should remove the scale class from the container', function() {
19 | $.deck('disableScale');
20 | expect($.deck('getContainer')).not.toHaveClass(defaults.classes.scale);
21 | });
22 | });
23 |
24 | describe('enableScale()', function() {
25 | it('should add the scale class to the container', function() {
26 | $.deck('disableScale');
27 | $.deck('enableScale');
28 | expect($.deck('getContainer')).toHaveClass(defaults.classes.scale);
29 | });
30 | });
31 |
32 | describe('toggleScale()', function() {
33 | it('should toggle between adding and removing the scale class', function() {
34 | $.deck('toggleScale');
35 | expect($.deck('getContainer')).not.toHaveClass(defaults.classes.scale);
36 | $.deck('toggleScale');
37 | expect($.deck('getContainer')).toHaveClass(defaults.classes.scale);
38 | });
39 | });
40 |
41 | describe('key bindings', function() {
42 | var e;
43 | var $d = $(document);
44 |
45 | beforeEach(function() {
46 | e = jQuery.Event('keydown.deckscale');
47 | });
48 |
49 | it('should toggle scaling if the specified key is pressed', function() {
50 | e.which = 83; // s
51 | $d.trigger(e);
52 | expect($.deck('getContainer')).not.toHaveClass(defaults.classes.scale);
53 | $d.trigger(e);
54 | expect($.deck('getContainer')).toHaveClass(defaults.classes.scale);
55 | });
56 | });
57 | });
--------------------------------------------------------------------------------
/deck.js/test/spec.status.js:
--------------------------------------------------------------------------------
1 | describe('Deck JS Status Indicator', function() {
2 | beforeEach(function() {
3 | loadFixtures('standard.html');
4 | if (Modernizr.history) {
5 | history.replaceState({}, "", "#")
6 | }
7 | else {
8 | window.location.hash = '#';
9 | }
10 | $.deck('.slide');
11 | });
12 |
13 | it('should show the correct total number of slides', function() {
14 | expect($(defaults.selectors.statusTotal)).toHaveText($.deck('getSlides').length);
15 | });
16 |
17 | it('should start at the right current slide', function() {
18 | expect($(defaults.selectors.statusCurrent)).toHaveText(1);
19 | $.deck('go', 2);
20 | $.deck('.slide');
21 | waitsFor(function() {
22 | return $(defaults.selectors.statusCurrent).text() === '3';
23 | });
24 | });
25 |
26 | it('should update to the correct number on slide change', function() {
27 | $.deck('go', 2);
28 | expect($(defaults.selectors.statusCurrent)).toHaveText('3');
29 | });
30 | });
31 |
32 | describe('countNested false indicator', function() {
33 | beforeEach(function() {
34 | loadFixtures('nesteds.html');
35 | if (Modernizr.history) {
36 | history.replaceState({}, "", "#")
37 | }
38 | else {
39 | window.location.hash = '#';
40 | }
41 | $.deck('.slide', {
42 | countNested: false
43 | });
44 | });
45 |
46 | it('should ignore nested slides in the total', function() {
47 | expect($(defaults.selectors.statusTotal)).toHaveText('5');
48 | });
49 |
50 | it('should update to the root slide number when nested becomes active', function() {
51 | $.deck('go', 10);
52 | expect($(defaults.selectors.statusCurrent)).toHaveText('4');
53 | $.deck('prev');
54 | expect($(defaults.selectors.statusCurrent)).toHaveText('3');
55 | $.deck('go', 3);
56 | expect($(defaults.selectors.statusCurrent)).toHaveText('3');
57 | $.deck('go', 1);
58 | expect($(defaults.selectors.statusCurrent)).toHaveText('2');
59 | });
60 | });
--------------------------------------------------------------------------------
/deck.js/themes/style/_reset.scss:
--------------------------------------------------------------------------------
1 | /* Resets and base styles from HTML5 Boilerplate */
2 | div, span, object, iframe,
3 | h1, h2, h3, h4, h5, h6, p, blockquote, pre,
4 | abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp,
5 | small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li,
6 | fieldset, form, label, legend,
7 | table, caption, tbody, tfoot, thead, tr, th, td,
8 | article, aside, canvas, details, figcaption, figure,
9 | footer, header, hgroup, menu, nav, section, summary,
10 | time, mark, audio, video {
11 | margin: 0;
12 | padding: 0;
13 | border: 0;
14 | font-size: 100%;
15 | font: inherit;
16 | vertical-align: baseline;
17 | }
18 |
19 | article, aside, details, figcaption, figure,
20 | footer, header, hgroup, menu, nav, section {
21 | display: block;
22 | }
23 |
24 | blockquote, q {
25 | quotes:none;
26 |
27 | &:before, &:after {
28 | content:"";
29 | content:none;
30 | }
31 | }
32 |
33 | ins {
34 | background-color:#ff9;
35 | color:#000;
36 | text-decoration:none;
37 | }
38 |
39 | mark {
40 | background-color:#ff9;
41 | color:#000;
42 | font-style:italic;
43 | font-weight:bold;
44 | }
45 |
46 | del {
47 | text-decoration:line-through;
48 | }
49 |
50 | abbr[title], dfn[title] {
51 | border-bottom:1px dotted;
52 | cursor:help;
53 | }
54 |
55 | table {
56 | border-collapse:collapse;
57 | border-spacing:0;
58 | }
59 |
60 | hr {
61 | display:block;
62 | height:1px;
63 | border:0;
64 | border-top:1px solid #ccc;
65 | margin:1em 0;
66 | padding:0;
67 | }
68 |
69 | input, select {
70 | vertical-align:middle;
71 | }
72 |
73 | select, input, textarea, button {
74 | font:99% sans-serif;
75 | }
76 |
77 | pre, code, kbd, samp {
78 | font-family:monospace, sans-serif;
79 | }
80 |
81 | a {
82 | -webkit-tap-highlight-color:rgba(0,0,0,0);
83 |
84 | &:hover, &:active {
85 | outline:none;
86 | }
87 | }
88 |
89 | ul, ol {
90 | margin-left:2em;
91 | vertical-align:top;
92 | }
93 |
94 | ol {
95 | list-style-type:decimal;
96 | }
97 |
98 | nav {
99 | ul, li {
100 | margin:0;
101 | list-style:none;
102 | list-style-image:none;
103 | }
104 | }
105 |
106 | small {
107 | font-size:85%;
108 | }
109 |
110 | strong, th {
111 | font-weight:bold;
112 | }
113 |
114 | td {
115 | vertical-align:top;
116 | }
117 |
118 | sub, sup {
119 | font-size:75%;
120 | line-height:0;
121 | position:relative;
122 | }
123 |
124 | sup {
125 | top:-0.5em;
126 | }
127 |
128 | sub { bottom: -0.25em; }
129 |
130 | textarea {
131 | overflow:auto;
132 | }
133 |
134 | input[type="radio"] {
135 | vertical-align:text-bottom;
136 | }
137 |
138 | input[type="checkbox"] {
139 | vertical-align:bottom;
140 | }
141 |
142 | label,
143 | input[type="button"],
144 | input[type="submit"],
145 | input[type="image"],
146 | button {
147 | cursor:pointer;
148 | }
149 |
150 | button, input, select, textarea {
151 | margin: 0;
152 | }
153 |
154 | input, textarea {
155 | &:invalid {
156 | border-radius:1px;
157 | -moz-box-shadow:0px 0px 5px red;
158 | -webkit-box-shadow:0px 0px 5px red;
159 | box-shadow: 0px 0px 5px red;
160 |
161 | .no-boxshadow {
162 | background-color: #f0dddd;
163 | }
164 | }
165 | }
166 |
167 | button {
168 | width:auto;
169 | overflow:visible;
170 | }
171 |
172 | select, input, textarea {
173 | color: #444 ;
174 | }
175 |
176 | a {
177 | color:#607890;
178 |
179 | &:hover, &:focus {
180 | color:#036;
181 | }
182 |
183 | &:link {
184 | -webkit-tap-highlight-color: #fff;
185 | }
186 | }
187 | /* End HTML5 Boilerplate adaptations */
188 |
189 | h1 {
190 | font-size:4.5em;
191 | }
192 |
193 | h1, .vcenter {
194 | font-weight:bold;
195 | text-align:center;
196 | padding-top:1em;
197 | max-height:100%;
198 |
199 | .csstransforms & {
200 | padding:0 48px;
201 | position:absolute;
202 | left:0;
203 | right:0;
204 | top:50%;
205 | -webkit-transform:translate(0, -50%);
206 | -moz-transform:translate(0, -50%);
207 | -ms-transform:translate(0, -50%);
208 | -o-transform:translate(0, -50%);
209 | transform:translate(0, -50%);
210 | }
211 | }
212 |
213 | .vcenter h1 {
214 | position:relative;
215 | top:auto;
216 | padding:0;
217 | -webkit-transform:none;
218 | -moz-transform:none;
219 | -ms-transform:none;
220 | -o-transform:none;
221 | transform:none;
222 | }
223 |
224 | h2 {
225 | font-size:2.25em;
226 | font-weight:bold;
227 | padding-top:.5em;
228 | margin:0 0 .66666em 0;
229 | border-bottom:3px solid #888;
230 | }
231 |
232 | h3 {
233 | font-size:1.4375em;
234 | font-weight:bold;
235 | margin-bottom:.30435em;
236 | }
237 |
238 | h4 {
239 | font-size:1.25em;
240 | font-weight:bold;
241 | margin-bottom:.25em;
242 | }
243 |
244 | h5 {
245 | font-size:1.125em;
246 | font-weight:bold;
247 | margin-bottom:.2222em;
248 | }
249 |
250 | h6 {
251 | font-size:1em;
252 | font-weight:bold;
253 | }
254 |
255 | img, iframe, video {
256 | display:block;
257 | max-width:100%;
258 | }
259 |
260 | video, iframe, img {
261 | display:block;
262 | margin:0 auto;
263 | }
264 |
265 | p, blockquote, iframe, img, ul, ol, pre, video {
266 | margin-bottom:1em;
267 | }
268 |
269 | pre {
270 | white-space:pre;
271 | white-space:pre-wrap;
272 | word-wrap:break-word;
273 | padding: 1em;
274 | border:1px solid #888;
275 | }
276 |
277 | em {
278 | font-style:italic;
279 | }
280 |
281 | li {
282 | padding:.25em 0;
283 | vertical-align:middle;
284 |
285 | > ol, > ul {
286 | margin-bottom:inherit;
287 | }
288 | }
289 |
290 | .deck-container {
291 | font-size:16px;
292 | line-height:1.25;
293 | color:#444;
294 | }
295 |
296 | .slide {
297 | -moz-box-sizing: border-box;
298 | box-sizing: border-box;
299 | width:100%;
300 | }
--------------------------------------------------------------------------------
/deck.js/themes/style/neon.scss:
--------------------------------------------------------------------------------
1 | @import "reset";
2 |
3 | h1 {
4 | color:#0af;
5 | font-weight:normal;
6 | font-weight:100;
7 | text-shadow:0 0 50px #0af, 0 0 3px #fff;
8 | }
9 |
10 | h2 {
11 | color:#af0;
12 | border-bottom-color:#ccc;
13 | font-weight:normal;
14 | font-weight:100;
15 | text-shadow:0 0 15px #af0, 0 0 2px #fff;
16 | border-bottom:1px solid #333;
17 | }
18 |
19 | h3 {
20 | color:#fff;
21 | font-weight:normal;
22 | font-weight:100;
23 | text-shadow:0 0 10px #fff, 0 0 2px #fff;
24 | }
25 |
26 | pre {
27 | border-color:#333;
28 |
29 | code {
30 | color:#fff;
31 | }
32 | }
33 |
34 | code {
35 | color:#f0a;
36 | }
37 |
38 | blockquote {
39 | font-size:2em;
40 | padding:1em 2em;
41 | color:#fff;
42 | border-left:5px solid #fff;
43 |
44 | p {
45 | margin:0;
46 | }
47 |
48 | cite {
49 | font-size:.5em;
50 | font-style:normal;
51 | font-weight:normal;
52 | font-weight:100;
53 | color:#aaa;
54 | text-shadow:0 0 15px #fff, 0 0 2px #fff;
55 | }
56 | }
57 |
58 | ::-moz-selection{ background:#a0f; }
59 | ::selection { background:#a0f; }
60 |
61 | a {
62 | &, &:hover, &:focus, &:active, &:visited {
63 | color:#f0a;
64 | text-decoration:none;
65 | }
66 |
67 | &:hover, &:focus {
68 | text-decoration:underline;
69 | }
70 | }
71 |
72 | .deck-container {
73 | font-family: "Gill Sans", "Gill Sans MT", Calibri, sans-serif;
74 | font-size:1.75em;
75 | color:#aaa;
76 | background:#000;
77 |
78 | > .slide {
79 | padding:0 48px;
80 | }
81 | }
82 |
83 | .slide {
84 | .deck-before, .deck-previous {
85 | opacity:0.4;
86 |
87 | &:not(.deck-child-current) {
88 | .deck-before, .deck-previous {
89 | opacity:1;
90 | }
91 | }
92 | }
93 |
94 | .deck-child-current {
95 | opacity:1;
96 | }
97 | }
98 |
99 | .deck-prev-link, .deck-next-link {
100 | background:#f0a;
101 | text-shadow:0 0 3px #fff;
102 |
103 | &, &:hover, &:focus, &:active, &:visited {
104 | color:#fff;
105 | }
106 |
107 | &:hover, &:focus {
108 | text-decoration:none;
109 | box-shadow:0 0 20px #f0a, 0 0 5px #fff;
110 | }
111 | }
112 |
113 | .deck-status {
114 | font-size:0.6666em;
115 | }
116 |
117 | .goto-form {
118 | background:#000;
119 | border:1px solid #f0a;
120 |
121 | label {
122 | color:#fff;
123 | }
124 | }
125 |
126 | .deck-menu {
127 | .slide {
128 | background:#333;
129 | }
130 |
131 | .deck-current {
132 | background:#444;
133 |
134 | .boxshadow & {
135 | background:#000;
136 | box-shadow:0 0 20px #f0a, 0 0 5px #fff;
137 | }
138 | }
139 |
140 | .no-touch & .slide:hover {
141 | background:#444;
142 | }
143 |
144 | .no-touch.boxshadow & .slide:hover {
145 | background:#000;
146 | box-shadow:0 0 20px #f0a, 0 0 5px #fff;
147 | }
148 | }
--------------------------------------------------------------------------------
/deck.js/themes/style/swiss.scss:
--------------------------------------------------------------------------------
1 | @import "reset";
2 |
3 | h1 {
4 | color:#000;
5 | }
6 |
7 | h2 {
8 | color:#c00;
9 | border-bottom-color:#ccc;
10 | }
11 |
12 | h3 {
13 | color:#888;
14 | }
15 |
16 | pre {
17 | border-color:#ccc;
18 | }
19 |
20 | code {
21 | color:#888;
22 | }
23 |
24 | blockquote {
25 | font-size:2em;
26 | font-style:italic;
27 | padding:1em 2em;
28 | color:#000;
29 | border-left:5px solid #ccc;
30 |
31 | p {
32 | margin:0;
33 | }
34 |
35 | cite {
36 | font-size:.5em;
37 | font-style:normal;
38 | font-weight:bold;
39 | color:#888;
40 | }
41 | }
42 |
43 | ::-moz-selection{ background:#c00; color:#fff; }
44 | ::selection { background:#c00; color:#fff; }
45 |
46 | a {
47 | &, &:hover, &:focus, &:active, &:visited {
48 | color:#c00;
49 | text-decoration:none;
50 | }
51 |
52 | &:hover, &:focus {
53 | text-decoration:underline;
54 | }
55 | }
56 |
57 | .deck-container {
58 | font-family: "Helvetica Neue", sans-serif;
59 | font-size:1.75em;
60 | background:#fff;
61 |
62 | > .slide {
63 | padding:0 48px;
64 | }
65 | }
66 |
67 | .slide {
68 | .deck-before, .deck-previous {
69 | opacity:0.4;
70 |
71 | &:not(.deck-child-current) {
72 | .deck-before, .deck-previous {
73 | opacity:1;
74 | }
75 | }
76 | }
77 |
78 | .deck-child-current {
79 | opacity:1;
80 | }
81 | }
82 |
83 | .deck-prev-link, .deck-next-link {
84 | background:#ccc;
85 | font-family:serif;
86 |
87 | &, &:hover, &:focus, &:active, &:visited {
88 | color:#fff;
89 | }
90 |
91 | &:hover, &:focus {
92 | background:#c00;
93 | text-decoration:none;
94 | }
95 | }
96 |
97 | .deck-status {
98 | font-size:0.6666em;
99 | }
100 |
101 | .deck-menu {
102 | .slide {
103 | background:#eee;
104 | }
105 |
106 | .deck-current, .no-touch & .slide:hover {
107 | background:#ddf;
108 | }
109 | }
110 |
--------------------------------------------------------------------------------
/deck.js/themes/style/web-2.0.scss:
--------------------------------------------------------------------------------
1 | @mixin rotate($deg) {
2 | -webkit-transform:rotate($deg);
3 | -ms-transform:rotate($deg);
4 | transform:rotate($deg);
5 | }
6 |
7 | @import "reset";
8 |
9 | h1, h2, h3, h4, h5, h6 {
10 | font-family: "Hoefler Text", Constantia, Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
11 | }
12 |
13 | h1 {
14 | color:#08455f;
15 | }
16 |
17 | h2 {
18 | color:#0b7495;
19 | border-bottom:0;
20 |
21 | .cssreflections & {
22 | line-height:1;
23 | -webkit-box-reflect:below -0.5555em -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(0.3, transparent), color-stop(0.7, rgba(255,255,255,.1)), to(transparent));
24 | -moz-box-reflect:below -0.5555em -moz-linear-gradient(top, transparent 0%, transparent 30%, rgba(255,255,255,.3) 100%);
25 | }
26 | }
27 |
28 | h3 {
29 | color:#000;
30 | }
31 |
32 | pre {
33 | border-color:#cde;
34 | background:#fff;
35 | position:relative;
36 | z-index:auto;
37 | border-radius:5px;
38 |
39 | /* http://nicolasgallagher.com/css-drop-shadows-without-images/ */
40 | .csstransforms.boxshadow & {
41 | > :first-child:before {
42 | content:"";
43 | position:absolute;
44 | z-index:-1;
45 | background:#fff;
46 | top:0;
47 | bottom:0;
48 | left:0;
49 | right:0;
50 | }
51 |
52 | &:before, &:after {
53 | content:"";
54 | position:absolute;
55 | z-index:-2;
56 | bottom:15px;
57 | width:50%;
58 | height:20%;
59 | max-width:300px;
60 | box-shadow:0 15px 10px rgba(0, 0, 0, 0.7);
61 | }
62 |
63 | &:before {
64 | left:10px;
65 | @include rotate(-3deg);
66 | }
67 |
68 | &:after {
69 | right:10px;
70 | @include rotate(3deg);
71 | }
72 | }
73 | }
74 |
75 | code {
76 | color:#789;
77 | }
78 |
79 | blockquote {
80 | font-family: "Hoefler Text", Constantia, Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
81 | font-size:2em;
82 | padding:1em 2em .5em 2em;
83 | color:#000;
84 | background:#fff;
85 | position:relative;
86 | border:1px solid #cde;
87 | z-index:auto;
88 | border-radius:5px;
89 |
90 | .boxshadow & {
91 | > :first-child:before {
92 | content:"";
93 | position:absolute;
94 | z-index:-1;
95 | background:#fff;
96 | top:0;
97 | bottom:0;
98 | left:0;
99 | right:0;
100 | }
101 |
102 | &:after {
103 | content:"";
104 | position:absolute;
105 | z-index:-2;
106 | top: 10px;
107 | bottom: 10px;
108 | left: 0;
109 | right: 50%;
110 | -moz-border-radius: 10px / 100px;
111 | border-radius: 10px / 100px;
112 | box-shadow:0 0 15px rgba(0,0,0,0.6);
113 | }
114 | }
115 |
116 | p {
117 | margin:0;
118 | }
119 |
120 | cite {
121 | font-size:.5em;
122 | font-style:normal;
123 | font-weight:bold;
124 | color:#888;
125 | }
126 |
127 | &:before {
128 | content:"“";
129 | position:absolute;
130 | top:0;
131 | left:0;
132 | font-size:5em;
133 | line-height:1;
134 | color:#ccf0f0;
135 | z-index:1;
136 | }
137 | }
138 |
139 | ::-moz-selection{ background:#08455f; color:#fff; }
140 | ::selection { background:#08455f; color:#fff; }
141 |
142 | a {
143 | &, &:hover, &:focus, &:active, &:visited {
144 | color:#599;
145 | text-decoration:none;
146 | }
147 |
148 | &:hover, &:focus {
149 | text-decoration:underline;
150 | }
151 | }
152 |
153 | .deck-container {
154 | font-family: "Gill Sans", "Gill Sans MT", Calibri, sans-serif;
155 | font-size:1.75em;
156 | background: rgb(244,250,254); /* Old browsers */
157 | background: -moz-linear-gradient(top, rgba(244,250,254,1) 0%, rgba(204,240,240,1) 100%); /* FF3.6+ */
158 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(244,250,254,1)), color-stop(100%,rgba(204,240,240,1))); /* Chrome,Safari4+ */
159 | background: -webkit-linear-gradient(top, rgba(244,250,254,1) 0%,rgba(204,240,240,1) 100%); /* Chrome10+,Safari5.1+ */
160 | background: -o-linear-gradient(top, rgba(244,250,254,1) 0%,rgba(204,240,240,1) 100%); /* Opera11.10+ */
161 | background: -ms-linear-gradient(top, rgba(244,250,254,1) 0%,rgba(204,240,240,1) 100%); /* IE10+ */
162 | background: linear-gradient(top, rgba(244,250,254,1) 0%,rgba(204,240,240,1) 100%); /* W3C */
163 | background-attachment: fixed;
164 | text-shadow:1px 1px 1px rgba(255,255,255,.5);
165 |
166 | > .slide {
167 | padding:0 48px;
168 | }
169 | }
170 |
171 | .slide {
172 | .deck-before, .deck-previous {
173 | opacity:0.4;
174 |
175 | &:not(.deck-child-current) {
176 | .deck-before, .deck-previous {
177 | opacity:1;
178 | }
179 | }
180 | }
181 |
182 | .deck-child-current {
183 | opacity:1;
184 | }
185 | }
186 |
187 | .deck-prev-link, .deck-next-link {
188 | background:#fff;
189 | opacity:0.5;
190 |
191 | &, &:hover, &:focus, &:active, &:visited {
192 | color:#599;
193 | }
194 |
195 | &:hover, &:focus {
196 | opacity:1;
197 | text-decoration:none;
198 | }
199 | }
200 |
201 | .deck-status {
202 | font-size:0.6666em;
203 | }
204 |
205 | .deck-menu {
206 | .slide {
207 | background:transparent;
208 | border-radius:5px;
209 |
210 | .rgba & {
211 | background:rgba(0,0,0,.1);
212 | }
213 |
214 | &.deck-current, .rgba &.deck-current, .no-touch &:hover {
215 | background:#fff;
216 | }
217 | }
218 | }
219 |
220 | .goto-form {
221 | background:#fff;
222 | border:1px solid #cde;
223 | border-radius:5px;
224 |
225 | .boxshadow & {
226 | box-shadow: 0 15px 10px -10px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
227 | }
228 | }
--------------------------------------------------------------------------------
/deck.js/themes/transition/fade.css:
--------------------------------------------------------------------------------
1 | .csstransitions.csstransforms .deck-container .slide {
2 | -webkit-transition: opacity 500ms ease-in-out 0ms;
3 | transition: opacity 500ms ease-in-out 0ms;
4 | }
5 | .csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide {
6 | position: absolute;
7 | top: 0;
8 | left: 0;
9 | }
10 | .csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .slide {
11 | position: relative;
12 | left: 0;
13 | top: 0;
14 | }
15 | .csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .deck-next, .csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .deck-after {
16 | opacity: 0;
17 | }
18 | .csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .deck-current {
19 | opacity: 1;
20 | }
21 | .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-previous, .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-before, .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-next, .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-after {
22 | opacity: 0;
23 | pointer-events: none;
24 | }
25 | .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-before .slide, .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-previous .slide {
26 | visibility: visible;
27 | }
28 | .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-child-current {
29 | opacity: 1;
30 | visibility: visible;
31 | pointer-events: auto;
32 | }
33 | .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-child-current .deck-next, .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-child-current .deck-after {
34 | visibility: hidden;
35 | }
36 |
--------------------------------------------------------------------------------
/deck.js/themes/transition/fade.scss:
--------------------------------------------------------------------------------
1 | @mixin translate($x: 0, $y: 0, $z: 0) {
2 | -webkit-transform:translate3d($x, $y, $z);
3 | -ms-transform:translate($x, $y);
4 | transform:translate3d($x, $y, $z);
5 | }
6 |
7 | @mixin transition($prop, $duration, $easing: ease-in-out, $delay: 0ms) {
8 | -webkit-transition:$prop $duration $easing $delay;
9 | transition:$prop $duration $easing $delay;
10 | }
11 |
12 | .csstransitions.csstransforms {
13 | .deck-container .slide {
14 | @include transition(opacity, 500ms);
15 | }
16 |
17 | .deck-container:not(.deck-menu) {
18 | > .slide {
19 | position:absolute;
20 | top:0;
21 | left:0;
22 |
23 | .slide {
24 | position:relative;
25 | left:0;
26 | top:0;
27 | }
28 |
29 | .deck-next, .deck-after {
30 | opacity:0;
31 | }
32 |
33 | .deck-current {
34 | opacity:1;
35 | }
36 | }
37 |
38 | > .deck-previous, > .deck-before, > .deck-next, > .deck-after {
39 | opacity:0;
40 | pointer-events:none;
41 | }
42 |
43 | > .deck-before, > .deck-previous {
44 | .slide {
45 | visibility:visible;
46 | }
47 | }
48 |
49 | > .deck-child-current {
50 | opacity:1;
51 | visibility:visible;
52 | pointer-events:auto;
53 |
54 | .deck-next, .deck-after {
55 | visibility:hidden;
56 | }
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/deck.js/themes/transition/horizontal-slide.css:
--------------------------------------------------------------------------------
1 | .csstransitions.csstransforms {
2 | overflow-x: hidden;
3 | }
4 | .csstransitions.csstransforms .deck-container > .slide {
5 | -webkit-transition: -webkit-transform 500ms ease-in-out;
6 | transition: transform 500ms ease-in-out;
7 | }
8 | .csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide {
9 | position: absolute;
10 | top: 0;
11 | left: 0;
12 | }
13 | .csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .slide {
14 | position: relative;
15 | left: 0;
16 | top: 0;
17 | -webkit-transition: -webkit-transform 500ms ease-in-out, opacity 500ms ease-in-out;
18 | transition: transform 500ms ease-in-out, opacity 500ms ease-in-out;
19 | }
20 | .csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .deck-next, .csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .deck-after {
21 | visibility: visible;
22 | -webkit-transform: translate3d(200%, 0, 0);
23 | -ms-transform: translate(200%, 0);
24 | transform: translate3d(200%, 0, 0);
25 | }
26 | .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-previous {
27 | -webkit-transform: translate3d(-200%, 0, 0);
28 | -ms-transform: translate(-200%, 0);
29 | transform: translate3d(-200%, 0, 0);
30 | }
31 | .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-before {
32 | -webkit-transform: translate3d(-400%, 0, 0);
33 | -ms-transform: translate(-400%, 0);
34 | transform: translate3d(-400%, 0, 0);
35 | }
36 | .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-next {
37 | -webkit-transform: translate3d(200%, 0, 0);
38 | -ms-transform: translate(200%, 0);
39 | transform: translate3d(200%, 0, 0);
40 | }
41 | .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-after {
42 | -webkit-transform: translate3d(400%, 0, 0);
43 | -ms-transform: translate(400%, 0);
44 | transform: translate3d(400%, 0, 0);
45 | }
46 | .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-before .slide, .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-previous .slide {
47 | visibility: visible;
48 | }
49 | .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-child-current {
50 | -webkit-transform: none;
51 | -ms-transform: none;
52 | transform: none;
53 | }
54 |
--------------------------------------------------------------------------------
/deck.js/themes/transition/horizontal-slide.scss:
--------------------------------------------------------------------------------
1 | @mixin translate($x: 0, $y: 0, $z: 0) {
2 | -webkit-transform:translate3d($x, $y, $z);
3 | -ms-transform:translate($x, $y);
4 | transform:translate3d($x, $y, $z);
5 | }
6 |
7 | @mixin transition($prop, $duration, $easing: ease-in-out, $delay: 0ms) {
8 | -webkit-transition:$prop $duration $easing $delay;
9 | transition:$prop $duration $easing $delay;
10 | }
11 |
12 | @mixin transform($val) {
13 | -webkit-transform:$val;
14 | -ms-transform:$val;
15 | transform:$val;
16 | }
17 |
18 | .csstransitions.csstransforms {
19 | overflow-x:hidden;
20 |
21 | .deck-container > .slide {
22 | -webkit-transition:-webkit-transform 500ms ease-in-out;
23 | transition:transform 500ms ease-in-out;
24 | }
25 |
26 | .deck-container:not(.deck-menu) {
27 | > .slide {
28 | position:absolute;
29 | top:0;
30 | left:0;
31 |
32 | .slide {
33 | position:relative;
34 | left:0;
35 | top:0;
36 | -webkit-transition:-webkit-transform 500ms ease-in-out, opacity 500ms ease-in-out;
37 | transition:transform 500ms ease-in-out, opacity 500ms ease-in-out;
38 | }
39 |
40 | .deck-next, .deck-after {
41 | visibility:visible;
42 | @include translate(200%);
43 | }
44 | }
45 |
46 | > .deck-previous {
47 | @include translate(-200%);
48 | }
49 |
50 | > .deck-before {
51 | @include translate(-400%);
52 | }
53 |
54 | > .deck-next {
55 | @include translate(200%);
56 | }
57 |
58 | > .deck-after {
59 | @include translate(400%);
60 | }
61 |
62 | > .deck-before, > .deck-previous {
63 | .slide {
64 | visibility:visible;
65 | }
66 | }
67 |
68 | > .deck-child-current {
69 | @include transform(none);
70 | }
71 | }
72 | }
--------------------------------------------------------------------------------
/deck.js/themes/transition/vertical-slide.css:
--------------------------------------------------------------------------------
1 | .csstransitions.csstransforms .deck-container {
2 | overflow-y: hidden;
3 | }
4 | .csstransitions.csstransforms .deck-container > .slide {
5 | -webkit-transition: -webkit-transform 500ms ease-in-out;
6 | transition: transform 500ms ease-in-out;
7 | }
8 | .csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide {
9 | position: absolute;
10 | top: 0;
11 | left: 0;
12 | }
13 | .csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .slide {
14 | position: relative;
15 | left: 0;
16 | top: 0;
17 | -webkit-transition: -webkit-transform 500ms ease-in-out, opacity 500ms ease-in-out;
18 | transition: transform 500ms ease-in-out, opacity 500ms ease-in-out;
19 | }
20 | .csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .deck-next, .csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .deck-after {
21 | visibility: visible;
22 | -webkit-transform: translate3d(0, 1600px, 0);
23 | -ms-transform: translate(0, 1600px);
24 | transform: translate3d(0, 1600px, 0);
25 | }
26 | .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-previous {
27 | -webkit-transform: translate3d(0, -200%, 0);
28 | -ms-transform: translate(0, -200%);
29 | transform: translate3d(0, -200%, 0);
30 | }
31 | .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-before {
32 | -webkit-transform: translate3d(0, -400%, 0);
33 | -ms-transform: translate(0, -400%);
34 | transform: translate3d(0, -400%, 0);
35 | }
36 | .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-next {
37 | -webkit-transform: translate3d(0, 200%, 0);
38 | -ms-transform: translate(0, 200%);
39 | transform: translate3d(0, 200%, 0);
40 | }
41 | .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-after {
42 | -webkit-transform: translate3d(0, 400%, 0);
43 | -ms-transform: translate(0, 400%);
44 | transform: translate3d(0, 400%, 0);
45 | }
46 | .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-before .slide, .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-previous .slide {
47 | visibility: visible;
48 | }
49 | .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-child-current {
50 | -webkit-transform: none;
51 | -ms-transform: none;
52 | transform: none;
53 | }
54 | .csstransitions.csstransforms .deck-prev-link {
55 | left: auto;
56 | right: 8px;
57 | top: 59px;
58 | -webkit-transform: rotate(90deg);
59 | -ms-transform: rotate(90deg);
60 | transform: rotate(90deg);
61 | }
62 | .csstransitions.csstransforms .deck-next-link {
63 | top: 99px;
64 | -webkit-transform: rotate(90deg);
65 | -ms-transform: rotate(90deg);
66 | transform: rotate(90deg);
67 | }
68 |
--------------------------------------------------------------------------------
/deck.js/themes/transition/vertical-slide.scss:
--------------------------------------------------------------------------------
1 | @mixin translate($x: 0, $y: 0, $z: 0) {
2 | -webkit-transform:translate3d($x, $y, $z);
3 | -ms-transform:translate($x, $y);
4 | transform:translate3d($x, $y, $z);
5 | }
6 |
7 | @mixin rotate($deg) {
8 | -webkit-transform:rotate($deg);
9 | -ms-transform:rotate($deg);
10 | transform:rotate($deg);
11 | }
12 |
13 | @mixin transition($prop, $duration, $easing: ease-in-out, $delay: 0ms) {
14 | -webkit-transition:$prop $duration $easing $delay;
15 | transition:$prop $duration $easing $delay;
16 | }
17 |
18 | @mixin transform($val) {
19 | -webkit-transform:$val;
20 | -ms-transform:$val;
21 | transform:$val;
22 | }
23 |
24 | .csstransitions.csstransforms {
25 | .deck-container {
26 | overflow-y:hidden;
27 |
28 | > .slide {
29 | -webkit-transition:-webkit-transform 500ms ease-in-out;
30 | transition:transform 500ms ease-in-out;
31 | }
32 | }
33 |
34 | .deck-container:not(.deck-menu) {
35 | > .slide {
36 | position:absolute;
37 | top:0;
38 | left:0;
39 |
40 | .slide {
41 | position:relative;
42 | left:0;
43 | top:0;
44 | -webkit-transition:-webkit-transform 500ms ease-in-out, opacity 500ms ease-in-out;
45 | transition:transform 500ms ease-in-out, opacity 500ms ease-in-out;
46 | }
47 |
48 | .deck-next, .deck-after {
49 | visibility:visible;
50 | @include translate(0, 1600px);
51 | }
52 | }
53 |
54 | > .deck-previous {
55 | @include translate(0, -200%);
56 | }
57 |
58 | > .deck-before {
59 | @include translate(0, -400%);
60 | }
61 |
62 | > .deck-next {
63 | @include translate(0, 200%);
64 | }
65 |
66 | > .deck-after {
67 | @include translate(0, 400%);
68 | }
69 |
70 | > .deck-before, > .deck-previous {
71 | .slide {
72 | visibility:visible;
73 | }
74 | }
75 |
76 | > .deck-child-current {
77 | @include transform(none);
78 | }
79 | }
80 |
81 | .deck-prev-link {
82 | left:auto;
83 | right:8px;
84 | top:59px;
85 | @include rotate(90deg);
86 | }
87 |
88 | .deck-next-link {
89 | top:99px;
90 | @include rotate(90deg);
91 | }
92 | }
--------------------------------------------------------------------------------
/iframes/circle-animation.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Three.js Starter - Circle Animation
5 |
10 |
11 |
12 |
13 |
14 |
110 |
111 |
--------------------------------------------------------------------------------
/iframes/cube-title.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | Three.js Cube
11 |
12 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
222 |
223 |
224 |
225 |
--------------------------------------------------------------------------------
/iframes/getting-started.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Three.js Starter
5 |
10 |
11 |
12 |
13 |
35 |
36 |
--------------------------------------------------------------------------------
/iframes/hierarchy.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | three.js webgl - geometry hierarchy 2
5 |
6 |
7 |
16 |
17 |
18 |
19 |
20 |
21 |
197 |
198 |
199 |
200 |
--------------------------------------------------------------------------------
/iframes/images/cube/Bridge2/negx.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/iframes/images/cube/Bridge2/negx.jpg
--------------------------------------------------------------------------------
/iframes/images/cube/Bridge2/negy.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/iframes/images/cube/Bridge2/negy.jpg
--------------------------------------------------------------------------------
/iframes/images/cube/Bridge2/negz.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/iframes/images/cube/Bridge2/negz.jpg
--------------------------------------------------------------------------------
/iframes/images/cube/Bridge2/posx.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/iframes/images/cube/Bridge2/posx.jpg
--------------------------------------------------------------------------------
/iframes/images/cube/Bridge2/posy.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/iframes/images/cube/Bridge2/posy.jpg
--------------------------------------------------------------------------------
/iframes/images/cube/Bridge2/posz.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/iframes/images/cube/Bridge2/posz.jpg
--------------------------------------------------------------------------------
/iframes/images/cube/Bridge2/readme.txt:
--------------------------------------------------------------------------------
1 | Author
2 | ======
3 |
4 | This is the work of Emil Persson, aka Humus.
5 | http://www.humus.name
6 | humus@comhem.se
7 |
8 |
9 |
10 | Legal stuff
11 | ===========
12 |
13 | This work is free and may be used by anyone for any purpose
14 | and may be distributed freely to anyone using any distribution
15 | media or distribution method as long as this file is included.
16 | Distribution without this file is allowed if it's distributed
17 | with free non-commercial software; however, fair credit of the
18 | original author is expected.
19 | Any commercial distribution of this software requires the written
20 | approval of Emil Persson.
21 |
--------------------------------------------------------------------------------
/iframes/images/cursor-centered.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/iframes/images/cursor-centered.png
--------------------------------------------------------------------------------
/iframes/images/planets/all-maps.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/iframes/images/planets/all-maps.png
--------------------------------------------------------------------------------
/iframes/images/planets/earth_alpha_2048.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/iframes/images/planets/earth_alpha_2048.jpg
--------------------------------------------------------------------------------
/iframes/images/planets/earth_atmos_2048.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/iframes/images/planets/earth_atmos_2048.jpg
--------------------------------------------------------------------------------
/iframes/images/planets/earth_clouds_1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/iframes/images/planets/earth_clouds_1024.png
--------------------------------------------------------------------------------
/iframes/images/planets/earth_normal_2048.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/iframes/images/planets/earth_normal_2048.jpg
--------------------------------------------------------------------------------
/iframes/images/planets/earth_specular_2048.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/iframes/images/planets/earth_specular_2048.jpg
--------------------------------------------------------------------------------
/iframes/images/planets/land_ocean_ice_cloud_2048.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/iframes/images/planets/land_ocean_ice_cloud_2048.jpg
--------------------------------------------------------------------------------
/iframes/images/planets/moon_1024.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/iframes/images/planets/moon_1024.jpg
--------------------------------------------------------------------------------
/iframes/interactive-cubes-gui.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | three.js webgl - interactive cubes
5 |
6 |
7 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
226 |
227 |
228 |
229 |
--------------------------------------------------------------------------------
/iframes/loader.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | Three.js Object Loader
11 |
12 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
193 |
194 |
195 |
196 |
--------------------------------------------------------------------------------
/iframes/misc_controls_orbit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | three.js webgl - orbit controls
5 |
6 |
7 |
32 |
33 |
34 |
35 |
36 |
37 |
three.js - orbit controls example
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
141 |
142 |
143 |
144 |
--------------------------------------------------------------------------------
/iframes/sprite.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | Three.js Sprite
11 |
12 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
220 |
221 |
222 |
223 |
--------------------------------------------------------------------------------
/iframes/three/UVsDebug.js:
--------------------------------------------------------------------------------
1 | /*
2 | * @author zz85 / http://github.com/zz85
3 | * @author WestLangley / http://github.com/WestLangley
4 | *
5 | * tool for "unwrapping" and debugging three.js
6 | * geometries UV mapping
7 | *
8 | * Sample usage:
9 | * document.body.appendChild( THREE.UVsDebug( new THREE.SphereGeometry( 10, 10, 10, 10 ) );
10 | *
11 | */
12 |
13 | THREE.UVsDebug = function( geometry, size ) {
14 |
15 | // handles wrapping of uv.x > 1 only
16 |
17 | var abc = 'abc';
18 |
19 | var uv, u, ax, ay;
20 | var i, il, j, jl;
21 | var vnum;
22 |
23 | var a = new THREE.Vector2();
24 | var b = new THREE.Vector2();
25 |
26 | var geo = ( geometry instanceof THREE.BufferGeometry ) ? new THREE.Geometry().fromBufferGeometry( geometry ) : geometry;
27 |
28 | var faces = geo.faces;
29 | var uvs = geo.faceVertexUvs[ 0 ];
30 |
31 | var canvas = document.createElement( 'canvas' );
32 | var width = size || 1024; // power of 2 required for wrapping
33 | var height = size || 1024;
34 | canvas.width = width;
35 | canvas.height = height;
36 |
37 | var ctx = canvas.getContext( '2d' );
38 | ctx.lineWidth = 2;
39 | // ctx.strokeStyle = 'rgba( 0, 0, 0, 1.0 )';
40 | ctx.strokeStyle = 'rgba( 255, 0, 0, 1.0 )';
41 | ctx.textAlign = 'center';
42 |
43 | // paint background white
44 |
45 | // ctx.fillStyle = 'rgba( 255, 255, 255, 1.0 )';
46 | // ctx.fillRect( 0, 0, width, height );
47 |
48 | for ( i = 0, il = uvs.length; i < il; i++ ) {
49 |
50 | uv = uvs[ i ];
51 |
52 | // draw lines
53 |
54 | ctx.beginPath();
55 |
56 | a.set( 0, 0 );
57 |
58 | for ( j = 0, jl = uv.length; j < jl; j++ ) {
59 |
60 | u = uv[ j ];
61 |
62 | a.x += u.x;
63 | a.y += u.y;
64 |
65 | if ( j == 0 ) {
66 |
67 | ctx.moveTo( u.x * width, ( 1 - u.y ) * height );
68 |
69 | } else {
70 |
71 | ctx.lineTo( u.x * width, ( 1 - u.y ) * height );
72 |
73 | }
74 |
75 | }
76 |
77 | ctx.closePath();
78 | ctx.stroke();
79 |
80 | a.divideScalar( jl );
81 |
82 | // label the face number
83 |
84 | // ctx.font = "12pt Arial bold";
85 | // ctx.fillStyle = 'rgba( 0, 0, 0, 1.0 )';
86 | // ctx.fillText( i, a.x * width, ( 1 - a.y ) * height );
87 |
88 | // if ( a.x > 0.95 ) {
89 |
90 | // wrap x // 0.95 is arbitrary
91 |
92 | // ctx.fillText( i, ( a.x % 1 ) * width, ( 1 - a.y ) * height );
93 |
94 | // }
95 |
96 | // ctx.font = "8pt Arial bold";
97 | // ctx.fillStyle = 'rgba( 0, 0, 0, 1.0 )';
98 |
99 | // label uv edge orders
100 |
101 | // for ( j = 0, jl = uv.length; j < jl; j++ ) {
102 |
103 | // u = uv[ j ];
104 | // b.addVectors( a, u ).divideScalar( 2 );
105 |
106 | // vnum = faces[ i ][ abc[ j ] ];
107 | // ctx.fillText( abc[ j ] + vnum, b.x * width, ( 1 - b.y ) * height );
108 |
109 | // if ( b.x > 0.95 ) {
110 |
111 | // wrap x
112 |
113 | // ctx.fillText( abc[ j ] + vnum, ( b.x % 1 ) * width, ( 1 - b.y ) * height );
114 |
115 | // }
116 |
117 | // }
118 |
119 | }
120 |
121 | return canvas;
122 |
123 | };
124 |
125 |
--------------------------------------------------------------------------------
/iframes/three/WebGL.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author alteredq / http://alteredqualia.com/
3 | * @author mr.doob / http://mrdoob.com/
4 | */
5 |
6 | var WEBGL = {
7 |
8 | isWebGLAvailable: function () {
9 |
10 | try {
11 |
12 | var canvas = document.createElement( 'canvas' );
13 | return !! ( window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) ) );
14 |
15 | } catch ( e ) {
16 |
17 | return false;
18 |
19 | }
20 |
21 | },
22 |
23 | isWebGL2Available: function () {
24 |
25 | try {
26 |
27 | var canvas = document.createElement( 'canvas' );
28 | return !! ( window.WebGL2RenderingContext && canvas.getContext( 'webgl2' ) );
29 |
30 | } catch ( e ) {
31 |
32 | return false;
33 |
34 | }
35 |
36 | },
37 |
38 | getWebGLErrorMessage: function () {
39 |
40 | return this.getErrorMessage( 1 );
41 |
42 | },
43 |
44 | getWebGL2ErrorMessage: function () {
45 |
46 | return this.getErrorMessage( 2 );
47 |
48 | },
49 |
50 | getErrorMessage: function ( version ) {
51 |
52 | var names = {
53 | 1: 'WebGL',
54 | 2: 'WebGL 2'
55 | };
56 |
57 | var contexts = {
58 | 1: window.WebGLRenderingContext,
59 | 2: window.WebGL2RenderingContext
60 | };
61 |
62 | var message = 'Your $0 does not seem to support $1 ';
63 |
64 | var element = document.createElement( 'div' );
65 | element.id = 'webglmessage';
66 | element.style.fontFamily = 'monospace';
67 | element.style.fontSize = '13px';
68 | element.style.fontWeight = 'normal';
69 | element.style.textAlign = 'center';
70 | element.style.background = '#fff';
71 | element.style.color = '#000';
72 | element.style.padding = '1.5em';
73 | element.style.width = '400px';
74 | element.style.margin = '5em auto 0';
75 |
76 | if ( contexts[ version ] ) {
77 |
78 | message = message.replace( '$0', 'graphics card' );
79 |
80 | } else {
81 |
82 | message = message.replace( '$0', 'browser' );
83 |
84 | }
85 |
86 | message = message.replace( '$1', names[ version ] );
87 |
88 | element.innerHTML = message;
89 |
90 | return element;
91 |
92 | }
93 |
94 | };
95 |
--------------------------------------------------------------------------------
/iframes/three/geometries/hilbert3D.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Hilbert Curve: Generates 2D-Coordinates in a very fast way.
3 | *
4 | * @author Dylan Grafmyre
5 | *
6 | * Based on work by:
7 | * @author Thomas Diewald
8 | * @link http://www.openprocessing.org/visuals/?visualID=15599
9 | *
10 | * Based on `examples/canvas_lines_colors.html`:
11 | * @author OpenShift guest
12 | * @link https://github.com/mrdoob/three.js/blob/8413a860aa95ed29c79cbb7f857c97d7880d260f/examples/canvas_lines_colors.html
13 | * @see Line 149 - 186
14 | *
15 | * @param center Center of Hilbert curve.
16 | * @param size Total width of Hilbert curve.
17 | * @param iterations Number of subdivisions.
18 | * @param v0 Corner index -X, +Y, -Z.
19 | * @param v1 Corner index -X, +Y, +Z.
20 | * @param v2 Corner index -X, -Y, +Z.
21 | * @param v3 Corner index -X, -Y, -Z.
22 | * @param v4 Corner index +X, -Y, -Z.
23 | * @param v5 Corner index +X, -Y, +Z.
24 | * @param v6 Corner index +X, +Y, +Z.
25 | * @param v7 Corner index +X, +Y, -Z.
26 | */
27 | function hilbert3D( center, size, iterations, v0, v1, v2, v3, v4, v5, v6, v7 ) {
28 |
29 | // Default Vars
30 | var center = undefined !== center ? center : new THREE.Vector3( 0, 0, 0 ),
31 | size = undefined !== size ? size : 10,
32 | half = size / 2,
33 | iterations = undefined !== iterations ? iterations : 1,
34 | v0 = undefined !== v0 ? v0 : 0,
35 | v1 = undefined !== v1 ? v1 : 1,
36 | v2 = undefined !== v2 ? v2 : 2,
37 | v3 = undefined !== v3 ? v3 : 3,
38 | v4 = undefined !== v4 ? v4 : 4,
39 | v5 = undefined !== v5 ? v5 : 5,
40 | v6 = undefined !== v6 ? v6 : 6,
41 | v7 = undefined !== v7 ? v7 : 7
42 | ;
43 |
44 | var vec_s = [
45 | new THREE.Vector3( center.x - half, center.y + half, center.z - half ),
46 | new THREE.Vector3( center.x - half, center.y + half, center.z + half ),
47 | new THREE.Vector3( center.x - half, center.y - half, center.z + half ),
48 | new THREE.Vector3( center.x - half, center.y - half, center.z - half ),
49 | new THREE.Vector3( center.x + half, center.y - half, center.z - half ),
50 | new THREE.Vector3( center.x + half, center.y - half, center.z + half ),
51 | new THREE.Vector3( center.x + half, center.y + half, center.z + half ),
52 | new THREE.Vector3( center.x + half, center.y + half, center.z - half )
53 | ];
54 |
55 | var vec = [
56 | vec_s[ v0 ],
57 | vec_s[ v1 ],
58 | vec_s[ v2 ],
59 | vec_s[ v3 ],
60 | vec_s[ v4 ],
61 | vec_s[ v5 ],
62 | vec_s[ v6 ],
63 | vec_s[ v7 ]
64 | ];
65 |
66 | // Recurse iterations
67 | if ( -- iterations >= 0 ) {
68 |
69 | var tmp = [];
70 |
71 | Array.prototype.push.apply( tmp, hilbert3D ( vec[ 0 ], half, iterations, v0, v3, v4, v7, v6, v5, v2, v1 ) );
72 | Array.prototype.push.apply( tmp, hilbert3D ( vec[ 1 ], half, iterations, v0, v7, v6, v1, v2, v5, v4, v3 ) );
73 | Array.prototype.push.apply( tmp, hilbert3D ( vec[ 2 ], half, iterations, v0, v7, v6, v1, v2, v5, v4, v3 ) );
74 | Array.prototype.push.apply( tmp, hilbert3D ( vec[ 3 ], half, iterations, v2, v3, v0, v1, v6, v7, v4, v5 ) );
75 | Array.prototype.push.apply( tmp, hilbert3D ( vec[ 4 ], half, iterations, v2, v3, v0, v1, v6, v7, v4, v5 ) );
76 | Array.prototype.push.apply( tmp, hilbert3D ( vec[ 5 ], half, iterations, v4, v3, v2, v5, v6, v1, v0, v7 ) );
77 | Array.prototype.push.apply( tmp, hilbert3D ( vec[ 6 ], half, iterations, v4, v3, v2, v5, v6, v1, v0, v7 ) );
78 | Array.prototype.push.apply( tmp, hilbert3D ( vec[ 7 ], half, iterations, v6, v5, v2, v1, v0, v3, v4, v7 ) );
79 |
80 | // Return recursive call
81 | return tmp;
82 |
83 | }
84 |
85 | // Return complete Hilbert Curve.
86 | return vec;
87 |
88 | }
89 |
--------------------------------------------------------------------------------
/iframes/three/libs/tween.min.js:
--------------------------------------------------------------------------------
1 | // tween.js - http://github.com/sole/tween.js - Licensed under the MIT License
2 | 'use strict';void 0===Date.now&&(Date.now=function(){return(new Date).valueOf()});
3 | var TWEEN=TWEEN||function(){var a=[];return{REVISION:"14",getAll:function(){return a},removeAll:function(){a=[]},add:function(c){a.push(c)},remove:function(c){c=a.indexOf(c);-1!==c&&a.splice(c,1)},update:function(c){if(0===a.length)return!1;for(var b=0,c=void 0!==c?c:"undefined"!==typeof window&&void 0!==window.performance&&void 0!==window.performance.now?window.performance.now():Date.now();b(a*=2)?0.5*a*a:-0.5*(--a*(a-2)-1)}},Cubic:{In:function(a){return a*a*a},Out:function(a){return--a*a*a+1},InOut:function(a){return 1>(a*=2)?0.5*a*a*a:0.5*((a-=2)*a*a+2)}},Quartic:{In:function(a){return a*a*a*a},Out:function(a){return 1- --a*a*a*a},InOut:function(a){return 1>(a*=2)?0.5*a*a*a*a:-0.5*((a-=2)*a*a*a-2)}},Quintic:{In:function(a){return a*a*a*
9 | a*a},Out:function(a){return--a*a*a*a*a+1},InOut:function(a){return 1>(a*=2)?0.5*a*a*a*a*a:0.5*((a-=2)*a*a*a*a+2)}},Sinusoidal:{In:function(a){return 1-Math.cos(a*Math.PI/2)},Out:function(a){return Math.sin(a*Math.PI/2)},InOut:function(a){return 0.5*(1-Math.cos(Math.PI*a))}},Exponential:{In:function(a){return 0===a?0:Math.pow(1024,a-1)},Out:function(a){return 1===a?1:1-Math.pow(2,-10*a)},InOut:function(a){return 0===a?0:1===a?1:1>(a*=2)?0.5*Math.pow(1024,a-1):0.5*(-Math.pow(2,-10*(a-1))+2)}},Circular:{In:function(a){return 1-
10 | Math.sqrt(1-a*a)},Out:function(a){return Math.sqrt(1- --a*a)},InOut:function(a){return 1>(a*=2)?-0.5*(Math.sqrt(1-a*a)-1):0.5*(Math.sqrt(1-(a-=2)*a)+1)}},Elastic:{In:function(a){var c,b=0.1;if(0===a)return 0;if(1===a)return 1;!b||1>b?(b=1,c=0.1):c=0.4*Math.asin(1/b)/(2*Math.PI);return-(b*Math.pow(2,10*(a-=1))*Math.sin((a-c)*2*Math.PI/0.4))},Out:function(a){var c,b=0.1;if(0===a)return 0;if(1===a)return 1;!b||1>b?(b=1,c=0.1):c=0.4*Math.asin(1/b)/(2*Math.PI);return b*Math.pow(2,-10*a)*Math.sin((a-c)*
11 | 2*Math.PI/0.4)+1},InOut:function(a){var c,b=0.1;if(0===a)return 0;if(1===a)return 1;!b||1>b?(b=1,c=0.1):c=0.4*Math.asin(1/b)/(2*Math.PI);return 1>(a*=2)?-0.5*b*Math.pow(2,10*(a-=1))*Math.sin((a-c)*2*Math.PI/0.4):0.5*b*Math.pow(2,-10*(a-=1))*Math.sin((a-c)*2*Math.PI/0.4)+1}},Back:{In:function(a){return a*a*(2.70158*a-1.70158)},Out:function(a){return--a*a*(2.70158*a+1.70158)+1},InOut:function(a){return 1>(a*=2)?0.5*a*a*(3.5949095*a-2.5949095):0.5*((a-=2)*a*(3.5949095*a+2.5949095)+2)}},Bounce:{In:function(a){return 1-
12 | TWEEN.Easing.Bounce.Out(1-a)},Out:function(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+0.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+0.9375:7.5625*(a-=2.625/2.75)*a+0.984375},InOut:function(a){return 0.5>a?0.5*TWEEN.Easing.Bounce.In(2*a):0.5*TWEEN.Easing.Bounce.Out(2*a-1)+0.5}}};
13 | TWEEN.Interpolation={Linear:function(a,c){var b=a.length-1,d=b*c,e=Math.floor(d),g=TWEEN.Interpolation.Utils.Linear;return 0>c?g(a[0],a[1],d):1b?b:e+1],d-e)},Bezier:function(a,c){var b=0,d=a.length-1,e=Math.pow,g=TWEEN.Interpolation.Utils.Bernstein,h;for(h=0;h<=d;h++)b+=e(1-c,d-h)*e(c,h)*a[h]*g(d,h);return b},CatmullRom:function(a,c){var b=a.length-1,d=b*c,e=Math.floor(d),g=TWEEN.Interpolation.Utils.CatmullRom;return a[0]===a[b]?(0>c&&(e=Math.floor(d=b*(1+c))),g(a[(e-
14 | 1+b)%b],a[e],a[(e+1)%b],a[(e+2)%b],d-e)):0>c?a[0]-(g(a[0],a[0],a[1],a[1],-d)-a[0]):1
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | Three.js Transforms
11 |
12 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
241 |
242 |
243 |
244 |
--------------------------------------------------------------------------------
/iframes/webgl_interactive_cubes.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | three.js webgl - interactive cubes
5 |
6 |
7 |
15 |
16 |
17 |
18 |
19 |
20 |
160 |
161 |
162 |
163 |
--------------------------------------------------------------------------------
/iframes/webgl_lines_colors.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | three.js webgl - lines - cubes - colors
5 |
6 |
7 |
39 |
40 |
41 |
42 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
226 |
227 |
228 |
--------------------------------------------------------------------------------
/iframes/webgl_points_random.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | three.js webgl - particles
5 |
6 |
7 |
32 |
33 |
34 |
35 |
36 |
three.js - webgl particles example
37 |
38 |
39 |
40 |
41 |
42 |
43 |
214 |
215 |
216 |
--------------------------------------------------------------------------------
/images/300.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/images/300.jpg
--------------------------------------------------------------------------------
/images/3d-software.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/images/3d-software.png
--------------------------------------------------------------------------------
/images/cardboard-ingredients.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/images/cardboard-ingredients.png
--------------------------------------------------------------------------------
/images/geometry.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/images/geometry.png
--------------------------------------------------------------------------------
/images/interaction.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/images/interaction.png
--------------------------------------------------------------------------------
/images/marble.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/images/marble.jpg
--------------------------------------------------------------------------------
/images/node-map.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/images/node-map.png
--------------------------------------------------------------------------------
/images/obj-json.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/images/obj-json.png
--------------------------------------------------------------------------------
/images/octocat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/images/octocat.png
--------------------------------------------------------------------------------
/images/orbit-all-the-things.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/images/orbit-all-the-things.jpg
--------------------------------------------------------------------------------
/images/sublime-completions.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/images/sublime-completions.png
--------------------------------------------------------------------------------
/images/sunny-sky.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/images/sunny-sky.jpg
--------------------------------------------------------------------------------
/images/surface-normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/images/surface-normal.png
--------------------------------------------------------------------------------
/images/threejs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/images/threejs.png
--------------------------------------------------------------------------------
/images/tron-legacy.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/images/tron-legacy.jpg
--------------------------------------------------------------------------------
/images/tween-graphs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/images/tween-graphs.png
--------------------------------------------------------------------------------
/images/twitter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/images/twitter.png
--------------------------------------------------------------------------------
/images/unit-circle-radians.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/images/unit-circle-radians.png
--------------------------------------------------------------------------------
/images/unit-circle-trig.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/images/unit-circle-trig.png
--------------------------------------------------------------------------------
/images/unit-circle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/images/unit-circle.png
--------------------------------------------------------------------------------
/images/webgl-browser-support.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/images/webgl-browser-support.png
--------------------------------------------------------------------------------
/resources/fonts.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: 'Source Sans Pro';
3 | font-style: normal;
4 | font-weight: 400;
5 | src: url('fonts/source-sans-pro/SourceSansPro-Regular.eot');
6 | src: url('fonts/source-sans-pro/SourceSansPro-Regular.eot?#iefix') format('embedded-opentype'), url('fonts/source-sans-pro/SourceSansPro-Regular.woff') format('woff'), url('fonts/source-sans-pro/SourceSansPro-Regular.svg#SourceSansPro-Regular') format('svg');
7 | }
8 | @font-face {
9 | font-family: 'Source Sans Pro';
10 | font-style: normal;
11 | font-weight: 700;
12 | src: url('fonts/source-sans-pro/SourceSansPro-Bold.eot');
13 | src: url('fonts/source-sans-pro/SourceSansPro-Bold.eot?#iefix') format('embedded-opentype'), url('fonts/source-sans-pro/SourceSansPro-Bold.woff') format('woff'), url('fonts/source-sans-pro/SourceSansPro-Bold.svg#SourceSansPro-Bold') format('svg');
14 | }
15 | @font-face {
16 | font-family: 'Source Code Pro';
17 | font-weight: 400;
18 | font-style: normal;
19 | src: url('fonts/source-code-pro/SourceCodePro-Regular.eot');
20 | src: url('fonts/source-code-pro/SourceCodePro-Regular.eot?#iefix') format('embedded-opentype'), url('fonts/source-code-pro/SourceCodePro-Regular.woff') format('woff'), url('fonts/source-code-pro/SourceCodePro-Regular.svg#SourceCodePro-Regular') format('svg');
21 | }
22 | @font-face {
23 | font-family: 'Source Code Pro';
24 | font-weight: 700;
25 | font-style: normal;
26 | src: url('fonts/source-code-pro/SourceCodePro-Bold.eot');
27 | src: url('fonts/source-code-pro/SourceCodePro-Bold.eot?#iefix') format('embedded-opentype'), url('fonts/source-code-pro/SourceCodePro-Bold.woff') format('woff'), url('fonts/source-code-pro/SourceCodePro-Bold.svg#SourceCodePro-Bold') format('svg');
28 | }
29 |
--------------------------------------------------------------------------------
/resources/fonts/source-code-pro/SourceCodePro-Bold.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/resources/fonts/source-code-pro/SourceCodePro-Bold.eot
--------------------------------------------------------------------------------
/resources/fonts/source-code-pro/SourceCodePro-Bold.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/resources/fonts/source-code-pro/SourceCodePro-Bold.woff
--------------------------------------------------------------------------------
/resources/fonts/source-code-pro/SourceCodePro-Regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/resources/fonts/source-code-pro/SourceCodePro-Regular.eot
--------------------------------------------------------------------------------
/resources/fonts/source-code-pro/SourceCodePro-Regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/resources/fonts/source-code-pro/SourceCodePro-Regular.woff
--------------------------------------------------------------------------------
/resources/fonts/source-sans-pro/SourceSansPro-Bold.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/resources/fonts/source-sans-pro/SourceSansPro-Bold.eot
--------------------------------------------------------------------------------
/resources/fonts/source-sans-pro/SourceSansPro-Bold.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/resources/fonts/source-sans-pro/SourceSansPro-Bold.woff
--------------------------------------------------------------------------------
/resources/fonts/source-sans-pro/SourceSansPro-Regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/resources/fonts/source-sans-pro/SourceSansPro-Regular.eot
--------------------------------------------------------------------------------
/resources/fonts/source-sans-pro/SourceSansPro-Regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/davidlyons/threejs-intro/ecb845dd338d31826e4d9103b2617678d2562785/resources/fonts/source-sans-pro/SourceSansPro-Regular.woff
--------------------------------------------------------------------------------
/resources/less/fonts.less:
--------------------------------------------------------------------------------
1 | // Source Sans Pro
2 |
3 | @font-face {
4 | font-family: 'Source Sans Pro';
5 | font-style: normal;
6 | font-weight: 400;
7 | src: url('fonts/source-sans-pro/SourceSansPro-Regular.eot');
8 | src: url('fonts/source-sans-pro/SourceSansPro-Regular.eot?#iefix') format('embedded-opentype'),
9 | url('fonts/source-sans-pro/SourceSansPro-Regular.woff') format('woff'),
10 | url('fonts/source-sans-pro/SourceSansPro-Regular.svg#SourceSansPro-Regular') format('svg');
11 | }
12 |
13 | @font-face {
14 | font-family: 'Source Sans Pro';
15 | font-style: normal;
16 | font-weight: 700;
17 | src: url('fonts/source-sans-pro/SourceSansPro-Bold.eot');
18 | src: url('fonts/source-sans-pro/SourceSansPro-Bold.eot?#iefix') format('embedded-opentype'),
19 | url('fonts/source-sans-pro/SourceSansPro-Bold.woff') format('woff'),
20 | url('fonts/source-sans-pro/SourceSansPro-Bold.svg#SourceSansPro-Bold') format('svg');
21 | }
22 |
23 |
24 | // Source Code Pro
25 |
26 | @font-face {
27 | font-family: 'Source Code Pro';
28 | font-weight: 400;
29 | font-style: normal;
30 | src: url('fonts/source-code-pro/SourceCodePro-Regular.eot');
31 | src: url('fonts/source-code-pro/SourceCodePro-Regular.eot?#iefix') format('embedded-opentype'),
32 | url('fonts/source-code-pro/SourceCodePro-Regular.woff') format('woff'),
33 | url('fonts/source-code-pro/SourceCodePro-Regular.svg#SourceCodePro-Regular') format('svg');
34 | }
35 |
36 | @font-face {
37 | font-family: 'Source Code Pro';
38 | font-weight: 700;
39 | font-style: normal;
40 | src: url('fonts/source-code-pro/SourceCodePro-Bold.eot');
41 | src: url('fonts/source-code-pro/SourceCodePro-Bold.eot?#iefix') format('embedded-opentype'),
42 | url('fonts/source-code-pro/SourceCodePro-Bold.woff') format('woff'),
43 | url('fonts/source-code-pro/SourceCodePro-Bold.svg#SourceCodePro-Bold') format('svg');
44 | }
--------------------------------------------------------------------------------
/resources/less/layout.less:
--------------------------------------------------------------------------------
1 | * { box-sizing: border-box; }
2 |
3 | body {
4 | font-family: 'Source Sans Pro', sans-serif;
5 | padding-top: 10px;
6 | background: #ddd;
7 | }
8 |
9 | a { color: #428bca; text-decoration: none; }
10 | a:hover, a:focus { color: #2a6496; text-decoration: underline; }
11 | a:focus { outline: thin dotted; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; }
12 |
13 | .deck-container {
14 | background: #f8f8f8;
15 | color: #333;
16 | text-align: center;
17 | margin: 0 auto;
18 | min-height: 0;
19 | overflow-y: hidden;
20 | font-size: 35px;
21 |
22 | position: absolute;
23 | top: 50%;
24 | left: 50%;
25 | margin-left: -640px;
26 | margin-top: -360px;
27 | // margin-top: -390px; // online?
28 | }
29 |
30 | .deck-menu { overflow: auto; }
31 |
32 | .deck-menu > .deck-current,
33 | .deck-menu > .deck-child-current {
34 | outline: 10px solid teal;
35 | }
36 |
37 | .deck-menu iframe {
38 | pointer-events: none;
39 | }
40 |
41 | .deck-container,
42 | .deck-container > .slide {
43 | width: 1280px;
44 | height: 720px;
45 | }
46 |
47 | .slide {
48 | width: 100%;
49 | }
50 |
51 | .page-cover {
52 | position: absolute;
53 | width: 100%;
54 | height: 100%;
55 | display: table;
56 | }
57 |
58 | .cover-title { display: table-cell; vertical-align: middle; font-size: 96px; line-height: 1 }
59 | .cover-inverted { color: #fff; text-shadow: 4px 4px 1px rgba(0,0,0,0.7); }
60 | .cover-title small { font-size: 60%; display: block; }
61 |
62 | h2 { margin: 0; padding-top: 20px; font-size: 56px; }
63 |
64 | // p { margin: 25px 0; }
65 |
66 | img.spotlight,
67 | video.spotlight {
68 | position: absolute; top: 0; left: 0; width: 100%;
69 | }
70 |
71 | iframe {
72 | // border: 1px dotted red;
73 | position: absolute;
74 | width: 100%;
75 | height: 100%;
76 | top: 0;
77 | left: 0;
78 | }
79 |
80 | pre { margin: 0; }
81 | code { font-family: 'Source Code Pro', monospace; }
82 |
83 | // TEMP: hide past subitem if marked
84 | .deck-container > .slide .deck-before.temp,
85 | .deck-container > .slide .deck-previous.temp,
86 | .deck-container > .slide.deck-before .temp:not(.slide),
87 | .deck-container > .slide.deck-previous .temp:not(.slide) {
88 | opacity: 0;
89 | position: absolute;
90 | // .transition-transform-opacity(300ms);
91 | }
92 |
93 | .deck-container > .slide .deck-current.temp,
94 | .deck-container > .slide.deck-current .temp:not(.slide) {
95 | position: relative;
96 | }
97 |
98 | .slide.abs-bc,
99 | .abs-bc {
100 | width: 100%;
101 | position: absolute !important;
102 | top: auto;
103 | bottom: 30px;
104 | left: 0;
105 | right: 0;
106 | text-align: center;
107 | z-index: 2;
108 |
109 | // pre[class*="language-"] { text-align: center; }
110 | }
111 |
112 | .slide.abs-tc,
113 | .abs-tc {
114 | width: 100%;
115 | position: absolute !important;
116 | top: auto;
117 | top: 30px;
118 | left: 0;
119 | right: 0;
120 | text-align: center;
121 | z-index: 2;
122 | }
123 |
124 | .deck-container .bc-text {
125 | bottom: 50px;
126 | padding: 35px 0;
127 | // background: rgba(255,255,255,0.75);
128 | }
129 |
130 | .outline {
131 | text-shadow:
132 | 3px 0px 1px rgb(255, 255, 255), -3px 0px 1px rgb(255, 255, 255),
133 | 0px -3px 1px rgb(255, 255, 255), 0px 3px 1px rgb(255, 255, 255),
134 | 2px 2px 1px rgb(255, 255, 255), -2px 2px 1px rgb(255, 255, 255),
135 | 2px -2px 1px rgb(255, 255, 255), -2px -2px 1px rgb(255, 255, 255),
136 | 3px 2px 1px rgb(255, 255, 255), -3px 2px 1px rgb(255, 255, 255),
137 | 3px -2px 1px rgb(255, 255, 255), -3px -2px 1px rgb(255, 255, 255),
138 | 1px 3px 1px rgb(255, 255, 255), -1px 3px 1px rgb(255, 255, 255),
139 | 1px -3px 1px rgb(255, 255, 255), -1px -3px 1px rgb(255, 255, 255),
140 | -1px -1px 1px rgb(255, 255, 255), -1px 1px 1px rgb(255, 255, 255),
141 | 1px -1px 1px rgb(255, 255, 255), 1px 1px 1px rgb(255, 255, 255);
142 | }
143 |
144 | .overlay-full {
145 | position: absolute;
146 | top: 0;
147 | left: 0;
148 | right: 0;
149 | bottom: 0;
150 | margin: 0 !important;
151 | }
152 |
153 | // extensions
154 |
155 | // navigation
156 |
157 | // bottom center
158 | .deck-nav {
159 | text-align: center;
160 | position: absolute;
161 | left: 50%;
162 | top: 50%;
163 | z-index: 100;
164 | margin-top: 370px;
165 | width: 100px;
166 | margin-left: -50px;
167 | }
168 |
169 | .deck-prev-link { left: auto; }
170 | .deck-next-link { right: auto; }
171 |
172 | .deck-prev-link,
173 | .deck-next-link {
174 | font-size: 28px;
175 | position: relative;
176 | display: inline-block;
177 | border-radius: 6px;
178 | background: rgba(0,0,0,0.3);
179 | width: 40px;
180 | height: 40px;
181 | line-height: 38px;
182 | margin-top: 0px;
183 |
184 | &:hover {
185 | text-decoration: none;
186 | background: rgba(0,0,0,0.5);
187 | }
188 |
189 | &:focus {
190 | text-decoration: none;
191 | }
192 | }
193 |
194 | // status
195 | .deck-status {
196 | font-size: 18px;
197 | right: 10px;
198 | text-shadow: 0 0 1px #fff;
199 | position: absolute;
200 | }
201 |
202 | // go to
203 | .goto-form {
204 | height: auto;
205 | font-size: 20px;
206 | }
207 | .goto-form label, .goto-form input {
208 | font-size: inherit;
209 | }
210 |
211 | #goto-slide {
212 | height: auto;
213 | }
214 |
215 | // active states
216 | .on-slide-scene-required .scene-required,
217 | .on-slide-scene-object .scene-object,
218 | .on-slide-render-loop .render-loop {
219 | // color: red;
220 | font-weight: 700;
221 | }
222 |
223 |
224 | #camera-demo { transition: height 400ms, top 400ms; }
225 | .on-slide-camera-iframe-resize #camera-demo {
226 | top: 150px;
227 | height: 50%;
228 | }
229 |
230 | .on-slide-interaction1 .interaction1,
231 | .on-slide-interaction2 .interaction2,
232 | .on-slide-interaction3 .interaction3,
233 | .on-slide-interaction4 .interaction4 {
234 | font-weight: 700;
235 | }
236 |
237 |
238 | #info-left {
239 | position: absolute;
240 | top: 50%;
241 | left: 50%;
242 | margin-top: 370px;
243 | margin-left: -640px;
244 | }
245 |
246 | #info-right {
247 | position: absolute;
248 | top: 50%;
249 | right: 50%;
250 | margin-top: 370px;
251 | margin-right: -640px;
252 | text-align: right;
253 | }
--------------------------------------------------------------------------------
/resources/less/prism/prism-base16-eighties.dark.less:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Name: Base16 Eighties Dark
4 | Author: Chris Kempson (http://chriskempson.com)
5 |
6 | Prism template by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/prism/)
7 | Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16)
8 |
9 | */
10 |
11 | code[class*="language-"],
12 | pre[class*="language-"] {
13 | color: #f2f0ec;
14 | font-family: 'Source Code Pro', Consolas, Menlo, Monaco, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", "Courier New", Courier, monospace;
15 | // font-size: 14px;
16 | // line-height: 1.375;
17 | direction: ltr;
18 | text-align: left;
19 | word-spacing: normal;
20 |
21 | -moz-tab-size: 4;
22 | -o-tab-size: 4;
23 | tab-size: 4;
24 |
25 | -webkit-hyphens: none;
26 | -moz-hyphens: none;
27 | -ms-hyphens: none;
28 | hyphens: none;
29 |
30 | white-space: pre;
31 | white-space: pre-wrap;
32 | word-break: break-all;
33 | word-wrap: break-word;
34 |
35 | // background: #2d2d2d;
36 | color: #d3d0c8;
37 | }
38 |
39 | code[class*="language-"] {
40 | font-size: 34px;
41 | }
42 |
43 | /* Code blocks */
44 | pre[class*="language-"] {
45 | padding: 1em;
46 | margin: .5em 0;
47 | overflow: auto;
48 | }
49 |
50 | :not(pre) > code[class*="language-"],
51 | pre[class*="language-"] {
52 | background: #2d2d2d;
53 | }
54 |
55 | .temp pre[class*="language-"] {
56 | background: fade(#2d2d2d, 80%);
57 | .token.comment, .token.prolog, .token.doctype, .token.cdata { color: #777; }
58 | }
59 |
60 | /* Inline code */
61 | :not(pre) > code[class*="language-"] {
62 | padding: .1em;
63 | border-radius: .3em;
64 | }
65 |
66 | .token.comment,
67 | .token.prolog,
68 | .token.doctype,
69 | .token.cdata {
70 | color: #515151;
71 | }
72 |
73 | .token.function {
74 | color: #87CEEB;
75 | }
76 |
77 | .token.punctuation {
78 | color: #d3d0c8;
79 | }
80 |
81 | .namespace {
82 | opacity: .7;
83 | }
84 |
85 | .token.null,
86 | .token.operator,
87 | .token.boolean,
88 | .token.number {
89 | color: #f99157;
90 | }
91 | .token.property {
92 | color: #ffcc66;
93 | }
94 | .token.tag {
95 | color: #6699cc;
96 | }
97 | .token.string {
98 | color: #66cccc;
99 | }
100 | .token.selector {
101 | color: #cc99cc;
102 | }
103 | .token.attr-name {
104 | color: #f99157;
105 | }
106 | .token.entity,
107 | .token.url,
108 | .language-css .token.string,
109 | .style .token.string {
110 | color: #66cccc;
111 | }
112 |
113 | .token.attr-value,
114 | .token.keyword,
115 | .token.control,
116 | .token.directive,
117 | .token.unit {
118 | color: #99cc99;
119 | }
120 |
121 | .token.statement,
122 | .token.regex,
123 | .token.atrule {
124 | color: #66cccc;
125 | }
126 |
127 | .token.placeholder,
128 | .token.variable {
129 | color: #6699cc;
130 | }
131 |
132 | .token.important {
133 | color: #f2777a;
134 | font-weight: bold;
135 | }
136 |
137 | .token.entity {
138 | cursor: help;
139 | }
140 |
141 | pre > code.highlight {
142 | outline: .4em solid red;
143 | outline-offset: .4em;
144 | }
145 |
146 |
--------------------------------------------------------------------------------
/resources/less/prism/prism-default.less:
--------------------------------------------------------------------------------
1 | /* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+python */
2 | /**
3 | * prism.js default theme for JavaScript, CSS and HTML
4 | * Based on dabblet (http://dabblet.com)
5 | * @author Lea Verou
6 | */
7 |
8 | code[class*="language-"],
9 | pre[class*="language-"] {
10 | color: black;
11 | text-shadow: 0 1px white;
12 | font-family: 'Source Code Pro', Consolas, Monaco, 'Andale Mono', monospace;
13 | direction: ltr;
14 | text-align: left;
15 | white-space: pre;
16 | word-spacing: normal;
17 | word-break: normal;
18 |
19 | -moz-tab-size: 4;
20 | -o-tab-size: 4;
21 | tab-size: 4;
22 |
23 | -webkit-hyphens: none;
24 | -moz-hyphens: none;
25 | -ms-hyphens: none;
26 | hyphens: none;
27 |
28 | white-space: pre;
29 | white-space: pre-wrap;
30 | word-break: break-all;
31 | word-wrap: break-word;
32 | }
33 |
34 | pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
35 | code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
36 | text-shadow: none;
37 | background: #b3d4fc;
38 | }
39 |
40 | pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
41 | code[class*="language-"]::selection, code[class*="language-"] ::selection {
42 | text-shadow: none;
43 | background: #b3d4fc;
44 | }
45 |
46 | @media print {
47 | code[class*="language-"],
48 | pre[class*="language-"] {
49 | text-shadow: none;
50 | }
51 | }
52 |
53 | code[class*="language-"] {
54 | font-size: 34px;
55 | }
56 |
57 | /* Code blocks */
58 | pre[class*="language-"] {
59 | padding: 1em;
60 | margin: .5em 0;
61 | overflow: auto;
62 | }
63 |
64 | :not(pre) > code[class*="language-"],
65 | pre[class*="language-"] {
66 | background: #f5f2f0;
67 | }
68 |
69 | .temp pre[class*="language-"] {
70 | background: fade(#f5f2f0, 80%);
71 | }
72 |
73 | /* Inline code */
74 | :not(pre) > code[class*="language-"] {
75 | padding: .1em;
76 | border-radius: .3em;
77 | }
78 |
79 | .token.comment,
80 | .token.prolog,
81 | .token.doctype,
82 | .token.cdata {
83 | color: slategray;
84 | }
85 |
86 | .token.punctuation {
87 | color: #999;
88 | }
89 |
90 | .namespace {
91 | opacity: .7;
92 | }
93 |
94 | .token.property,
95 | .token.tag,
96 | .token.boolean,
97 | .token.number,
98 | .token.constant,
99 | .token.symbol {
100 | color: #905;
101 | }
102 |
103 | .token.selector,
104 | .token.attr-name,
105 | .token.string,
106 | .token.builtin {
107 | color: #690;
108 | }
109 |
110 | .token.operator,
111 | .token.entity,
112 | .token.url,
113 | .language-css .token.string,
114 | .style .token.string,
115 | .token.variable {
116 | color: #a67f59;
117 | // background: hsla(0,0%,100%,.5);
118 | }
119 |
120 | .token.atrule,
121 | .token.attr-value,
122 | .token.keyword {
123 | color: #07a;
124 | }
125 |
126 | .token.function {
127 | color: #DD4A68;
128 | }
129 |
130 | .token.regex,
131 | .token.important {
132 | color: #e90;
133 | }
134 |
135 | .token.important {
136 | font-weight: bold;
137 | }
138 |
139 | .token.entity {
140 | cursor: help;
141 | }
142 |
143 |
--------------------------------------------------------------------------------
/resources/less/theme.less:
--------------------------------------------------------------------------------
1 | // deck.js theme
2 | @import "vendor-prefixes.less";
3 | // @import "fonts.less"; // separated for offline version
4 | @import "layout.less";
5 |
6 | @import "prism/prism-default.less";
7 | // @import "prism/prism-base16-eighties.dark.less";
--------------------------------------------------------------------------------
/resources/prism.js:
--------------------------------------------------------------------------------
1 | /* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+python */
2 | self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{};var Prism=function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=self.Prism={util:{encode:function(e){return e instanceof n?new n(e.type,t.util.encode(e.content)):"Array"===t.util.type(e)?e.map(t.util.encode):e.replace(/&/g,"&").replace(/e.length)break e;if(!(f instanceof r)){l.lastIndex=0;var h=l.exec(f);if(h){c&&(g=h[1].length);var d=h.index-1+g,h=h[0].slice(g),p=h.length,m=d+p,v=f.slice(0,d+1),y=f.slice(m+1),k=[u,1];v&&k.push(v);var b=new r(o,s?t.tokenize(h,s):h);k.push(b),y&&k.push(y),Array.prototype.splice.apply(a,k)}}}}return a},hooks:{all:{},add:function(e,n){var r=t.hooks.all;r[e]=r[e]||[],r[e].push(n)},run:function(e,n){var r=t.hooks.all[e];if(r&&r.length)for(var a,i=0;a=r[i++];)a(n)}}},n=t.Token=function(e,t){this.type=e,this.content=t};if(n.stringify=function(e,r,a){if("string"==typeof e)return e;if("[object Array]"==Object.prototype.toString.call(e))return e.map(function(t){return n.stringify(t,r,e)}).join("");var i={type:e.type,content:n.stringify(e.content,r,a),tag:"span",classes:["token",e.type],attributes:{},language:r,parent:a};"comment"==i.type&&(i.attributes.spellcheck="true"),t.hooks.run("wrap",i);var o="";for(var l in i.attributes)o+=l+'="'+(i.attributes[l]||"")+'"';return"<"+i.tag+' class="'+i.classes.join(" ")+'" '+o+">"+i.content+""+i.tag+">"},!self.document)return self.addEventListener?(self.addEventListener("message",function(e){var n=JSON.parse(e.data),r=n.language,a=n.code;self.postMessage(JSON.stringify(t.tokenize(a,t.languages[r]))),self.close()},!1),self.Prism):self.Prism;var r=document.getElementsByTagName("script");return r=r[r.length-1],r&&(t.filename=r.src,document.addEventListener&&!r.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)),self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism);;
3 | Prism.languages.markup={comment://g,prolog:/<\?.+?\?>/,doctype://,cdata://i,tag:{pattern:/<\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|[^\s'">=]+))?\s*)*\/?>/gi,inside:{tag:{pattern:/^<\/?[\w:-]+/i,inside:{punctuation:/^<\/?/,namespace:/^[\w-]+?:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/gi,inside:{punctuation:/=|>|"/g}},punctuation:/\/?>/g,"attr-name":{pattern:/[\w:-]+/g,inside:{namespace:/^[\w-]+?:/}}}},entity:/\?[\da-z]{1,8};/gi},Prism.hooks.add("wrap",function(t){"entity"===t.type&&(t.attributes.title=t.content.replace(/&/,"&"))});;
4 | Prism.languages.css={comment:/\/\*[\w\W]*?\*\//g,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*{))/gi,inside:{punctuation:/[;:]/g}},url:/url\((["']?).*?\1\)/gi,selector:/[^\{\}\s][^\{\};]*(?=\s*\{)/g,property:/(\b|\B)[\w-]+(?=\s*:)/gi,string:/("|')(\\?.)*?\1/g,important:/\B!important\b/gi,punctuation:/[\{\};:]/g,"function":/[-a-z0-9]+(?=\()/gi},Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{style:{pattern:/