ahmet müzesi açıldı

This commit is contained in:
esef committed 2025-12-28 15:32:29 +03:00
1 parent 2d6a6be925
commit 000d310baf
3 files changed
+28 -20

No files matched your search

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

+6
View File
@@ -15,6 +15,7 @@
<a href="index.html" id="home-btn"></a>
<button id="about-btn">About This Website</button>
<button id="gallery-btn">Gallery</button>
<button id="ahmet-btn">Ahmet Museum</button>
</div>
<section id="about" class="tab-content">
@@ -28,6 +29,11 @@
<div id="gallery-container" class="gallery-grid"></div>
</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/hideBroken.js" defer></script>
<script src="js/tabs.js" defer></script>
+22 -20
View File
@@ -1,27 +1,29 @@
document.addEventListener('DOMContentLoaded', () => {
const galleryContainer = document.getElementById('gallery-container');
const totalImages = 50; // number of images you want to load
// Function to load images into a specific container from a specific folder
const loadGallery = (containerId, folderName, totalImages) => {
const container = document.getElementById(containerId);
if (!container) return;
for (let i = 1; i <= totalImages; i++) {
const img = document.createElement('img');
img.alt = `Image ${i}`;
for (let i = 1; i <= totalImages; i++) {
const img = document.createElement('img');
img.alt = `${folderName} Image ${i}`;
// Try jpg first
img.src = `gallery/${i}.jpg`;
// fallback to png
img.onerror = () => {
img.src = `gallery/${i}.png`;
// fallback to gif
// Try loading jpg -> png -> gif
img.src = `${folderName}/${i}.jpg`;
img.onerror = () => {
img.src = `gallery/${i}.gif`;
// hide if all fail
img.onerror = () => { img.style.display = 'none'; };
img.src = `${folderName}/${i}.png`;
img.onerror = () => {
img.src = `${folderName}/${i}.gif`;
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);
});