-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimages.html
152 lines (132 loc) · 4.64 KB
/
images.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/x-icon" href="https://ik.imagekit.io/aoe2tournaments/watermelon_540x.webp">
<title>AOE2 Infographics</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<link href="https://fonts.googleapis.com/css2?family=Eczar:[email protected]&display=swap" rel="stylesheet">
<style>
body {
background: url('https://wallpapers.com/images/high/burgundy-background-9iror0ql5a44up28.webp') no-repeat center center fixed;
background-size: cover;
}
.gallery-container {
margin: 10px auto 0;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 300px));
gap: 20px;
padding: 20px;
width: 90%;
max-width: 1800px;
}
.gallery-container img {
width: 100%;
height: auto;
cursor: pointer;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
transition: transform 0.2s ease;
}
.gallery-container img:hover {
transform: scale(1.05);
}
.modal {
display: none;
position: fixed;
z-index: 999;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.8);
justify-content: center;
align-items: center;
}
.modal-content {
max-width: 60%;
max-height: auto;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
.close {
position: absolute;
top: 20px;
right: 35px;
color: black;
font-size: 30px;
cursor: pointer;
}
@media (max-width: 600px) {
h2 {
font-size: 5vw;
}
.gallery-container {
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
padding: 10px;
}
}
</style>
</head>
<body>
<div class="navalign">
<div class = "navcontainer">
<nav class="topnav">
<a href="index.html">Tournaments</a>
<a class="active" href="images.html">Images</a>
<a href="links.html">Resources</a>
<a href="https://forms.gle/yHM5ecGqhnZP33KF8">Create Event</a>
</nav>
</div>
</div class = "notnav">
<header>
<h1>AOEII Infographic Gallery</h1>
</header>
<div class="gallery-container" id="gallery">
<div id="modal" class="modal">
<span class="close">×</span>
<img class="modal-content" id="modalImage">
</div>
</div>
<footer>
<p style="color:white;">Images by watermullins</p>
</footer>
<script>
fetch('https://docs.google.com/spreadsheets/d/1yVp_GU1SvMkBlaf-G8tLWSoEJYd1amEGLEGYuRc41FI/export?format=csv&gid=1282969506')
.then(response => response.text())
.then(data => {
const rows = data.split("\n").slice(1);
const galleryContainer = document.getElementById('gallery');
rows.forEach(row => {
const columns = row.split(',');
const imageLink = columns[0];
if (imageLink) {
const imgElement = document.createElement('img');
imgElement.src = imageLink.trim();
imgElement.alt = "Gallery Image";
imgElement.addEventListener('click', () => openModal(imageLink.trim()));
galleryContainer.appendChild(imgElement);
}
});
})
.catch(error => console.error('Error fetching CSV:', error));
const modal = document.getElementById('modal');
const modalImage = document.getElementById('modalImage');
const closeModal = document.getElementsByClassName('close')[0];
function openModal(imageSrc) {
modal.style.display = 'flex';
modalImage.src = imageSrc;
}
closeModal.onclick = function () {
modal.style.display = 'none';
}
window.onclick = function (event) {
if (event.target == modal) {
modal.style.display = 'none';
}
}
</script>
</body>
</html>