-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
57 lines (49 loc) · 1.45 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
margin: 0;
padding: 0;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
background-size: cover;
background-position: center;
transition: background-image 1s ease-in-out;
}
</style>
<title>Browser Homepage</title>
<link rel="icon" href="assets/homepage.jpg">
<script data-goatcounter="https://brajesh3.goatcounter.com/count" + async src="//gc.zgo.at/count.js"></script>
</head>
<body>
<script>
document.addEventListener('DOMContentLoaded', function() {
const imageKeywords = ['nature', 'wild', 'space', 'city', 'animal', 'cat', 'dog'];
let currentIndex = 0;
function getImageUrl(keyword) {
return `https://source.unsplash.com/featured/?${keyword}`;
}
function preloadImage(url) {
const img = new Image();
img.src = url;
}
function changeBackground() {
const keyword = imageKeywords[currentIndex];
const imageUrl = getImageUrl(keyword);
document.body.style.backgroundImage = `url('${imageUrl}')`;
currentIndex = (currentIndex + 1) % imageKeywords.length;
}
// Preload images
imageKeywords.forEach(keyword => preloadImage(getImageUrl(keyword)));
changeBackground(); // Initial background
setInterval(changeBackground, 10000); // Change background every 10 seconds
});
</script>
</body>
</html>