-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclock-with-gradient-text.html
More file actions
executable file
·84 lines (79 loc) · 1.83 KB
/
clock-with-gradient-text.html
File metadata and controls
executable file
·84 lines (79 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE html>
<html>
<head>
<title>Gradient Text Clock</title>
<!-- see also -->
<style>
html {
font-size: 20px;
/* REM is locked to this */
/* EM locks to local fonts */
}
h1 {
font-size: 5rem;
padding: 0;
margin: 0;
}
p{
padding: 0rem, auto;
}
img{
max-width: 70%;
background-color: white;
}
.box {
font-family: arial sans-serif;
border: solid #99b 0.3rem;
border-radius: 0.3rem;
font-family: "Gill Sans", sans-serif;
text-align: center;
padding: 0.3rem 0rem;
width: 80%;
margin: 2rem auto;
color: white;
background-color: black
}
.box__clock {
background: linear-gradient(0deg, blue, black, blue, black, blue, black, blue, black, blue);
font-size: 5rem;
font-weight: 700;
background-clip: text;
-webkit-background-clip: text;
color: transparent;
}
.box__brand {
background-color: white;
border: none;
}
</style>
</head>
<body>
<div class="box">
<h1>Eternal Now</h1>
<p>An example of </p>
<ul>
<li>timeout (JS)</li>
<li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/background-clip">background-clip</a> (CSS)</li>
<li>centered divs (CSS)</li>
<li>window.onload (JS)</li>
</ul>
</div>
<div class="box box__clock" id="clock"></div>
<div class="box box__brand"><a href="http://www.zenthinking.net/blog/the-eternal-now"> <img src="images/Zen-Thinking-Enso-Logo-200pxW-black-letters.png"></a> </div>
<script>
function displayTime(){
// Set time in a var
let now = new Date().toLocaleTimeString();
// Grab the div
let el3 = document.getElementById('clock');
// Put 'er there, pardner
el3.innerHTML = now;
// Rinse-lather-repeat
setTimeout(displayTime , 1000);
}
window.onload = displayTime();
// NOTICE THE syntax above is EQUALS, NOT PARENS
</script>
</body>
</html>
<!-- add a tooltip for onload -->