Vortrag für GIT angefangen.

This commit is contained in:
Tim Schumacher 2012-09-27 22:34:43 +02:00
parent 61165635cd
commit 40e34e4a91
60 changed files with 8603 additions and 0 deletions

99
git/boilerplate.html Normal file
View file

@ -0,0 +1,99 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=1024, user-scalable=no">
<title>Your deck.js Presentation</title>
<!-- Required stylesheet -->
<link rel="stylesheet" href="core/deck.core.css">
<!-- Extension CSS files go here. Remove or add as needed. -->
<link rel="stylesheet" href="extensions/goto/deck.goto.css">
<link rel="stylesheet" href="extensions/menu/deck.menu.css">
<link rel="stylesheet" href="extensions/navigation/deck.navigation.css">
<link rel="stylesheet" href="extensions/status/deck.status.css">
<link rel="stylesheet" href="extensions/hash/deck.hash.css">
<link rel="stylesheet" href="extensions/scale/deck.scale.css">
<!-- Style theme. More available in /themes/style/ or create your own. -->
<link rel="stylesheet" href="themes/style/swiss.css">
<!-- Transition theme. More available in /themes/transition/ or create your own. -->
<link rel="stylesheet" href="themes/transition/horizontal-slide.css">
<!-- Required Modernizr file -->
<script src="modernizr.custom.js"></script>
</head>
<body class="deck-container">
<!-- Begin slides. Just make elements with a class of slide. -->
<header>
<h1>Dokumente schlau verwalten mit Git</h1>
</header>
<section class="slide">
<h1>Los gehts!</h1>
</section>
<section class="slide">
<h1>Content</h1>
</section>
<section class="slide">
<h1>Here</h1>
</section>
<!-- End slides. -->
<!-- Begin extension snippets. Add or remove as needed. -->
<!-- deck.navigation snippet -->
<a href="#" class="deck-prev-link" title="Previous">&#8592;</a>
<a href="#" class="deck-next-link" title="Next">&#8594;</a>
<!-- deck.status snippet -->
<p class="deck-status">
<span class="deck-status-current"></span>
/
<span class="deck-status-total"></span>
</p>
<!-- deck.goto snippet -->
<form action="." method="get" class="goto-form">
<label for="goto-slide">Go to slide:</label>
<input type="text" name="slidenum" id="goto-slide" list="goto-datalist">
<datalist id="goto-datalist"></datalist>
<input type="submit" value="Go">
</form>
<!-- deck.hash snippet -->
<a href="." title="Permalink to this slide" class="deck-permalink">#</a>
<!-- End extension snippets. -->
<!-- Required JS files. -->
<script src="jquery-1.7.2.min.js"></script>
<script src="core/deck.core.js"></script>
<!-- Extension JS files. Add or remove as needed. -->
<script src="../core/deck.core.js"></script>
<script src="../extensions/hash/deck.hash.js"></script>
<script src="../extensions/menu/deck.menu.js"></script>
<script src="../extensions/goto/deck.goto.js"></script>
<script src="../extensions/status/deck.status.js"></script>
<script src="../extensions/navigation/deck.navigation.js"></script>
<script src="../extensions/scale/deck.scale.js"></script>
<!-- Initialize the deck. You can put this in an external file if desired. -->
<script>
$(function() {
$.deck('.slide');
});
</script>
</body>
</html>

407
git/core/deck.core.css Normal file
View file

@ -0,0 +1,407 @@
html, body {
height: 100%;
padding: 0;
margin: 0;
}
body.deck-container {
overflow-y: auto;
position: static;
}
.deck-container {
position: relative;
min-height: 100%;
margin: 0 auto;
padding: 0 48px;
font-size: 16px;
line-height: 1.25;
overflow: hidden;
/* Resets and base styles from HTML5 Boilerplate */
/* End HTML5 Boilerplate adaptations */
}
.js .deck-container {
visibility: hidden;
}
.ready .deck-container {
visibility: visible;
}
.touch .deck-container {
-webkit-text-size-adjust: none;
-moz-text-size-adjust: none;
}
.deck-container div, .deck-container span, .deck-container object, .deck-container iframe,
.deck-container h1, .deck-container h2, .deck-container h3, .deck-container h4, .deck-container h5, .deck-container h6, .deck-container p, .deck-container blockquote, .deck-container pre,
.deck-container abbr, .deck-container address, .deck-container cite, .deck-container code, .deck-container del, .deck-container dfn, .deck-container em, .deck-container img, .deck-container ins, .deck-container kbd, .deck-container q, .deck-container samp,
.deck-container small, .deck-container strong, .deck-container sub, .deck-container sup, .deck-container var, .deck-container b, .deck-container i, .deck-container dl, .deck-container dt, .deck-container dd, .deck-container ol, .deck-container ul, .deck-container li,
.deck-container fieldset, .deck-container form, .deck-container label, .deck-container legend,
.deck-container table, .deck-container caption, .deck-container tbody, .deck-container tfoot, .deck-container thead, .deck-container tr, .deck-container th, .deck-container td,
.deck-container article, .deck-container aside, .deck-container canvas, .deck-container details, .deck-container figcaption, .deck-container figure,
.deck-container footer, .deck-container header, .deck-container hgroup, .deck-container menu, .deck-container nav, .deck-container section, .deck-container summary,
.deck-container time, .deck-container mark, .deck-container audio, .deck-container video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
.deck-container article, .deck-container aside, .deck-container details, .deck-container figcaption, .deck-container figure,
.deck-container footer, .deck-container header, .deck-container hgroup, .deck-container menu, .deck-container nav, .deck-container section {
display: block;
}
.deck-container blockquote, .deck-container q {
quotes: none;
}
.deck-container blockquote:before, .deck-container blockquote:after, .deck-container q:before, .deck-container q:after {
content: "";
content: none;
}
.deck-container ins {
background-color: #ff9;
color: #000;
text-decoration: none;
}
.deck-container mark {
background-color: #ff9;
color: #000;
font-style: italic;
font-weight: bold;
}
.deck-container del {
text-decoration: line-through;
}
.deck-container abbr[title], .deck-container dfn[title] {
border-bottom: 1px dotted;
cursor: help;
}
.deck-container table {
border-collapse: collapse;
border-spacing: 0;
}
.deck-container hr {
display: block;
height: 1px;
border: 0;
border-top: 1px solid #ccc;
margin: 1em 0;
padding: 0;
}
.deck-container input, .deck-container select {
vertical-align: middle;
}
.deck-container select, .deck-container input, .deck-container textarea, .deck-container button {
font: 99% sans-serif;
}
.deck-container pre, .deck-container code, .deck-container kbd, .deck-container samp {
font-family: monospace, sans-serif;
}
.deck-container a {
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.deck-container a:hover, .deck-container a:active {
outline: none;
}
.deck-container ul, .deck-container ol {
margin-left: 2em;
vertical-align: top;
}
.deck-container ol {
list-style-type: decimal;
}
.deck-container nav ul, .deck-container nav li {
margin: 0;
list-style: none;
list-style-image: none;
}
.deck-container small {
font-size: 85%;
}
.deck-container strong, .deck-container th {
font-weight: bold;
}
.deck-container td {
vertical-align: top;
}
.deck-container sub, .deck-container sup {
font-size: 75%;
line-height: 0;
position: relative;
}
.deck-container sup {
top: -0.5em;
}
.deck-container sub {
bottom: -0.25em;
}
.deck-container textarea {
overflow: auto;
}
.ie6 .deck-container legend, .ie7 .deck-container legend {
margin-left: -7px;
}
.deck-container input[type="radio"] {
vertical-align: text-bottom;
}
.deck-container input[type="checkbox"] {
vertical-align: bottom;
}
.ie7 .deck-container input[type="checkbox"] {
vertical-align: baseline;
}
.ie6 .deck-container input {
vertical-align: text-bottom;
}
.deck-container label, .deck-container input[type="button"], .deck-container input[type="submit"], .deck-container input[type="image"], .deck-container button {
cursor: pointer;
}
.deck-container button, .deck-container input, .deck-container select, .deck-container textarea {
margin: 0;
}
.deck-container input:invalid, .deck-container textarea:invalid {
border-radius: 1px;
-moz-box-shadow: 0px 0px 5px red;
-webkit-box-shadow: 0px 0px 5px red;
box-shadow: 0px 0px 5px red;
}
.deck-container input:invalid .no-boxshadow, .deck-container textarea:invalid .no-boxshadow {
background-color: #f0dddd;
}
.deck-container button {
width: auto;
overflow: visible;
}
.ie7 .deck-container img {
-ms-interpolation-mode: bicubic;
}
.deck-container, .deck-container select, .deck-container input, .deck-container textarea {
color: #444;
}
.deck-container a {
color: #607890;
}
.deck-container a:hover, .deck-container a:focus {
color: #036;
}
.deck-container a:link {
-webkit-tap-highlight-color: #fff;
}
.deck-container.deck-loading {
display: none;
}
.slide {
width: auto;
min-height: 100%;
position: relative;
}
.slide h1 {
font-size: 4.5em;
}
.slide h1, .slide .vcenter {
font-weight: bold;
text-align: center;
padding-top: 1em;
max-height: 100%;
}
.csstransforms .slide h1, .csstransforms .slide .vcenter {
padding: 0 48px;
position: absolute;
left: 0;
right: 0;
top: 50%;
-webkit-transform: translate(0, -50%);
-moz-transform: translate(0, -50%);
-ms-transform: translate(0, -50%);
-o-transform: translate(0, -50%);
transform: translate(0, -50%);
}
.slide .vcenter h1 {
position: relative;
top: auto;
padding: 0;
-webkit-transform: none;
-moz-transform: none;
-ms-transform: none;
-o-transform: none;
transform: none;
}
.slide h2 {
font-size: 2.25em;
font-weight: bold;
padding-top: .5em;
margin: 0 0 .66666em 0;
border-bottom: 3px solid #888;
}
.slide h3 {
font-size: 1.4375em;
font-weight: bold;
margin-bottom: .30435em;
}
.slide h4 {
font-size: 1.25em;
font-weight: bold;
margin-bottom: .25em;
}
.slide h5 {
font-size: 1.125em;
font-weight: bold;
margin-bottom: .2222em;
}
.slide h6 {
font-size: 1em;
font-weight: bold;
}
.slide img, .slide iframe, .slide video {
display: block;
max-width: 100%;
}
.slide video, .slide iframe, .slide img {
display: block;
margin: 0 auto;
}
.slide p, .slide blockquote, .slide iframe, .slide img, .slide ul, .slide ol, .slide pre, .slide video {
margin-bottom: 1em;
}
.slide pre {
white-space: pre;
white-space: pre-wrap;
word-wrap: break-word;
padding: 1em;
border: 1px solid #888;
}
.slide em {
font-style: italic;
}
.slide li {
padding: .25em 0;
vertical-align: middle;
}
.deck-before, .deck-previous, .deck-next, .deck-after {
position: absolute;
left: -999em;
top: -999em;
}
.deck-current {
z-index: 2;
}
.slide .slide {
visibility: hidden;
position: static;
min-height: 0;
}
.deck-child-current {
position: static;
z-index: 2;
}
.deck-child-current .slide {
visibility: hidden;
}
.deck-child-current .deck-previous, .deck-child-current .deck-before, .deck-child-current .deck-current {
visibility: visible;
}
@media screen and (max-device-width: 480px) {
/* html { -webkit-text-size-adjust:none; -ms-text-size-adjust:none; } */
}
@media print {
* {
background: transparent !important;
color: black !important;
text-shadow: none !important;
filter: none !important;
-ms-filter: none !important;
-webkit-box-reflect: none !important;
-moz-box-reflect: none !important;
-webkit-box-shadow: none !important;
-moz-box-shadow: none !important;
box-shadow: none !important;
}
* :before, * :after {
display: none !important;
}
a, a:visited {
color: #444 !important;
text-decoration: underline;
}
a[href]:after {
content: " (" attr(href) ")";
}
abbr[title]:after {
content: " (" attr(title) ")";
}
.ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after {
content: "";
}
pre, blockquote {
border: 1px solid #999;
page-break-inside: avoid;
}
thead {
display: table-header-group;
}
tr, img {
page-break-inside: avoid;
}
@page {
margin: 0.5cm;
}
p, h2, h3 {
orphans: 3;
widows: 3;
}
h2, h3 {
page-break-after: avoid;
}
.slide {
position: static !important;
visibility: visible !important;
display: block !important;
-webkit-transform: none !important;
-moz-transform: none !important;
-o-transform: none !important;
-ms-transform: none !important;
transform: none !important;
opacity: 1 !important;
}
h1, .vcenter {
-webkit-transform: none !important;
-moz-transform: none !important;
-o-transform: none !important;
-ms-transform: none !important;
transform: none !important;
padding: 0 !important;
position: static !important;
}
.deck-container > .slide {
page-break-after: always;
}
.deck-container {
width: 100% !important;
height: auto !important;
padding: 0 !important;
display: block !important;
}
script {
display: none;
}
}

498
git/core/deck.core.js Normal file
View file

@ -0,0 +1,498 @@
/*!
Deck JS - deck.core
Copyright (c) 2011 Caleb Troughton
Dual licensed under the MIT license and GPL license.
https://github.com/imakewebthings/deck.js/blob/master/MIT-license.txt
https://github.com/imakewebthings/deck.js/blob/master/GPL-license.txt
*/
/*
The deck.core module provides all the basic functionality for creating and
moving through a deck. It does so by applying classes to indicate the state of
the deck and its slides, allowing CSS to take care of the visual representation
of each state. It also provides methods for navigating the deck and inspecting
its state, as well as basic key bindings for going to the next and previous
slides. More functionality is provided by wholly separate extension modules
that use the API provided by core.
*/
(function($, deck, document, undefined) {
var slides, // Array of all the uh, slides...
current, // Array index of the current slide
$container, // Keeping this cached
events = {
/*
This event fires whenever the current slide changes, whether by way of
next, prev, or go. The callback function is passed two parameters, from
and to, equal to the indices of the old slide and the new slide
respectively. If preventDefault is called on the event within this handler
the slide change does not occur.
$(document).bind('deck.change', function(event, from, to) {
alert('Moving from slide ' + from + ' to ' + to);
});
*/
change: 'deck.change',
/*
This event fires at the beginning of deck initialization, after the options
are set but before the slides array is created. This event makes a good hook
for preprocessing extensions looking to modify the deck.
*/
beforeInitialize: 'deck.beforeInit',
/*
This event fires at the end of deck initialization. Extensions should
implement any code that relies on user extensible options (key bindings,
element selectors, classes) within a handler for this event. Native
events associated with Deck JS should be scoped under a .deck event
namespace, as with the example below:
var $d = $(document);
$.deck.defaults.keys.myExtensionKeycode = 70; // 'h'
$d.bind('deck.init', function() {
$d.bind('keydown.deck', function(event) {
if (event.which === $.deck.getOptions().keys.myExtensionKeycode) {
// Rock out
}
});
});
*/
initialize: 'deck.init'
},
options = {},
$d = $(document),
/*
Internal function. Updates slide and container classes based on which
slide is the current slide.
*/
updateStates = function() {
var oc = options.classes,
osc = options.selectors.container,
old = $container.data('onSlide'),
$all = $();
// Container state
$container.removeClass(oc.onPrefix + old)
.addClass(oc.onPrefix + current)
.data('onSlide', current);
// Remove and re-add child-current classes for nesting
$('.' + oc.current).parentsUntil(osc).removeClass(oc.childCurrent);
slides[current].parentsUntil(osc).addClass(oc.childCurrent);
// Remove previous states
$.each(slides, function(i, el) {
$all = $all.add(el);
});
$all.removeClass([
oc.before,
oc.previous,
oc.current,
oc.next,
oc.after
].join(" "));
// Add new states back in
slides[current].addClass(oc.current);
if (current > 0) {
slides[current-1].addClass(oc.previous);
}
if (current + 1 < slides.length) {
slides[current+1].addClass(oc.next);
}
if (current > 1) {
$.each(slides.slice(0, current - 1), function(i, el) {
el.addClass(oc.before);
});
}
if (current + 2 < slides.length) {
$.each(slides.slice(current+2), function(i, el) {
el.addClass(oc.after);
});
}
},
/* Methods exposed in the jQuery.deck namespace */
methods = {
/*
jQuery.deck(selector, options)
selector: string | jQuery | array
options: object, optional
Initializes the deck, using each element matched by selector as a slide.
May also be passed an array of string selectors or jQuery objects, in
which case each selector in the array is considered a slide. The second
parameter is an optional options object which will extend the default
values.
$.deck('.slide');
or
$.deck([
'#first-slide',
'#second-slide',
'#etc'
]);
*/
init: function(elements, opts) {
var startTouch,
tolerance,
esp = function(e) {
e.stopPropagation();
};
options = $.extend(true, {}, $[deck].defaults, opts);
slides = [];
current = 0;
$container = $(options.selectors.container);
tolerance = options.touch.swipeTolerance;
// Pre init event for preprocessing hooks
$d.trigger(events.beforeInitialize);
// Hide the deck while states are being applied to kill transitions
$container.addClass(options.classes.loading);
// Fill slides array depending on parameter type
if ($.isArray(elements)) {
$.each(elements, function(i, e) {
slides.push($(e));
});
}
else {
$(elements).each(function(i, e) {
slides.push($(e));
});
}
/* Remove any previous bindings, and rebind key events */
$d.unbind('keydown.deck').bind('keydown.deck', function(e) {
if (e.which === options.keys.next || $.inArray(e.which, options.keys.next) > -1) {
methods.next();
e.preventDefault();
}
else if (e.which === options.keys.previous || $.inArray(e.which, options.keys.previous) > -1) {
methods.prev();
e.preventDefault();
}
})
/* Stop propagation of key events within editable elements */
.undelegate('input, textarea, select, button, meter, progress, [contentEditable]', 'keydown', esp)
.delegate('input, textarea, select, button, meter, progress, [contentEditable]', 'keydown', esp);
/* Bind touch events for swiping between slides on touch devices */
$container.unbind('touchstart.deck').bind('touchstart.deck', function(e) {
if (!startTouch) {
startTouch = $.extend({}, e.originalEvent.targetTouches[0]);
}
})
.unbind('touchmove.deck').bind('touchmove.deck', function(e) {
$.each(e.originalEvent.changedTouches, function(i, t) {
if (startTouch && t.identifier === startTouch.identifier) {
if (t.screenX - startTouch.screenX > tolerance || t.screenY - startTouch.screenY > tolerance) {
$[deck]('prev');
startTouch = undefined;
}
else if (t.screenX - startTouch.screenX < -1 * tolerance || t.screenY - startTouch.screenY < -1 * tolerance) {
$[deck]('next');
startTouch = undefined;
}
return false;
}
});
e.preventDefault();
})
.unbind('touchend.deck').bind('touchend.deck', function(t) {
$.each(t.originalEvent.changedTouches, function(i, t) {
if (startTouch && t.identifier === startTouch.identifier) {
startTouch = undefined;
}
});
})
.scrollLeft(0).scrollTop(0);
/*
Kick iframe videos, which dont like to redraw w/ transforms.
Remove this if Webkit ever fixes it.
*/
$.each(slides, function(i, $el) {
$el.unbind('webkitTransitionEnd.deck').bind('webkitTransitionEnd.deck',
function(event) {
if ($el.hasClass($[deck]('getOptions').classes.current)) {
var embeds = $(this).find('iframe').css('opacity', 0);
window.setTimeout(function() {
embeds.css('opacity', 1);
}, 100);
}
});
});
if (slides.length) {
updateStates();
}
// Show deck again now that slides are in place
$container.removeClass(options.classes.loading);
$d.trigger(events.initialize);
},
/*
jQuery.deck('go', index)
index: integer | string
Moves to the slide at the specified index if index is a number. Index is
0-based, so $.deck('go', 0); will move to the first slide. If index is a
string this will move to the slide with the specified id. If index is out
of bounds or doesn't match a slide id the call is ignored.
*/
go: function(index) {
var e = $.Event(events.change),
ndx;
/* Number index, easy. */
if (typeof index === 'number' && index >= 0 && index < slides.length) {
ndx = index;
}
/* Id string index, search for it and set integer index */
else if (typeof index === 'string') {
$.each(slides, function(i, $slide) {
if ($slide.attr('id') === index) {
ndx = i;
return false;
}
});
};
/* Out of bounds, id doesn't exist, illegal input, eject */
if (typeof ndx === 'undefined') return;
$d.trigger(e, [current, ndx]);
if (e.isDefaultPrevented()) {
/* Trigger the event again and undo the damage done by extensions. */
$d.trigger(events.change, [ndx, current]);
}
else {
current = ndx;
updateStates();
}
},
/*
jQuery.deck('next')
Moves to the next slide. If the last slide is already active, the call
is ignored.
*/
next: function() {
methods.go(current+1);
},
/*
jQuery.deck('prev')
Moves to the previous slide. If the first slide is already active, the
call is ignored.
*/
prev: function() {
methods.go(current-1);
},
/*
jQuery.deck('getSlide', index)
index: integer, optional
Returns a jQuery object containing the slide at index. If index is not
specified, the current slide is returned.
*/
getSlide: function(index) {
var i = typeof index !== 'undefined' ? index : current;
if (typeof i != 'number' || i < 0 || i >= slides.length) return null;
return slides[i];
},
/*
jQuery.deck('getSlides')
Returns all slides as an array of jQuery objects.
*/
getSlides: function() {
return slides;
},
/*
jQuery.deck('getContainer')
Returns a jQuery object containing the deck container as defined by the
container option.
*/
getContainer: function() {
return $container;
},
/*
jQuery.deck('getOptions')
Returns the options object for the deck, including any overrides that
were defined at initialization.
*/
getOptions: function() {
return options;
},
/*
jQuery.deck('extend', name, method)
name: string
method: function
Adds method to the deck namespace with the key of name. This doesnt
give access to any private member data public methods must still be
used within method but lets extension authors piggyback on the deck
namespace rather than pollute jQuery.
$.deck('extend', 'alert', function(msg) {
alert(msg);
});
// Alerts 'boom'
$.deck('alert', 'boom');
*/
extend: function(name, method) {
methods[name] = method;
}
};
/* jQuery extension */
$[deck] = function(method, arg) {
if (methods[method]) {
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
}
else {
return methods.init(method, arg);
}
};
/*
The default settings object for a deck. All deck extensions should extend
this object to add defaults for any of their options.
options.classes.after
This class is added to all slides that appear after the 'next' slide.
options.classes.before
This class is added to all slides that appear before the 'previous'
slide.
options.classes.childCurrent
This class is added to all elements in the DOM tree between the
'current' slide and the deck container. For standard slides, this is
mostly seen and used for nested slides.
options.classes.current
This class is added to the current slide.
options.classes.loading
This class is applied to the deck container during loading phases and is
primarily used as a way to short circuit transitions between states
where such transitions are distracting or unwanted. For example, this
class is applied during deck initialization and then removed to prevent
all the slides from appearing stacked and transitioning into place
on load.
options.classes.next
This class is added to the slide immediately following the 'current'
slide.
options.classes.onPrefix
This prefix, concatenated with the current slide index, is added to the
deck container as you change slides.
options.classes.previous
This class is added to the slide immediately preceding the 'current'
slide.
options.selectors.container
Elements matched by this CSS selector will be considered the deck
container. The deck container is used to scope certain states of the
deck, as with the onPrefix option, or with extensions such as deck.goto
and deck.menu.
options.keys.next
The numeric keycode used to go to the next slide.
options.keys.previous
The numeric keycode used to go to the previous slide.
options.touch.swipeTolerance
The number of pixels the users finger must travel to produce a swipe
gesture.
*/
$[deck].defaults = {
classes: {
after: 'deck-after',
before: 'deck-before',
childCurrent: 'deck-child-current',
current: 'deck-current',
loading: 'deck-loading',
next: 'deck-next',
onPrefix: 'on-slide-',
previous: 'deck-previous'
},
selectors: {
container: '.deck-container'
},
keys: {
// enter, space, page down, right arrow, down arrow,
next: [13, 32, 34, 39, 40],
// backspace, page up, left arrow, up arrow
previous: [8, 33, 37, 38]
},
touch: {
swipeTolerance: 60
}
};
$d.ready(function() {
$('html').addClass('ready');
});
/*
FF + Transforms + Flash video don't get along...
Firefox will reload and start playing certain videos after a
transform. Blanking the src when a previously shown slide goes out
of view prevents this.
*/
$d.bind('deck.change', function(e, from, to) {
var oldFrames = $[deck]('getSlide', from).find('iframe'),
newFrames = $[deck]('getSlide', to).find('iframe');
oldFrames.each(function() {
var $this = $(this),
curSrc = $this.attr('src');
if(curSrc) {
$this.data('deck-src', curSrc).attr('src', '');
}
});
newFrames.each(function() {
var $this = $(this),
originalSrc = $this.data('deck-src');
if (originalSrc) {
$this.attr('src', originalSrc);
}
});
});
})(jQuery, 'deck', document);

450
git/core/deck.core.scss Executable file
View file

@ -0,0 +1,450 @@
html, body {
height:100%;
padding:0;
margin:0;
}
body.deck-container {
overflow-y:auto;
position:static;
}
.deck-container {
position:relative;
min-height:100%;
margin:0 auto;
padding:0 48px;
font-size:16px;
line-height:1.25;
overflow:hidden;
.js & {
visibility:hidden;
}
.ready & {
visibility:visible;
}
.touch & {
-webkit-text-size-adjust:none;
-moz-text-size-adjust:none;
}
/* Resets and base styles from HTML5 Boilerplate */
div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp,
small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, figcaption, figure,
footer, header, hgroup, menu, nav, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
blockquote, q {
quotes:none;
&:before, &:after {
content:"";
content:none;
}
}
ins {
background-color:#ff9;
color:#000;
text-decoration:none;
}
mark {
background-color:#ff9;
color:#000;
font-style:italic;
font-weight:bold;
}
del {
text-decoration:line-through;
}
abbr[title], dfn[title] {
border-bottom:1px dotted;
cursor:help;
}
table {
border-collapse:collapse;
border-spacing:0;
}
hr {
display:block;
height:1px;
border:0;
border-top:1px solid #ccc;
margin:1em 0;
padding:0;
}
input, select {
vertical-align:middle;
}
select, input, textarea, button {
font:99% sans-serif;
}
pre, code, kbd, samp {
font-family:monospace, sans-serif;
}
a {
-webkit-tap-highlight-color:rgba(0,0,0,0);
&:hover, &:active {
outline:none;
}
}
ul, ol {
margin-left:2em;
vertical-align:top;
}
ol {
list-style-type:decimal;
}
nav {
ul, li {
margin:0;
list-style:none;
list-style-image:none;
}
}
small {
font-size:85%;
}
strong, th {
font-weight:bold;
}
td {
vertical-align:top;
}
sub, sup {
font-size:75%;
line-height:0;
position:relative;
}
sup {
top:-0.5em;
}
sub { bottom: -0.25em; }
textarea {
overflow:auto;
}
legend {
.ie6 &, .ie7 & {
margin-left:-7px;
}
}
input[type="radio"] {
vertical-align:text-bottom;
}
input[type="checkbox"] {
vertical-align:bottom;
}
.ie7 & input[type="checkbox"] {
vertical-align:baseline;
}
.ie6 & input {
vertical-align:text-bottom;
}
label, input[type="button"], input[type="submit"], input[type="image"], button {
cursor:pointer;
}
button, input, select, textarea {
margin: 0;
}
input, textarea {
&:invalid {
border-radius:1px;
-moz-box-shadow:0px 0px 5px red;
-webkit-box-shadow:0px 0px 5px red;
box-shadow: 0px 0px 5px red;
.no-boxshadow {
background-color: #f0dddd;
}
}
}
button {
width:auto;
overflow:visible;
}
.ie7 & img {
-ms-interpolation-mode: bicubic; }
&, select, input, textarea {
color:#444;
}
a {
color:#607890;
&:hover, &:focus {
color:#036;
}
&:link {
-webkit-tap-highlight-color: #fff;
}
}
/* End HTML5 Boilerplate adaptations */
&.deck-loading {
display:none;
}
}
.slide {
width:auto;
min-height:100%;
position:relative;
h1 {
font-size:4.5em;
}
h1, .vcenter {
font-weight:bold;
text-align:center;
padding-top:1em;
max-height:100%;
.csstransforms & {
padding:0 48px;
position:absolute;
left:0;
right:0;
top:50%;
-webkit-transform:translate(0, -50%);
-moz-transform:translate(0, -50%);
-ms-transform:translate(0, -50%);
-o-transform:translate(0, -50%);
transform:translate(0, -50%);
}
}
.vcenter h1 {
position:relative;
top:auto;
padding:0;
-webkit-transform:none;
-moz-transform:none;
-ms-transform:none;
-o-transform:none;
transform:none;
}
h2 {
font-size:2.25em;
font-weight:bold;
padding-top:.5em;
margin:0 0 .66666em 0;
border-bottom:3px solid #888;
}
h3 {
font-size:1.4375em;
font-weight:bold;
margin-bottom:.30435em;
}
h4 {
font-size:1.25em;
font-weight:bold;
margin-bottom:.25em;
}
h5 {
font-size:1.125em;
font-weight:bold;
margin-bottom:.2222em;
}
h6 {
font-size:1em;
font-weight:bold;
}
img, iframe, video {
display:block;
max-width:100%;
}
video, iframe, img {
display:block;
margin:0 auto;
}
p, blockquote, iframe, img, ul, ol, pre, video {
margin-bottom:1em;
}
pre {
white-space:pre;
white-space:pre-wrap;
word-wrap:break-word;
padding: 1em;
border:1px solid #888;
}
em {
font-style:italic;
}
li {
padding:.25em 0;
vertical-align:middle;
}
}
.deck-before, .deck-previous, .deck-next, .deck-after {
position:absolute;
left:-999em;
top:-999em;
}
.deck-current {
z-index:2;
}
.slide .slide {
visibility:hidden;
position:static;
min-height:0;
}
.deck-child-current {
position:static;
z-index:2;
.slide {
visibility:hidden;
}
.deck-previous, .deck-before, .deck-current {
visibility:visible;
}
}
@media all and (orientation:portrait) {
}
@media all and (orientation:landscape) {
}
@media screen and (max-device-width: 480px) {
/* html { -webkit-text-size-adjust:none; -ms-text-size-adjust:none; } */
}
@media print {
* {
background: transparent !important;
color: black !important;
text-shadow: none !important;
filter:none !important;
-ms-filter: none !important;
-webkit-box-reflect:none !important;
-moz-box-reflect:none !important;
-webkit-box-shadow:none !important;
-moz-box-shadow:none !important;
box-shadow:none !important;
:before, :after {
display:none !important;
}
}
a, a:visited { color: #444 !important; text-decoration: underline; }
a[href]:after { content: " (" attr(href) ")"; }
abbr[title]:after { content: " (" attr(title) ")"; }
.ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; }
pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
thead { display: table-header-group; }
tr, img { page-break-inside: avoid; }
@page { margin: 0.5cm; }
p, h2, h3 { orphans: 3; widows: 3; }
h2, h3{ page-break-after: avoid; }
.slide {
position:static !important;
visibility:visible !important;
display:block !important;
-webkit-transform:none !important;
-moz-transform:none !important;
-o-transform:none !important;
-ms-transform:none !important;
transform:none !important;
opacity:1 !important;
}
h1, .vcenter {
-webkit-transform:none !important;
-moz-transform:none !important;
-o-transform:none !important;
-ms-transform:none !important;
transform:none !important;
padding:0 !important;
position:static !important;
}
.deck-container > .slide {
page-break-after: always;
}
.deck-container {
width:100% !important;
height:auto !important;
padding:0 !important;
display:block !important;
}
script {
display:none;
}
}

View file

@ -0,0 +1,41 @@
.deck-container .goto-form {
position: absolute;
z-index: 3;
bottom: 10px;
left: 50%;
height: 1.75em;
margin: 0 0 0 -9.125em;
line-height: 1.75em;
padding: 0.625em;
display: none;
background: #ccc;
overflow: hidden;
}
.borderradius .deck-container .goto-form {
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
}
.deck-container .goto-form label {
font-weight: bold;
}
.deck-container .goto-form label, .deck-container .goto-form input {
display: inline-block;
font-family: inherit;
}
.deck-goto .goto-form {
display: block;
}
#goto-slide {
width: 8.375em;
margin: 0 0.625em;
height: 1.4375em;
}
@media print {
.goto-form, #goto-slide {
display: none !important;
}
}

