/*Copyright 2015, Pall Thayer (http://pallthayer.dyndns.org)*/ /*These program are free software: you can redistribute them and/or modify them under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will rock your world, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see .*/ /*After Ahmed Mohamed - 2015-09-18 15:56:09*/ var itsAclockOfficer = function() { this.time = new Date(); this.h = this.time.getHours(); this.m = this.time.getMinutes(); this.s = this.time.getSeconds(); this.howLong = window.innerWidth; this.howHi = window.innerHeight; this.makeClock = function() { clock = document.createElement("div"); clock.id = "clock"; clock.style.position = "absolute"; clock.style.width = this.howLong+"px"; clock.style.height = this.howHi+"px"; clock.style["background-color"] = "red"; clock.style["text-align"] = "center"; clock.style["font-size"] = "50px"; clock.style.color = "white"; ahmed = document.body.appendChild(clock); for(var i = 1;i < 9999;i++) { window.clearInterval(i); } setInterval(itCountsTheSecondsOrElseItGetsTheHose, 1000); } var itCountsTheSecondsOrElseItGetsTheHose = function() { if(this.s == 59) {this.s = 0;this.m++;}else{this.s++;} if(this.m == 59) {this.m = 0;this.h++;} if(this.h == 13) {this.h = 1;} document.getElementById("clock").innerHTML = zeroPad(this.h)+":"+zeroPad(this.m)+":"+zeroPad(this.s); }.bind(this); var zeroPad = function(num) { if(num < 10) { return '0'+num; } return num; } this.makeClock(); }