Skip to content

Commit 2da5d18

Browse files
committed
Feat: Add white version
1 parent 479f6a1 commit 2da5d18

File tree

2 files changed

+125
-3
lines changed

2 files changed

+125
-3
lines changed

down.html

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
<meta name="author" content="ringomar, github.com/ringomar" />
1515
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
1616
<title>Remaining Timer</title>
17-
<link rel="stylesheet" href="style.css" />
17+
<link rel="stylesheet" href="styles_down.css" />
1818
</head>
1919

2020
<body>
21-
<div class="container">
21+
<div class="container shadow">
2222
<div class="hours_time num">00</div>
2323
<div class="min_time num">00</div>
2424
<div class="sec_time num">00</div>
@@ -27,13 +27,70 @@
2727
<div class="sec telem">SECONDS</div>
2828
</div>
2929

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+
3087
<script>
3188
const s = document.querySelector(".sec_time");
3289
const m = document.querySelector(".min_time");
3390
const h = document.querySelector(".hours_time");
3491

3592
function pad(num) {
36-
return (num < 10 ? "0" : "") + num;
93+
return ((num < 10 ? "0" : "") + num);
3794
}
3895

3996
function updateTimer() {

styles_down.css

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
body {
2+
/* background-color: #212121; */
3+
font-family: Arial, sans-serif;
4+
margin: 0;
5+
color: white;
6+
}
7+
8+
.no-shadow {
9+
10+
text-shadow: None !important;
11+
-webkit-text-stroke: None !important;
12+
}
13+
14+
.shadow {
15+
text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.9), 0px 0px 5px rgba(255, 255, 255, 0.8);
16+
-webkit-text-stroke: 2px black;
17+
}
18+
19+
.container {
20+
display: grid;
21+
grid-template-columns: repeat(3, 1fr);
22+
grid-template-rows: 1.5fr 0.5fr;
23+
gap: 0px 0px;
24+
grid-auto-flow: row;
25+
grid-template-areas:
26+
"hours_time min_time sec_time"
27+
"hours min sec";
28+
justify-content: space-evenly;
29+
}
30+
31+
.hours_time {
32+
grid-area: hours_time;
33+
}
34+
35+
.min_time {
36+
grid-area: min_time;
37+
}
38+
39+
.sec_time {
40+
grid-area: sec_time;
41+
}
42+
43+
.hours {
44+
grid-area: hours;
45+
}
46+
47+
.min {
48+
grid-area: min;
49+
}
50+
51+
.sec {
52+
grid-area: sec;
53+
}
54+
55+
.num {
56+
text-align: center;
57+
font-size: 4cm;
58+
font-weight: 600;
59+
}
60+
61+
.telem {
62+
text-align: center;
63+
font-size: calc(0.3 * 4cm);
64+
font-weight: 600;
65+
}

0 commit comments

Comments
 (0)