View file

@ -0,0 +1,7 @@
<!-- Place the following snippet at the bottom of the deck container. -->
<form action="." method="get" class="goto-form">
<label for="goto-slide">Go to slide:</label>
<input type="text" name="slidenum" id="goto-slide" list="goto-datalist">
<datalist id="goto-datalist"></datalist>
<input type="submit" value="Go">
</form>

View file

@ -0,0 +1,170 @@
/*!
Deck JS - deck.goto
Copyright (c) 2011 Caleb Troughton
Dual licensed under the MIT license and GPL license.
https://github.com/imakewebthings/deck.js/blob/master/MIT-license.txt
https://github.com/imakewebthings/deck.js/blob/master/GPL-license.txt
*/
/*
This module adds the necessary methods and key bindings to show and hide a form
for jumping to any slide number/id in the deck (and processes that form
accordingly). The form-showing state is indicated by the presence of a class on
the deck container.
*/
(function($, deck, undefined) {
var $d = $(document);
/*
Extends defaults/options.
options.classes.goto
This class is added to the deck container when showing the Go To Slide
form.
options.selectors.gotoDatalist
The element that matches this selector is the datalist element that will
be populated with options for each of the slide ids. In browsers that
support the datalist element, this provides a drop list of slide ids to
aid the user in selecting a slide.
options.selectors.gotoForm
The element that matches this selector is the form that is submitted
when a user hits enter after typing a slide number/id in the gotoInput
element.
options.selectors.gotoInput
The element that matches this selector is the text input field for
entering a slide number/id in the Go To Slide form.
options.keys.goto
The numeric keycode used to show the Go To Slide form.
options.countNested
If false, only top level slides will be counted when entering a
slide number.
*/
$.extend(true, $[deck].defaults, {
classes: {
goto: 'deck-goto'
},
selectors: {
gotoDatalist: '#goto-datalist',
gotoForm: '.goto-form',
gotoInput: '#goto-slide'
},
keys: {
goto: 71 // g
},
countNested: true
});
/*
jQuery.deck('showGoTo')
Shows the Go To Slide form by adding the class specified by the goto class
option to the deck container.
*/
$[deck]('extend', 'showGoTo', function() {
$[deck]('getContainer').addClass($[deck]('getOptions').classes.goto);
$($[deck]('getOptions').selectors.gotoInput).focus();
});
/*
jQuery.deck('hideGoTo')
Hides the Go To Slide form by removing the class specified by the goto class
option from the deck container.
*/
$[deck]('extend', 'hideGoTo', function() {
$($[deck]('getOptions').selectors.gotoInput).blur();
$[deck]('getContainer').removeClass($[deck]('getOptions').classes.goto);
});
/*
jQuery.deck('toggleGoTo')
Toggles between showing and hiding the Go To Slide form.
*/
$[deck]('extend', 'toggleGoTo', function() {
$[deck]($[deck]('getContainer').hasClass($[deck]('getOptions').classes.goto) ? 'hideGoTo' : 'showGoTo');
});
$d.bind('deck.init', function() {
var opts = $[deck]('getOptions'),
$datalist = $(opts.selectors.gotoDatalist),
slideTest = $.map([
opts.classes.before,
opts.classes.previous,
opts.classes.current,
opts.classes.next,
opts.classes.after
], function(el, i) {
return '.' + el;
}).join(', '),
rootCounter = 1;
// Bind key events
$d.unbind('keydown.deckgoto').bind('keydown.deckgoto', function(e) {
var key = $[deck]('getOptions').keys.goto;
if (e.which === key || $.inArray(e.which, key) > -1) {
e.preventDefault();
$[deck]('toggleGoTo');
}
});
/* Populate datalist and work out countNested*/
$.each($[deck]('getSlides'), function(i, $slide) {
var id = $slide.attr('id'),
$parentSlides = $slide.parentsUntil(opts.selectors.container, slideTest);
if (id) {
$datalist.append('<option value="' + id + '">');
}
if ($parentSlides.length) {
$slide.removeData('rootIndex');
}
else if (!opts.countNested) {
$slide.data('rootIndex', rootCounter);
++rootCounter;
}
});
// Process form submittal, go to the slide entered
$(opts.selectors.gotoForm)
.unbind('submit.deckgoto')
.bind('submit.deckgoto', function(e) {
var $field = $($[deck]('getOptions').selectors.gotoInput),
ndx = parseInt($field.val(), 10);
if (!$[deck]('getOptions').countNested) {
if (ndx >= rootCounter) return false;
$.each($[deck]('getSlides'), function(i, $slide) {
if ($slide.data('rootIndex') === ndx) {
ndx = i + 1;
return false;
}
});
}
$[deck]('go', isNaN(ndx) ? $field.val() : ndx - 1);
$[deck]('hideGoTo');
$field.val('');
e.preventDefault();
});
// Dont let keys in the input trigger deck actions
$(opts.selectors.gotoInput)
.unbind('keydown.deckgoto')
.bind('keydown.deckgoto', function(e) {
e.stopPropagation();
});
});
})(jQuery, 'deck');

View file

@ -0,0 +1,46 @@
.deck-container {
.goto-form {
position:absolute;
z-index:3;
bottom:10px;
left:50%;
height:1.75em;
margin:0 0 0 -9.125em;
line-height:1.75em;
padding:0.625em;
display:none;
background:#ccc;
overflow:hidden;
.borderradius & {
-webkit-border-radius:10px;
-moz-border-radius:10px;
border-radius:10px;
}
label {
font-weight:bold;
}
label, input {
display:inline-block;
font-family:inherit;
}
}
}
.deck-goto .goto-form {
display:block;
}
#goto-slide {
width:8.375em;
margin:0 0.625em;
height:1.4375em;
}
@media print {
.goto-form, #goto-slide {
display:none !important;
}
}

View file

@ -0,0 +1,13 @@
.deck-container .deck-permalink {
display: none;
position: absolute;
z-index: 4;
bottom: 30px;
right: 0;
width: 48px;
text-align: center;
}
.no-history .deck-container:hover .deck-permalink {
display: block;
}

View file

@ -0,0 +1,2 @@
<!-- Place the following snippet at the bottom of the deck container. -->
<a href="." title="Permalink to this slide" class="deck-permalink">#</a>

View file

