Clock1

Clock in basso alle pagine colore blu e rosso

目前為 2022-07-04 提交的版本,檢視 最新版本

// ==UserScript==
// @name           Clock1
// @description    Clock in basso alle pagine colore blu e rosso
// @author         figuccio
// @version        0.3
// @match          *://*/*
// @grant          GM_setValue
// @grant          GM_getValue
// @require        http://code.jquery.com/jquery-latest.js
// @require        https://code.jquery.com/ui/1.12.1/jquery-ui.js
// @license                  MIT
// @namespace      https://greasyfork.org/users/237458
// ==/UserScript==
let $ = window.jQuery;
var j = $.noConflict();
const body=document.body;
if (window.top != window.self) return;
var box = document.createElement("div");
box.setAttribute("style","top:500px;margin:10px;color:red;border-radius:10px;border:2px solid green;font-family:sans-serif;font-size:16pt;background-color:blue;position:fixed;text-align:center;z-index:99999;");
document.body.appendChild(box);

function tick()
{
	var d = new Date();
	var h = d.getHours();
	var m = d.getMinutes();
    var s = d.getSeconds();
    var D = d.getDate();//giorno settimana

  var DataAttuale = new Date();
  var Giorni = ["domenica", "lunedì", "martedì", "mercoledì", "giovedì", "venerdì", "sabato"]
  var NumeroGiornoAttuale = DataAttuale.getDay();
  var GiornoAttuale = Giorni[NumeroGiornoAttuale];

  var Datamese = new Date();
  var Mesi = ["gennaio", "febbraio", "marzo", "aprile", "maggio", "giugno", "luglio", "agosto", "settembre", "ottobre", "novembre", "dicembre"]
  var NumeroMeseAttuale = DataAttuale.getMonth();
  var MeseAttuale = Mesi[NumeroMeseAttuale];
         //anno
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()+1
if (month<10)
month="0"+month
var daym=mydate.getDate()
if (daym<10)


	if (h < 10) h = "0" + h;
	if (m < 10) m = "0" + m;
    if (s < 10) s = "0" + s;
	box.innerHTML =GiornoAttuale + " " +D + " "+MeseAttuale + " " +year + " " + h + ":" + m + ":" + s
}
j(box).draggable();
body.append(box);
tick();
setInterval(tick, 1000);