-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
171 lines (151 loc) · 3.81 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
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Slerf PFP Wall">
<meta name="twitter:image" content="https://slerfsol.github.io/slerf-wall/assets/twitter_card.webp">
<meta name="twitter:image:alt" content="Community repository for Slerf PFPs!">
<link rel="icon" type="image/png" href="assets/coin.png" />
<title>Slerf Wall</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background-color: #f68d00;
}
.photo-wall {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 0px;
margin: 0px;
}
.photo-wall .img-container {
position: relative;
flex: 1;
min-width: 200px;
max-width: 200px;
height: 200px;
overflow: visible;
}
.photo-wall img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.5s ease;
}
.photo-wall img:hover {
transform: scale(2);
z-index: 9999;
overflow: visible;
}
.img-container:hover {
z-index: 9999;
}
.loading-animation {
border: 5px solid #f3f3f3;
border-top: 5px solid #3498db;
border-radius: 50%;
width: 30px;
height: 30px;
animation: spin 1s linear infinite;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
@media (max-width: 1280px) {
.photo-wall .img-container {
min-width: 100px;
max-width: 100px;
height: 100px;
}
}
@media (max-width: 600px) {
.photo-wall .img-container {
min-width: 100px;
max-width: 100px;
height: 100px;
}
}
@media (max-width: 430px) {
.photo-wall .img-container {
min-width: 86px;
max-width: 86px;
height: 86px;
}
}
@media (max-width: 412px) {
.photo-wall .img-container {
min-width: 82px;
max-width: 82px;
height: 82px;
}
}
@media (max-width: 400px) {
.photo-wall .img-container {
min-width: 78px;
max-width: 78px;
height: 78px;
}
}
@media (max-width: 360px) {
.photo-wall .img-container {
min-width: 70px;
max-width: 70px;
height: 70px;
}
}
</style>
</head>
<body>
<div class="photo-wall" id="photoWall"></div>
<script>
function shuffleArray(array) {
for (let i = array.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[array[i], array[j]] = [array[j], array[i]];
}
}
function createPhotoWall(totalPhotos) {
const basePath = "pfps/"; // Update with the actual path
const photoWall = document.getElementById("photoWall");
let photoNumbers = Array.from({length: totalPhotos}, (_, i) => i + 1);
shuffleArray(photoNumbers);
photoNumbers.forEach(number => {
const imgContainer = document.createElement("div");
imgContainer.classList.add("img-container");
const loadingDiv = document.createElement("div");
loadingDiv.classList.add("loading-animation");
const img = document.createElement("img");
const formattedNumber = String(number).padStart(3, '0');
img.src = `${basePath}slerf_pfps_${formattedNumber}.png`;
img.alt = `Slerf ${formattedNumber}`;
img.style.display = "none"; // Initially hide the image
img.onload = function() {
loadingDiv.remove();
img.style.display = "";
};
imgContainer.appendChild(loadingDiv);
imgContainer.appendChild(img);
photoWall.appendChild(imgContainer);
});
}
// Example: Generate a photo wall with 10 images, randomized
createPhotoWall(309);
</script>
</body>
</html>