-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
101 lines (89 loc) · 3.73 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Avant Gallery</title>
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="manifest" href="manifest.json">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="menu" onclick="toggleMenu()">
<span></span>
<span></span>
<span></span>
</div>
<div class="menu-links">
<a href="https://warpcast.com/~/channel/higher" target="_blank">FC</a>
<a href="https://zora.co/explore/higher" target="_blank">ZORA</a>
<a href="https://base.party.app/party/0x8177b34687bC8B99C205e533ae7DD7c6C9D07a66" target="_blank">PARTY</a>
<a href="https://swap.defillama.com/?chain=base&from=0x0000000000000000000000000000000000000000&to=0x0578d8a44db98b23bf096a382e016e29a5ce0ffe" target="_blank">SWAP</a>
<a href="https://coinmarketcap.com/currencies/higher/" target="_blank">CMC</a>
<div class="close" onclick="toggleMenu()">X</div>
</div>
<div id="photo-container"></div>
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', function () {
navigator.serviceWorker.register('/service-worker.js').then(function (registration) {
console.log('ServiceWorker registration successful with scope: ', registration.scope);
}, function (error) {
console.log('ServiceWorker registration failed: ', error);
});
});
}
const photoContainer = document.getElementById('photo-container');
let currentIndex = -1; // Track the currently enlarged photo index
let startX, endX; // Variables to track swipe gestures
// Predefined list of image paths
const images = [];
for (let i = 1; i <= 100; i++) {
images.push(`images/HIGHERWAV${i}.png`);
}
// Function to load images into the gallery
function loadImages(imagePaths) {
imagePaths.forEach((image) => {
const photoDiv = document.createElement('div');
photoDiv.classList.add('photo');
const img = new Image();
img.src = image;
img.alt = 'Photo';
img.onerror = () => {
img.src = 'path/to/placeholder/image.png'; // Provide a path to a placeholder image if original fails
};
photoDiv.appendChild(img);
photoContainer.appendChild(photoDiv);
});
}
function toggleMenu() {
const menu = document.querySelector('.menu');
const menuLinks = document.querySelector('.menu-links');
menu.classList.toggle('active');
menuLinks.classList.toggle('active');
}
// Swipe detection
document.addEventListener('touchstart', (event) => {
if (event.touches.length === 1) {
startX = event.touches[0].clientX;
}
});
document.addEventListener('touchmove', (event) => {
if (event.touches.length === 1) {
endX = event.touches[0].clientX;
}
});
document.addEventListener('touchend', () => {
if (currentIndex !== -1) {
if (startX - endX > 50) {
navigatePhotos(1); // Swipe left to go to the next photo
} else if (endX - startX > 50) {
navigatePhotos(-1); // Swipe right to go to the previous photo
}
}
});
// Load predefined images
loadImages(images);
</script>
</body>
</html>