-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
136 lines (116 loc) · 3.69 KB
/
index.html
File metadata and controls
136 lines (116 loc) · 3.69 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Valis HQ</title>
<style>
body {
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #1a1a1a; /* Darker background */
overflow: hidden;
}
.grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
gap: 10px; /* Ensure consistent row and column gaps */
width: 100vw;
height: 100vh;
}
.grid-item {
width: 100%;
aspect-ratio: 1 / 1; /* Ensures the items are square */
display: flex;
justify-content: center;
align-items: center;
perspective: 1000px;
border-radius: 8px; /* Slightly round borders */
}
.flip-card {
width: 100%;
height: 100%;
transform-style: preserve-3d;
transition: transform 0.6s;
position: relative;
border-radius: 8px; /* Matches the grid item */
}
.flip-card.flipped {
transform: rotateY(180deg);
}
.flip-card-front,
.flip-card-back {
position: absolute;
width: 100%;
height: 100%;
backface-visibility: hidden;
border-radius: 8px; /* Ensures both sides are round */
}
.flip-card-front {
background: url("valishq_3_bck.webp") no-repeat center center;
background-size: cover;
}
.flip-card-back {
background-color: #1a1a1a; /* Match the body background */
display: flex;
justify-content: center;
align-items: center;
transform: rotateY(180deg);
}
.flip-card-back img {
width: 100%;
height: 100%;
border-radius: 8px; /* Matches the corners */
}
@media (min-width: 600px) {
.grid {
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 10px; /* Ensure consistent row and column gaps */
}
}
</style>
</head>
<body>
<div class="grid" id="grid"></div>
<script>
const grid = document.getElementById("grid");
// Create the grid items
for (let i = 0; i < 50; i++) {
// Reduced number of items for better spacing on larger cells
const gridItem = document.createElement("div");
gridItem.classList.add("grid-item");
const flipCard = document.createElement("div");
flipCard.classList.add("flip-card");
const front = document.createElement("div");
front.classList.add("flip-card-front");
const back = document.createElement("div");
back.classList.add("flip-card-back");
const img = document.createElement("img");
img.src = "valishq_3.webp";
img.alt = "Logo";
back.appendChild(img);
flipCard.appendChild(front);
flipCard.appendChild(back);
gridItem.appendChild(flipCard);
grid.appendChild(gridItem);
}
// Randomly flip cards
function flipRandomCard() {
const cards = document.querySelectorAll(".flip-card");
const randomCard = cards[Math.floor(Math.random() * cards.length)];
if (!randomCard.classList.contains("flipped")) {
randomCard.classList.add("flipped");
setTimeout(() => {
randomCard.classList.remove("flipped");
}, Math.random() * 2000 + 1000); // Random time between 1 and 3 seconds
}
}
// Continuously flip cards
setInterval(flipRandomCard, Math.random() * 2000 + 1000);
</script>
</body>
</html>