Clock figuccio

clock ore minuti secondi

目前為 2019-03-31 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        Clock figuccio
// @description clock ore minuti secondi
// @version     1.0.9
// @include     *
// @author      figuccio
// @grant       GM_setValue
// @grant       GM_getValue
// @grant       GM_registerMenuCommand
// @icon        data:image/gif;base64,R0lGODlhEAAQAKECABEREe7u7v///////yH5BAEKAAIALAAAAAAQABAAAAIplI+py30Bo5wB2IvzrXDvaoFcCIBeeXaeSY4tibqxSWt2RuWRw/e+UQAAOw==
// @namespace https://greasyfork.org/users/237458
// ==/UserScript==
function updateClock() {
  let date = new Date();
// parametri per la lingua:
 //   'ITA'   'ING'   'FRA'    'TED'    'SPA'     'POR'
 // ITALIANO INGLESE FRANCESE TEDESCO  SPAGNOLO PORTOGHESE
  let time = date.toLocaleString('ita', {
      hour:'numeric',minute:'numeric',second:'numeric',
       day:'numeric',year:'numeric',
     month:'long',weekday:'long',
    hour12: false
  });
  node.innerHTML = time;
}
let node = document.createElement('div');
function setStyles(styles) {
  styles.forEach(style => node.style.setProperty(style.name, style.value));
}
setStyles([
  { name: 'position', value: 'fixed'},
  { name: 'bottom', value: '0' },
  { name: 'background-color', value: 'red' },
  { name: 'color', value: 'white' },
  { name: 'z-index', value: '99999' },//99999
  { name: 'font-size', value: '16px',},//dimensioni
  { name: 'padding', value: '2px 2px 2px 2px'},//piccolo miglioramento rispetto ha prima su alcuni siti2px 2px 2px 2px
  { name: 'border-radius', value: '10px' },/* bordi arrotondati */
  { name: 'border', value: '2px solid blue' },/* colore bordo */
  { name: 'margin',value: '20px  15px' },
  { name: 'font',value:'Arial'},
  { name: 'cursor', value: 'move' },
]);
document.body.appendChild(node);
setInterval(() => updateClock(), 1000);
              //effetti speciali
node.addEventListener("mouseover", function( event ) {
    // evidenzia il bersaglio del mouseover
    event.target.style.color = "orange";
    event.target.style.background = "green";
    event.target.style.border= "solid black";
// ripristinare il colore dopo un breve ritardo
    setTimeout(function() {
    event.target.style.color = "white";
    event.target.style.background = "red";
    event.target.style.border = "solid blue";
    }, 7000);
  }, false);
         //cambia posizione al orologio per 5secondi  ottimizzato per youtube fullscreen
node.addEventListener("click", function( event ) {
event.target.style.margin= "730px 9cm";
setTimeout(function() {
event.target.style.margin = "20px 15px";
    },5000 );
  }, false);