-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
61 lines (53 loc) · 1.32 KB
/
Copy pathindex.html
File metadata and controls
61 lines (53 loc) · 1.32 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Random Image on Particles</title>
<style>
* {
margin: 0;
padding: 0;
}
html,
body {
height: 100%;
width: 100%;
overflow: hidden;
}
#particles-js {
width: 100%;
height: 100%;
background-color: #ffffff;
position: fixed;
top: 0;
left: 0;
z-index: 0;
}
#random-image {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: contain;
z-index: 1;
pointer-events: none;
background-color: transparent;
}
</style>
</head>
<body>
<div id="particles-js"></div>
<img id="random-image" src="" alt="Random Image" />
<script src="particles.js"></script>
<script src="app.js"></script>
<script>
const totalImages = 7;
const images = Array.from({ length: totalImages }, (_, i) => `images/${i + 1}.jpeg`);
const randomIndex = Math.floor(Math.random() * images.length);
const randomImage = images[randomIndex];
document.getElementById("random-image").src = randomImage;
</script>
</body>
</html>