-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathanalog.html
135 lines (122 loc) · 3.46 KB
/
analog.html
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<!DOCTYPE html>
<html lang="en">
<head>
<!-- META -->
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Clock+Wallpaper+Quotes+Facts+Jokes+News site. Pin this site to make your day!">
<meta name=”robots” content="index, follow">
<link
rel="shortcut icon"
href="https://cdn.pixabay.com/photo/2013/07/12/13/46/clock-147257__340.png"
type="image/x-icon"
/>
<title>Clock: Daily Dose of Wallpaper, Quotes, Facts, Jokes, News</title>
<style>
body {
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue",
sans-serif;
background-color: indigo;
display: flex;
flex-direction: column;
overflow: hidden;
min-height: 100vh;
}
.timer-button {
margin-top: 0.6rem;
font-size: 0.8rem;
border-style: none;
border-radius: 2rem;
font: 2vmax/1 "bungee";
}
.timer-button:hover {
cursor: pointer;
box-shadow: 1px 1px 20px #00000050;
}
#container {
position: relative;
margin: 8em auto;
height: 20rem;
width: 20rem;
background-image: url("background.png");
background-repeat: no-repeat;
background-size: 100%;
}
#hour {
position: absolute;
background-color: black;
height: 20%;
width: 2%;
border-radius: 0.7em;
top: 30%;
left: 49%;
transform-origin: bottom;
}
#min {
position: absolute;
background-color: grey;
height: 30%;
width: 2%;
border-radius: 0.7em;
top: 20%;
left: 49%;
transform-origin: bottom;
}
#sec {
position: absolute;
background-color: rgb(177, 82, 98);
height: 35%;
width: 0.5%;
border-radius: 0.7em;
top: 15%;
left: 49.5%;
transform-origin: bottom;
}
</style>
</head>
<body>
<a
class="timer-button"
href="index.html"
style="
text-decoration: none;
color: #000;
background-color: aliceblue;
padding: 10px;
width: 100px;
text-align: center;
margin: 0 auto;
margin-top: 20px;
padding-bottom: 10px;
margin-bottom: 0;
"
>back</a
>
<div id="container">
<div id="hour"></div>
<div id="min"></div>
<div id="sec"></div>
</div>
</body>
<script>
const randomRng = Math.floor(Math.random() * 1000) + 0;
document.body.style.cssText = `background: linear-gradient(to bottom,#08D9D699,#FF2E6390,#00000099),url(https://picsum.photos/seed/${randomRng}/1920/1080)`;
document.body.style.backgroundRepeat = "no-repeat";
document.body.style.backgroundSize = "cover";
document.body.style.backgroundAttachment = "fixed";
setInterval(() => {
let d = new Date();
let h = d.getHours();
let mn = d.getMinutes();
let sc = d.getSeconds();
hrotation = 30 * h + mn / 2;
mrotation = 6 * mn;
srotation = 6 * sc;
hour.style.transform = `rotate(${hrotation}deg)`;
min.style.transform = `rotate(${mrotation}deg)`;
sec.style.transform = `rotate(${srotation}deg)`;
}, 1000);
</script>
</html>