Files
colweb-lw1/pages/gallery.html

86 lines
2.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Галерея » Веб-програмування ПР№1</title>
<link rel="stylesheet" href="../style.css">
<script>
const gallery = [
{
image: "../images/hero-image.png",
title: "Всім привіт!"
},
{
image: "../images/website-logo.png",
title: "Наш логотип"
},
{
image: "../images/about-image.png",
title: "Наш офіс"
},
{
image: "../images/team-photo.webp",
title: "Наша команда"
},
{
image: "../images/product-image.jpg",
title: "Наш продукт"
},
{
image: "../images/event-image.jpg",
title: "Подія компанії"
},
];
function loadGallery() {
const gallerySection = document.getElementById("gallery");
gallery.forEach(el => {
const galleryItem = document.createElement("a");
galleryItem.href = el.image;
galleryItem.target = "_blank";
galleryItem.className = "gallery-item";
const img = document.createElement("img");
img.src = el.image;
img.alt = el.title;
const title = document.createElement("span");
title.className = "gallery-title";
title.textContent = el.title;
galleryItem.appendChild(img);
galleryItem.appendChild(title);
gallerySection.appendChild(galleryItem);
});
}
document.addEventListener("DOMContentLoaded", () => {
loadGallery();
});
</script>
</head>
<body>
<!-- Navbar -->
<nav>
<div class="nav-links">
<a href="../index.html" class="nav-logo"><img src="../images/website-logo.png" alt="Логотип компанії"></a>
<a href="./gallery.html"><u>Галерея</u></a>
<a href="./articles.html">Статті</a>
<a href="./contacts.html">Контакти</a>
<a href="./about.html">Про нас</a>
</div>
</nav>
<!-- Content -->
<main>
<h1>Галерея</h1>
<div id="gallery" class="gallery">
<!-- Generated dynamically with JS -->
</div>
</main>
</body>
</html>