Skip to content

Commit

Permalink
Added Extra Reading section
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisAntaki committed Feb 13, 2015
1 parent 11097b2 commit 035378b
Show file tree
Hide file tree
Showing 5 changed files with 258 additions and 71 deletions.
56 changes: 31 additions & 25 deletions _src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,14 @@ var YourSenators = require('./YourSenators');

function loadMoreSections() {
var queue = [];
function loadNextSection() {
if (queue.length > 0) {
queue.shift()();
}
}
function loadNextSectionAfterDelay(delay) {
setTimeout(loadNextSection, delay || 100);
}

queue.push(function() {
new AJAX({
Expand All @@ -205,9 +213,7 @@ var YourSenators = require('./YourSenators');
template: e.target.responseText
});

if (queue.length > 0) {
queue.shift()();
}
loadNextSectionAfterDelay();
}
});
});
Expand All @@ -221,9 +227,7 @@ var YourSenators = require('./YourSenators');
template: e.target.responseText
});

if (queue.length > 0) {
queue.shift()();
}
loadNextSectionAfterDelay();
}
});
});
Expand All @@ -237,9 +241,21 @@ var YourSenators = require('./YourSenators');
template: e.target.responseText
});

if (queue.length > 0) {
queue.shift()();
}
loadNextSectionAfterDelay();
}
});
});

queue.push(function() {
new AJAX({
url: 'templates/ExtraReading.html' + buster,
success: function(e) {
new SimpleSection({
target: '.extra-reading-target',
template: e.target.responseText
});

loadNextSectionAfterDelay();
}
});
});
Expand All @@ -253,9 +269,7 @@ var YourSenators = require('./YourSenators');
template: e.target.responseText
});

if (queue.length > 0) {
queue.shift()();
}
loadNextSectionAfterDelay();
}
});
});
Expand All @@ -276,9 +290,7 @@ var YourSenators = require('./YourSenators');
template: e.target.responseText
});

if (queue.length > 0) {
queue.shift()();
}
loadNextSectionAfterDelay();
}
});
});
Expand All @@ -295,9 +307,7 @@ var YourSenators = require('./YourSenators');

loadJS('js/scoreboard.js' + buster, true);

if (queue.length > 0) {
queue.shift()();
}
loadNextSectionAfterDelay();
}
});
});
Expand All @@ -321,9 +331,7 @@ var YourSenators = require('./YourSenators');
if (ga) ga('send', 'event', 'button', 'click', 'share_facebook');
}, false);

if (queue.length > 0) {
queue.shift()();
}
loadNextSectionAfterDelay();
}
});
});
Expand All @@ -348,14 +356,12 @@ var YourSenators = require('./YourSenators');
if (document.referrer.indexOf('//t.co') != -1)
global.modals.display('twitter_modal');

if (queue.length > 0) {
queue.shift()();
}
loadNextSectionAfterDelay();
}
});
});

// Start queue
queue.shift()();
loadNextSection();
}
})();
24 changes: 24 additions & 0 deletions css/battle.css
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,30 @@ body #battle .thanks h2 {
}
}

/* Extra Reading */
#battle section#extra-reading {
background-color: #313142;
font-family: "proxima-nova", sans-serif;
padding: 16px 25px 64px;
}
#battle section#extra-reading h2 {
margin-bottom: 0;
}
#battle section#extra-reading p a {
color: #20cba1;

-webkit-transition: color 0.3s;
transition: color 0.3s;
}
#battle section#extra-reading p a:hover {
color: #2aedbd;
}
#battle section#extra-reading p .publication {
color: #ccd;
display: block;
font-size: 20px;
font-style: italic;
}



Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ <h1 class="padded-900 tk-proxima-nova">
<div class="team-internet-target"></div>
<div class="scoreboard-target"></div>
<div class="learn-more-target"></div>
<div class="extra-reading-target"></div>
<div class="footer-target"></div>
<div class="modals-target"></div>
<div class="actionbar-target"></div>
Expand Down
Loading

0 comments on commit 035378b

Please sign in to comment.