diff --git a/index.html b/index.html index 0b8a6a5..0ae4d90 100644 --- a/index.html +++ b/index.html @@ -50,5 +50,6 @@

Analogue

+ diff --git a/js/clock.js b/js/clock.js new file mode 100644 index 0000000..20594e9 --- /dev/null +++ b/js/clock.js @@ -0,0 +1,15 @@ +(function(){ + console.info("Hello JS") ; + +var myNode = document.createElement('div'); +document.getElementById("digitalClock").appendChild(myNode); +var updateTime = function() { + var myDate = new Date(); + myNode.innerHTML = myDate.toTimeString() .substring(0,8); +} +setInterval (updateTime, 1000); +}) (); + +var rotSeconds = (seconds * 6) -90; +document.getElementById('secondHand').style.transform = +'rotate('+rotSeconds+'deg)'; \ No newline at end of file