add reddit add and update landing map stats

This commit is contained in:
Quincy Larson
2015-10-30 23:39:11 -07:00
parent 718681fdd5
commit 03f189b260
3 changed files with 40 additions and 24 deletions

View File

@ -689,6 +689,12 @@ iframe.iphone {
transition: background .2s ease-in-out, border .2s ease-in-out; transition: background .2s ease-in-out, border .2s ease-in-out;
} }
.population-table {
@media (max-width: 767px) {
font-size: 16px;
}
}
@media (max-width: 991px) { @media (max-width: 991px) {
.navbar-header { .navbar-header {
float: none; float: none;

View File

@ -579,6 +579,7 @@ module.exports = function(app) {
res.render('challengeMap/show', { res.render('challengeMap/show', {
blocks, blocks,
daysRunning, daysRunning,
globalCompletedCount: numberWithCommas(5612952 + (Math.floor((Date.now() - 1446268581061) / 3000))),
camperCount, camperCount,
lastCompleted, lastCompleted,
title: "A map of all Free Code Camp's Challenges" title: "A map of all Free Code Camp's Challenges"

View File

@ -10,27 +10,36 @@ block content
else else
img.img-responsive.img-center.border-radius-5(src='https://s3.amazonaws.com/freecodecamp/wide-social-banner.png') img.img-responsive.img-center.border-radius-5(src='https://s3.amazonaws.com/freecodecamp/wide-social-banner.png')
.col-xs-12.col-md-8.col-md-offset-2 .col-xs-12.col-md-8.col-md-offset-2
h2.text-center h2
span.text-primary #{camperCount}   table.population-table.img-center
| campers have joined our community tr
br td Established: 
| since we launched   td
span.text-primary #{daysRunning}   span.text-primary #{daysRunning} 
| days ago. | days ago
tr
td Population: 
td
span.text-primary #{camperCount} 
| campers
tr
td Completed: 
td
span.text-primary #{globalCompletedCount} 
| challenges
.spacer .spacer
if (user && user.progressTimestamps.length > 5) if (user && user.progressTimestamps.length > 100)
#tshirt-notice.col-xs-12.col-md-8.col-md-offset-2.hidden #map-notice.col-xs-12.col-md-8.col-md-offset-2.hidden
h2.text-center Get our first-edition t-shirt. h2.text-center We have a subreddit
br img.thumbnail.img-center.img-responsive(src="http://i.imgur.com/lyd0bfM.jpg")
span.text-success Only available until Oct 29! h4.text-center We welcome you to come ask questions and share your thoughts with our entire open source community.
img.thumbnail.img-center.img-responsive(src="http://i.imgur.com/o07uuOL.png") a.button.btn.btn-block.btn-primary(href="https://reddit.com/r/freecodecamp" target="_blank") Check it out
p.text-justify Our community has voted. Get our winning design emblazoned on a durable, American-made American Apparel shirt (available in women's and men's sizes). 
a(href="https://teespring.com/free-code-camp-shirt-eu" target="_blank") Also ships from Europe
| .
a.button.btn.btn-block.signup-btn(href="https://teespring.com/get-free-code-camp-t-shirt" target="_blank") Get yours
.button-spacer .button-spacer
.text-center .text-center
a#hideTshirtNoticeButton(href='#') Hide this forever a#hide-map-notice-button(href='#') Hide this
.spacer .spacer
.row .row
.col-xs-12.col-sm-8.col-sm-offset-2 .col-xs-12.col-sm-8.col-sm-offset-2
@ -131,14 +140,14 @@ block content
var username = !{JSON.stringify(user && user.username || '')}; var username = !{JSON.stringify(user && user.username || '')};
var lastCompleted = !{JSON.stringify(lastCompleted || false)} var lastCompleted = !{JSON.stringify(lastCompleted || false)}
$(document).ready(function () { $(document).ready(function () {
if (!localStorage || !localStorage.hideTshirtNotice) { if (!localStorage || !localStorage.hideRedditNotice) {
$("#tshirt-notice").removeClass("hidden"); $("#map-notice").removeClass("hidden");
} }
$("#hideTshirtNoticeButton").on("click", function() { $("#hide-map-notice-button").on("click", function() {
$("#tshirt-notice").addClass('animated fadeOut'); $("#map-notice").addClass('animated fadeOut');
setTimeout(function() { setTimeout(function() {
$("#tshirt-notice").hide(); $("#map-notice").hide();
}, 1000); }, 1000);
localStorage.hideTshirtNotice = "true"; localStorage.hideRedditNotice = "true";
}); });
}); });