Clock1

Clock in basso alle pagine colore blu e rosso

目前为 2022-07-04 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Clock1
  3. // @description Clock in basso alle pagine colore blu e rosso
  4. // @author figuccio
  5. // @version 0.3
  6. // @match *://*/*
  7. // @grant GM_setValue
  8. // @grant GM_getValue
  9. // @require http://code.jquery.com/jquery-latest.js
  10. // @require https://code.jquery.com/ui/1.12.1/jquery-ui.js
  11. // @license MIT
  12. // @namespace https://greasyfork.org/users/237458
  13. // ==/UserScript==
  14. let $ = window.jQuery;
  15. var j = $.noConflict();
  16. const body=document.body;
  17. if (window.top != window.self) return;
  18. var box = document.createElement("div");
  19. 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;");
  20. document.body.appendChild(box);
  21.  
  22. function tick()
  23. {
  24. var d = new Date();
  25. var h = d.getHours();
  26. var m = d.getMinutes();
  27. var s = d.getSeconds();
  28. var D = d.getDate();//giorno settimana
  29.  
  30. var DataAttuale = new Date();
  31. var Giorni = ["domenica", "lunedì", "martedì", "mercoledì", "giovedì", "venerdì", "sabato"]
  32. var NumeroGiornoAttuale = DataAttuale.getDay();
  33. var GiornoAttuale = Giorni[NumeroGiornoAttuale];
  34.  
  35. var Datamese = new Date();
  36. var Mesi = ["gennaio", "febbraio", "marzo", "aprile", "maggio", "giugno", "luglio", "agosto", "settembre", "ottobre", "novembre", "dicembre"]
  37. var NumeroMeseAttuale = DataAttuale.getMonth();
  38. var MeseAttuale = Mesi[NumeroMeseAttuale];
  39. //anno
  40. var mydate=new Date()
  41. var year=mydate.getYear()
  42. if (year < 1000)
  43. year+=1900
  44. var day=mydate.getDay()
  45. var month=mydate.getMonth()+1
  46. if (month<10)
  47. month="0"+month
  48. var daym=mydate.getDate()
  49. if (daym<10)
  50.  
  51.  
  52. if (h < 10) h = "0" + h;
  53. if (m < 10) m = "0" + m;
  54. if (s < 10) s = "0" + s;
  55. box.innerHTML =GiornoAttuale + " " +D + " "+MeseAttuale + " " +year + " " + h + ":" + m + ":" + s
  56. }
  57. j(box).draggable();
  58. body.append(box);
  59. tick();
  60. setInterval(tick, 1000);
  61.  
  62.  
  63.