@ -0,0 +1,142 @@
/*!
Deck JS - deck.hash
Copyright (c) 2011 Caleb Troughton
Dual licensed under the MIT license and GPL license.
https://github.com/imakewebthings/deck.js/blob/master/MIT-license.txt
https://github.com/imakewebthings/deck.js/blob/master/GPL-license.txt
*/
/*
This module adds deep linking to individual slides, enables internal links
to slides within decks, and updates the address bar with the hash as the user
moves through the deck. A permalink anchor is also updated. Standard themes
hide this link in browsers that support the History API, and show it for
those that do not. Slides that do not have an id are assigned one according to
the hashPrefix option. In addition to the on-slide container state class
kept by core, this module adds an on-slide state class that uses the id of each
slide.
*/
(function ($, deck, window, undefined) {
var $d = $(document),
$window = $(window),
/* Collection of internal fragment links in the deck */
$internals,
/*
Internal only function. Given a string, extracts the id from the hash,
matches it to the appropriate slide, and navigates there.
*/
goByHash = function(str) {
var id = str.substr(str.indexOf("#") + 1),
slides = $[deck]('getSlides');
$.each(slides, function(i, $el) {
if ($el.attr('id') === id) {
$[deck]('go', i);
return false;
}
});
// If we don't set these to 0 the container scrolls due to hashchange
$[deck]('getContainer').scrollLeft(0).scrollTop(0);
};
/*
Extends defaults/options.
options.selectors.hashLink
The element matching this selector has its href attribute updated to
the hash of the current slide as the user navigates through the deck.
options.hashPrefix
Every slide that does not have an id is assigned one at initialization.
Assigned ids take the form of hashPrefix + slideIndex, e.g., slide-0,
slide-12, etc.
options.preventFragmentScroll
When deep linking to a hash of a nested slide, this scrolls the deck
container to the top, undoing the natural browser behavior of scrolling
to the document fragment on load.
*/
$.extend(true, $[deck].defaults, {
selectors: {
hashLink: '.deck-permalink'
},
hashPrefix: 'slide-',
preventFragmentScroll: true
});
$d.bind('deck.init', function() {
var opts = $[deck]('getOptions');
$internals = $(),
slides = $[deck]('getSlides');
$.each(slides, function(i, $el) {
var hash;
/* Hand out ids to the unfortunate slides born without them */
if (!$el.attr('id') || $el.data('deckAssignedId') === $el.attr('id')) {
$el.attr('id', opts.hashPrefix + i);
$el.data('deckAssignedId', opts.hashPrefix + i);
}
hash ='#' + $el.attr('id');
/* Deep link to slides on init */
if (hash === window.location.hash) {
$[deck]('go', i);
}
/* Add internal links to this slide */
$internals = $internals.add('a[href="' + hash + '"]');
});
if (!Modernizr.hashchange) {
/* Set up internal links using click for the poor browsers
without a hashchange event. */
$internals.unbind('click.deckhash').bind('click.deckhash', function(e) {
goByHash($(this).attr('href'));
});
}
/* Set up first id container state class */
if (slides.length) {
$[deck]('getContainer').addClass(opts.classes.onPrefix + $[deck]('getSlide').attr('id'));
};
})
/* Update permalink, address bar, and state class on a slide change */
.bind('deck.change', function(e, from, to) {
var hash = '#' + $[deck]('getSlide', to).attr('id'),
hashPath = window.location.href.replace(/#.*/, '') + hash,
opts = $[deck]('getOptions'),
osp = opts.classes.onPrefix,
$c = $[deck]('getContainer');
$c.removeClass(osp + $[deck]('getSlide', from).attr('id'));
$c.addClass(osp + $[deck]('getSlide', to).attr('id'));
$(opts.selectors.hashLink).attr('href', hashPath);
if (Modernizr.history) {
window.history.replaceState({}, "", hashPath);
}
});
/* Deals with internal links in modern browsers */
$window.bind('hashchange.deckhash', function(e) {
if (e.originalEvent && e.originalEvent.newURL) {
goByHash(e.originalEvent.newURL);
}
else {
goByHash(window.location.hash);
}
})
/* Prevent scrolling on deep links */
.bind('load', function() {
if ($[deck]('getOptions').preventFragmentScroll) {
$[deck]('getContainer').scrollLeft(0).scrollTop(0);
}
});
})(jQuery, 'deck', this);

View file

@ -0,0 +1,15 @@
.deck-container {
.deck-permalink {
display:none;
position:absolute;
z-index:4;
bottom:30px;
right:0;
width:48px;
text-align:center;
}
}
.no-history .deck-container:hover .deck-permalink {
display:block;
}

View file

@ -0,0 +1,47 @@
.deck-menu .slide {
background: #eee;
position: relative;
left: 0;
top: 0;
visibility: visible;
cursor: pointer;
}
.no-csstransforms .deck-menu > .slide {
float: left;
width: 22%;
height: 22%;
min-height: 0;
margin: 1%;
font-size: 0.22em;
overflow: hidden;
padding: 0 0.5%;
}
.csstransforms .deck-menu > .slide {
-webkit-transform: scale(0.22) !important;
-moz-transform: scale(0.22) !important;
-o-transform: scale(0.22) !important;
-ms-transform: scale(0.22) !important;
transform: scale(0.22) !important;
-webkit-transform-origin: 0 0;
-moz-transform-origin: 0 0;
-o-transform-origin: 0 0;
-ms-transform-origin: 0 0;
transform-origin: 0 0;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
width: 100%;
height: 100%;
overflow: hidden;
padding: 0 48px;
margin: 12px;
}
.deck-menu iframe, .deck-menu img, .deck-menu video {
max-width: 100%;
}
.deck-menu .deck-current, .no-touch .deck-menu .slide:hover {
background: #ddf;
}
.deck-menu.deck-container:hover .deck-prev-link, .deck-menu.deck-container:hover .deck-next-link {
display: none;
}

View file

@ -0,0 +1,187 @@
/*!
Deck JS - deck.menu
Copyright (c) 2011 Caleb Troughton
Dual licensed under the MIT license and GPL license.
https://github.com/imakewebthings/deck.js/blob/master/MIT-license.txt
https://github.com/imakewebthings/deck.js/blob/master/GPL-license.txt
*/
/*
This module adds the methods and key binding to show and hide a menu of all
slides in the deck. The deck menu state is indicated by the presence of a class
on the deck container.
*/
(function($, deck, undefined) {
var $d = $(document),
rootSlides; // Array of top level slides
/*
Extends defaults/options.
options.classes.menu
This class is added to the deck container when showing the slide menu.
options.keys.menu
The numeric keycode used to toggle between showing and hiding the slide
menu.
options.touch.doubletapWindow
Two consecutive touch events within this number of milliseconds will
be considered a double tap, and will toggle the menu on touch devices.
*/
$.extend(true, $[deck].defaults, {
classes: {
menu: 'deck-menu'
},
keys: {
menu: 77 // m
},
touch: {
doubletapWindow: 400
}
});
/*
jQuery.deck('showMenu')
Shows the slide menu by adding the class specified by the menu class option
to the deck container.
*/
$[deck]('extend', 'showMenu', function() {
var $c = $[deck]('getContainer'),
opts = $[deck]('getOptions');
if ($c.hasClass(opts.classes.menu)) return;
// Hide through loading class to short-circuit transitions (perf)
$c.addClass([opts.classes.loading, opts.classes.menu].join(' '));
/* Forced to do this in JS until CSS learns second-grade math. Save old
style value for restoration when menu is hidden. */
if (Modernizr.csstransforms) {
$.each(rootSlides, function(i, $slide) {
$slide.data('oldStyle', $slide.attr('style'));
$slide.css({
'position': 'absolute',
'left': ((i % 4) * 25) + '%',
'top': (Math.floor(i / 4) * 25) + '%'
});
});
}
// Need to ensure the loading class renders first, then remove
window.setTimeout(function() {
$c.removeClass(opts.classes.loading)
.scrollTop($[deck]('getSlide').offset().top);
}, 0);
});
/*
jQuery.deck('hideMenu')
Hides the slide menu by removing the class specified by the menu class
option from the deck container.
*/
$[deck]('extend', 'hideMenu', function() {
var $c = $[deck]('getContainer'),
opts = $[deck]('getOptions');
if (!$c.hasClass(opts.classes.menu)) return;
$c.removeClass(opts.classes.menu);
$c.addClass(opts.classes.loading);
/* Restore old style value */
if (Modernizr.csstransforms) {
$.each(rootSlides, function(i, $slide) {
var oldStyle = $slide.data('oldStyle');
$slide.attr('style', oldStyle ? oldStyle : '');
});
}
window.setTimeout(function() {
$c.removeClass(opts.classes.loading).scrollTop(0);
}, 0);
});
/*
jQuery.deck('toggleMenu')
Toggles between showing and hiding the slide menu.
*/
$[deck]('extend', 'toggleMenu', function() {
$[deck]('getContainer').hasClass($[deck]('getOptions').classes.menu) ?
$[deck]('hideMenu') : $[deck]('showMenu');
});
$d.bind('deck.init', function() {
var opts = $[deck]('getOptions'),
touchEndTime = 0,
currentSlide,
slideTest = $.map([
opts.classes.before,
opts.classes.previous,
opts.classes.current,
opts.classes.next,
opts.classes.after
], function(el, i) {
return '.' + el;
}).join(', ');
// Build top level slides array
rootSlides = [];
$.each($[deck]('getSlides'), function(i, $el) {
if (!$el.parentsUntil(opts.selectors.container, slideTest).length) {
rootSlides.push($el);
}
});
// Bind key events
$d.unbind('keydown.deckmenu').bind('keydown.deckmenu', function(e) {
if (e.which === opts.keys.menu || $.inArray(e.which, opts.keys.menu) > -1) {
$[deck]('toggleMenu');
e.preventDefault();
}
});
// Double tap to toggle slide menu for touch devices
$[deck]('getContainer').unbind('touchstart.deckmenu').bind('touchstart.deckmenu', function(e) {
currentSlide = $[deck]('getSlide');
})
.unbind('touchend.deckmenu').bind('touchend.deckmenu', function(e) {
var now = Date.now();
// Ignore this touch event if it caused a nav change (swipe)
if (currentSlide !== $[deck]('getSlide')) return;
if (now - touchEndTime < opts.touch.doubletapWindow) {
$[deck]('toggleMenu');
e.preventDefault();
}
touchEndTime = now;
});
// Selecting slides from the menu
$.each($[deck]('getSlides'), function(i, $s) {
$s.unbind('click.deckmenu').bind('click.deckmenu', function(e) {
if (!$[deck]('getContainer').hasClass(opts.classes.menu)) return;
$[deck]('go', i);
$[deck]('hideMenu');
e.stopPropagation();
e.preventDefault();
});
});
})
.bind('deck.change', function(e, from, to) {
var container = $[deck]('getContainer');
if (container.hasClass($[deck]('getOptions').classes.menu)) {
container.scrollTop($[deck]('getSlide', to).offset().top);
}
});
})(jQuery, 'deck');

View file

@ -0,0 +1,58 @@
.deck-menu {
.slide {
background:#eee;
position:relative;
left:0;
top:0;
visibility:visible;
cursor:pointer;
}
> .slide {
.no-csstransforms & {
float:left;
width:22%;
height:22%;
min-height:0;
margin:1%;
font-size:0.22em;
overflow:hidden;
padding:0 0.5%;
}
.csstransforms & {
-webkit-transform:scale(.22) !important;
-moz-transform:scale(.22) !important;
-o-transform:scale(.22) !important;
-ms-transform:scale(.22) !important;
transform:scale(.22) !important;
-webkit-transform-origin:0 0;
-moz-transform-origin:0 0;
-o-transform-origin:0 0;
-ms-transform-origin:0 0;
transform-origin:0 0;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
width:100%;
height:100%;
overflow:hidden;
padding:0 48px;
margin:12px;
}
}
iframe, img, video {
max-width:100%;
}
.deck-current, .no-touch & .slide:hover {
background:#ddf;
}
&.deck-container:hover {
.deck-prev-link, .deck-next-link {
display:none;
}
}
}

View file

@ -0,0 +1,43 @@
.deck-container .deck-prev-link, .deck-container .deck-next-link {
display: none;
position: absolute;
z-index: 3;
top: 50%;
width: 32px;
height: 32px;
margin-top: -16px;
font-size: 20px;
font-weight: bold;
line-height: 32px;
vertical-align: middle;
text-align: center;
text-decoration: none;
color: #fff;
background: #888;
}
.borderradius .deck-container .deck-prev-link, .borderradius .deck-container .deck-next-link {
-webkit-border-radius: 16px;
-moz-border-radius: 16px;
border-radius: 16px;
}
.deck-container .deck-prev-link:hover, .deck-container .deck-prev-link:focus, .deck-container .deck-prev-link:active, .deck-container .deck-prev-link:visited, .deck-container .deck-next-link:hover, .deck-container .deck-next-link:focus, .deck-container .deck-next-link:active, .deck-container .deck-next-link:visited {
color: #fff;
}
.deck-container .deck-prev-link {
left: 8px;
}
.deck-container .deck-next-link {
right: 8px;
}
.deck-container:hover .deck-prev-link, .deck-container:hover .deck-next-link {
display: block;
}
.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 {
display: none;
}
@media print {
.deck-prev-link, .deck-next-link {
display: none !important;
}
}

View file

@ -0,0 +1,3 @@
<!-- Place the following snippet at the bottom of the deck container. -->
<a href="#" class="deck-prev-link" title="Previous">&#8592;</a>
<a href="#" class="deck-next-link" title="Next">&#8594;</a>

View file

@ -0,0 +1,92 @@
/*!
Deck JS - deck.navigation
Copyright (c) 2011 Caleb Troughton
Dual licensed under the MIT license and GPL license.
https://github.com/imakewebthings/deck.js/blob/master/MIT-license.txt
https://github.com/imakewebthings/deck.js/blob/master/GPL-license.txt
*/
/*
This module adds clickable previous and next links to the deck.
*/
(function($, deck, undefined) {
var $d = $(document),
/* Updates link hrefs, and disabled states if last/first slide */
updateButtons = function(e, from, to) {
var opts = $[deck]('getOptions'),
last = $[deck]('getSlides').length - 1,
prevSlide = $[deck]('getSlide', to - 1),
nextSlide = $[deck]('getSlide', to + 1),
hrefBase = window.location.href.replace(/#.*/, ''),
prevId = prevSlide ? prevSlide.attr('id') : undefined,
nextId = nextSlide ? nextSlide.attr('id') : undefined;
$(opts.selectors.previousLink)
.toggleClass(opts.classes.navDisabled, !to)
.attr('href', hrefBase + '#' + (prevId ? prevId : ''));
$(opts.selectors.nextLink)
.toggleClass(opts.classes.navDisabled, to === last)
.attr('href', hrefBase + '#' + (nextId ? nextId : ''));
};
/*
Extends defaults/options.
options.classes.navDisabled
This class is added to a navigation link when that action is disabled.
It is added to the previous link when on the first slide, and to the
next link when on the last slide.
options.selectors.nextLink
The elements that match this selector will move the deck to the next
slide when clicked.
options.selectors.previousLink
The elements that match this selector will move to deck to the previous
slide when clicked.
*/
$.extend(true, $[deck].defaults, {
classes: {
navDisabled: 'deck-nav-disabled'
},
selectors: {
nextLink: '.deck-next-link',
previousLink: '.deck-prev-link'
}
});
$d.bind('deck.init', function() {
var opts = $[deck]('getOptions'),
slides = $[deck]('getSlides'),
$current = $[deck]('getSlide'),
ndx;
// Setup prev/next link events
$(opts.selectors.previousLink)
.unbind('click.decknavigation')
.bind('click.decknavigation', function(e) {
$[deck]('prev');
e.preventDefault();
});
$(opts.selectors.nextLink)
.unbind('click.decknavigation')
.bind('click.decknavigation', function(e) {
$[deck]('next');
e.preventDefault();
});
// Find where we started in the deck and set initial states
$.each(slides, function(i, $slide) {
if ($slide === $current) {
ndx = i;
return false;
}
});
updateButtons(null, ndx, ndx);
})
.bind('deck.change', updateButtons);
})(jQuery, 'deck');

View file

@ -0,0 +1,56 @@
@mixin border-radius($r) {
-webkit-border-radius:$r;
-moz-border-radius:$r;
border-radius:$r;
}
.deck-container {
.deck-prev-link, .deck-next-link {
display:none;
position:absolute;
z-index:3;
top:50%;
width:32px;
height:32px;
margin-top:-16px;
font-size:20px;
font-weight:bold;
line-height:32px;
vertical-align:middle;
text-align:center;
text-decoration:none;
color:#fff;
background:#888;
.borderradius & {
@include border-radius(16px);
}
&:hover, &:focus, &:active, &:visited {
color:#fff;
}
}
.deck-prev-link {
left:8px;
}
.deck-next-link {
right:8px;
}
&:hover .deck-prev-link, &:hover .deck-next-link {
display:block;
&.deck-nav-disabled, .touch & {
display:none;
}
}
}
@media print {
.deck-prev-link, .deck-next-link {
display:none !important;
}
}

View file

@ -0,0 +1,28 @@
/* Remove this line if you are embedding deck.js in a page and
using the scale extension. */
.csstransforms {
overflow: hidden;
}
.csstransforms .deck-container.deck-scale:not(.deck-menu) > .slide {
-webkit-box-sizing: padding-box;
-moz-box-sizing: padding-box;
box-sizing: padding-box;
width: 100%;
padding-bottom: 20px;
}
.csstransforms .deck-container.deck-scale:not(.deck-menu) > .slide > .deck-slide-scaler {
-webkit-transform-origin: 50% 0;
-moz-transform-origin: 50% 0;
-o-transform-origin: 50% 0;
-ms-transform-origin: 50% 0;
transform-origin: 50% 0;
}
.csstransforms .deck-container.deck-menu .deck-slide-scaler {
-webkit-transform: none !important;
-moz-transform: none !important;
-o-transform: none !important;
-ms-transform: none !important;
transform: none !important;
}

View file

@ -0,0 +1,170 @@
/*!
Deck JS - deck.scale
Copyright (c) 2011-2012 Caleb Troughton
Dual licensed under the MIT license and GPL license.
https://github.com/imakewebthings/deck.js/blob/master/MIT-license.txt
https://github.com/imakewebthings/deck.js/blob/master/GPL-license.txt
*/
/*
This module adds automatic scaling to the deck. Slides are scaled down
using CSS transforms to fit within the deck container. If the container is
big enough to hold the slides without scaling, no scaling occurs. The user
can disable and enable scaling with a keyboard shortcut.
Note: CSS transforms may make Flash videos render incorrectly. Presenters
that need to use video may want to disable scaling to play them. HTML5 video
works fine.
*/
(function($, deck, window, undefined) {
var $d = $(document),
$w = $(window),
baseHeight, // Value to scale against
timer, // Timeout id for debouncing
rootSlides,
/*
Internal function to do all the dirty work of scaling the slides.
*/
scaleDeck = function() {
var opts = $[deck]('getOptions'),
obh = opts.baseHeight,
$container = $[deck]('getContainer'),
baseHeight = obh ? obh : $container.height();
// Scale each slide down if necessary (but don't scale up)
$.each(rootSlides, function(i, $slide) {
var slideHeight = $slide.innerHeight(),
$scaler = $slide.find('.' + opts.classes.scaleSlideWrapper),
scale = $container.hasClass(opts.classes.scale) ?
baseHeight / slideHeight :
1;
$.each('Webkit Moz O ms Khtml'.split(' '), function(i, prefix) {
if (scale === 1) {
$scaler.css(prefix + 'Transform', '');
}
else {
$scaler.css(prefix + 'Transform', 'scale(' + scale + ')');
}
});
});
}
/*
Extends defaults/options.
options.classes.scale
This class is added to the deck container when scaling is enabled.
It is enabled by default when the module is included.
options.classes.scaleSlideWrapper
Scaling is done using a wrapper around the contents of each slide. This
class is applied to that wrapper.
options.keys.scale
The numeric keycode used to toggle enabling and disabling scaling.
options.baseHeight
When baseHeight is falsy, as it is by default, the deck is scaled in
proportion to the height of the deck container. You may instead specify
a height as a number of px, and slides will be scaled against this
height regardless of the container size.
options.scaleDebounce
Scaling on the browser resize event is debounced. This number is the
threshold in milliseconds. You can learn more about debouncing here:
http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
*/
$.extend(true, $[deck].defaults, {
classes: {
scale: 'deck-scale',
scaleSlideWrapper: 'deck-slide-scaler'
},
keys: {
scale: 83 // s
},
baseHeight: null,
scaleDebounce: 200
});
/*
jQuery.deck('disableScale')
Disables scaling and removes the scale class from the deck container.
*/
$[deck]('extend', 'disableScale', function() {
$[deck]('getContainer').removeClass($[deck]('getOptions').classes.scale);
scaleDeck();
});
/*
jQuery.deck('enableScale')
Enables scaling and adds the scale class to the deck container.
*/
$[deck]('extend', 'enableScale', function() {
$[deck]('getContainer').addClass($[deck]('getOptions').classes.scale);
scaleDeck();
});
/*
jQuery.deck('toggleScale')
Toggles between enabling and disabling scaling.
*/
$[deck]('extend', 'toggleScale', function() {
var $c = $[deck]('getContainer');
$[deck]($c.hasClass($[deck]('getOptions').classes.scale) ?
'disableScale' : 'enableScale');
});
$d.bind('deck.init', function() {
var opts = $[deck]('getOptions'),
slideTest = $.map([
opts.classes.before,
opts.classes.previous,
opts.classes.current,
opts.classes.next,
opts.classes.after
], function(el, i) {
return '.' + el;
}).join(', ');
// Build top level slides array
rootSlides = [];
$.each($[deck]('getSlides'), function(i, $el) {
if (!$el.parentsUntil(opts.selectors.container, slideTest).length) {
rootSlides.push($el);
}
});
// Use a wrapper on each slide to handle content scaling
$.each(rootSlides, function(i, $slide) {
$slide.children().wrapAll('<div class="' + opts.classes.scaleSlideWrapper + '"/>');
});
// Debounce the resize scaling
$w.unbind('resize.deckscale').bind('resize.deckscale', function() {
window.clearTimeout(timer);
timer = window.setTimeout(scaleDeck, opts.scaleDebounce);
})
// Scale once on load, in case images or something change layout
.unbind('load.deckscale').bind('load.deckscale', scaleDeck);
// Bind key events
$d.unbind('keydown.deckscale').bind('keydown.deckscale', function(e) {
if (e.which === opts.keys.scale || $.inArray(e.which, opts.keys.scale) > -1) {
$[deck]('toggleScale');
e.preventDefault();
}
});
// Enable scale on init
$[deck]('enableScale');
});
})(jQuery, 'deck', this);

View file

@ -0,0 +1,31 @@
/* Remove this line if you are embedding deck.js in a page and
using the scale extension. */
.csstransforms {
overflow:hidden;
}
.csstransforms .deck-container.deck-scale:not(.deck-menu) {
> .slide {
-webkit-box-sizing: padding-box;
-moz-box-sizing: padding-box;
box-sizing: padding-box;
width:100%;
padding-bottom:20px;
> .deck-slide-scaler {
-webkit-transform-origin: 50% 0;
-moz-transform-origin: 50% 0;
-o-transform-origin: 50% 0;
-ms-transform-origin: 50% 0;
transform-origin: 50% 0;
}
}
}
.csstransforms .deck-container.deck-menu .deck-slide-scaler {
-webkit-transform:none !important;
-moz-transform:none !important;
-o-transform:none !important;
-ms-transform:none !important;
transform:none !important;
}

View file

@ -0,0 +1,18 @@
.deck-container .deck-status {
position: absolute;
bottom: 10px;
right: 5px;
color: #888;
z-index: 3;
margin: 0;
}
body.deck-container .deck-status {
position: fixed;
}
@media print {
.deck-status {
display: none;
}
}

View file

@ -0,0 +1,6 @@
<!-- Place the following snippet at the bottom of the deck container. -->
<p class="deck-status">
<span class="deck-status-current"></span>
/
<span class="deck-status-total"></span>
</p>

View file

@ -0,0 +1,95 @@
/*!
Deck JS - deck.status
Copyright (c) 2011 Caleb Troughton
Dual licensed under the MIT license and GPL license.
https://github.com/imakewebthings/deck.js/blob/master/MIT-license.txt
https://github.com/imakewebthings/deck.js/blob/master/GPL-license.txt
*/
/*
This module adds a (current)/(total) style status indicator to the deck.
*/
(function($, deck, undefined) {
var $d = $(document),
updateCurrent = function(e, from, to) {
var opts = $[deck]('getOptions');
$(opts.selectors.statusCurrent).text(opts.countNested ?
to + 1 :
$[deck]('getSlide', to).data('rootSlide')
);
};
/*
Extends defaults/options.
options.selectors.statusCurrent
The element matching this selector displays the current slide number.
options.selectors.statusTotal
The element matching this selector displays the total number of slides.
options.countNested
If false, only top level slides will be counted in the current and
total numbers.
*/
$.extend(true, $[deck].defaults, {
selectors: {
statusCurrent: '.deck-status-current',
statusTotal: '.deck-status-total'
},
countNested: true
});
$d.bind('deck.init', function() {
var opts = $[deck]('getOptions'),
slides = $[deck]('getSlides'),
$current = $[deck]('getSlide'),
ndx;
// Set total slides once
if (opts.countNested) {
$(opts.selectors.statusTotal).text(slides.length);
}
else {
/* Determine root slides by checking each slide's ancestor tree for
any of the slide classes. */
var rootIndex = 1,
slideTest = $.map([
opts.classes.before,
opts.classes.previous,
opts.classes.current,
opts.classes.next,
opts.classes.after
], function(el, i) {
return '.' + el;
}).join(', ');
/* Store the 'real' root slide number for use during slide changes. */
$.each(slides, function(i, $el) {
var $parentSlides = $el.parentsUntil(opts.selectors.container, slideTest);
$el.data('rootSlide', $parentSlides.length ?
$parentSlides.last().data('rootSlide') :
rootIndex++
);
});
$(opts.selectors.statusTotal).text(rootIndex - 1);
}
// Find where we started in the deck and set initial state
$.each(slides, function(i, $el) {
if ($el === $current) {
ndx = i;
return false;
}
});
updateCurrent(null, ndx, ndx);
})
/* Update current slide number with each change event */
.bind('deck.change', updateCurrent);
})(jQuery, 'deck');

View file

@ -0,0 +1,22 @@
.deck-container {
.deck-status {
position:absolute;
bottom:10px;
right:5px;
color:#888;
z-index:3;
margin:0;
}
}
body.deck-container {
.deck-status {
position:fixed;
}
}
@media print {
.deck-status {
display:none;
}
}

215
git/introduction/index.html Normal file
View file

@ -0,0 +1,215 @@
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Getting Started with deck.js</title>
<meta name="description" content="A jQuery library for modern HTML presentations">
<meta name="author" content="Caleb Troughton">
<meta name="viewport" content="width=1024, user-scalable=no">
<!-- Core and extension CSS files -->
<link rel="stylesheet" href="../core/deck.core.css">
<link rel="stylesheet" href="../extensions/goto/deck.goto.css">
<link rel="stylesheet" href="../extensions/menu/deck.menu.css">
<link rel="stylesheet" href="../extensions/navigation/deck.navigation.css">
<link rel="stylesheet" href="../extensions/status/deck.status.css">
<link rel="stylesheet" href="../extensions/hash/deck.hash.css">
<link rel="stylesheet" href="../extensions/scale/deck.scale.css">
<!-- Style theme. More available in /themes/style/ or create your own. -->
<link rel="stylesheet" href="../themes/style/web-2.0.css">
<!-- Transition theme. More available in /themes/transition/ or create your own. -->
<link rel="stylesheet" href="../themes/transition/horizontal-slide.css">
<script src="../modernizr.custom.js"></script>
</head>
<body class="deck-container">
<!-- Begin slides -->
<section class="slide" id="title-slide">
<h1>Getting Started with deck.js</h1>
</section>
<section class="slide" id="how-to-overview">
<h2>How to Make a Deck</h2>
<ol>
<li>
<h3>Write Slides</h3>
<p>Slide content is simple&nbsp;HTML.</p>
</li>
<li>
<h3>Choose Themes</h3>
<p>One for slide styles and one for deck&nbsp;transitions.</p>
</li>
<li>
<h3>Include Extensions</h3>
<p>Add extra functionality to your deck, or leave it stripped&nbsp;down.</p>
</li>
</ol>
</section>
<section class="slide" id="markup">
<h2>The Markup</h2>
<p>Slides are just HTML elements with a class of <code>slide</code>.</p>
<pre><code>&lt;section class=&quot;slide&quot;&gt;
&lt;h2&gt;How to Make a Deck&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;h3&gt;Write Slides&lt;/h3&gt;
&lt;p&gt;Slide content is simple HTML.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;h3&gt;Choose Themes&lt;/h3&gt;
&lt;p&gt;One for slide styles and one for deck transitions.&lt;/p&gt;
&lt;/li&gt;
&hellip;
&lt;/ol&gt;
&lt;/section&gt;</code></pre>
</section>
<section class="slide" id="themes">
<h2>Style Themes</h2>
<p>Customizes the colors, typography, and layout of slide&nbsp;content.</p>
<pre><code>&lt;link rel=&quot;stylesheet&quot; href=&quot;/path/to/css/style-theme.css&quot;&gt;</code></pre>
<h2>Transition Themes</h2>
<p>Defines transitions between slides using CSS3 transitions. Less capable browsers fall back to cutaways. But <strong>you</strong> aren&rsquo;t using <em>those</em> browsers to give your presentations, are&nbsp;you&hellip;</p>
<pre><code>&lt;link rel=&quot;stylesheet&quot; href=&quot;/path/to/css/transition-theme.css&quot;&gt;</code></pre>
</section>
<section class="slide" id="extensions">
<h2>Extensions</h2>
<p>Core gives you basic slide functionality with left and right arrow navigation, but you may want more. Here are the ones included in this&nbsp;deck:</p>
<ul>
<li class="slide" id="extensions-goto">
<strong>deck.goto</strong>: Adds a shortcut key to jump to any slide number. Hit g, type in the slide number, and hit&nbsp;enter.
</li>
<li class="slide" id="extensions-hash">
<strong>deck.hash</strong>: Enables internal linking within slides, deep linking to individual slides, and updates the address bar &amp; a permalink anchor with each slide&nbsp;change.
</li>
<li class="slide" id="extensions-menu">
<strong>deck.menu</strong>: Adds a menu view, letting you see all slides in a grid. Hit m to toggle to menu view, continue navigating your deck, and hit m to return to normal view. Touch devices can double-tap the deck to switch between&nbsp;views.
</li>
<li class="slide" id="extensions-navigation">
<strong>deck.navigation</strong>: Adds clickable left and right buttons for the less keyboard&nbsp;inclined.
</li>
<li class="slide" id="extensions-status">
<strong>deck.status</strong>: Adds a page number indicator. (current/total)
</li>
<li class="slide" id="extensions-scale">
<strong>deck.scale</strong>: Scales each slide to fit within the deck container using CSS Transforms for those browsers that support them.
</li>
</ul>
<p class="slide" id="extension-folders">Each extension folder in the download package contains the necessary JavaScript, CSS, and HTML&nbsp;files. For a complete list of extension modules included in deck.js, check out the&nbsp;<a href="http://imakewebthings.github.com/deck.js/docs">documentation</a>.</p>
</section>
<section class="slide" id="nested">
<h2>Nested Slides</h2>
<p>That last slide had a few steps. To create substeps in slides, just nest them:</p>
<pre><code>&lt;section class=&quot;slide&quot;&gt;
&lt;h2&gt;Extensions&lt;/h2&gt;
&lt;p&gt;Core gives you basic slide functionality...&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;slide&quot;&gt;
&lt;h3&gt;deck.goto&lt;/h3&gt;
&lt;p&gt;Adds a shortcut key to jump to any slide number...&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;slide&quot;&gt;...&lt;/li&gt;
&lt;li class=&quot;slide&quot;&gt;...&lt;/li&gt;
&lt;li class=&quot;slide&quot;&gt;...&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;</code></pre>
</section>
<section class="slide" id="elements-images">
<h2>Other Elements: Images</h2>
<img src="http://placekitten.com/600/375" alt="Kitties">
<pre><code>&lt;img src=&quot;http://placekitten.com/600/375&quot; alt=&quot;Kitties&quot;&gt;</code></pre>
</section>
<section class="slide" id="elements-blockquotes">
<h2>Other Elements: Blockquotes</h2>
<blockquote cite="http://example.org">
<p>Food is an important part of a balanced diet.</p>
<p><cite>Fran Lebowitz</cite></p>
</blockquote>
<pre><code>&lt;blockquote cite=&quot;http://example.org&quot;&gt;
&lt;p&gt;Food is an important part of a balanced diet.&lt;/p&gt;
&lt;p&gt;&lt;cite&gt;Fran Lebowitz&lt;/cite&gt;&lt;/p&gt;
&lt;/blockquote&gt;</code></pre>
</section>
<section class="slide" id="elements-videos">
<h2>Other Elements: Video Embeds</h2>
<p>Embed videos from your favorite online video service or with an HTML5 video&nbsp;element.</p>
<iframe src="http://player.vimeo.com/video/1063136?title=0&amp;byline=0&amp;portrait=0" width="400" height="225" frameborder="0"></iframe>
<pre><code>&lt;iframe src=&quot;http://player.vimeo.com/video/1063136?title=0&amp;amp;byline=0&amp;amp;portrait=0&quot; width=&quot;400&quot; height=&quot;225&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;</code></pre>
</section>
<section class="slide" id="digging-deeper">
<h2>Digging Deeper</h2>
<p>If you want to learn about making your own themes, extending deck.js, and more, check out the&nbsp;<a href="../docs/">documentation</a>.</p>
</section>
<!-- deck.navigation snippet -->
<a href="#" class="deck-prev-link" title="Previous">&#8592;</a>
<a href="#" class="deck-next-link" title="Next">&#8594;</a>
<!-- deck.status snippet -->
<p class="deck-status">
<span class="deck-status-current"></span>
/
<span class="deck-status-total"></span>
</p>
<!-- deck.goto snippet -->
<form action="." method="get" class="goto-form">
<label for="goto-slide">Go to slide:</label>
<input type="text" name="slidenum" id="goto-slide" list="goto-datalist">
<datalist id="goto-datalist"></datalist>
<input type="submit" value="Go">
</form>
<!-- deck.hash snippet -->
<a href="." title="Permalink to this slide" class="deck-permalink">#</a>
<!-- Grab CDN jQuery, with a protocol relative URL; fall back to local if offline -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="../jquery-1.7.2.min.js"><\/script>')</script>
<!-- Deck Core and extensions -->
<script src="../core/deck.core.js"></script>
<script src="../extensions/hash/deck.hash.js"></script>
<script src="../extensions/menu/deck.menu.js"></script>
<script src="../extensions/goto/deck.goto.js"></script>
<script src="../extensions/status/deck.status.js"></script>
<script src="../extensions/navigation/deck.navigation.js"></script>
<script src="../extensions/scale/deck.scale.js"></script>
<!-- Initialize the deck -->
<script>
$(function() {
$.deck('.slide');
});
</script>
</body>
</html>

4
git/jquery-1.7.2.min.js vendored Normal file

File diff suppressed because one or more lines are too long

4
git/modernizr.custom.js Normal file

File diff suppressed because one or more lines are too long

24
git/test/fixtures/complex.html vendored Normal file
View file

@ -0,0 +1,24 @@
<div class="deck-container">
<div class="slide1"></div>
<div class="slide2 slide3 slide4">
<div class="slide2 slide10"></div>
<div class="slide3 slide4"></div>
</div>
<div class="slide3 slide5"></div>
<div class="slide6 slide7 slide8 slide9 slide10"></div>
<p class="deck-status">
<span class="deck-status-current"></span>
/
<span class="deck-status-total"></span>
</p>
<form action="." method="get" class="goto-form">
<label for="goto-slide">Go to slide:</label>
<input type="number" name="slidenum" id="goto-slide" value="">
<input type="submit" value="Go">
</form>
</div>

19
git/test/fixtures/empty.html vendored Normal file
View file

@ -0,0 +1,19 @@
<div class="deck-container">
<a href="#" class="deck-prev-link">Previous</a>
<a href="#" class="deck-next-link">Next</a>
<p class="deck-status">
<span class="deck-status-current"></span>
/
<span class="deck-status-total"></span>
</p>
<form action="." method="get" class="goto-form">
<label for="goto-slide">Go to slide:</label>
<input type="number" name="slidenum" id="goto-slide" value="">
<input type="submit" value="Go">
</form>
<a href="#" class="deck-permalink">#</a>
<a href="#custom-id" id="internal-test">Internal Test Link</a>
</div>

10
git/test/fixtures/iframe_simple.html vendored Normal file
View file

@ -0,0 +1,10 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
Simple Iframe
</body>
</html>

32
git/test/fixtures/iframes.html vendored Normal file
View file

@ -0,0 +1,32 @@
<div class="deck-container">
<div class="slide1"></div>
<div class="slide2 slide3 slide4">
</div>
<div class="slide5">
<iframe src='fixtures/iframe_simple.html'></iframe>
</div>
<div class='slide6'>
</div>
<div class="slide7">
<iframe></iframe>
</div>
<div class="slide8 slide9 slide10"></div>
<p class="deck-status">
<span class="deck-status-current"></span>
/
<span class="deck-status-total"></span>
</p>
<form action="." method="get" class="goto-form">
<label for="goto-slide">Go to slide:</label>
<input type="number" name="slidenum" id="goto-slide" value="">
<input type="submit" value="Go">
</form>
</div>

36
git/test/fixtures/nesteds.html vendored Normal file
View file

@ -0,0 +1,36 @@
<div class="deck-container">
<div class="slide">
</div>
<div class="slide">
</div>
<div class="slide root">
<div class="slide"></div>
<div class="slide"></div>
<div class="slide"></div>
<div class="slide">
<div class="slide"></div>
<div class="slide"></div>
<div class="slide"></div>
</div>
</div>
<div class="slide" id="after">
</div>
<div class="slide">
</div>
<p class="deck-status">
<span class="deck-status-current"></span>
/
<span class="deck-status-total"></span>
</p>
<form action="." method="get" class="goto-form">
<label for="goto-slide">Go to slide:</label>
<input type="number" name="slidenum" id="goto-slide" value="">
<input type="submit" value="Go">
</form>
</div>

42
git/test/fixtures/standard.html vendored Normal file
View file

@ -0,0 +1,42 @@
<div class="deck-container">
<div class="slide slide1"></div>
<div class="slide slide2" id="custom-id"></div>
<div class="slide slide3"></div>
<div class="slide slide4"></div>
<div class="slide slide5"></div>
<a href="#" class="deck-prev-link">Previous</a>
<a href="#" class="deck-next-link">Next</a>
<p class="deck-status">
<span class="deck-status-current"></span>
/
<span class="deck-status-total"></span>
</p>
<form action="." method="get" class="goto-form">
<label for="goto-slide">Go to slide:</label>
<input type="number" name="slidenum" id="goto-slide" value="" list="goto-datalist">
<datalist id="goto-datalist"></datalist>
<input type="submit" value="Go">
</form>
<a href="#" class="deck-permalink">#</a>
<a href="#custom-id" id="internal-test">Internal Test Link</a>
</div>
<div class="alt-container">
<div class="alt-slide alt-slide1"><input></div>
<div class="alt-slide alt-slide2"></div>
<div class="alt-slide alt-slide3"></div>
<div class="alt-slide alt-slide4"></div>
<div class="alt-slide alt-slide5"></div>
</div>

39
git/test/index.html Normal file
View file

@ -0,0 +1,39 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>deck.js - Jasmine Test Runner</title>
<link rel="stylesheet" type="text/css" href="lib/jasmine.css">
<script type="text/javascript" src="../modernizr.custom.js"></script>
<script type="text/javascript" src="lib/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-html.js"></script>
<script src="../jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="lib/jasmine-jquery.js"></script>
<!-- include source files here... -->
<script type="text/javascript" src="../core/deck.core.js"></script>
<script type="text/javascript" src="../extensions/hash/deck.hash.js"></script>
<script type="text/javascript" src="../extensions/menu/deck.menu.js"></script>
<script type="text/javascript" src="../extensions/goto/deck.goto.js"></script>
<script type="text/javascript" src="../extensions/status/deck.status.js"></script>
<script type="text/javascript" src="../extensions/navigation/deck.navigation.js"></script>
<script type="text/javascript" src="../extensions/scale/deck.scale.js"></script>
<!-- include spec files here... -->
<script type="text/javascript" src="settings.js"></script>
<script type="text/javascript" src="spec.core.js"></script>
<script type="text/javascript" src="spec.menu.js"></script>
<script type="text/javascript" src="spec.goto.js"></script>
<script type="text/javascript" src="spec.navigation.js"></script>
<script type="text/javascript" src="spec.hash.js"></script>
<script type="text/javascript" src="spec.status.js"></script>
<script type="text/javascript" src="spec.scale.js"></script>
</head>
<body>
<script type="text/javascript">
jasmine.getEnv().addReporter(new jasmine.TrivialReporter());
jasmine.getEnv().execute();
</script>
</body>
</html>

190
git/test/lib/jasmine-html.js Executable file
View file

@ -0,0 +1,190 @@
jasmine.TrivialReporter = function(doc) {
this.document = doc || document;
this.suiteDivs = {};
this.logRunningSpecs = false;
};
jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) {
var el = document.createElement(type);
for (var i = 2; i < arguments.length; i++) {
var child = arguments[i];
if (typeof child === 'string') {
el.appendChild(document.createTextNode(child));
} else {
if (child) { el.appendChild(child); }
}
}
for (var attr in attrs) {
if (attr == "className") {
el[attr] = attrs[attr];
} else {
el.setAttribute(attr, attrs[attr]);
}
}
return el;
};
jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
var showPassed, showSkipped;
this.outerDiv = this.createDom('div', { className: 'jasmine_reporter' },
this.createDom('div', { className: 'banner' },
this.createDom('div', { className: 'logo' },
this.createDom('span', { className: 'title' }, "Jasmine"),
this.createDom('span', { className: 'version' }, runner.env.versionString())),
this.createDom('div', { className: 'options' },
"Show ",
showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' }),
this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "),
showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' }),
this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped")
)
),
this.runnerDiv = this.createDom('div', { className: 'runner running' },
this.createDom('a', { className: 'run_spec', href: '?' }, "run all"),
this.runnerMessageSpan = this.createDom('span', {}, "Running..."),
this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, ""))
);
this.document.body.appendChild(this.outerDiv);
var suites = runner.suites();
for (var i = 0; i < suites.length; i++) {
var suite = suites[i];
var suiteDiv = this.createDom('div', { className: 'suite' },
this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"),
this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description));
this.suiteDivs[suite.id] = suiteDiv;
var parentDiv = this.outerDiv;
if (suite.parentSuite) {
parentDiv = this.suiteDivs[suite.parentSuite.id];
}
parentDiv.appendChild(suiteDiv);
}
this.startedAt = new Date();
var self = this;
showPassed.onclick = function(evt) {
if (showPassed.checked) {
self.outerDiv.className += ' show-passed';
} else {
self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, '');
}
};
showSkipped.onclick = function(evt) {
if (showSkipped.checked) {
self.outerDiv.className += ' show-skipped';
} else {
self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, '');
}
};
};
jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) {
var results = runner.results();
var className = (results.failedCount > 0) ? "runner failed" : "runner passed";
this.runnerDiv.setAttribute("class", className);
//do it twice for IE
this.runnerDiv.setAttribute("className", className);
var specs = runner.specs();
var specCount = 0;
for (var i = 0; i < specs.length; i++) {
if (this.specFilter(specs[i])) {
specCount++;
}
}
var message = "" + specCount + " spec" + (specCount == 1 ? "" : "s" ) + ", " + results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s");
message += " in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s";
this.runnerMessageSpan.replaceChild(this.createDom('a', { className: 'description', href: '?'}, message), this.runnerMessageSpan.firstChild);
this.finishedAtSpan.appendChild(document.createTextNode("Finished at " + new Date().toString()));
};
jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) {
var results = suite.results();
var status = results.passed() ? 'passed' : 'failed';
if (results.totalCount === 0) { // todo: change this to check results.skipped
status = 'skipped';
}
this.suiteDivs[suite.id].className += " " + status;
};
jasmine.TrivialReporter.prototype.reportSpecStarting = function(spec) {
if (this.logRunningSpecs) {
this.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
}
};
jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
var results = spec.results();
var status = results.passed() ? 'passed' : 'failed';
if (results.skipped) {
status = 'skipped';
}
var specDiv = this.createDom('div', { className: 'spec ' + status },
this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"),
this.createDom('a', {
className: 'description',
href: '?spec=' + encodeURIComponent(spec.getFullName()),
title: spec.getFullName()
}, spec.description));
var resultItems = results.getItems();
var messagesDiv = this.createDom('div', { className: 'messages' });
for (var i = 0; i < resultItems.length; i++) {
var result = resultItems[i];
if (result.type == 'log') {
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
} else if (result.type == 'expect' && result.passed && !result.passed()) {
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
if (result.trace.stack) {
messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
}
}
}
if (messagesDiv.childNodes.length > 0) {
specDiv.appendChild(messagesDiv);
}
this.suiteDivs[spec.suite.id].appendChild(specDiv);
};
jasmine.TrivialReporter.prototype.log = function() {
var console = jasmine.getGlobal().console;
if (console && console.log) {
if (console.log.apply) {
console.log.apply(console, arguments);
} else {
console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
}
}
};
jasmine.TrivialReporter.prototype.getLocation = function() {
return this.document.location;
};
jasmine.TrivialReporter.prototype.specFilter = function(spec) {
var paramMap = {};
var params = this.getLocation().search.substring(1).split('&');
for (var i = 0; i < params.length; i++) {
var p = params[i].split('=');
paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
}
if (!paramMap.spec) {
return true;
}
return spec.getFullName().indexOf(paramMap.spec) === 0;
};

