Create index.js

This commit is contained in:
Innovation Inc 2019-04-23 10:03:10 -05:00 committed by GitHub
parent 14e5155f75
commit 6af067d652
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

22
js/index.js Normal file
View file

@ -0,0 +1,22 @@
$(function() {
// Set the command-line prompt to include the user's IP Address
//$('.prompt').html('[' + codehelper_ip["IP"] + '@HTML5] # ');
$('.prompt').html('[user@HTML5] # ');
// Initialize a new terminal object
var term = new Terminal('#input-line .cmdline', '#container output');
term.init();
// Update the clock every second
setInterval(function() {
function r(cls, deg) {
$('.' + cls).attr('transform', 'rotate('+ deg +' 50 50)')
}
var d = new Date()
r("sec", 6*d.getSeconds())
r("min", 6*d.getMinutes())
r("hour", 30*(d.getHours()%12) + d.getMinutes()/2)
}, 1000);
});