Clock figuccio

clock ore minuti secondi millesimi data

当前为 2020-01-19 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Clock figuccio
  3. // @description clock ore minuti secondi millesimi data
  4. // @version 1.4
  5. // @include *
  6. // @noframes
  7. // @author figuccio
  8. // @grant GM_setValue
  9. // @grant GM_getValue
  10. // @grant GM_registerMenuCommand
  11. // @icon data:image/gif;base64,R0lGODlhEAAQAKECABEREe7u7v///////yH5BAEKAAIALAAAAAAQABAAAAIplI+py30Bo5wB2IvzrXDvaoFcCIBeeXaeSY4tibqxSWt2RuWRw/e+UQAAOw==
  12. // @namespace https://greasyfork.org/users/237458
  13. // ==/UserScript==
  14. /*inserire questo per disattivare alcune funzioni allinizio e alla fine del codice short long*/
  15. function updateClock() {
  16. let options = {'day':'2-digit','year':'numeric','month':'long','weekday':'long',hour:'2-digit',minute:'numeric',second:'numeric',};
  17. let time = new Date().toLocaleString('it-IT', options);
  18. let d = new Date();
  19. let milli = d.getMilliseconds()
  20.  
  21. node.innerHTML = time+ ":" +milli;
  22. }
  23. let node = document.createElement('div');
  24. node.setAttribute("style", "bottom: ;padding:4px;background:red;color:white;font-family:sans-serif;font-size:14px;top:0;right:0;position:fixed;text-align:center;z-index:999999;border-radius:10px;border:2px solid blue;");
  25. document.body.appendChild(node);
  26. setInterval(() => updateClock(), 70);
  27. //mostra nascondi time
  28. function myFunction1() {
  29. if (node.style.display === 'none') {
  30. node.style.display = 'block';
  31. } else {
  32. node.style.display = 'none';
  33. }
  34. }
  35. GM_registerMenuCommand("mostra/nascondi",myFunction1);
  36.  
  37.  
  38. function myFunction10() {
  39. if (node.style.margin === '593px 0px') {
  40. node.style.margin = '0px';
  41. } else {
  42. node.style.margin = '593px 0px';
  43. }
  44. }
  45. GM_registerMenuCommand("giu ►su ►",myFunction10);
  46.  
  47. function myFunction1f() {
  48. if (node.style.margin === '0px 1259px') {
  49. node.style.margin = '539px 1259px';
  50. } else {
  51. node.style.margin = '0px 1259px';
  52. }
  53. }
  54. GM_registerMenuCommand("left su◄left giu◄",myFunction1f);
  55.  
  56.  
  57.