Skip to content

Commit

Permalink
add website files
Browse files Browse the repository at this point in the history
  • Loading branch information
kripken committed Aug 23, 2012
1 parent 86ac121 commit a558e82
Show file tree
Hide file tree
Showing 36 changed files with 1,187 additions and 0 deletions.
Binary file added cube2/assets/OutThere_0.ogg
Binary file not shown.
Binary file added cube2/assets/alarmcreatemiltaryfoot_1.ogg
Binary file not shown.
Binary file added cube2/assets/bg.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cube2/assets/fonts/BEBAS___-webfont.eot
Binary file not shown.
132 changes: 132 additions & 0 deletions cube2/assets/fonts/BEBAS___-webfont.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cube2/assets/fonts/BEBAS___-webfont.ttf
Binary file not shown.
Binary file added cube2/assets/fonts/BEBAS___-webfont.woff
Binary file not shown.
Binary file added cube2/assets/fonts/OpenSans-Bold.ttf
Binary file not shown.
Binary file added cube2/assets/fonts/OpenSans-Italic.ttf
Binary file not shown.
Binary file added cube2/assets/fonts/OpenSans-Regular.ttf
Binary file not shown.
File renamed without changes.
Binary file added cube2/assets/screenshots/01.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cube2/assets/screenshots/02.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cube2/assets/screenshots/03.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cube2/assets/screenshots/04.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cube2/assets/screenshots/05.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cube2/assets/screenshots/06.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cube2/assets/screenshots/07.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cube2/assets/screenshots/08.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cube2/assets/screenshots/09.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cube2/assets/screenshots/10.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cube2/assets/screenshots/11.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cube2/assets/screenshots/12.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cube2/assets/screenshots/13.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cube2/assets/screenshots/14.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cube2/assets/screenshots/15.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cube2/assets/screenshots/16.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cube2/assets/screenshots/21.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cube2/assets/screenshots/22.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cube2/assets/screenshots/23.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cube2/assets/screenshots/24.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cube2/assets/screenshots/25.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cube2/assets/screenshots/26.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
481 changes: 481 additions & 0 deletions cube2/css/style.css

Large diffs are not rendered by default.

453 changes: 453 additions & 0 deletions cube2/js/game-setup.js

Large diffs are not rendered by default.

121 changes: 121 additions & 0 deletions cube2/js/main.js
@@ -0,0 +1,121 @@
(function(){

var SLIDE_DURATION = 5000;

function makeAnchor(element){
element.addEventListener('click', function(){
// set to null first to make browser jump here regardless of whether or not hash is already set
window.location.hash = null;
window.location.hash = element.getAttribute('data-anchor');
}, false);
}

function setupGallery(){
var interval = -1;
var external;
var slides = [];

function Slide(element, left, counterNode){
element.style.top = '0px';
element.style.left = left + 'px';

var video = element.querySelector('video');

function onVideoPlay(){
external.stop();
}

function onVideoPause(){
}

function onVideoEnded(){
external.start();
}

return {
enter: function(skipSlideIn){
counterNode.className = 'slide-counter-node on';
if(video){
if(video.readyState > 0){
video.currentTime = 0;
}
video.setAttribute('disabled', true);
video.addEventListener('play', onVideoPlay, false);
video.addEventListener('ended', onVideoEnded, false);
video.addEventListener('pause', onVideoPause, false);
}
},
exit: function(){
counterNode.className = 'slide-counter-node';
if(video){
video.pause();
video.setAttribute('disabled', true);
video.removeEventListener('play', onVideoPlay, false);
video.removeEventListener('ended', onVideoEnded, false);
video.removeEventListener('pause', onVideoPause, false);
}
}
};
}

var gallery = document.getElementById('gallery');
var slidesElements = gallery.querySelectorAll('.slide');
var container = document.getElementById('slide-container');
var counter = document.getElementById('slide-counter');
var slideWidth = slidesElements[0].getBoundingClientRect().width;
var slideIndex = 0;

container.style.width = slideWidth * (slides.length + 1) + 'px';
slidesElements = Array.prototype.slice.apply(slidesElements);
slidesElements.forEach(function(slide, index){
var counterNode = document.createElement('div');
counterNode.className = 'slide-counter-node';
slides.push(new Slide(slide, index * slideWidth, counterNode, generateCounterNodeClickFunction(index, counterNode)));
counter.insertBefore(counterNode, counter.firstChild);
});

function generateCounterNodeClickFunction(index, counterNode){
counterNode.addEventListener('click', function(e){
external.stop();
goToSlide(index);
external.start();
}, false);
}

function goToSlide(nextIndex){
var oldSlideIndex = slideIndex;
slides[oldSlideIndex].exit();
slides[nextIndex].enter();
slideIndex = nextIndex;
container.style.left = -nextIndex * slideWidth + 'px';
}

function nextGallerySlide(){
goToSlide((slideIndex + 1) % slides.length);
}

slides[0].enter();

external = {
start: function(){
interval = setInterval(nextGallerySlide, SLIDE_DURATION);
},
stop: function(){
clearInterval(interval);
}
};

return external;
}

document.addEventListener('DOMContentLoaded', function(e){
var anchors = document.querySelectorAll('[data-anchor]');
for(var i=0, l=anchors.length; i<l; ++i){
makeAnchor(anchors[i]);
}

var gallery = setupGallery();
gallery.start();
}, false);

}());

0 comments on commit a558e82

Please sign in to comment.