Timer Watch

Displays the timer on timerminutes.com and also shows a digital clock.

安裝腳本?
作者推薦腳本

您可能也會喜歡 Redirect to imgur

安裝腳本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Timer Watch
// @namespace    https://greasyfork.org/en/users/670188-hacker09?sort=daily_installs
// @version      2
// @description  Displays the timer on timerminutes.com and also shows a digital clock.
// @author       hacker09
// @match        https://www.timerminutes.com/*
// @icon         https://www.timerminutes.com/favicon.ico
// @run-at       document-end
// @grant        none
// ==/UserScript==


(function() {
  'use strict';
  document.querySelector("#btnreset").style.display = 'none'; //Hides the element
  document.querySelector("div.header").style.display = 'none'; //Hides the element
  document.querySelector("div.footer").style.display = 'none'; //Hides the element
  document.querySelector("#timer-form").style.display = 'none'; //Hides the element
  document.querySelector("main > div > h1").style.display = 'none'; //Hides the element
  document.querySelector("main > div > h2").style.display = 'none'; //Hides the element
  document.querySelector("main > div > h3").style.display = 'none'; //Hides the element
  document.querySelectorAll("p").forEach(el => el.style.display = 'none'); //Hides the element
  document.querySelectorAll("ul.listh").forEach(el => el.style.display = 'none'); //Hides the element
  document.querySelectorAll("div.margin10.center").forEach(el => el.style.display = 'none'); //Hides the element

  document.querySelector("#result > span").insertAdjacentHTML('afterEnd', `<br><span class="time"></span>`); //Show the time

  function showTime() { //Creates a new function
    var date = new Date(); //Creates a variable to hold the computer date on the local time zone
    var h = date.getHours(); //Get the hours in the computer date on the local time zone
    var m = date.getMinutes(); //Get the minutes in the computer date on the local time zone
    var s = date.getSeconds(); //Get the seconds in the computer date on the local time zone

    document.querySelector(".time").innerText = h + ":" + m + ":" + s; //Adds the current time to the time element
    setTimeout(showTime, 1000); //Update the time every second
  } //Finishes the showTime function

  showTime(); //Runs the showTime function
})();