288
git/test/lib/jasmine-jquery.js Executable file
View file

@ -0,0 +1,288 @@
var readFixtures = function() {
return jasmine.getFixtures().proxyCallTo_('read', arguments);
};
var preloadFixtures = function() {
jasmine.getFixtures().proxyCallTo_('preload', arguments);
};
var loadFixtures = function() {
jasmine.getFixtures().proxyCallTo_('load', arguments);
};
var setFixtures = function(html) {
jasmine.getFixtures().set(html);
};
var sandbox = function(attributes) {
return jasmine.getFixtures().sandbox(attributes);
};
var spyOnEvent = function(selector, eventName) {
jasmine.JQuery.events.spyOn(selector, eventName);
}
jasmine.getFixtures = function() {
return jasmine.currentFixtures_ = jasmine.currentFixtures_ || new jasmine.Fixtures();
};
jasmine.Fixtures = function() {
this.containerId = 'jasmine-fixtures';
this.fixturesCache_ = {};
this.fixturesPath = 'spec/javascripts/fixtures';
};
jasmine.Fixtures.prototype.set = function(html) {
this.cleanUp();
this.createContainer_(html);
};
jasmine.Fixtures.prototype.preload = function() {
this.read.apply(this, arguments);
};
jasmine.Fixtures.prototype.load = function() {
this.cleanUp();
this.createContainer_(this.read.apply(this, arguments));
};
jasmine.Fixtures.prototype.read = function() {
var htmlChunks = [];
var fixtureUrls = arguments;
for(var urlCount = fixtureUrls.length, urlIndex = 0; urlIndex < urlCount; urlIndex++) {
htmlChunks.push(this.getFixtureHtml_(fixtureUrls[urlIndex]));
}
return htmlChunks.join('');
};
jasmine.Fixtures.prototype.clearCache = function() {
this.fixturesCache_ = {};
};
jasmine.Fixtures.prototype.cleanUp = function() {
jQuery('#' + this.containerId).remove();
};
jasmine.Fixtures.prototype.sandbox = function(attributes) {
var attributesToSet = attributes || {};
return jQuery('<div id="sandbox" />').attr(attributesToSet);
};
jasmine.Fixtures.prototype.createContainer_ = function(html) {
var container;
if(html instanceof jQuery) {
container = jQuery('<div id="' + this.containerId + '" />');
container.html(html);
} else {
container = '<div id="' + this.containerId + '">' + html + '</div>'
}
jQuery('body').append(container);
};
jasmine.Fixtures.prototype.getFixtureHtml_ = function(url) {
if (typeof this.fixturesCache_[url] == 'undefined') {
this.loadFixtureIntoCache_(url);
}
return this.fixturesCache_[url];
};
jasmine.Fixtures.prototype.loadFixtureIntoCache_ = function(relativeUrl) {
var self = this;
var url = this.fixturesPath.match('/$') ? this.fixturesPath + relativeUrl : this.fixturesPath + '/' + relativeUrl;
jQuery.ajax({
async: false, // must be synchronous to guarantee that no tests are run before fixture is loaded
cache: false,
dataType: 'html',
url: url,
success: function(data) {
self.fixturesCache_[relativeUrl] = data;
},
error: function(jqXHR, status, errorThrown) {
throw Error('Fixture could not be loaded: ' + url + ' (status: ' + status + ', message: ' + errorThrown.message + ')');
}
});
};
jasmine.Fixtures.prototype.proxyCallTo_ = function(methodName, passedArguments) {
return this[methodName].apply(this, passedArguments);
};
jasmine.JQuery = function() {};
jasmine.JQuery.browserTagCaseIndependentHtml = function(html) {
return jQuery('<div/>').append(html).html();
};
jasmine.JQuery.elementToString = function(element) {
return jQuery('<div />').append(element.clone()).html();
};
jasmine.JQuery.matchersClass = {};
(function(namespace) {
var data = {
spiedEvents: {},
handlers: []
};
namespace.events = {
spyOn: function(selector, eventName) {
var handler = function(e) {
data.spiedEvents[[selector, eventName]] = e;
};
jQuery(selector).bind(eventName, handler);
data.handlers.push(handler);
},
wasTriggered: function(selector, eventName) {
return !!(data.spiedEvents[[selector, eventName]]);
},
cleanUp: function() {
data.spiedEvents = {};
data.handlers = [];
}
}
})(jasmine.JQuery);
(function(){
var jQueryMatchers = {
toHaveClass: function(className) {
return this.actual.hasClass(className);
},
toBeVisible: function() {
return this.actual.is(':visible');
},
toBeHidden: function() {
return this.actual.is(':hidden');
},
toBeSelected: function() {
return this.actual.is(':selected');
},
toBeChecked: function() {
return this.actual.is(':checked');
},
toBeEmpty: function() {
return this.actual.is(':empty');
},
toExist: function() {
return this.actual.size() > 0;
},
toHaveAttr: function(attributeName, expectedAttributeValue) {
return hasProperty(this.actual.attr(attributeName), expectedAttributeValue);
},
toHaveId: function(id) {
return this.actual.attr('id') == id;
},
toHaveHtml: function(html) {
return this.actual.html() == jasmine.JQuery.browserTagCaseIndependentHtml(html);
},
toHaveText: function(text) {
if (text && jQuery.isFunction(text.test)) {
return text.test(this.actual.text());
} else {
return this.actual.text() == text;
}
},
toHaveValue: function(value) {
return this.actual.val() == value;
},
toHaveData: function(key, expectedValue) {
return hasProperty(this.actual.data(key), expectedValue);
},
toBe: function(selector) {
return this.actual.is(selector);
},
toContain: function(selector) {
return this.actual.find(selector).size() > 0;
},
toBeDisabled: function(selector){
return this.actual.is(':disabled');
},
// tests the existence of a specific event binding
toHandle: function(eventName) {
var events = this.actual.data("events");
return events && events[eventName].length > 0;
},
// tests the existence of a specific event binding + handler
toHandleWith: function(eventName, eventHandler) {
var stack = this.actual.data("events")[eventName];
var i;
for (i = 0; i < stack.length; i++) {
if (stack[i].handler == eventHandler) {
return true;
}
}
return false;
}
};
var hasProperty = function(actualValue, expectedValue) {
if (expectedValue === undefined) {
return actualValue !== undefined;
}
return actualValue == expectedValue;
};
var bindMatcher = function(methodName) {
var builtInMatcher = jasmine.Matchers.prototype[methodName];
jasmine.JQuery.matchersClass[methodName] = function() {
if (this.actual instanceof jQuery) {
var result = jQueryMatchers[methodName].apply(this, arguments);
this.actual = jasmine.JQuery.elementToString(this.actual);
return result;
}
if (builtInMatcher) {
return builtInMatcher.apply(this, arguments);
}
return false;
};
};
for(var methodName in jQueryMatchers) {
bindMatcher(methodName);
}
})();
beforeEach(function() {
this.addMatchers(jasmine.JQuery.matchersClass);
this.addMatchers({
toHaveBeenTriggeredOn: function(selector) {
this.message = function() {
return [
"Expected event " + this.actual + " to have been triggered on" + selector,
"Expected event " + this.actual + " not to have been triggered on" + selector
];
};
return jasmine.JQuery.events.wasTriggered(selector, this.actual);
}
})
});
afterEach(function() {
jasmine.getFixtures().cleanUp();
jasmine.JQuery.events.cleanUp();
});

