Files
Commerce/home.php
“VeLiTi” b9193fc3dc test branch
2025-05-26 11:51:25 +02:00

124 lines
3.8 KiB
PHP

<?php
// ++++++++++++++++++++++++++++++
// Prevent direct access to file
// ++++++++++++++++++++++++++++++
defined(security_key) or exit;
// ++++++++++++++++++++++++++++++
// Include header
// ++++++++++++++++++++++++++++++
$view = template_header($home_text, '');
$view .= '
<!-- Hero Section -->
<section class="hero">
<div class="hero-content">
<h1>'.$h2_brand_name_1.'<br>'.$h2_brand_name_2.'</h1>
<a href="'.url(link_to_collection).'" class="hero-btn">'.$h2_brand_visit.'</a>
</div>
</section>
<!-- Store Description -->
<div class="store-description">
<p>'.$h2_brand_wow.'</p>
</div>';
// ++++++++++++++++++++++++++++++
// Include highlighted Products
// ++++++++++++++++++++++++++++++
$view .= highlightedProducts2($clientsecret,category_id_highlighted_products_2, ($highlight_2 ?? 'highlight 2'),'');
$view .= '
<section class="watch-ad-section">
<div class="top-section">
<div class="watch-image">
</div>
<div class="top-content">
<h2>'.($ad_watch_1 ?? 'Dutch design and Swiss craftsmanship').'</h2>
<a href="'.url('index.php?page=about').'" class="btn">'.($btn_readmore ?? 'Read more').'</a>
</div>
</div>
<div class="bottom-section">
<div class="bottom-content">
<h2>'.($ad_watch_2 ?? 'Timeless timepieces that will last for generations!').'</h2>
<a href="'.url(link_to_collection).'" class="btn">'.$h2_brand_visit.'</a>
</div>
</div>
</section>';
$view .= '
<section class="features">
<div class="container features-container">
<div class="feature-item">
<h2>'.($home_timeless ?? 'Timeless').'</h2>
<p>'.($home_timeless_text ?? 'Morval Watches are unique, robust, stylish and timeless timepieces that will last for generations!').'</p>
</div>
<div class="feature-item">
<h2>'.($home_quality ?? 'Quality').'</h2>
<p>'.($home_quality_text ?? ' Morval watches meet the highest quality requirements and can compete with the well-known Swiss brands. The parts are supplied by renowned manufacturers from Europe and beyond. A Morval contains a Swiss-made caliber (STP) that is known for its reliable quality.').'</p>
</div>
<div class="feature-item">
<h2>'.($home_price ?? 'Price').'</h2>
<p>'.($home_price_text ?? 'Morval stands for an excellent price-quality ratio').'</p>
</div>
</div>
</section>';
// ++++++++++++++++++++++++++++++
// Include footer
// ++++++++++++++++++++++++++++++
$view .= template_footer();
// ++++++++++++++++++++++++++++++
// Additional JS scripts for page
// ++++++++++++++++++++++++++++++
$view .='
<script>
// Basic slider functionality
const prevBtn = document.querySelector(\'.prev-btn\');
const nextBtn = document.querySelector(\'.next-btn\');
const productContainer = document.querySelector(\'.product-container-slider\');
const products = document.querySelectorAll(\'.product-card-slider\');
let currentIndex = 0;
const productsPerView = window.innerWidth < 480 ? 1 :
window.innerWidth < 768 ? 2 :
window.innerWidth < 992 ? 3 : 4;
prevBtn.addEventListener(\'click\', () => {
if (currentIndex > 0) {
currentIndex--;
updateSliderPosition();
}
});
nextBtn.addEventListener(\'click\', () => {
if (currentIndex < products.length - productsPerView) {
currentIndex++;
updateSliderPosition();
}
});
function updateSliderPosition() {
const productWidth = products[0].offsetWidth;
productContainer.style.transform = `translateX(-${currentIndex * productWidth}px)`;
}
// Update slider on window resize
window.addEventListener(\'resize\', () => {
// Reset position when screen size changes
currentIndex = 0;
updateSliderPosition();
});
</script>
</html>
';
echo $view;
?>