-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtesting-idlepage
65 lines (55 loc) · 1.88 KB
/
testing-idlepage
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Clock Embed with Random Rotating Background</title>
<style>
body {
display: flex;
flex-direction: column;
min-height: 100vh;
margin: 0;
background-size: cover;
background-position: center;
transition: background-image 1s ease-in-out; /* Smooth transition */
}
.clock-container {
display: flex;
justify-content: center;
align-items: center;
padding: 20px 0;
background-color: rgba(240, 240, 240, 0.8);
}
#clock {
font-size: 2em;
font-family: monospace;
}
</style>
</head>
<body>
<div class="clock-container">
<div id="clock"></div>
</div>
<script>
const images = [
"bigrat.png", "bigrat.png", "image3.jpg", "image4.jpg", "image5.jpg",
"image6.jpg", "image7.jpg", "image8.jpg", "image9.jpg", "image10.jpg",
"image11.jpg", "image12.jpg", "image13.jpg", "image14.jpg", "image15.jpg",
"image16.jpg", "image17.jpg", "image18.jpg", "image19.jpg", "image20.jpg"
];
function updateClock() {
const now = new Date();
const timeString = now.toLocaleTimeString();
document.getElementById('clock').textContent = timeString;
}
function changeBackground() {
const randomIndex = Math.floor(Math.random() * images.length);
document.body.style.backgroundImage = `url(${images[randomIndex]})`;
}
updateClock();
setInterval(updateClock, 1000);
setInterval(changeBackground, 60000); // Change background every 60 seconds (1 minute)
</script>
</body>
</html>