166
git/test/lib/jasmine.css Executable file
View file

@ -0,0 +1,166 @@
body {
font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif;
}
.jasmine_reporter a:visited, .jasmine_reporter a {
color: #303;
}
.jasmine_reporter a:hover, .jasmine_reporter a:active {
color: blue;
}
.run_spec {
float:right;
padding-right: 5px;
font-size: .8em;
text-decoration: none;
}
.jasmine_reporter {
margin: 0 5px;
}
.banner {
color: #303;
background-color: #fef;
padding: 5px;
}
.logo {
float: left;
font-size: 1.1em;
padding-left: 5px;
}
.logo .version {
font-size: .6em;
padding-left: 1em;
}
.runner.running {
background-color: yellow;
}
.options {
text-align: right;
font-size: .8em;
}
.suite {
border: 1px outset gray;
margin: 5px 0;
padding-left: 1em;
}
.suite .suite {
margin: 5px;
}
.suite.passed {
background-color: #dfd;
}
.suite.failed {
background-color: #fdd;
}
.spec {
margin: 5px;
padding-left: 1em;
clear: both;
}
.spec.failed, .spec.passed, .spec.skipped {
padding-bottom: 5px;
border: 1px solid gray;
}
.spec.failed {
background-color: #fbb;
border-color: red;
}
.spec.passed {
background-color: #bfb;
border-color: green;
}
.spec.skipped {
background-color: #bbb;
}
.messages {
border-left: 1px dashed gray;
padding-left: 1em;
padding-right: 1em;
}
.passed {
background-color: #cfc;
display: none;
}
.failed {
background-color: #fbb;
}
.skipped {
color: #777;
background-color: #eee;
display: none;
}
/*.resultMessage {*/
/*white-space: pre;*/
/*}*/
.resultMessage span.result {
display: block;
line-height: 2em;
color: black;
}
.resultMessage .mismatch {
color: black;
}
.stackTrace {
white-space: pre;
font-size: .8em;
margin-left: 10px;
max-height: 5em;
overflow: auto;
border: 1px inset red;
padding: 1em;
background: #eef;
}
.finished-at {
padding-left: 1em;
font-size: .6em;
}
.show-passed .passed,
.show-skipped .skipped {
display: block;
}
#jasmine_content {
position:fixed;
right: 100%;
}
.runner {
border: 1px solid gray;
display: block;
margin: 5px 0;
padding: 2px 0 2px 10px;
}

2477
git/test/lib/jasmine.js Executable file

File diff suppressed because it is too large Load diff

3
git/test/settings.js Executable file
View file

@ -0,0 +1,3 @@
// SETTINGS, VARS, UTILITY FUNCTIONS
jasmine.getFixtures().fixturesPath = 'fixtures';
var defaults = $.deck.defaults;

436
git/test/spec.core.js Executable file
View file

