Clock figuccio

clock ore minuti secondi data

目前為 2020-01-11 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Clock figuccio
  3. // @description clock ore minuti secondi data
  4. // @version 1.1.9
  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 */
  15. const clockSettings = {
  16. is12hour: false,
  17. }
  18. function updateClock() {
  19. let date = new Date();
  20. let time = date.toLocaleString('it',{
  21. hour:'2-digit',minute:'numeric',second:'numeric',
  22. day:'2-digit',year:'numeric',month:'long',weekday:'long',
  23. hour12: clockSettings.is12hour
  24. });
  25. node.innerHTML = time;
  26. }
  27. let node = document.createElement('div');
  28. node.setAttribute("style", "bottom: ;background:red;color:white;font-family:sans-serif;font-size:15px;top:0;right:0;position:fixed;text-align:center;z-index:999999;padding:5px;border-radius:10px;border:2px solid blue;padding:5px;");
  29. document.body.appendChild(node);
  30.  
  31. setInterval(() => updateClock(), 1000);
  32. //mostra nascondi time
  33. function myFunction1() {
  34. if (node.style.display === 'none') {
  35. node.style.display = 'block';
  36. } else {
  37. node.style.display = 'none';
  38. }
  39. }
  40. GM_registerMenuCommand("mostra/nascondi",myFunction1);
  41.  
  42. function myFunction10() {
  43. if (node.style.margin === '590px 0px') {
  44. node.style.margin = '0px';
  45. } else {
  46. node.style.margin = '590px 0px';
  47. }
  48. }
  49. GM_registerMenuCommand("giu ►su ►",myFunction10);
  50.  
  51. function myFunction1f() {
  52. if (node.style.margin === '0px 1277px') {
  53. node.style.margin = '512px 1277px';
  54. } else {
  55. node.style.margin = '0px 1277px';
  56. }
  57. }
  58. GM_registerMenuCommand("left su◄left giu◄",myFunction1f);