ahmet müzesi açıldı
This commit is contained in:
1 parent
2d6a6be925
commit
000d310baf
3 files changed
+28
-20
No files matched your search
BIN
Binary file not shown.
|
After Width: | Height: | Size: 141 KiB |
@@ -15,6 +15,7 @@
|
|||||||
<a href="index.html" id="home-btn"></a>
|
<a href="index.html" id="home-btn"></a>
|
||||||
<button id="about-btn">About This Website</button>
|
<button id="about-btn">About This Website</button>
|
||||||
<button id="gallery-btn">Gallery</button>
|
<button id="gallery-btn">Gallery</button>
|
||||||
|
<button id="ahmet-btn">Ahmet Museum</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<section id="about" class="tab-content">
|
<section id="about" class="tab-content">
|
||||||
@@ -28,6 +29,11 @@
|
|||||||
<div id="gallery-container" class="gallery-grid"></div>
|
<div id="gallery-container" class="gallery-grid"></div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<section id="ahmet" class="tab-content">
|
||||||
|
<div id="ahmet-container" class="gallery-grid">
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
<script src="js/gallery.js" defer></script>
|
<script src="js/gallery.js" defer></script>
|
||||||
<script src="js/hideBroken.js" defer></script>
|
<script src="js/hideBroken.js" defer></script>
|
||||||
<script src="js/tabs.js" defer></script>
|
<script src="js/tabs.js" defer></script>
|
||||||
|
|||||||
+22
-20
@@ -1,27 +1,29 @@
|
|||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
const galleryContainer = document.getElementById('gallery-container');
|
// Function to load images into a specific container from a specific folder
|
||||||
const totalImages = 50; // number of images you want to load
|
const loadGallery = (containerId, folderName, totalImages) => {
|
||||||
|
const container = document.getElementById(containerId);
|
||||||
|
if (!container) return;
|
||||||
|
|
||||||
for (let i = 1; i <= totalImages; i++) {
|
for (let i = 1; i <= totalImages; i++) {
|
||||||
const img = document.createElement('img');
|
const img = document.createElement('img');
|
||||||
img.alt = `Image ${i}`;
|
img.alt = `${folderName} Image ${i}`;
|
||||||
|
|
||||||
// Try jpg first
|
// Try loading jpg -> png -> gif
|
||||||
img.src = `gallery/${i}.jpg`;
|
img.src = `${folderName}/${i}.jpg`;
|
||||||
|
|
||||||
// fallback to png
|
|
||||||
img.onerror = () => {
|
|
||||||
img.src = `gallery/${i}.png`;
|
|
||||||
|
|
||||||
// fallback to gif
|
|
||||||
img.onerror = () => {
|
img.onerror = () => {
|
||||||
img.src = `gallery/${i}.gif`;
|
img.src = `${folderName}/${i}.png`;
|
||||||
|
img.onerror = () => {
|
||||||
// hide if all fail
|
img.src = `${folderName}/${i}.gif`;
|
||||||
img.onerror = () => { img.style.display = 'none'; };
|
img.onerror = () => { img.style.display = 'none'; };
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
container.appendChild(img);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
galleryContainer.appendChild(img);
|
// Load your original Gallery
|
||||||
}
|
loadGallery('gallery-container', 'gallery', 50);
|
||||||
|
|
||||||
|
// Load your new Ahmet Museum (adjust the number 20 to however many photos you have)
|
||||||
|
loadGallery('ahmet-container', 'ahmet', 20);
|
||||||
});
|
});
|
||||||
Reference in new issue
Block a user