@ -0,0 +1,436 @@
// Go tests, go
describe('Deck JS', function() {
describe('standard html structure', function() {
beforeEach(function() {
loadFixtures('standard.html');
if (Modernizr.history) {
history.replaceState({}, "", "#")
}
else {
window.location.hash = '#';
}
});
describe('init(selector)', function() {
it('should create slides', function() {
$.deck('.slide');
expect($.deck('getSlides').length).toEqual($('.slide').length);
});
});
describe('init([selectors])', function() {
it('should create slides', function() {
$.deck([
'.slide1',
'.slide2',
'.slide3',
'.slide4',
'.slide5'
]);
expect($.deck('getSlides').length).toEqual($('.slide').length);
});
});
describe('navigation functions', function() {
beforeEach(function() {
$.deck('.slide');
});
describe('go(i)', function() {
it('should go to the i slide (0 based index)', function() {
$.deck('go', 3);
expect($.deck('getSlide')).toHaveClass('slide4');
});
it('should go to the slide with specified id', function() {
$.deck('go', 'custom-id');
expect($.deck('getSlide')).toHaveId('custom-id');
});
it('should go nowhere if i is out of bounds', function() {
$.deck('go', 5);
expect($.deck('getSlide')).toHaveClass('slide1');
});
it('should go nowhere if id does not exist', function() {
$.deck('go', 'i-dont-exist');
expect($.deck('getSlide')).toHaveClass('slide1');
});
});
describe('next()', function() {
it('should go to the next slide', function() {
$.deck('next');
expect($.deck('getSlide')).toHaveClass('slide2');
});
it('should go nowhere if on the last slide', function() {
$.deck('go', 4);
$.deck('next');
expect($.deck('getSlide')).toHaveClass('slide5');
});
});
describe('prev()', function() {
it('should go to the previous slide', function() {
$.deck('go', 2);
$.deck('prev');
expect($.deck('getSlide')).toHaveClass('slide2');
});
it('should go nowhere if on the first slide', function() {
$.deck('prev');
expect($.deck('getSlide')).toHaveClass('slide1');
});
});
});
describe('getters', function() {
beforeEach(function() {
$.deck('.slide');
});
describe('getSlide()', function() {
it('should get the current slide', function() {
expect($.deck('getSlide')).toHaveClass('slide1');
$.deck('go', 2);
expect($.deck('getSlide')).toHaveClass('slide3');
});
});
describe('getSlide(i)', function() {
it('should get slide number i (0 based index)', function() {
expect($.deck('getSlide', 1)).toHaveClass('slide2');
expect($.deck('getSlide', 3)).toHaveClass('slide4');
});
it('should return null if i is NaN', function() {
expect($.deck('getSlide', 'barfoo')).toBeNull();
});
it('should return null if i is out of bounds', function() {
expect($.deck('getSlide', 6)).toBeNull();
});
});
describe('getSlides()', function() {
it('should return an array of jQuery objects for each slide', function() {
var expectation = [],
slides = $.deck('getSlides');
$('.slide').each(function() {
expectation.push($(this));
});
expect(slides).toEqual(expectation);
});
});
describe('getContainer()', function() {
it('should return a jQuery object with the container element(s)', function() {
expect($.deck('getContainer')).toBe(defaults.selectors.container);
});
});
describe('getOptions()', function() {
it('should return the current options object', function() {
expect($.deck('getOptions')).toEqual(defaults);
});
});
});
describe('container states', function() {
beforeEach(function() {
$.deck('.slide');
});
it('should start at state 0', function() {
expect($(defaults.selectors.container)).toHaveClass(defaults.classes.onPrefix + '0');
});
it('should change states with the slide number', function() {
$.deck('next');
expect($(defaults.selectors.container)).toHaveClass(defaults.classes.onPrefix + '1');
$.deck('go', 3);
expect($(defaults.selectors.container)).toHaveClass(defaults.classes.onPrefix + '3');
$.deck('prev');
expect($(defaults.selectors.container)).toHaveClass(defaults.classes.onPrefix + '2');
});
});
describe('options object', function() {
var $d = $(document);
beforeEach(function() {
$.deck('.alt-slide', {
classes: {
after: 'alt-after',
before: 'alt-before',
current: 'alt-current',
onPrefix: 'alt-on-',
next: 'alt-next',
previous: 'alt-prev'
},
selectors: {
container: '.alt-container'
},
keys: {
next: 87,
previous: 69
}
});
});
describe('classes', function() {
it('should use the specified after class', function() {
expect($('.alt-slide3, .alt-slide4, .alt-slide5')).toHaveClass('alt-after');
});
it('should use the specified before class', function() {
$.deck('go', 4);
expect($('.alt-slide1, .alt-slide2, .alt-slide3')).toHaveClass('alt-before');
});
it('should use the specified container class', function() {
$.deck('go', 2);
expect($('.alt-container')).toHaveClass('alt-on-2');
});
it('should use the specified current class', function() {
expect($.deck('getSlide')).toHaveClass('alt-current');
});
it('should use the specified next class', function() {
expect($('.alt-slide2')).toHaveClass('alt-next');
});
it('should use the specified previous class', function() {
$.deck('next');
expect($('.alt-slide1')).toHaveClass('alt-prev');
});
});
describe('key bindings', function() {
var e;
beforeEach(function() {
e = jQuery.Event('keydown.deck');
});
it('should go to the next slide using the specified key', function() {
e.which = 87; // 'w'
$d.trigger(e);
expect($.deck('getSlide')).toHaveClass('alt-slide2');
});
it('should go to the previous slide using the specified key', function() {
$.deck('next');
e.which = 69; // 'e'
$d.trigger(e);
expect($.deck('getSlide')).toHaveClass('alt-slide1');
});
it('should not trigger events that originate within editable elements', function() {
var $outside = $('<input type="text" />').appendTo('body');
e = jQuery.Event('keydown');
e.which = 87;
$outside.trigger(e);
expect($.deck('getSlide')).toHaveClass('alt-slide1');
$outside.remove();
});
});
});
describe('events', function() {
var $d = $(document);
beforeEach(function() {
spyOnEvent($d, 'deck.init');
spyOnEvent($d, 'deck.beforeInit');
$.deck('.slide');
$.deck('go', 1);
spyOnEvent($d, 'deck.change');
});
describe('deck.change', function() {
it('should fire on go(i)', function() {
$.deck('go', 3);
expect('deck.change').toHaveBeenTriggeredOn($d);
});
it('should fire on next()', function() {
$.deck('next');
expect('deck.change').toHaveBeenTriggeredOn($d);
});
it('should fire on prev()', function() {
$.deck('prev');
expect('deck.change').toHaveBeenTriggeredOn($d);
});
it('should pass parameters with from and to indices', function() {
var f = function(e, from, to) {
expect(from).toEqual(1);
expect(to).toEqual(3);
};
$d.bind('deck.change', f);
$.deck('go', 3);
$d.unbind('deck.change', f);
});
it('should not change slides if default prevented', function() {
$d.bind('deck.change', false);
$.deck('go', 3);
expect($.deck('getSlide')).toEqual($.deck('getSlide', 1));
$d.unbind('deck.change', false);
});
});
describe('deck.init', function() {
it('should fire on deck initialization', function() {
expect('deck.init').toHaveBeenTriggeredOn($d);
});
it('should have already populated the slides array', function() {
var f = function() {
expect($.deck('getSlides').length).toBeGreaterThan(0);
};
$d.bind('deck.init', f);
$.deck('.slide');
$d.unbind('deck.init', f);
});
});
describe('deck.beforeInit', function() {
it('should fire on deck initialization', function() {
expect('deck.beforeInit').toHaveBeenTriggeredOn($d);
});
it('should have not populated the slides array', function() {
var f = function() {
expect($.deck('getSlides').length).toEqual(0);
};
$d.bind('deck.beforeInit', f);
$.deck('.slide');
$d.unbind('deck.beforeInit', f);
});
});
});
});
describe('complex html structure', function() {
beforeEach(function() {
loadFixtures('complex.html');
if (Modernizr.history) {
history.replaceState({}, "", "#")
}
$.deck([
'.slide1',
'.slide2',
'.slide3',
'.slide4',
'.slide5',
'.slide6',
'.slide7',
'.slide8',
'.slide9',
'.slide10',
]);
$.deck('go', 2);
});
describe('compound state classes', function() {
it('should apply current class', function() {
$('.slide3').each(function(i, el) {
expect($(el)).toHaveClass(defaults.classes.current);
});
});
it('should apply previous class', function() {
$('.slide2').each(function(i, el) {
expect($(el)).toHaveClass(defaults.classes.previous);
});
});
it('should apply next class', function() {
$('.slide4').each(function(i, el) {
expect($(el)).toHaveClass(defaults.classes.next);
});
});
it('should apply before class', function() {
$('.slide1').each(function(i, el) {
expect($(el)).toHaveClass(defaults.classes.before);
});
});
it('should apply after class', function() {
$('.slide5, .slide6, .slide7, .slide8, .slide9, .slide10').each(function(i, el) {
expect($(el)).toHaveClass(defaults.classes.after);
});
});
it('should apply child-current class', function() {
expect($('.slide2').not('.slide10')).toHaveClass(defaults.classes.childCurrent);
});
});
it('should remove old state classes', function() {
$.deck('go', 4);
expect($('.slide3').not('.slide5')).not.toHaveClass(defaults.classes.current);
expect($('.slide2').not('.slide4')).not.toHaveClass(defaults.classes.previous);
expect($('.slide4').not('.slide6')).not.toHaveClass(defaults.classes.next);
});
});
describe('iframes', function() {
beforeEach(function() {
loadFixtures('iframes.html');
if (Modernizr.history) {
history.replaceState({}, "", "#")
}
$.deck([
'.slide1',
'.slide2',
'.slide3',
'.slide4',
'.slide5',
'.slide6',
'.slide7',
'.slide8',
'.slide9',
'.slide10',
]);
});
it('should remove/restore iframe sources when leaving/entering a slide', function() {
$.deck('go', 4);
expect($.deck('getSlide').find('iframe').attr('src')).toEqual('fixtures/iframe_simple.html');
$.deck('next');
expect($('.slide5').find('iframe').attr('src')).toEqual('');
$.deck('prev');
expect($('.slide5').find('iframe').attr('src')).toEqual('fixtures/iframe_simple.html');
});
it('should not store blank iframe sources', function() {
$.deck('go', 6);
$.deck('next');
expect($.deck('getSlide').find('iframe').data('src')).toBeUndefined();
});
});
describe('empty deck', function() {
beforeEach(function() {
loadFixtures('empty.html');
$.deck('.slide');
});
describe('getSlide()', function() {
it('should not error on init', $.noop);
});
});
});

142
git/test/spec.goto.js Normal file
View file

@ -0,0 +1,142 @@
describe('Deck JS Quick Go-To', function() {
var $d = $(document);
beforeEach(function() {
loadFixtures('standard.html');
if (Modernizr.history) {
history.replaceState({}, "", "#")
}
else {
window.location.hash = '#';
}
$.deck('.slide');
});
describe('showGoTo()', function() {
it('should show the go-to helper', function() {
expect($(defaults.selectors.container)).not.toHaveClass(defaults.classes.goto);
$.deck('showGoTo');
expect($(defaults.selectors.container)).toHaveClass(defaults.classes.goto);
});
it('should focus the go-to input', function() {
$.deck('showGoTo');
expect($(defaults.selectors.gotoInput)[0]).toEqual(document.activeElement);
});
});
describe('hideGoTo()', function() {
beforeEach(function() {
$.deck('showGoTo');
$.deck('hideGoTo');
});
it('should hide the go-to helper', function() {
expect($(defaults.selectors.container)).not.toHaveClass(defaults.classes.goto);
});
it('should blur the go-to input', function() {
expect($(defaults.selectors.gotoInput)[0]).not.toEqual(document.activeElement);
});
});
describe('toggleGoTo()', function() {
it('should toggle the go-to helper on and off', function() {
expect($(defaults.selectors.container)).not.toHaveClass(defaults.classes.goto);
$.deck('toggleGoTo');
expect($(defaults.selectors.container)).toHaveClass(defaults.classes.goto);
$.deck('toggleGoTo');
expect($(defaults.selectors.container)).not.toHaveClass(defaults.classes.goto);
});
});
describe('Go-To submit', function() {
beforeEach(function() {
$.deck('showGoTo');
});
it('should hide the go-to helper', function() {
$(defaults.selectors.gotoInput).val('3');
$(defaults.selectors.gotoForm).submit();
expect($(defaults.selectors.container)).not.toHaveClass(defaults.classes.goto);
});
it('should go to the slide number entered', function() {
$(defaults.selectors.gotoInput).val('3');
$(defaults.selectors.gotoForm).submit();
expect($.deck('getSlide')).toEqual($.deck('getSlide'), 2);
});
it('should go to the slide id entered', function() {
$(defaults.selectors.gotoInput).val('custom-id');
$(defaults.selectors.gotoForm).submit();
expect($.deck('getSlide')).toEqual($.deck('getSlide'), 1);
});
it('should go nowhere if the number is negative', function() {
$(defaults.selectors.gotoInput).val('-2');
$(defaults.selectors.gotoForm).submit();
expect($.deck('getSlide')).toEqual($.deck('getSlide'), 0);
});
it('should go nowhere if the number is greater than the number of slides', function() {
$(defaults.selectors.gotoInput).val('9');
$(defaults.selectors.gotoForm).submit();
expect($.deck('getSlide')).toEqual($.deck('getSlide'), 0);
});
it('should go nowhere if the id does not exist', function() {
$(defaults.selectors.gotoInput).val('do-not-exist');
$(defaults.selectors.gotoForm).submit();
expect($.deck('getSlide')).toEqual($.deck('getSlide'), 0);
});
});
describe('Datalist population', function() {
it('should fill in options with all the slide ids', function() {
var $dataOptions = $(defaults.selectors.gotoDatalist).find('option');
expect($dataOptions.length).toEqual(5);
expect($dataOptions.eq(0).attr('value')).toEqual('slide-0');
expect($dataOptions.eq(1).attr('value')).toEqual('custom-id');
});
});
describe('key bindings', function() {
var e;
beforeEach(function() {
e = jQuery.Event('keydown.deckgoto');
});
it('should toggle the go-to helper if the specified key is pressed', function() {
e.which = 71; // g
$d.trigger(e);
expect($(defaults.selectors.container)).toHaveClass(defaults.classes.goto);
$d.trigger(e);
expect($(defaults.selectors.container)).not.toHaveClass(defaults.classes.goto);
});
});
describe('countNested false', function() {
beforeEach(function() {
loadFixtures('nesteds.html');
$.deck('.slide', {
countNested: false
});
$.deck('showGoTo');
});
it('should ignore nested slides when given a slide number', function() {
$(defaults.selectors.gotoInput).val('4');
$(defaults.selectors.gotoForm).submit();
expect($.deck('getSlide')).toHaveId('after');
});
it('should respect top side of new slide range', function() {
$.deck('go', 0);
$(defaults.selectors.gotoInput).val('6');
$(defaults.selectors.gotoForm).submit();
expect($.deck('getSlide')).toHaveId('slide-0');
});
});
});

81
git/test/spec.hash.js Normal file
View file

@ -0,0 +1,81 @@
describe('Deck JS Hash Extension', function() {
beforeEach(function() {
loadFixtures('standard.html');
if (Modernizr.history) {
history.replaceState({}, "", "#")
}
else {
window.location.hash = '#';
}
$.deck('.slide');
});
it('should assign ids to slides that do not have them', function() {
var slides = $.deck('getSlides');
$.each(slides, function(i, $e) {
expect($e.attr('id')).toBeTruthy();
});
});
it('should reassign ids on reinitialization', function() {
var $firstSlide = $.deck('getSlide', 0),
firstID = $firstSlide.attr('id');
$firstSlide.before('<div class="slide"></div>');
$.deck('.slide');
expect($firstSlide).not.toHaveId(firstID);
});
it('should update container with a state class including the slide id', function() {
var $c = $.deck('getContainer'),
osp = defaults.classes.onPrefix;
expect($c).toHaveClass(osp + $.deck('getSlide', 0).attr('id'));
$.deck('next');
expect($c).toHaveClass(osp + $.deck('getSlide', 1).attr('id'));
$.deck('next');
expect($c).not.toHaveClass(osp + $.deck('getSlide', 1).attr('id'));
expect($c).toHaveClass(osp + $.deck('getSlide', 2).attr('id'));
});
it('should update the href on slide change', function() {
var $hashLink = $(defaults.selectors.hashLink);
$.deck('go', 3);
expect($hashLink.attr('href')).toMatch('#slide-3');
});
it('should use existing ids if they exist', function() {
var $hashLink = $(defaults.selectors.hashLink);
$.deck('go', 1);
expect($hashLink.attr('href')).toMatch('#custom-id');
});
it('should update the URL on slide change (if supported)', function() {
if (Modernizr.history) {
$.deck('go', 3);
expect(window.location.hash).toEqual('#slide-3');
}
});
it('should deep link to slide on deck init', function() {
window.location.hash = "#slide-3";
$.deck('.slide');
expect($.deck('getSlide')).toHaveId('slide-3');
});
it('should follow internal hash links using hashchange (if supported)', function() {
if (Modernizr.hashchange) {
window.location.hash = "#slide-3";
// Hashchange event doesn't fire right when the hash changes?
waitsFor(function() {
return $.deck('getSlide').attr('id') === 'slide-3';
}, 'hash to change to slide-3', 2000);
}
});
it('should follow internal hash links on click', function() {
/* Triggered clicks dont generate hashchanges, so until I find
a way to do this in an automated fashion, needs to be hand tested. */
});
});

66
git/test/spec.menu.js Normal file
View file

@ -0,0 +1,66 @@
describe('Deck JS Menu', function() {
var $d = $(document),
dsc = defaults.selectors.container;
beforeEach(function() {
loadFixtures('standard.html');
if (Modernizr.history) {
history.replaceState({}, "", "#")
}
else {
window.location.hash = '#';
}
$.deck('.slide');
});
describe('showMenu()', function() {
it('should show the menu', function() {
expect($(dsc)).not.toHaveClass(defaults.classes.menu);
$.deck('showMenu');
expect($(dsc)).toHaveClass(defaults.classes.menu);
});
it('should do nothing if menu is already showing', function() {
if (Modernizr.csstransforms) {
$.deck('showMenu');
$.deck('showMenu');
$.deck('hideMenu');
expect($('.slide').attr('style')).toBeFalsy();
}
});
});
describe('hideMenu()', function() {
it('should hide the menu', function() {
$.deck('showMenu');
$.deck('hideMenu');
expect($(dsc)).not.toHaveClass(defaults.classes.menu);
});
});
describe('toggleMenu()', function() {
it('should toggle menu on and off', function() {
expect($(dsc)).not.toHaveClass(defaults.classes.menu);
$.deck('toggleMenu');
expect($(dsc)).toHaveClass(defaults.classes.menu);
$.deck('toggleMenu');
expect($(dsc)).not.toHaveClass(defaults.classes.menu);
});
});
describe('key bindings', function() {
var e;
beforeEach(function() {
e = jQuery.Event('keydown.deckmenu');
});
it('should toggle the menu if the specified key is pressed', function() {
e.which = 77; // m
$d.trigger(e);
expect($(dsc)).toHaveClass(defaults.classes.menu);
$d.trigger(e);
expect($(dsc)).not.toHaveClass(defaults.classes.menu);
});
});
});

View file

