millesimisec Clock figuccio

Clock millisecondi

目前为 2020-01-11 提交的版本。查看 最新版本

// ==UserScript==
// @name          millesimisec Clock figuccio
// @description    Clock millisecondi
// @include     *
// @version     5
// @author      figuccio
// @grant       GM_setValue
// @grant       GM_getValue
// @grant       GM_registerMenuCommand
// @namespace https://greasyfork.org/users/237458
// ==/UserScript==
if (window.top != window.self) return;
var box = document.createElement("div");
box.setAttribute("style", "bottom: ;background:blue;color:red; font-family:sans-serif; font-size:16pt; top:0px;right:0px; line-height:21px; position:fixed; text-align:center; z-index:999999;");
document.body.appendChild(box);
function tick()
{
    var d = new Date();
	var h = d.getHours();
	var m = d.getMinutes();
    var s = d.getSeconds();
	var milli = d.getMilliseconds()
    var dd = String(d.getDate()).padStart(2, '0');
    var mm = String(d.getMonth() + 1).padStart(2, '0'); //Gennaio è 0!
    var yyyy = d.getFullYear();


  var DataAttuale = new Date();
  var Giorni = ["dom", "lun", "mar", "mer", "gio", "ven", "sab"]
  var NumeroGiornoAttuale = DataAttuale.getDay();
  var GiornoAttuale = Giorni[NumeroGiornoAttuale];


	if (h < 10) h = "0" + h;
	if (m < 10) m = "0" + m;
    if (s < 10) s = "0" + s;

	box.innerHTML = h + ":" + m + ":" + s+ ":" + milli+ " " +GiornoAttuale + " "+dd + "/"+mm + "/" +yyyy ;
}
tick();
setInterval(tick, 70);
  //mostra nascondi time
    function myFunction2() {
  if (box.style.display === 'none') {
    box.style.display = 'block';
  } else {
    box.style.display = 'none';
  }
}
GM_registerMenuCommand("mostra/nascondi",myFunction2);

                //posizione
 function myFunctiong() {
  if (box.style.margin === '16cm 0px') {
    box.style.margin = '0px';
  } else {
    box.style.margin = '16cm 0px';
  }
}
GM_registerMenuCommand("in basso ►/in alto ► ",myFunctiong);

 function myFunctionx() {
  if (box.style.margin === '0px 91%') {
    box.style.margin = '565px 91%';
  } else {
    box.style.margin = '0px 91%';
  }
}
GM_registerMenuCommand("left in alto ◄/left in basso ◄",myFunctionx);