--text-dark: #000000;
--text-light: #727274;
--extra-light: #f3f4f6;
--max-width: 1200px;
--header-font: "Montserrat", sans-serif;
--text-font: "Poppins", sans-serif;
}
body {
margin: 0;
padding: 0;
background-image: url('backg5.png');
background-size: cover;
background-position: center 10px;
background-attachment: fixed;
color: white;
overflow-x: hidden;
padding-top: 80px;
}
header {
display: flex;
position: fixed;
justify-content: center;
align-items: center;
top: 0;
width: 100%;
z-index: 1000;
transition: top 0.3s ease-in-out;
color: white;
background: hsl(0, 100%, 100%);
box-shadow: -4px 0 6px rgba(0, 0, 0, 0.1), 4px 0 6px rgba(0, 0, 0, 0.1);
padding: 10px 15px;
}
.logo {
display: flex;
justify-content: center;
align-items: center;
flex: 1;
}
.logo img {
max-width: 120px;
margin-top: 5px;
}
.product-container {
position: absolute;
display: inline-block;
align-items: center;
justify-content: flex-start;
transform: translateY(-50%);
left: 40px;
top: 50%;
}
.product-icon {
font-size: 30px;
color: green;
}
.dropdown {
position: relative;
display: inline-block;
margin-left: auto;
}
.dropdown-content {
display: none;
position: absolute;
margin-left: auto;
background-color: #f9f9f9;
width: 1260px;
top: 71%;
padding: 0;
left: 0;
z-index: 1000;
transition: opacity 0.3s ease, visibility 0.3s ease;
border-radius: 8px;
max-height: 160px;
overflow-y: auto;
}
.dropdown:hover .dropdown-content {
display: block;
padding-top: 3px;
background-color: #f9f9f9;
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.15);
opacity: 1;
visibility: visible;
}
.dropdown-content:hover {
display: block;
opacity: 1;
visibility: visible;
}
.dropdown:hover .dropdown-content {
background-color: whitesmoke;
}
.container {
display: flex;
overflow-x: auto;
margin: 10px;
scroll-padding: 0px;
gap: 10px;
max-height: 100vh;
overflow-y: hidden;
}
.container::-webkit-scrollbar {
display: block;
}
.container::-webkit-scrollbar-track {
background-color: #AAB99A;
border-radius: 10px;
}
#Container {
display: flex;
scroll-snap-type: x mandatory;
}
.item {
flex: 0 0 auto;
}
.category {
width: 100%;
max-width: 300px;
height: auto;
border-radius: 5px;
}
.product-category {
width: 100px;
height: 100px;
object-fit: contain;
gap: 2px;
border-radius: 10px;
transition: transform 0.3s ease, box-shadow 0.3s ease;
margin-bottom: 10px;
}
.product-category:hover {
transform: scale(1.1);
padding: 5px;
z-index: 10;
}
.page-body {
font-family: var(--header-font);
margin: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 90vh;
padding: 5px;
}
.page-container {
background-color: #fff;
display: flex;
flex-direction: column;
border-radius: 10px;
box-shadow: 0 5px 15px rgba(0,0,0,0.1);
padding: 30px;
max-width: 1000px;
width: 100%;
margin-bottom: 0;
padding-bottom: 0;
gap: 10px;
}
@media (min-width: 768px) {
.page-container {
flex-direction: row;
}
}
.image-gallery {
flex: 0.9;
text-align: left;
}
.image-gallery img {
max-width: 100%;
height: auto;
}
.image-wrapper {
max-width: 450px;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.thumbnail-wrapper {
display: flex;
align-items: center;
justify-content: center;
position: relative;
overflow: hidden;
padding: 5px 0;
width: 100%;
}
.thumbnail-row {
display: flex;
gap: 4px;
overflow-x: auto;
height: 80px;
scroll-behavior: smooth;
pointer-events: auto;
scrollbar-width: none;
scroll-snap-type: x mandatory;
padding-top: 8px;
padding-left: 0;
padding-right: 0;
align-items: center;
}
.thumbnail-row::-webkit-scrollbar {
display: none;
}
.thumbnail-row img {
width: 75px;
height: 75px;
border: 2px solid transparent;
transition: border 0.2s ease, transform 0.2s ease;
cursor: pointer;
pointer-events: auto;
scroll-snap-align: start;
box-sizing: border-box;
object-fit: cover;
flex-shrink: 0;
margin-left: 0;
margin-right: 0;
position: relative;
z-index: 1;
display: block;
}
.thumbnail-row img:hover {
border-color: #5F8B4C;
z-index: 1;
}
/* Selected state */
.thumbnail-row img.selected {
border-color: #5F8B4C;
}
.arrow {
position: absolute;
top: 50%;
transform: translateY(-50%);
border: none;
font-size: 30px;
padding: 8px;
cursor: pointer;
z-index: 10;
color: white;
background-color: rgba(87, 83, 83, 0.428);
}
.arrow img {
width: 25px;
height: 25px;
pointer-events: none;
}
.arrow.left {
position: absolute;
left: -0px;
}
.arrow.right {
position: absolute;
right: -0px;
}
.product-details {
flex: 1;
padding-top: 10px;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: flex-start;
text-align: left;
gap: 10px;
margin-top: 0;
padding-left: 0;
}
@media (min-width: 768px) {
.product-details {
padding-left: 0px;
padding-top: 0;
flex-direction: column;
}
}
.product-details h2 {
color: var(--text-dark);
font-family: var(--header-font);
text-align: left;
}
.price {
color: #5F8B4C;
font-weight: bold;
font-family: var(--header-font);
font-size: large;
text-align: left;
}
.description {
margin: 15px 0;
color: #666;
font-family: var(--text-font);
font-size: 16px;
text-align: left;
}
.color-name {
color: var(--text-dark);
font-weight: bold;
text-align: left;
}
.colors {
margin: 10px 0;
flex-wrap: wrap;
gap: 10px;
overflow: hidden;
text-align: left;
}
.color-option {
display: inline-block;
width: 30px;
height: 30px;
border-radius: 50%;
margin-right: 10px;
cursor: pointer;
transition: transform 0.3s ease;
transform-origin: center center;
border: 2px solid #EFF3EA;
flex-shrink: 0;
}
.color-option:hover {
outline: 2px solid #EFF3EA;
outline-offset: 0px;
transform: scale(1.2);
}
< /code>
GOOJODOQ













‹






›
Beats Solo3 Wireless
$999.99
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Available Colors
< /code>
document.addEventListener("DOMContentLoaded", function () {
let lastScrollTop = 0;
const header = document.querySelector("header");
window.addEventListener("scroll", function () {
const currentScroll = window.pageYOffset || document.documentElement.scrollTop;
header.style.top = currentScroll > lastScrollTop ? "-100px" : "0";
lastScrollTop = currentScroll {
img.classList.remove("selected");
});
imgElement.classList.add("selected");
}
function changeQty(change) {
const qtyElement = document.getElementById("quantity");
if (qtyElement) {
let qty = parseInt(qtyElement.textContent) || 1;
qty = Math.max(qty + change, 1);
qtyElement.textContent = qty;
}
}
const scrollContainer = document.getElementById("thumbnailRow");
const leftArrow = document.querySelector(".arrow.left");
const rightArrow = document.querySelector(".arrow.right");
function scrollThumbnails(direction) {
const scrollAmount = 100;
if (scrollContainer) {
scrollContainer.scrollBy({
left: direction * scrollAmount,
behavior: "smooth"
});
}
}
if (leftArrow && rightArrow && scrollContainer) {
leftArrow.addEventListener("click", () => scrollThumbnails(-1));
rightArrow.addEventListener("click", () => scrollThumbnails(1));
}
const mainImage = document.getElementById("mainImage");
const thumbnails = document.querySelectorAll(".thumbnail-row img");
thumbnails.forEach(thumbnail => {
thumbnail.addEventListener("mouseover", () => {
// Set as main image
if (mainImage) {
mainImage.src = thumbnail.src;
}
thumbnails.forEach(img => img.classList.remove("selected"));
// Add selected to hovered
thumbnail.classList.add("selected");
});
});
window.img = function (src) {
const mainImage = document.getElementById("mainImage");
if (mainImage) {
mainImage.src = src;
}
};
if (typeof ScrollReveal !== "undefined") {
ScrollReveal().reveal(".page-body", {
origin: "bottom",
distance: "50px",
duration: 1000,
delay: 100,
reset: true
});
} else {
console.warn("ScrollReveal is not defined.");
}
window.changeImage = changeImage;
window.changeQty = changeQty;
});
Подробнее здесь: https://stackoverflow.com/questions/795 ... ge-options
Мобильная версия