@ -0,0 +1,51 @@
describe('Deck JS Navigation Buttons', function() {
beforeEach(function() {
loadFixtures('standard.html');
if (Modernizr.history) {
history.replaceState({}, "", "#")
}
else {
window.location.hash = '#';
}
$.deck('.slide');
});
it('should go to the next slide if next link is clicked', function() {
$(defaults.selectors.nextLink).click();
expect($.deck('getSlide')).toHaveClass('slide2');
});
it('should go to the previous slide if previous link is clicked', function() {
$.deck('go', 2);
$(defaults.selectors.previousLink).click();
expect($.deck('getSlide')).toHaveClass('slide2');
});
it('should add the disabled class to the previous link if on first slide', function() {
expect($(defaults.selectors.previousLink)).toHaveClass(defaults.classes.navDisabled);
$(defaults.selectors.nextLink).click();
expect($(defaults.selectors.previousLink)).not.toHaveClass(defaults.classes.navDisabled);
$(defaults.selectors.previousLink).click();
expect($(defaults.selectors.previousLink)).toHaveClass(defaults.classes.navDisabled);
});
it('should add the disabled class to the next link if on last slide', function() {
expect($(defaults.selectors.nextLink)).not.toHaveClass(defaults.classes.navDisabled);
$.deck('go', $.deck('getSlides').length - 1);
expect($(defaults.selectors.nextLink)).toHaveClass(defaults.classes.navDisabled);
});
it('should not start disabled if deck initialized in the middle', function() {
$.deck('go', 2);
$.deck('.slide');
expect($(defaults.selectors.previousLink)).not.toHaveClass(defaults.classes.navDisabled);
});
it('should update the links hrefs with real fragment ids', function() {
expect($(defaults.selectors.previousLink).attr('href')).toMatch(/#$/);
expect($(defaults.selectors.nextLink).attr('href')).toMatch('#custom-id');
$.deck('go', 2);
expect($(defaults.selectors.previousLink).attr('href')).toMatch('#custom-id');
expect($(defaults.selectors.nextLink).attr('href')).toMatch('#slide-3');
});
});

57
git/test/spec.scale.js Normal file
View file

@ -0,0 +1,57 @@
describe('Deck JS Status Indicator', function() {
beforeEach(function() {
loadFixtures('standard.html');
if (Modernizr.history) {
history.replaceState({}, "", "#")
}
else {
window.location.hash = '#';
}
$.deck('.slide');
});
it('should start with scaling enabled', function() {
expect($.deck('getContainer')).toHaveClass(defaults.classes.scale);
});
describe('disableScale()', function() {
it('should remove the scale class from the container', function() {
$.deck('disableScale');
expect($.deck('getContainer')).not.toHaveClass(defaults.classes.scale);
});
});
describe('enableScale()', function() {
it('should add the scale class to the container', function() {
$.deck('disableScale');
$.deck('enableScale');
expect($.deck('getContainer')).toHaveClass(defaults.classes.scale);
});
});
describe('toggleScale()', function() {
it('should toggle between adding and removing the scale class', function() {
$.deck('toggleScale');
expect($.deck('getContainer')).not.toHaveClass(defaults.classes.scale);
$.deck('toggleScale');
expect($.deck('getContainer')).toHaveClass(defaults.classes.scale);
});
});
describe('key bindings', function() {
var e,
$d = $(document);
beforeEach(function() {
e = jQuery.Event('keydown.deckscale');
});
it('should toggle scaling if the specified key is pressed', function() {
e.which = 83; // s
$d.trigger(e);
expect($.deck('getContainer')).not.toHaveClass(defaults.classes.scale);
$d.trigger(e);
expect($.deck('getContainer')).toHaveClass(defaults.classes.scale);
});
});
});

58
git/test/spec.status.js Normal file
View file

@ -0,0 +1,58 @@
describe('Deck JS Status Indicator', function() {
beforeEach(function() {
loadFixtures('standard.html');
if (Modernizr.history) {
history.replaceState({}, "", "#")
}
else {
window.location.hash = '#';
}
$.deck('.slide');
});
it('should show the correct total number of slides', function() {
expect($(defaults.selectors.statusTotal)).toHaveText($.deck('getSlides').length);
});
it('should start at the right current slide', function() {
expect($(defaults.selectors.statusCurrent)).toHaveText(1);
$.deck('go', 2);
$.deck('.slide');
expect($(defaults.selectors.statusCurrent)).toHaveText(3);
});
it('should update to the correct number on slide change', function() {
$.deck('go', 2);
expect($(defaults.selectors.statusCurrent)).toHaveText('3');
});
});
describe('countNested false indicator', function() {
beforeEach(function() {
loadFixtures('nesteds.html');
if (Modernizr.history) {
history.replaceState({}, "", "#")
}
else {
window.location.hash = '#';
}
$.deck('.slide', {
countNested: false
});
});
it('should ignore nested slides in the total', function() {
expect($(defaults.selectors.statusTotal)).toHaveText('5');
});
it('should update to the root slide number when nested becomes active', function() {
$.deck('go', 10);
expect($(defaults.selectors.statusCurrent)).toHaveText('4');
$.deck('prev');
expect($(defaults.selectors.statusCurrent)).toHaveText('3');
$.deck('go', 3);
expect($(defaults.selectors.statusCurrent)).toHaveText('3');
$.deck('go', 1);
expect($(defaults.selectors.statusCurrent)).toHaveText('2');
});
});

123
git/themes/style/neon.css Normal file
View file

@ -0,0 +1,123 @@
.deck-container {
font-family: "Gill Sans", "Gill Sans MT", Calibri, sans-serif;
font-size: 1.75em;
color: #aaa;
background: #000;
}
.deck-container .slide {
background: #000;
}
.deck-container .slide h1 {
color: #0af;
font-weight: normal;
font-weight: 100;
text-shadow: 0 0 50px #0af, 0 0 3px #fff;
}
.deck-container .slide h2 {
color: #af0;
border-bottom-color: #ccc;
font-weight: normal;
font-weight: 100;
text-shadow: 0 0 15px #af0, 0 0 2px #fff;
border-bottom: 1px solid #333;
}
.deck-container .slide h3 {
color: #fff;
font-weight: normal;
font-weight: 100;
text-shadow: 0 0 10px #fff, 0 0 2px #fff;
}
.deck-container .slide pre {
border-color: #333;
}
.deck-container .slide pre code {
color: #fff;
}
.deck-container .slide code {
color: #f0a;
}
.deck-container .slide blockquote {
font-size: 2em;
padding: 1em 2em;
color: #fff;
border-left: 5px solid #fff;
}
.deck-container .slide blockquote p {
margin: 0;
}
.deck-container .slide blockquote cite {
font-size: .5em;
font-style: normal;
font-weight: normal;
font-weight: 100;
color: #aaa;
text-shadow: 0 0 15px #fff, 0 0 2px #fff;
}
.deck-container .slide ::-moz-selection {
background: #a0f;
}
.deck-container .slide ::selection {
background: #a0f;
}
.deck-container .slide a, .deck-container .slide a:hover, .deck-container .slide a:focus, .deck-container .slide a:active, .deck-container .slide a:visited {
color: #f0a;
text-decoration: none;
}
.deck-container .slide a:hover, .deck-container .slide a:focus {
text-decoration: underline;
}
.deck-container .deck-prev-link, .deck-container .deck-next-link {
background: #f0a;
text-shadow: 0 0 3px #fff;
}
.deck-container .deck-prev-link, .deck-container .deck-prev-link:hover, .deck-container .deck-prev-link:focus, .deck-container .deck-prev-link:active, .deck-container .deck-prev-link:visited, .deck-container .deck-next-link, .deck-container .deck-next-link:hover, .deck-container .deck-next-link:focus, .deck-container .deck-next-link:active, .deck-container .deck-next-link:visited {
color: #fff;
}
.deck-container .deck-prev-link:hover, .deck-container .deck-prev-link:focus, .deck-container .deck-next-link:hover, .deck-container .deck-next-link:focus {
text-decoration: none;
}
.boxshadow .deck-container .deck-prev-link:hover, .boxshadow .deck-container .deck-prev-link:focus, .boxshadow .deck-container .deck-next-link:hover, .boxshadow .deck-container .deck-next-link:focus {
-webkit-box-shadow: 0 0 20px #f0a, 0 0 5px #fff;
-moz-box-shadow: 0 0 20px #f0a, 0 0 5px #fff;
box-shadow: 0 0 20px #f0a, 0 0 5px #fff;
}
.deck-container > .slide .deck-before, .deck-container > .slide .deck-previous {
opacity: 0.4;
}
.deck-container > .slide .deck-before:not(.deck-child-current) .deck-before, .deck-container > .slide .deck-before:not(.deck-child-current) .deck-previous, .deck-container > .slide .deck-previous:not(.deck-child-current) .deck-before, .deck-container > .slide .deck-previous:not(.deck-child-current) .deck-previous {
opacity: 1;
}
.deck-container > .slide .deck-child-current {
opacity: 1;
}
.deck-container .deck-status {
font-size: 0.6666em;
}
.deck-container .goto-form {
background: #000;
border: 1px solid #f0a;
}
.deck-container .goto-form label {
color: #fff;
}
.deck-container.deck-menu .slide {
background: #333;
}
.deck-container.deck-menu .deck-current {
background: #444;
}
.boxshadow .deck-container.deck-menu .deck-current {
background: #000;
-webkit-box-shadow: 0 0 20px #f0a, 0 0 5px #fff;
-moz-box-shadow: 0 0 20px #f0a, 0 0 5px #fff;
box-shadow: 0 0 20px #f0a, 0 0 5px #fff;
}
.no-touch .deck-container.deck-menu .slide:hover {
background: #444;
}
.no-touch.boxshadow .deck-container.deck-menu .slide:hover {
background: #000;
-webkit-box-shadow: 0 0 20px #f0a, 0 0 5px #fff;
-moz-box-shadow: 0 0 20px #f0a, 0 0 5px #fff;
box-shadow: 0 0 20px #f0a, 0 0 5px #fff;
}

155
git/themes/style/neon.scss Normal file
View file

@ -0,0 +1,155 @@
.deck-container {
font-family: "Gill Sans", "Gill Sans MT", Calibri, sans-serif;
font-size:1.75em;
color:#aaa;
background:#000;
.slide {
background:#000;
h1 {
color:#0af;
font-weight:normal;
font-weight:100;
text-shadow:0 0 50px #0af, 0 0 3px #fff;
}
h2 {
color:#af0;
border-bottom-color:#ccc;
font-weight:normal;
font-weight:100;
text-shadow:0 0 15px #af0, 0 0 2px #fff;
border-bottom:1px solid #333;
}
h3 {
color:#fff;
font-weight:normal;
font-weight:100;
text-shadow:0 0 10px #fff, 0 0 2px #fff;
}
pre {
border-color:#333;
code {
color:#fff;
}
}
code {
color:#f0a;
}
blockquote {
font-size:2em;
padding:1em 2em;
color:#fff;
border-left:5px solid #fff;
p {
margin:0;
}
cite {
font-size:.5em;
font-style:normal;
font-weight:normal;
font-weight:100;
color:#aaa;
text-shadow:0 0 15px #fff, 0 0 2px #fff;
}
}
::-moz-selection{ background:#a0f; }
::selection { background:#a0f; }
a {
&, &:hover, &:focus, &:active, &:visited {
color:#f0a;
text-decoration:none;
}
&:hover, &:focus {
text-decoration:underline;
}
}
}
.deck-prev-link, .deck-next-link {
background:#f0a;
text-shadow:0 0 3px #fff;
&, &:hover, &:focus, &:active, &:visited {
color:#fff;
}
&:hover, &:focus {
text-decoration:none;
.boxshadow & {
-webkit-box-shadow:0 0 20px #f0a, 0 0 5px #fff;
-moz-box-shadow:0 0 20px #f0a, 0 0 5px #fff;
box-shadow:0 0 20px #f0a, 0 0 5px #fff;
}
}
}
> .slide {
.deck-before, .deck-previous {
opacity:0.4;
&:not(.deck-child-current) {
.deck-before, .deck-previous {
opacity:1;
}
}
}
.deck-child-current {
opacity:1;
}
}
.deck-status {
font-size:0.6666em;
}
.goto-form {
background:#000;
border:1px solid #f0a;
label {
color:#fff;
}
}
&.deck-menu {
.slide {
background:#333;
}
.deck-current {
background:#444;
.boxshadow & {
background:#000;
-webkit-box-shadow:0 0 20px #f0a, 0 0 5px #fff;
-moz-box-shadow:0 0 20px #f0a, 0 0 5px #fff;
box-shadow:0 0 20px #f0a, 0 0 5px #fff;
}
}
.no-touch & .slide:hover {
background:#444;
}
.no-touch.boxshadow & .slide:hover {
background:#000;
-webkit-box-shadow:0 0 20px #f0a, 0 0 5px #fff;
-moz-box-shadow:0 0 20px #f0a, 0 0 5px #fff;
box-shadow:0 0 20px #f0a, 0 0 5px #fff;
}
}
}

View file

@ -0,0 +1,84 @@
.deck-container {
font-family: "Helvetica Neue", sans-serif;
font-size: 1.75em;
background: #fff;
}
.deck-container .slide {
background: #fff;
}
.deck-container .slide h1 {
color: #000;
}
.deck-container .slide h2 {
color: #c00;
border-bottom-color: #ccc;
}
.deck-container .slide h3 {
color: #888;
}
.deck-container .slide pre {
border-color: #ccc;
}
.deck-container .slide code {
color: #888;
}
.deck-container .slide blockquote {
font-size: 2em;
font-style: italic;
padding: 1em 2em;
color: #000;
border-left: 5px solid #ccc;
}
.deck-container .slide blockquote p {
margin: 0;
}
.deck-container .slide blockquote cite {
font-size: .5em;
font-style: normal;
font-weight: bold;
color: #888;
}
.deck-container .slide ::-moz-selection {
background: #c00;
color: #fff;
}
.deck-container .slide ::selection {
background: #c00;
color: #fff;
}
.deck-container .slide a, .deck-container .slide a:hover, .deck-container .slide a:focus, .deck-container .slide a:active, .deck-container .slide a:visited {
color: #c00;
text-decoration: none;
}
.deck-container .slide a:hover, .deck-container .slide a:focus {
text-decoration: underline;
}
.deck-container > .slide .deck-before, .deck-container > .slide .deck-previous {
opacity: 0.4;
}
.deck-container > .slide .deck-before:not(.deck-child-current) .deck-before, .deck-container > .slide .deck-before:not(.deck-child-current) .deck-previous, .deck-container > .slide .deck-previous:not(.deck-child-current) .deck-before, .deck-container > .slide .deck-previous:not(.deck-child-current) .deck-previous {
opacity: 1;
}
.deck-container > .slide .deck-child-current {
opacity: 1;
}
.deck-container .deck-prev-link, .deck-container .deck-next-link {
background: #ccc;
font-family: serif;
}
.deck-container .deck-prev-link, .deck-container .deck-prev-link:hover, .deck-container .deck-prev-link:focus, .deck-container .deck-prev-link:active, .deck-container .deck-prev-link:visited, .deck-container .deck-next-link, .deck-container .deck-next-link:hover, .deck-container .deck-next-link:focus, .deck-container .deck-next-link:active, .deck-container .deck-next-link:visited {
color: #fff;
}
.deck-container .deck-prev-link:hover, .deck-container .deck-prev-link:focus, .deck-container .deck-next-link:hover, .deck-container .deck-next-link:focus {
background: #c00;
text-decoration: none;
}
.deck-container .deck-status {
font-size: 0.6666em;
}
.deck-container.deck-menu .slide {
background: #eee;
}
.deck-container.deck-menu .deck-current, .no-touch .deck-container.deck-menu .slide:hover {
background: #ddf;
}

107
git/themes/style/swiss.scss Normal file
View file

@ -0,0 +1,107 @@
.deck-container {
font-family: "Helvetica Neue", sans-serif;
font-size:1.75em;
background:#fff;
.slide {
background:#fff;
h1 {
color:#000;
}
h2 {
color:#c00;
border-bottom-color:#ccc;
}
h3 {
color:#888;
}
pre {
border-color:#ccc;
}
code {
color:#888;
}
blockquote {
font-size:2em;
font-style:italic;
padding:1em 2em;
color:#000;
border-left:5px solid #ccc;
p {
margin:0;
}
cite {
font-size:.5em;
font-style:normal;
font-weight:bold;
color:#888;
}
}
::-moz-selection{ background:#c00; color:#fff; }
::selection { background:#c00; color:#fff; }
a {
&, &:hover, &:focus, &:active, &:visited {
color:#c00;
text-decoration:none;
}
&:hover, &:focus {
text-decoration:underline;
}
}
}
> .slide {
.deck-before, .deck-previous {
opacity:0.4;
&:not(.deck-child-current) {
.deck-before, .deck-previous {
opacity:1;
}
}
}
.deck-child-current {
opacity:1;
}
}
.deck-prev-link, .deck-next-link {
background:#ccc;
font-family:serif; // sans-serif arrows x-browser fail
&, &:hover, &:focus, &:active, &:visited {
color:#fff;
}
&:hover, &:focus {
background:#c00;
text-decoration:none;
}
}
.deck-status {
font-size:0.6666em;
}
&.deck-menu {
.slide {
background:#eee;
}
.deck-current, .no-touch & .slide:hover {
background:#ddf;
}
}
}

View file

@ -0,0 +1,214 @@
@charset "UTF-8";
.deck-container {
font-family: "Gill Sans", "Gill Sans MT", Calibri, sans-serif;
font-size: 1.75em;
background: #f4fafe;
/* Old browsers */
background: -moz-linear-gradient(top, #f4fafe 0%, #ccf0f0 100%);
/* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f4fafe), color-stop(100%, #ccf0f0));
/* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #f4fafe 0%, #ccf0f0 100%);
/* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #f4fafe 0%, #ccf0f0 100%);
/* Opera11.10+ */
background: -ms-linear-gradient(top, #f4fafe 0%, #ccf0f0 100%);
/* IE10+ */
background: linear-gradient(top, #f4fafe 0%, #ccf0f0 100%);
/* W3C */
background-attachment: fixed;
}
.deck-container > .slide {
text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.5);
}
.deck-container > .slide .deck-before, .deck-container > .slide .deck-previous {
opacity: 0.4;
}
.deck-container > .slide .deck-before:not(.deck-child-current) .deck-before, .deck-container > .slide .deck-before:not(.deck-child-current) .deck-previous, .deck-container > .slide .deck-previous:not(.deck-child-current) .deck-before, .deck-container > .slide .deck-previous:not(.deck-child-current) .deck-previous {
opacity: 1;
}
.deck-container > .slide .deck-child-current {
opacity: 1;
}
.deck-container .slide h1, .deck-container .slide h2, .deck-container .slide h3, .deck-container .slide h4, .deck-container .slide h5, .deck-container .slide h6 {
font-family: "Hoefler Text", Constantia, Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
}
.deck-container .slide h1 {
color: #08455f;
}
.deck-container .slide h2 {
color: #0b7495;
border-bottom: 0;
}
.cssreflections .deck-container .slide h2 {
line-height: 1;
-webkit-box-reflect: below -0.556em -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(0.3, transparent), color-stop(0.7, rgba(255, 255, 255, 0.1)), to(transparent));
-moz-box-reflect: below -0.556em -moz-linear-gradient(top, transparent 0%, transparent 30%, rgba(255, 255, 255, 0.3) 100%);
}
.deck-container .slide h3 {
color: #000;
}
.deck-container .slide pre {
border-color: #cde;
background: #fff;
position: relative;
z-index: auto;
/* http://nicolasgallagher.com/css-drop-shadows-without-images/ */
}
.borderradius .deck-container .slide pre {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.csstransforms.boxshadow .deck-container .slide pre > :first-child:before {
content: "";
position: absolute;
z-index: -1;
background: #fff;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
.csstransforms.boxshadow .deck-container .slide pre:before, .csstransforms.boxshadow .deck-container .slide pre:after {
content: "";
position: absolute;
z-index: -2;
bottom: 15px;
width: 50%;
height: 20%;
max-width: 300px;
-webkit-box-shadow: 0 15px 10px rgba(0, 0, 0, 0.7);
-moz-box-shadow: 0 15px 10px rgba(0, 0, 0, 0.7);
box-shadow: 0 15px 10px rgba(0, 0, 0, 0.7);
}
.csstransforms.boxshadow .deck-container .slide pre:before {
left: 10px;
-webkit-transform: rotate(-3deg);
-moz-transform: rotate(-3deg);
-ms-transform: rotate(-3deg);
-o-transform: rotate(-3deg);
transform: rotate(-3deg);
}
.csstransforms.boxshadow .deck-container .slide pre:after {
right: 10px;
-webkit-transform: rotate(3deg);
-moz-transform: rotate(3deg);
-ms-transform: rotate(3deg);
-o-transform: rotate(3deg);
transform: rotate(3deg);
}
.deck-container .slide code {
color: #789;
}
.deck-container .slide blockquote {
font-family: "Hoefler Text", Constantia, Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
font-size: 2em;
padding: 1em 2em .5em 2em;
color: #000;
background: #fff;
position: relative;
border: 1px solid #cde;
z-index: auto;
}
.borderradius .deck-container .slide blockquote {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.boxshadow .deck-container .slide blockquote > :first-child:before {
content: "";
position: absolute;
z-index: -1;
background: #fff;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
.boxshadow .deck-container .slide blockquote:after {
content: "";
position: absolute;
z-index: -2;
top: 10px;
bottom: 10px;
left: 0;
right: 50%;
-moz-border-radius: 10px/100px;
border-radius: 10px/100px;
-webkit-box-shadow: 0 0 15px rgba(0, 0, 0, 0.6);
-moz-box-shadow: 0 0 15px rgba(0, 0, 0, 0.6);
box-shadow: 0 0 15px rgba(0, 0, 0, 0.6);
}
.deck-container .slide blockquote p {
margin: 0;
}
.deck-container .slide blockquote cite {
font-size: .5em;
font-style: normal;
font-weight: bold;
color: #888;
}
.deck-container .slide blockquote:before {
content: "“";
position: absolute;
top: 0;
left: 0;
font-size: 5em;
line-height: 1;
color: #ccf0f0;
z-index: 1;
}
.deck-container .slide ::-moz-selection {
background: #08455f;
color: #fff;
}
.deck-container .slide ::selection {
background: #08455f;
color: #fff;
}
.deck-container .slide a, .deck-container .slide a:hover, .deck-container .slide a:focus, .deck-container .slide a:active, .deck-container .slide a:visited {
color: #599;
text-decoration: none;
}
.deck-container .slide a:hover, .deck-container .slide a:focus {
text-decoration: underline;
}
.deck-container .deck-prev-link, .deck-container .deck-next-link {
background: #fff;
opacity: 0.5;
}
.deck-container .deck-prev-link, .deck-container .deck-prev-link:hover, .deck-container .deck-prev-link:focus, .deck-container .deck-prev-link:active, .deck-container .deck-prev-link:visited, .deck-container .deck-next-link, .deck-container .deck-next-link:hover, .deck-container .deck-next-link:focus, .deck-container .deck-next-link:active, .deck-container .deck-next-link:visited {
color: #599;
}
.deck-container .deck-prev-link:hover, .deck-container .deck-prev-link:focus, .deck-container .deck-next-link:hover, .deck-container .deck-next-link:focus {
opacity: 1;
text-decoration: none;
}
.deck-container .deck-status {
font-size: 0.6666em;
}
.deck-container.deck-menu .slide {
background: transparent;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.rgba .deck-container.deck-menu .slide {
background: rgba(0, 0, 0, 0.1);
}
.deck-container.deck-menu .slide.deck-current, .rgba .deck-container.deck-menu .slide.deck-current, .no-touch .deck-container.deck-menu .slide:hover {
background: #fff;
}
.deck-container .goto-form {
background: #fff;
border: 1px solid #cde;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.boxshadow .deck-container .goto-form {
-webkit-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;
-moz-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;
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;
}

View file

@ -0,0 +1,250 @@
@mixin border-radius($r) {
-webkit-border-radius:$r;
-moz-border-radius:$r;
border-radius:$r;
}
@mixin rotate($deg) {
-webkit-transform:rotate($deg);
-moz-transform:rotate($deg);
-ms-transform:rotate($deg);
-o-transform:rotate($deg);
transform:rotate($deg);
}
@mixin box-shadow($x, $y, $blur, $color) {
-webkit-box-shadow:$x $y $blur $color;
-moz-box-shadow:$x $y $blur $color;
box-shadow:$x $y $blur $color;
}
.deck-container {
font-family: "Gill Sans", "Gill Sans MT", Calibri, sans-serif;
font-size:1.75em;
background: rgb(244,250,254); /* Old browsers */
background: -moz-linear-gradient(top, rgba(244,250,254,1) 0%, rgba(204,240,240,1) 100%); /* FF3.6+ */
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+ */
background: -webkit-linear-gradient(top, rgba(244,250,254,1) 0%,rgba(204,240,240,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(244,250,254,1) 0%,rgba(204,240,240,1) 100%); /* Opera11.10+ */
background: -ms-linear-gradient(top, rgba(244,250,254,1) 0%,rgba(204,240,240,1) 100%); /* IE10+ */
background: linear-gradient(top, rgba(244,250,254,1) 0%,rgba(204,240,240,1) 100%); /* W3C */
background-attachment: fixed;
> .slide {
text-shadow:1px 1px 1px rgba(255,255,255,.5);
.deck-before, .deck-previous {
opacity:0.4;
&:not(.deck-child-current) {
.deck-before, .deck-previous {
opacity:1;
}
}
}
.deck-child-current {
opacity:1;
}
}
.slide {
h1, h2, h3, h4, h5, h6 {
font-family: "Hoefler Text", Constantia, Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
}
h1 {
color:#08455f;
}
h2 {
color:#0b7495;
border-bottom:0;
.cssreflections & {
line-height:1;
-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));
-moz-box-reflect:below -0.5555em -moz-linear-gradient(top, transparent 0%, transparent 30%, rgba(255,255,255,.3) 100%);
}
}
h3 {
color:#000;
}
pre {
border-color:#cde;
background:#fff;
position:relative;
z-index:auto;
.borderradius & {
@include border-radius(5px);
}
/* http://nicolasgallagher.com/css-drop-shadows-without-images/ */
.csstransforms.boxshadow & {
> :first-child:before {
content:"";
position:absolute;
z-index:-1;
background:#fff;
top:0;
bottom:0;
left:0;
right:0;
}
&:before, &:after {
content:"";
position:absolute;
z-index:-2;
bottom:15px;
width:50%;
height:20%;
max-width:300px;
@include box-shadow(0, 15px, 10px, rgba(0, 0, 0, 0.7));
}
&:before {
left:10px;
@include rotate(-3deg);
}
&:after {
right:10px;
@include rotate(3deg);
}
}
}
code {
color:#789;
}
blockquote {
font-family: "Hoefler Text", Constantia, Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
font-size:2em;
padding:1em 2em .5em 2em;
color:#000;
background:#fff;
position:relative;
border:1px solid #cde;
z-index:auto;
.borderradius & {
@include border-radius(5px);
}
.boxshadow & {
> :first-child:before {
content:"";
position:absolute;
z-index:-1;
background:#fff;
top:0;
bottom:0;
left:0;
right:0;
}
&:after {
content:"";
position:absolute;
z-index:-2;
top: 10px;
bottom: 10px;
left: 0;
right: 50%;
-moz-border-radius: 10px / 100px;
border-radius: 10px / 100px;
@include box-shadow(0, 0, 15px, rgba(0,0,0,0.6));
}
}
p {
margin:0;
}
cite {
font-size:.5em;
font-style:normal;
font-weight:bold;
color:#888;
}
&:before {
content:"";
position:absolute;
top:0;
left:0;
font-size:5em;
line-height:1;
color:#ccf0f0;
z-index:1;
}
}
::-moz-selection{ background:#08455f; color:#fff; }
::selection { background:#08455f; color:#fff; }
a {
&, &:hover, &:focus, &:active, &:visited {
color:#599;
text-decoration:none;
}
&:hover, &:focus {
text-decoration:underline;
}
}
}
.deck-prev-link, .deck-next-link {
background:#fff;
opacity:0.5;
&, &:hover, &:focus, &:active, &:visited {
color:#599;
}
&:hover, &:focus {
opacity:1;
text-decoration:none;
}
}
.deck-status {
font-size:0.6666em;
}
&.deck-menu {
.slide {
background:transparent;
@include border-radius(5px);
.rgba & {
background:rgba(0,0,0,.1);
}
&.deck-current, .rgba &.deck-current, .no-touch &:hover {
background:#fff;
}
}
}
.goto-form {
background:#fff;
border:1px solid #cde;
@include border-radius(5px);
.boxshadow & {
-webkit-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;
-moz-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;
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;
}
}
}

View file

@ -0,0 +1,43 @@
.csstransitions.csstransforms .deck-container .slide {
-webkit-transition: opacity 500ms ease-in-out 0ms;
-moz-transition: opacity 500ms ease-in-out 0ms;
-ms-transition: opacity 500ms ease-in-out 0ms;
-o-transition: opacity 500ms ease-in-out 0ms;
transition: opacity 500ms ease-in-out 0ms;
}
.csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide {
position: absolute;
top: 0;
left: 0;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
width: 100%;
padding: 0 48px;
}
.csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .slide {
position: relative;
left: 0;
top: 0;
}
.csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .deck-next, .csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .deck-after {
opacity: 0;
}
.csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .deck-current {
opacity: 1;
}
.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 {
opacity: 0;
pointer-events: none;
}
.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-before .slide, .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-previous .slide {
visibility: visible;
}
.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-child-current {
opacity: 1;
visibility: visible;
pointer-events: auto;
}
.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-child-current .deck-next, .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-child-current .deck-after {
visibility: hidden;
}

View file

@ -0,0 +1,69 @@
@mixin translate($x: 0, $y: 0, $z: 0) {
-webkit-transform:translate3d($x, $y, $z);
-moz-transform:translate($x, $y);
-ms-transform:translate($x, $y);
-o-transform:translate($x, $y);
transform:translate3d($x, $y, $z);
}
@mixin transition($prop, $duration, $easing: ease-in-out, $delay: 0ms) {
-webkit-transition:$prop $duration $easing $delay;
-moz-transition:$prop $duration $easing $delay;
-ms-transition:$prop $duration $easing $delay;
-o-transition:$prop $duration $easing $delay;
transition:$prop $duration $easing $delay;
}
.csstransitions.csstransforms {
.deck-container .slide {
@include transition(opacity, 500ms);
}
.deck-container:not(.deck-menu) {
> .slide {
position:absolute;
top:0;
left:0;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
width:100%;
padding:0 48px;
.slide {
position:relative;
left:0;
top:0;
}
.deck-next, .deck-after {
opacity:0;
}
.deck-current {
opacity:1;
}
}
> .deck-previous, > .deck-before, > .deck-next, > .deck-after {
opacity:0;
pointer-events:none;
}
> .deck-before, > .deck-previous {
.slide {
visibility:visible;
}
}
> .deck-child-current {
opacity:1;
visibility:visible;
pointer-events:auto;
.deck-next, .deck-after {
visibility:hidden;
}
}
}
}

View file

@ -0,0 +1,76 @@
.csstransitions.csstransforms {
overflow-x: hidden;
}
.csstransitions.csstransforms .deck-container > .slide {
-webkit-transition: -webkit-transform 500ms ease-in-out;
-moz-transition: -moz-transform 500ms ease-in-out;
-ms-transition: -ms-transform 500ms ease-in-out;
-o-transition: -o-transform 500ms ease-in-out;
transition: transform 500ms ease-in-out;
}
.csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide {
position: absolute;
top: 0;
left: 0;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
width: 100%;
padding: 0 48px;
}
.csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .slide {
position: relative;
left: 0;
top: 0;
-webkit-transition: -webkit-transform 500ms ease-in-out, opacity 500ms ease-in-out;
-moz-transition: -moz-transform 500ms ease-in-out, opacity 500ms ease-in-out;
-ms-transition: -ms-transform 500ms ease-in-out, opacity 500ms ease-in-out;
-o-transition: -o-transform 500ms ease-in-out, opacity 500ms ease-in-out;
transition: -webkit-transform 500ms ease-in-out, opacity 500ms ease-in-out;
}
.csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .deck-next, .csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .deck-after {
visibility: visible;
-webkit-transform: translate3d(200%, 0, 0);
-moz-transform: translate(200%, 0);
-ms-transform: translate(200%, 0);
-o-transform: translate(200%, 0);
transform: translate3d(200%, 0, 0);
}
.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-previous {
-webkit-transform: translate3d(-200%, 0, 0);
-moz-transform: translate(-200%, 0);
-ms-transform: translate(-200%, 0);
-o-transform: translate(-200%, 0);
transform: translate3d(-200%, 0, 0);
}
.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-before {
-webkit-transform: translate3d(-400%, 0, 0);
-moz-transform: translate(-400%, 0);
-ms-transform: translate(-400%, 0);
-o-transform: translate(-400%, 0);
transform: translate3d(-400%, 0, 0);
}
.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-next {
-webkit-transform: translate3d(200%, 0, 0);
-moz-transform: translate(200%, 0);
-ms-transform: translate(200%, 0);
-o-transform: translate(200%, 0);
transform: translate3d(200%, 0, 0);
}
.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-after {
-webkit-transform: translate3d(400%, 0, 0);
-moz-transform: translate(400%, 0);
-ms-transform: translate(400%, 0);
-o-transform: translate(400%, 0);
transform: translate3d(400%, 0, 0);
}
.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-before .slide, .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-previous .slide {
visibility: visible;
}
.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-child-current {
-webkit-transform: none;
-moz-transform: none;
-ms-transform: none;
-o-transform: none;
transform: none;
}

View file

@ -0,0 +1,90 @@
@mixin translate($x: 0, $y: 0, $z: 0) {
-webkit-transform:translate3d($x, $y, $z);
-moz-transform:translate($x, $y);
-ms-transform:translate($x, $y);
-o-transform:translate($x, $y);
transform:translate3d($x, $y, $z);
}
@mixin transition($prop, $duration, $easing: ease-in-out, $delay: 0ms) {
-webkit-transition:$prop $duration $easing $delay;
-moz-transition:$prop $duration $easing $delay;
-ms-transition:$prop $duration $easing $delay;
-o-transition:$prop $duration $easing $delay;
transition:$prop $duration $easing $delay;
}
@mixin transform($val) {
-webkit-transform:$val;
-moz-transform:$val;
-ms-transform:$val;
-o-transform:$val;
transform:$val;
}
.csstransitions.csstransforms {
overflow-x:hidden;
.deck-container > .slide {
-webkit-transition:-webkit-transform 500ms ease-in-out;
-moz-transition:-moz-transform 500ms ease-in-out;
-ms-transition:-ms-transform 500ms ease-in-out;
-o-transition:-o-transform 500ms ease-in-out;
transition:transform 500ms ease-in-out;
}
.deck-container:not(.deck-menu) {
> .slide {
position:absolute;
top:0;
left:0;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
width:100%;
padding:0 48px;
.slide {
position:relative;
left:0;
top:0;
-webkit-transition:-webkit-transform 500ms ease-in-out, opacity 500ms ease-in-out;
-moz-transition:-moz-transform 500ms ease-in-out, opacity 500ms ease-in-out;
-ms-transition:-ms-transform 500ms ease-in-out, opacity 500ms ease-in-out;
-o-transition:-o-transform 500ms ease-in-out, opacity 500ms ease-in-out;
transition:-webkit-transform 500ms ease-in-out, opacity 500ms ease-in-out;
}
.deck-next, .deck-after {
visibility:visible;
@include translate(200%);
}
}
> .deck-previous {
@include translate(-200%);
}
> .deck-before {
@include translate(-400%);
}
> .deck-next {
@include translate(200%);
}
> .deck-after {
@include translate(400%);
}
> .deck-before, > .deck-previous {
.slide {
visibility:visible;
}
}
> .deck-child-current {
@include transform(none);
}
}
}

View file

@ -0,0 +1,94 @@
.csstransitions.csstransforms .deck-container {
overflow-y: hidden;
}
.csstransitions.csstransforms .deck-container > .slide {
-webkit-transition: -webkit-transform 500ms ease-in-out;
-moz-transition: -moz-transform 500ms ease-in-out;
-ms-transition: -ms-transform 500ms ease-in-out;
-o-transition: -o-transform 500ms ease-in-out;
transition: transform 500ms ease-in-out;
}
.csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide {
position: absolute;
top: 0;
left: 0;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
width: 100%;
padding: 0 48px;
}
.csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .slide {
position: relative;
left: 0;
top: 0;
-webkit-transition: -webkit-transform 500ms ease-in-out, opacity 500ms ease-in-out;
-moz-transition: -moz-transform 500ms ease-in-out, opacity 500ms ease-in-out;
-ms-transition: -ms-transform 500ms ease-in-out, opacity 500ms ease-in-out;
-o-transition: -o-transform 500ms ease-in-out, opacity 500ms ease-in-out;
transition: -webkit-transform 500ms ease-in-out, opacity 500ms ease-in-out;
}
.csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .deck-next, .csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .deck-after {
visibility: visible;
-webkit-transform: translate3d(0, 1600px, 0);
-moz-transform: translate(0, 1600px);
-ms-transform: translate(0, 1600px);
-o-transform: translate(0, 1600px);
transform: translate3d(0, 1600px, 0);
}
.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-previous {
-webkit-transform: translate3d(0, -200%, 0);
-moz-transform: translate(0, -200%);
-ms-transform: translate(0, -200%);
-o-transform: translate(0, -200%);
transform: translate3d(0, -200%, 0);
}
.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-before {
-webkit-transform: translate3d(0, -400%, 0);
-moz-transform: translate(0, -400%);
-ms-transform: translate(0, -400%);
-o-transform: translate(0, -400%);
transform: translate3d(0, -400%, 0);
}
.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-next {
-webkit-transform: translate3d(0, 200%, 0);
-moz-transform: translate(0, 200%);
-ms-transform: translate(0, 200%);
-o-transform: translate(0, 200%);
transform: translate3d(0, 200%, 0);
}
.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-after {
-webkit-transform: translate3d(0, 400%, 0);
-moz-transform: translate(0, 400%);
-ms-transform: translate(0, 400%);
-o-transform: translate(0, 400%);
transform: translate3d(0, 400%, 0);
}
.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-before .slide, .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-previous .slide {
visibility: visible;
}
.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-child-current {
-webkit-transform: none;
-moz-transform: none;
-ms-transform: none;
-o-transform: none;
transform: none;
}
.csstransitions.csstransforms .deck-prev-link {
left: auto;
right: 8px;
top: 59px;
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-ms-transform: rotate(90deg);
-o-transform: rotate(90deg);
transform: rotate(90deg);
}
.csstransitions.csstransforms .deck-next-link {
top: 99px;
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-ms-transform: rotate(90deg);
-o-transform: rotate(90deg);
transform: rotate(90deg);
}

View file

@ -0,0 +1,112 @@
@mixin translate($x: 0, $y: 0, $z: 0) {
-webkit-transform:translate3d($x, $y, $z);
-moz-transform:translate($x, $y);
-ms-transform:translate($x, $y);
-o-transform:translate($x, $y);
transform:translate3d($x, $y, $z);
}
@mixin rotate($deg) {
-webkit-transform:rotate($deg);
-moz-transform:rotate($deg);
-ms-transform:rotate($deg);
-o-transform:rotate($deg);
transform:rotate($deg);
}
@mixin transition($prop, $duration, $easing: ease-in-out, $delay: 0ms) {
-webkit-transition:$prop $duration $easing $delay;
-moz-transition:$prop $duration $easing $delay;
-ms-transition:$prop $duration $easing $delay;
-o-transition:$prop $duration $easing $delay;
transition:$prop $duration $easing $delay;
}
@mixin transform($val) {
-webkit-transform:$val;
-moz-transform:$val;
-ms-transform:$val;
-o-transform:$val;
transform:$val;
}
.csstransitions.csstransforms {
.deck-container {
overflow-y:hidden;
> .slide {
-webkit-transition:-webkit-transform 500ms ease-in-out;
-moz-transition:-moz-transform 500ms ease-in-out;
-ms-transition:-ms-transform 500ms ease-in-out;
-o-transition:-o-transform 500ms ease-in-out;
transition:transform 500ms ease-in-out;
}
}
.deck-container:not(.deck-menu) {
> .slide {
position:absolute;
top:0;
left:0;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
width:100%;
padding:0 48px;
.slide {
position:relative;
left:0;
top:0;
-webkit-transition:-webkit-transform 500ms ease-in-out, opacity 500ms ease-in-out;
-moz-transition:-moz-transform 500ms ease-in-out, opacity 500ms ease-in-out;
-ms-transition:-ms-transform 500ms ease-in-out, opacity 500ms ease-in-out;
-o-transition:-o-transform 500ms ease-in-out, opacity 500ms ease-in-out;
transition:-webkit-transform 500ms ease-in-out, opacity 500ms ease-in-out;
}
.deck-next, .deck-after {
visibility:visible;
@include translate(0, 1600px);
}
}
> .deck-previous {
@include translate(0, -200%);
}
> .deck-before {
@include translate(0, -400%);
}
> .deck-next {
@include translate(0, 200%);
}
> .deck-after {
@include translate(0, 400%);
}
> .deck-before, > .deck-previous {
.slide {
visibility:visible;
}
}
> .deck-child-current {
@include transform(none);
}
}
.deck-prev-link {
left:auto;
right:8px;
top:59px;
@include rotate(90deg);
}
.deck-next-link {
top:99px;
@include rotate(90deg);
}
}