diff --git a/index.css b/index.css index ec4a909..661ee60 100644 --- a/index.css +++ b/index.css @@ -1,16 +1,21 @@ +@import url('https://fonts.googleapis.com/css?family=Orbitron'); + + + + body { background-color: #80d4ea; + font-family: 'Orbitron', sans-serif; } -#clock { +.clock { height: 100px; width: 800px; margin: auto; position: absolute; top: 0; left: 0; bottom: 0; right: 0; padding-top: 70px; - font-family: courier, monospace; text-align: center; color: white; - font-size: 100px; + font-size: 60px; } diff --git a/index.html b/index.html index 191d3cc..5aee6e6 100644 --- a/index.html +++ b/index.html @@ -7,8 +7,16 @@ -
+
+ +
+ + + + + - - diff --git a/index.js b/index.js index 877a3aa..327f25b 100644 --- a/index.js +++ b/index.js @@ -1 +1,26 @@ -// Your code here +$(document).ready(function() { + + var timezones = [ + {class: "pacific", name: "Seattle", offset: 0}, + {class: "eastern", name: "Boston", offset: 3} + ]; + + timezones.forEach(function(zone) { + $('.clock').append("
"); + }); + + var getTimes = function() {timezones.forEach(function(zone) { + var time = new Date(); + var utcTime = time.getTime(); + var localTime = new Date(utcTime + (Number(zone.offset)*60*60*1000)); + localTime = localTime.toString().substring(16, 24); + $("." + zone.class).empty().append(zone.name + ": " + localTime ); + console.log("." + zone.class); + console.log(zone); + }); + }; + + setInterval(getTimes, 500); + + +});