Skip to content

Commit

Permalink
2016 refresh
Browse files Browse the repository at this point in the history
many changes, now with Cardpool
  • Loading branch information
Mattthew authored and Mattthew committed Jan 4, 2016
1 parent 310a947 commit 2f1e1a7
Show file tree
Hide file tree
Showing 13 changed files with 2,609 additions and 323 deletions.
Binary file added assets/cardpoolBG.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
112 changes: 55 additions & 57 deletions assets/index_scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ $(window).load(function() {
var sections = [];
var docHeight = $(window).height();
var lastSection = 0;
var currentSection = 0;
var currentSection = -1;
var hasScrolled = false;
var allowShardEdit = false;
var shards = 1;
Expand Down Expand Up @@ -201,8 +201,8 @@ $(window).load(function() {
//
function setSectionColors() {
// minimap colors
sections[0].color = 'rgb(87, 150, 0)'; // rotten green
sections[1].color = 'rgb(255, 195, 0)'; // gerReady orange
sections[0].color = 'rgb(245, 103, 160)'; // cardpool pink
sections[1].color = 'rgb(87, 150, 0)'; // rotten green
sections[2].color = 'rgb(0, 0, 0)'; // watch black
sections[3].color = 'rgb(208, 83, 0)'; // couch orange
sections[4].color = 'rgb(0, 0, 0)'; // fermi black
Expand All @@ -227,11 +227,13 @@ $(window).load(function() {

//
function initiateMinimap() {
$('#map' + currentSection + ' A').css('width','12px');
$('#map' + currentSection + ' A').css('height','12px');
$('#map' + currentSection + ' A').css('margin','-2px 6px');
$('#map' + currentSection + ' A').css('background-color',sections[currentSection].color);
$('#map' + currentSection + ' A').css('box-shadow','0px 0px 2px 0px rgba(0, 0, 0, 0.3)');
var num = currentSection;
num<0 ? num=0 : num;
$('#map' + num + ' A').css('width','12px');
$('#map' + num + ' A').css('height','12px');
$('#map' + num + ' A').css('margin','-2px 6px');
$('#map' + num + ' A').css('background-color',sections[num].color);
$('#map' + num + ' A').css('box-shadow','0px 0px 2px 0px rgba(0, 0, 0, 0.3)');
}

function bindMiniMapEvents() {
Expand Down Expand Up @@ -261,13 +263,28 @@ $(window).load(function() {

// starts animtion for currentSection
function doAnimation() {
if(currentSection==0) {
if(currentSection==1) {



// rotten
$({count:0}).animate({count:31}, {
duration: 1000,
easing: 'easeOutQuad',
step: function() {
$('#sectionRotten .title').css('background', 'radial-gradient(circle at 70% 50%, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.1) '+(this.count/2)+'%, rgba(255,255,255,0) '+(this.count)+'%, rgba(255,255,255,0) 100%)');
}
});



} else if(currentSection==0) {



// Cardpool
var num = 0;
$('#sectionRotten .button').each(function() {
$('#sectionCardpool .button').each(function() {
var el = this;
var delay = num*100;
window.setTimeout(function(){
Expand Down Expand Up @@ -300,15 +317,6 @@ $(window).load(function() {



} else if(currentSection==1) {



// getReady
// nothing yet



} else if(currentSection==2) {


Expand All @@ -318,7 +326,7 @@ $(window).load(function() {
str = str.substring(0,str.indexOf(' ')-2);
var x = parseInt(str);
$({count:0}).animate({count:x}, {
duration: 2000,
duration: 1000,
easing: 'easeOutQuad',
step: function() {
$('#sectionWatchEffect').css('background','linear-gradient(to right, rgba(0, 0, 0, 1) ' + ((x*0.75)-this.count) + 'px, rgba(0, 0, 0, 0.1) ' + ((x*1.1)-this.count) + 'px, rgba(0, 0, 0, 0) ' + ((x*1.25)-this.count) + 'px');
Expand Down Expand Up @@ -418,6 +426,7 @@ $(window).load(function() {




} else if(currentSection==7) {


Expand Down Expand Up @@ -455,7 +464,7 @@ $(window).load(function() {



} else if(currentSection==8) {
} else if(currentSection==9) {



Expand All @@ -466,29 +475,22 @@ $(window).load(function() {

}

// twitch
/*
$('#logoTwitch DIV').animate({
backgroundPositionX: -358
// won't work on firefox
}, {
'duration': 600,
'easing': 'easeInOutBack',
});
*/

}

//
function setStartAnimation(num) {
if(num == 0) {
// rotten
$('#sectionRotten .button').css('color','rgba(0, 0, 0, 0.6)');
$('#sectionRotten .button').css('text-shadow','0px -3px 6px rgba(0, 0, 0, 0.6)');
$('#sectionRotten .button').css('opacity','0');
$('#sectionRotten .button').css('margin-top','-20px');
$('#sectionRotten .button').css('margin-bottom','20px');
// Cardpool
$('#sectionCardpool .button').css('color','rgba(0, 0, 0, 0.6)');
$('#sectionCardpool .button').css('text-shadow','0px -3px 6px rgba(0, 0, 0, 0.6)');
$('#sectionCardpool .button').css('opacity','0');
$('#sectionCardpool .button').css('margin-top','-20px');
$('#sectionCardpool .button').css('margin-bottom','20px');
} else if(num==1) {
// rotten
$('#sectionRotten .title').css('background', '');
} else if(num==2) {
// watch
var str = $('#sectionWatch').css('background-size');
str = str.substring(0,str.indexOf(' ')-2);
Expand All @@ -500,25 +502,25 @@ $(window).load(function() {
$('#sectionWatchEffect').css('background','linear-gradient(to right, rgba(0, 0, 0, 1) ' + ((x*0.75)-this.count) + 'px, rgba(0, 0, 0, 0.1) ' + ((x*1.1)-this.count) + 'px, rgba(0, 0, 0, 0) ' + ((x*1.25)-this.count) + 'px');
}
});
} else if(num==2) {
} else if(num==3) {
// couch
$('#sectionCouch .button DIV').css('background-position','-296px 0px');
} else if(num==3 && !Modernizr.touch) {
} else if(num==4 && !Modernizr.touch) {
// fermi
// end is same as start
} else if(num==4) {
} else if(num==5) {
// shsh
$('#logoShsh SPAN').css('background-image','');
} else if(num==5) {
} else if(num==6) {
// essays
// nothing yet
} else if(num==6) {
} else if(num==7) {
// documentary
// end is same as start
} else if(num==7) {
} else if(num==8) {
// portraits
// nothing yet
} else if(num==8) {
} else if(num==9) {
// mixed
// nothing yet
}
Expand All @@ -540,12 +542,6 @@ $(window).load(function() {
// find which section the user is looking at
$(window).scroll(function() {

// animates the top section on fist scroll
if(!hasScrolled) {
doAnimation();
hasScrolled = true;
}

var scrollY = $(document).scrollTop();
// section is updated when 'animated' class within
// the section reaches .5 way up the page
Expand All @@ -562,21 +558,23 @@ $(window).load(function() {
break;
}
}
if(currentSection<0) { currentSection = 0; }
if(currentSection<-1) { currentSection = -1; }

// set miniMap
// set miniMap
for(var i=0; i<sections.length; i++) {
$('#map'+ i + ' A').css('width','');
$('#map'+ i + ' A').css('height','');
$('#map'+ i + ' A').css('margin','');
$('#map'+ i + ' A').css('background-color','');
$('#map'+ i + ' A').css('box-shadow','');
}
$('#map'+ currentSection + ' A').css('width','12px');
$('#map'+ currentSection + ' A').css('height','12px');
$('#map'+ currentSection + ' A').css('margin','1px 6px');
$('#map'+ currentSection + ' A').css('background-color',sections[currentSection].color);
$('#map'+ currentSection + ' A').css('box-shadow','0px 0px 2px 0px rgba(0, 0, 0, 0.3)');
var num = currentSection;
num<0 ? num=0 : num;
$('#map'+ num + ' A').css('width','12px');
$('#map'+ num + ' A').css('height','12px');
$('#map'+ num + ' A').css('margin','1px 6px');
$('#map'+ num + ' A').css('background-color',sections[num].color);
$('#map'+ num + ' A').css('box-shadow','0px 0px 2px 0px rgba(0, 0, 0, 0.3)');

// trigger animation start if users is scrolling down
if(currentSection > lastSection) {
Expand Down
Binary file added assets/logoCardpool.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 2f1e1a7

Please sign in to comment.