Gallery page content
This commit is contained in:
BIN
images/event-image.jpg
Normal file
BIN
images/event-image.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 65 KiB |
BIN
images/product-image.jpg
Normal file
BIN
images/product-image.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 163 KiB |
BIN
images/team-photo.webp
Normal file
BIN
images/team-photo.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 46 KiB |
@@ -5,6 +5,63 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Галерея » Веб-програмування ПР№1</title>
|
<title>Галерея » Веб-програмування ПР№1</title>
|
||||||
<link rel="stylesheet" href="/style.css">
|
<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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<!-- Navbar -->
|
<!-- Navbar -->
|
||||||
@@ -17,5 +74,13 @@
|
|||||||
<a href="/pages/about.html">Про нас</a>
|
<a href="/pages/about.html">Про нас</a>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
<!-- Content -->
|
||||||
|
<main>
|
||||||
|
<h1>Галерея</h1>
|
||||||
|
<div id="gallery" class="gallery">
|
||||||
|
<!-- Generated dynamically with JS -->
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
38
style.css
38
style.css
@@ -136,3 +136,41 @@ button:hover {
|
|||||||
button:active {
|
button:active {
|
||||||
transform: scale(0.98);
|
transform: scale(0.98);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Gallery */
|
||||||
|
|
||||||
|
.gallery {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
|
||||||
|
gap: 1rem;
|
||||||
|
margin: 1rem auto;
|
||||||
|
max-width: 50rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-item {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
text-align: center;
|
||||||
|
background-color: var(--highlight);
|
||||||
|
border-radius: 0.75rem;
|
||||||
|
overflow: hidden;
|
||||||
|
transition: transform 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-item img {
|
||||||
|
width: 100%;
|
||||||
|
aspect-ratio: 1 / 1;
|
||||||
|
object-fit: cover;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-item:hover {
|
||||||
|
transform: scale(1.05);
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-title {
|
||||||
|
padding: 0.5rem;
|
||||||
|
color: var(--primary);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user