Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
robflaherty committed May 25, 2010
0 parents commit 67df4af
Show file tree
Hide file tree
Showing 11 changed files with 541 additions and 0 deletions.
13 changes: 13 additions & 0 deletions content/css/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

@font-face {
font-family: 'ChunkFiveRegular';
src: url('../fonts/Chunkfive-webfont.eot');
src: local('☺'), url('../fonts/Chunkfive-webfont.woff') format('woff'), url('../fonts/Chunkfive-webfont.ttf') format('truetype'), url('../fonts/Chunkfive-webfont.svg#webfont') format('svg');
font-weight: normal;
font-style: normal;
}

body{ background:#f5f6f6; }
#deck h1 { font-family: 'ChunkFiveRegular', Arial; font-size:50px; text-shadow: 0px 1px 0px rgba(255, 255, 255, 0.8); }
#deck h2 { font-family: 'ChunkFiveRegular', Arial; font-size: 30px; text-shadow: 0px 1px 0px rgba(255, 255, 255, 0.8); }
#deck p, #deck li { font-family: Arial; font-size:20px; text-shadow: 0px 1px 0px rgba(255, 255, 255, 0.8); }
Binary file added content/fonts/Chunkfive-webfont.eot
Binary file not shown.
110 changes: 110 additions & 0 deletions content/fonts/Chunkfive-webfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/fonts/Chunkfive-webfont.ttf
Binary file not shown.
Binary file added content/fonts/Chunkfive-webfont.woff
Binary file not shown.
Binary file added content/images/cached-request.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/images/drupal-tpl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
137 changes: 137 additions & 0 deletions resources/htmlSlides.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
/*
* HTML Slideshow
* Author: Rob Flaherty | rob@ravelrumba.com
*/

(function() {

//Initialize variables and cache jQuery objects
var currentSlide = 1,
slideHash = location.hash,
deck = $('#deck'),
slideCount = $('#deck > section').size(),
prevButton = $('#prev-btn'),
nextButton = $('#next-btn'),
slideNumber = $('#slide-number');

var sliderInit = function(options) {

//Add ids and classes to slides
$('#deck > section').each(function(index,el){
$(el).attr('id', 'slide' + (index +1));
$(el).attr('class', 'slide');
});

//Set total slide count in header
$('#slide-total').html('/' + slideCount);

//Check for hash and validate value
if (slideHash && (parseInt((slideHash.substring(1)), 10) <= slideCount)) {
currentSlide = slideHash.replace('#','');
}

//Hide menubar if hideMenu === true
if(options.hideMenu === true) {
setTimeout(function(){
$('header').fadeTo(300,0);
}, 1500);

$('header').hover(function(){
$('header').fadeTo(300,1);
},
function(){
$('header').fadeTo(300,0);
});
}

//Set initial slide
changeSlide(currentSlide);

};

//Main functions
function changeSlide(id) {
var slideID = '#slide' + id;
deck.find('.slide-selected').removeClass('slide-selected');
$(slideID).addClass('slide-selected');

//Update menu bar
slideNumber.html(currentSlide);

//Update hash
location.hash = id;

//Trigger newSlide event
$('html').trigger("newSlide", id);

//Hide arrows on first and last slides
if ((id != 1) && (id != slideCount)) {
prevButton.css('visibility', 'visible');
nextButton.css('visibility', 'visible');
} else if (id == 1) {
prevButton.css('visibility', 'hidden');
} else if (id == slideCount) {
nextButton.css('visibility', 'hidden');
}
}

function prevSlide() {
if (currentSlide > 1) {
currentSlide--;
changeSlide(currentSlide);
}
}

function nextSlide() {
if (currentSlide < slideCount) {
currentSlide++;
changeSlide(currentSlide);
}
}

function showActions() {
var actions = $('.slide-selected').find('.action');

//If actions exist
if (actions.length > 0) {
actions.first().removeClass('action').addClass('action-on').fadeIn(250);

//Number of current action
var actionOns = $('.slide-selected').find('.action-on'),
actionNumber = actionOns.length;

//Trigger newAction event
$('html').trigger("newAction", actionNumber );
} else {
nextSlide();
}
}

//Keyboard controls
function keyControls(event) {
switch(event.keyCode) {
//Left and up keys
case 37:
case 38:
prevSlide();
break;
//Right, down, and spacebar keys
case 32:
case 39:
case 40:
showActions();
break;
}
}

//Control events
prevButton.bind('click', prevSlide);
nextButton.bind('click', nextSlide);
$('html').bind('keydown', keyControls);

//Do our business when the DOM is ready
$(function(){
sliderInit({hideMenu: true});
});

})();
Loading

0 comments on commit 67df4af

Please sign in to comment.