Skip to content

Instantly share code, notes, and snippets.

@usmanity
Created January 9, 2015 19:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save usmanity/31369c4e41833ef3de0a to your computer and use it in GitHub Desktop.
Save usmanity/31369c4e41833ef3de0a to your computer and use it in GitHub Desktop.
colors.js back up for later
var getDailyHex = function(){
var d = new Date();
var month = (d.getMonth() + 1).toString();
var day = function(){ if (d.getDate() < 10) { return '0' + d.getDate() } return d.getDate().toString() };
var year = (d.getFullYear() - 2000).toString();
var dailyHex = month + day() + year;
return dailyHex;
}
var getSecondsHex = function(){
var d = new Date();
var hours = function(){ if (d.getHours() < 10) { return '0' + d.getHours() } return d.getHours().toString() };
var minutes = function(){ if (d.getMinutes() < 10) { return '0' + d.getMinutes() } return d.getMinutes().toString() };
var seconds = function(){ if (d.getSeconds() < 10) { return '0' + d.getSeconds() } return d.getSeconds().toString() };
return hours() + minutes() + seconds();
}
var updateColors = function(){
var color = '#' + getSecondsHex();
$('body, a, #content #intro, ol li a').css({
'color': color
});
}
$(document).ready(function(){
window.setInterval(updateColors, 1000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment