From 03759602e153a90e0255aed4162899e5ec3f9dbf Mon Sep 17 00:00:00 2001 From: Curenay Simon Rosas Date: Thu, 8 Aug 2024 22:06:00 +1000 Subject: [PATCH] web qw --- gar/script.js | 17 +++++ gar/styles.css | 175 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 192 insertions(+) create mode 100644 gar/script.js create mode 100644 gar/styles.css diff --git a/gar/script.js b/gar/script.js new file mode 100644 index 0000000..5f84b14 --- /dev/null +++ b/gar/script.js @@ -0,0 +1,17 @@ +document.addEventListener("DOMContentLoaded", function() { + const lightbox = document.getElementById('lightbox'); + const lightboxImg = document.getElementById('lightbox-img'); + const lightboxLinks = document.querySelectorAll('.lightbox'); + + lightboxLinks.forEach(link => { + link.addEventListener('click', function(e) { + e.preventDefault(); + lightboxImg.src = this.href; + lightbox.classList.add('active'); + }); + }); + + lightbox.addEventListener('click', function() { + lightbox.classList.remove('active'); + }); +}); diff --git a/gar/styles.css b/gar/styles.css new file mode 100644 index 0000000..a3c9e6d --- /dev/null +++ b/gar/styles.css @@ -0,0 +1,175 @@ +/* Reset CSS */ +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + font-family: 'Helvetica Neue', Arial, sans-serif; + line-height: 1.6; + background-color: #f5f5f5; + color: #333; +} + +header { + padding: 20px; + text-align: center; + border-bottom: 1px solid #e0e0e0; + background-color: #ffffff; +} + +header h1 { + font-size: 2em; + color: #333; + font-weight: 300; +} + +header p.emphasis { + font-size: 1em; + color: #666; + margin-top: 10px; +} + +.product-navigation { + margin: 20px 0; + text-align: center; +} + +.product-navigation ul { + list-style: none; + padding: 0; +} + +.product-navigation li { + display: inline-block; + margin: 0 10px; +} + +.product-navigation a { + text-decoration: none; + color: #007bff; + font-weight: bold; + transition: color 0.3s, background-color 0.3s; + padding: 5px 10px; + border-radius: 5px; +} + +.product-navigation a.active { + color: #ffffff; + background-color: #007bff; +} + +.product-navigation a:hover { + background-color: #0056b3; + color: #ffffff; +} + +.products { + display: flex; + flex-wrap: wrap; + justify-content: space-between; + margin-bottom: 30px; +} + +.product { + background: #ffffff; + border: 1px solid #e0e0e0; + border-radius: 5px; + margin: 10px; + width: 30%; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); + transition: transform 0.2s; +} + +.product:hover { + transform: translateY(-5px); +} + +.product img { + width: 100%; + height: 200px; + object-fit: cover; + border-top-left-radius: 5px; + border-top-right-radius: 5px; +} + +.product-info { + padding: 15px; + text-align: center; +} + +.product-info h2 { + font-size: 1.2em; + color: #333; + font-weight: 400; + margin-bottom: 10px; +} + +.product-info p.price { + font-size: 1.1em; + color: #e74c3c; +} + +.buttons { + display: flex; + justify-content: space-around; +} + +.buttons .button { + background: #007bff; + color: white; + padding: 10px; + text-align: center; + text-decoration: none; + border-radius: 3px; + transition: background 0.3s; +} + +.buttons .button:hover { + background: #0056b3; +} + +.subscription { + text-align: center; + padding: 20px; + background: #ffffff; + margin-top: 30px; + border-radius: 5px; + border: 1px solid #e0e0e0; +} + +footer { + text-align: center; + padding: 20px; + background: #ffffff; + margin-top: 30px; + border-top: 1px solid #e0e0e0; + font-size: 0.9em; + color: #777; +} + +/* Lightbox Styles */ +.lightbox-overlay { + display: none; + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.8); + justify-content: center; + align-items: center; + z-index: 1000; +} + +.lightbox-overlay img { + max-width: 90%; + max-height: 90%; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5); + border-radius: 5px; +} + +.lightbox-overlay.active { + display: flex; +}