|
14 | 14 | <meta name="author" content="ringomar, github.com/ringomar" />
|
15 | 15 | <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
|
16 | 16 | <title>Remaining Timer</title>
|
17 |
| - <link rel="stylesheet" href="style.css" /> |
| 17 | + <link rel="stylesheet" href="styles_down.css" /> |
18 | 18 | </head>
|
19 | 19 |
|
20 | 20 | <body>
|
21 |
| - <div class="container"> |
| 21 | + <div class="container shadow"> |
22 | 22 | <div class="hours_time num">00</div>
|
23 | 23 | <div class="min_time num">00</div>
|
24 | 24 | <div class="sec_time num">00</div>
|
|
27 | 27 | <div class="sec telem">SECONDS</div>
|
28 | 28 | </div>
|
29 | 29 |
|
| 30 | + <script> |
| 31 | + // configurations |
| 32 | + |
| 33 | + /* |
| 34 | + Stroke: Number |
| 35 | + Set the outline of the numbers & text of the timer |
| 36 | + */ |
| 37 | + |
| 38 | + document.addEventListener("DOMContentLoaded", function () { |
| 39 | + const timestampStroke = new URLSearchParams(window.location.search).get( |
| 40 | + "stroke" |
| 41 | + ); |
| 42 | + const resetWhite = new URLSearchParams(window.location.search).get( |
| 43 | + "white" |
| 44 | + ); |
| 45 | + |
| 46 | + const containerSelect = document.querySelectorAll(".num"); |
| 47 | + const containers = document.querySelectorAll(".container"); |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + if (resetWhite === "true") { |
| 52 | + containers.forEach(i => { |
| 53 | + i.classList.remove('shadow'); |
| 54 | + |
| 55 | + i.style.webkitTextStroke = "0 !important"; |
| 56 | + i.style.textStroke = "0 !important"; |
| 57 | + }); |
| 58 | + |
| 59 | + } else { |
| 60 | + |
| 61 | + const strokeAmount = |
| 62 | + timestampStroke === null || isNaN(timestampStroke) || timestampStroke > 10 |
| 63 | + ? "2" |
| 64 | + : timestampStroke; |
| 65 | + containerSelect.forEach(i => { |
| 66 | + |
| 67 | + i.style.webkitTextStroke = `${strokeAmount}px black`; |
| 68 | + i.style.textStroke = `${strokeAmount}px black`; |
| 69 | + }); |
| 70 | + } |
| 71 | + }); |
| 72 | + </script> |
| 73 | + |
| 74 | + <script> |
| 75 | + document.addEventListener('DOMContentLoaded', function () { |
| 76 | + const whiteparams = new URLSearchParams(window.location.search).get( |
| 77 | + "white" |
| 78 | + ); |
| 79 | + |
| 80 | + if (whiteparams) { |
| 81 | + document.getElementsByClassName("container")[0].style.textShadow = "None !important"; |
| 82 | + } |
| 83 | + }); |
| 84 | + |
| 85 | + </script> |
| 86 | + |
30 | 87 | <script>
|
31 | 88 | const s = document.querySelector(".sec_time");
|
32 | 89 | const m = document.querySelector(".min_time");
|
33 | 90 | const h = document.querySelector(".hours_time");
|
34 | 91 |
|
35 | 92 | function pad(num) {
|
36 |
| - return (num < 10 ? "0" : "") + num; |
| 93 | + return ((num < 10 ? "0" : "") + num); |
37 | 94 | }
|
38 | 95 |
|
39 | 96 | function updateTimer() {
|
|
0 commit comments