commit 392b5d41637a9588dfb9ca69ff2677fbe761cc68 Author: Romain Dacet Date: Tue Jun 9 20:06:48 2026 +0200 Site vitrine statique Brasserie Terroir & Savoirs (HTML/CSS/JS) diff --git a/README.md b/README.md new file mode 100644 index 0000000..1726a71 --- /dev/null +++ b/README.md @@ -0,0 +1,51 @@ +# Brasserie Terroir & Savoirs — Site vitrine + +Site vitrine **statique** (HTML5 / CSS3 / JavaScript Vanilla) pour la **Brasserie Terroir & Savoirs** (Hauts-de-France). + +Contrairement à la version thème WordPress, ce site **n'a besoin d'aucun serveur ni CMS** : il suffit d'ouvrir `index.html` dans un navigateur. + +## Lancer le site + +Double-cliquez simplement sur `index.html`, ou servez le dossier avec un petit serveur local : + +```bash +# Python +python -m http.server 8000 +# puis ouvrir http://localhost:8000 +``` + +## Structure + +```text +brasserie-site/ +├── index.html ← Page unique (hero, à propos, produits, contact) +├── css/ +│ └── style.css ← Feuille de style complète (palette cuivrée, responsive) +├── js/ +│ └── main.js ← Catalogue produits, modal, menu, scroll, formulaire +└── assets/ + └── img/ ← logo.png + produits-01..05.png +``` + +## Fonctionnalités + +- One-page avec ancres : Accueil, À propos, Produits, Contact +- Header sticky avec effet au scroll + menu burger mobile (off-canvas) +- Bandeau légal « L'abus d'alcool est dangereux pour la santé » +- Hero plein écran avec dégradé cuivré et indicateur de défilement +- Bandeau de chiffres clés +- Galerie produits générée en JS + **modal** détaillée au clic +- Lien de navigation actif synchronisé avec la section visible (scroll-spy) +- Animations d'apparition au scroll (respecte `prefers-reduced-motion`) +- Formulaire de contact avec validation côté client +- Responsive mobile-first + accessibilité (ARIA, focus, clavier) + +## Personnalisation + +- **Couleurs** : variables CSS dans `:root` (fichier `css/style.css`). +- **Produits** : tableau `PRODUCTS` en haut de `js/main.js`. +- **Coordonnées** : section `#contact` dans `index.html`. + +## Licence + +MIT diff --git a/assets/img/hero.jpg b/assets/img/hero.jpg new file mode 100644 index 0000000..454b686 Binary files /dev/null and b/assets/img/hero.jpg differ diff --git a/assets/img/logo.png b/assets/img/logo.png new file mode 100644 index 0000000..2852be6 Binary files /dev/null and b/assets/img/logo.png differ diff --git a/assets/img/produits-01.png b/assets/img/produits-01.png new file mode 100644 index 0000000..f9a826c Binary files /dev/null and b/assets/img/produits-01.png differ diff --git a/assets/img/produits-02.png b/assets/img/produits-02.png new file mode 100644 index 0000000..0b1b4e0 Binary files /dev/null and b/assets/img/produits-02.png differ diff --git a/assets/img/produits-03.png b/assets/img/produits-03.png new file mode 100644 index 0000000..d24a711 Binary files /dev/null and b/assets/img/produits-03.png differ diff --git a/assets/img/produits-04.png b/assets/img/produits-04.png new file mode 100644 index 0000000..405a129 Binary files /dev/null and b/assets/img/produits-04.png differ diff --git a/assets/img/produits-05.png b/assets/img/produits-05.png new file mode 100644 index 0000000..14718ff Binary files /dev/null and b/assets/img/produits-05.png differ diff --git a/css/style.css b/css/style.css new file mode 100644 index 0000000..41177c1 --- /dev/null +++ b/css/style.css @@ -0,0 +1,617 @@ +/* ============================================================ + Brasserie Terroir & Savoirs — Feuille de style + Site statique (HTML/CSS/JS) — palette cuivrée + ============================================================ */ + +/* ---------- Reset ---------- */ +*, *::before, *::after { box-sizing: border-box; } +html { scroll-behavior: smooth; } +body { margin: 0; padding: 0; } +img { max-width: 100%; display: block; height: auto; } +a { color: inherit; text-decoration: none; } +button { font: inherit; cursor: pointer; border: 0; background: none; } +ul { list-style: none; margin: 0; padding: 0; } + +:root { + /* Palette cuivrée */ + --cream: #f7f1e3; + --beige: #e8d5a9; + --beige-dk: #ddc491; + --ocre: #c89b3c; + --cuivre: #b5651d; + --cuivre-lt: #d27c2c; + --marron: #5c3a1e; + --marron-dk: #2d1a0a; + --text: #2d1a0a; + --text-soft: #5c3a1e; + --white: #fffaf0; + + --font-display: "Playfair Display", Georgia, serif; + --font-body: "Inter", system-ui, -apple-system, sans-serif; + + --container: 1200px; + --radius: 14px; + --radius-sm: 8px; + --shadow: 0 10px 30px rgba(45, 26, 10, 0.12); + --shadow-lg: 0 20px 50px rgba(45, 26, 10, 0.22); + --header-h: 78px; +} + +/* ---------- Base ---------- */ +body { + font-family: var(--font-body); + color: var(--text); + background: var(--cream); + line-height: 1.65; + font-size: 16px; + -webkit-font-smoothing: antialiased; +} + +h1, h2, h3, h4 { + font-family: var(--font-display); + color: var(--marron-dk); + font-weight: 700; + line-height: 1.15; + margin: 0 0 .6em; +} +h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); } +h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); } +h3 { font-size: 1.35rem; } +p { margin: 0 0 1rem; } + +.container { + max-width: var(--container); + margin: 0 auto; + padding: 0 1.5rem; + width: 100%; +} + +/* ---------- Boutons ---------- */ +.btn { + display: inline-flex; + align-items: center; + justify-content: center; + padding: .9rem 2rem; + background: var(--cuivre); + color: var(--white); + border-radius: 50px; + font-weight: 600; + letter-spacing: .02em; + box-shadow: 0 6px 18px rgba(181, 101, 29, .35); + transition: background .25s, transform .25s, box-shadow .25s; +} +.btn:hover { background: var(--marron); transform: translateY(-3px); box-shadow: 0 10px 24px rgba(45,26,10,.3); } +.btn--outline { + background: transparent; + color: var(--cream); + border: 2px solid rgba(247,241,227,.6); + box-shadow: none; +} +.btn--outline:hover { background: var(--cream); color: var(--marron-dk); border-color: var(--cream); } + +/* ---------- Bandeau légal ---------- */ +.age-warning { + background: var(--marron-dk); + color: var(--beige); + text-align: center; + padding: .55rem 1rem; + font-size: .82rem; + letter-spacing: .03em; +} + +/* ---------- Header ---------- */ +.site-header { + position: sticky; + top: 0; + z-index: 100; + background: rgba(45, 26, 10, .85); + backdrop-filter: blur(10px); + -webkit-backdrop-filter: blur(10px); + transition: background .3s, box-shadow .3s, padding .3s; +} +.site-header.scrolled { + background: rgba(45, 26, 10, .98); + box-shadow: var(--shadow); +} +.site-header .container { + display: flex; + align-items: center; + justify-content: space-between; + gap: 1rem; + min-height: var(--header-h); +} + +.site-logo { display: flex; align-items: center; gap: .8rem; } +.site-logo img { height: 50px; width: auto; filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); } +.site-logo .site-title { + font-family: var(--font-display); + font-size: 1.3rem; + font-weight: 700; + color: var(--ocre); + line-height: 1.1; +} +.site-logo .site-title small { + display: block; + font-family: var(--font-body); + font-size: .68rem; + font-weight: 500; + color: var(--beige); + letter-spacing: .22em; + text-transform: uppercase; +} + +.main-nav ul { display: flex; gap: 2.2rem; align-items: center; } +.main-nav a { + color: var(--cream); + font-weight: 500; + font-size: .98rem; + position: relative; + padding: .35rem 0; + transition: color .2s; +} +.main-nav a::after { + content: ''; + position: absolute; + left: 0; bottom: -2px; + width: 0; height: 2px; + background: var(--ocre); + transition: width .28s; +} +.main-nav a:hover, .main-nav a.active { color: var(--ocre); } +.main-nav a:hover::after, .main-nav a.active::after { width: 100%; } + +/* Burger */ +.nav-toggle { + display: none; + flex-direction: column; + justify-content: center; + gap: 5px; + width: 42px; height: 42px; +} +.nav-toggle span { + display: block; + width: 26px; height: 2px; + background: var(--cream); + border-radius: 2px; + transition: transform .3s, opacity .3s; +} +.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); } +.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; } +.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); } + +/* ---------- Hero ---------- */ +.hero { + position: relative; + min-height: calc(100vh - var(--header-h)); + display: flex; + align-items: center; + text-align: center; + color: var(--cream); + overflow: hidden; + background: + linear-gradient(160deg, rgba(45,26,10,.78) 0%, rgba(28,16,6,.82) 100%), + url('../assets/img/hero.jpg') center/cover no-repeat; + background-color: var(--marron-dk); +} +.hero__overlay { + position: absolute; + inset: 0; + background: + radial-gradient(circle at 20% 25%, rgba(200,155,60,.25), transparent 45%), + radial-gradient(circle at 85% 80%, rgba(181,101,29,.28), transparent 50%); + pointer-events: none; +} +.hero__content { position: relative; z-index: 2; max-width: 820px; } +.hero__eyebrow { + display: inline-block; + color: var(--ocre); + letter-spacing: .28em; + text-transform: uppercase; + font-size: .8rem; + font-weight: 600; + margin-bottom: 1.4rem; + padding: .4rem 1.1rem; + border: 1px solid rgba(200,155,60,.4); + border-radius: 50px; +} +.hero h1 { color: var(--white); margin-bottom: 1.2rem; } +.hero p { + font-size: 1.2rem; + max-width: 620px; + margin: 0 auto 2.4rem; + color: var(--beige); +} +.hero__actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; } + +.hero__scroll { + position: absolute; + bottom: 28px; left: 50%; + transform: translateX(-50%); + width: 26px; height: 44px; + border: 2px solid rgba(247,241,227,.5); + border-radius: 14px; + z-index: 2; +} +.hero__scroll span { + position: absolute; + top: 8px; left: 50%; + width: 4px; height: 8px; + margin-left: -2px; + background: var(--ocre); + border-radius: 2px; + animation: scrollDot 1.8s infinite; +} +@keyframes scrollDot { + 0% { opacity: 0; transform: translateY(0); } + 40% { opacity: 1; } + 100% { opacity: 0; transform: translateY(16px); } +} + +/* ---------- Stats ---------- */ +.stats { + background: var(--marron-dk); + color: var(--cream); + padding: 2.8rem 0; +} +.stats__grid { + display: grid; + grid-template-columns: repeat(4, 1fr); + gap: 1.5rem; + text-align: center; +} +.stat__num { + display: block; + font-family: var(--font-display); + font-size: clamp(2rem, 4vw, 3rem); + font-weight: 800; + color: var(--ocre); + line-height: 1; +} +.stat__label { + display: block; + margin-top: .5rem; + font-size: .85rem; + letter-spacing: .06em; + color: var(--beige); +} + +/* ---------- Sections ---------- */ +.section { padding: 6rem 0; } +.section--alt { background: var(--beige); } + +.section-title { text-align: center; margin-bottom: 3.5rem; } +.section-title span { + display: block; + color: var(--cuivre); + font-size: .82rem; + letter-spacing: .28em; + text-transform: uppercase; + font-weight: 600; + margin-bottom: .6rem; +} +.section-title h2 { position: relative; display: inline-block; } +.section-title h2::after { + content: ''; + display: block; + width: 64px; height: 3px; + background: var(--cuivre); + border-radius: 2px; + margin: .8rem auto 0; +} + +/* ---------- À propos ---------- */ +.about { + display: grid; + grid-template-columns: 1.2fr 1fr; + gap: 3.5rem; + align-items: center; +} +.about__text p { color: var(--text-soft); } +.about__values { + margin-top: 1.6rem; + display: grid; + gap: .7rem; +} +.about__values li { + position: relative; + padding-left: 1.9rem; + font-weight: 500; + color: var(--marron-dk); +} +.about__values li::before { + content: ''; + position: absolute; + left: 0; top: 50%; + transform: translateY(-50%); + width: 1.1rem; height: 1.1rem; + border-radius: 50%; + background: var(--cuivre); + box-shadow: inset 0 0 0 3px var(--beige); +} +.about__media { display: flex; justify-content: center; } +.about__logo-card { + background: var(--cream); + border-radius: var(--radius); + padding: 3rem; + box-shadow: var(--shadow-lg); + border: 1px solid rgba(181,101,29,.15); + max-width: 360px; +} +.about__logo-card img { width: 100%; } + +/* ---------- Produits ---------- */ +.products-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); + gap: 2rem; +} +.product-card { + background: var(--white); + border-radius: var(--radius); + overflow: hidden; + box-shadow: var(--shadow); + text-align: center; + display: flex; + flex-direction: column; + cursor: pointer; + border: 1px solid rgba(181,101,29,.08); + transition: transform .3s, box-shadow .3s; +} +.product-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); } +.product-card .img-wrap { + background: linear-gradient(160deg, var(--cream), var(--beige)); + padding: 2rem; + aspect-ratio: 1 / 1; + display: flex; + align-items: center; + justify-content: center; +} +.product-card .img-wrap img { + max-height: 100%; + width: auto; + object-fit: contain; + filter: drop-shadow(0 8px 16px rgba(45,26,10,.25)); + transition: transform .3s; +} +.product-card:hover .img-wrap img { transform: scale(1.06) rotate(-2deg); } +.product-card__cat { + display: inline-block; + margin: 1.1rem auto 0; + font-size: .7rem; + letter-spacing: .18em; + text-transform: uppercase; + color: var(--cuivre); + font-weight: 600; +} +.product-card h3 { padding: .4rem 1rem 0; color: var(--marron-dk); } +.product-card .tagline { + padding: 0 1.25rem 1.25rem; + color: var(--text-soft); + font-size: .92rem; + flex: 1; +} +.product-card .more { + background: var(--marron-dk); + color: var(--ocre); + padding: .85rem; + font-weight: 600; + letter-spacing: .06em; + font-size: .8rem; + text-transform: uppercase; + transition: background .25s, color .25s; +} +.product-card:hover .more { background: var(--cuivre); color: var(--white); } + +/* ---------- Modal ---------- */ +.modal { + position: fixed; + inset: 0; + z-index: 1000; + display: none; + align-items: center; + justify-content: center; + padding: 1.5rem; +} +.modal.is-open { display: flex; } +.modal__overlay { + position: absolute; + inset: 0; + background: rgba(28, 16, 6, .82); + backdrop-filter: blur(4px); +} +.modal__content { + position: relative; + z-index: 2; + background: var(--cream); + max-width: 760px; + width: 100%; + max-height: 88vh; + border-radius: var(--radius); + overflow: hidden; + display: grid; + grid-template-columns: 1fr 1.25fr; + box-shadow: var(--shadow-lg); + animation: modalIn .35s ease; +} +@keyframes modalIn { + from { opacity: 0; transform: translateY(24px) scale(.97); } + to { opacity: 1; transform: none; } +} +.modal__close { + position: absolute; + top: .6rem; right: .9rem; + font-size: 2rem; + color: var(--marron-dk); + line-height: 1; + z-index: 3; + width: 40px; height: 40px; + border-radius: 50%; + transition: background .2s; +} +.modal__close:hover { background: rgba(45,26,10,.1); } +.modal__media { + background: linear-gradient(160deg, var(--beige), var(--beige-dk)); + padding: 2.5rem; + display: flex; + align-items: center; + justify-content: center; +} +.modal__media img { max-height: 340px; width: auto; filter: drop-shadow(0 12px 24px rgba(45,26,10,.3)); } +.modal__body { padding: 2.5rem; overflow-y: auto; } +.modal__eyebrow { + display: block; + color: var(--cuivre); + font-size: .75rem; + letter-spacing: .2em; + text-transform: uppercase; + font-weight: 600; + margin-bottom: .5rem; +} +.modal__body h3 { color: var(--marron-dk); font-size: 2rem; margin-bottom: 1rem; } +.modal__body p { color: var(--text-soft); } + +/* ---------- Contact ---------- */ +.contact-grid { + display: grid; + grid-template-columns: 1fr 1.3fr; + gap: 3.5rem; + align-items: start; +} +.contact-info { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 1.8rem; +} +.contact-info__item h3 { + font-size: 1rem; + color: var(--cuivre); + text-transform: uppercase; + letter-spacing: .08em; + margin-bottom: .3rem; +} +.contact-info__item p { color: var(--text-soft); margin: 0; } +.contact-info__item a:hover { color: var(--cuivre); } + +.contact-form { + background: var(--cream); + padding: 2.2rem; + border-radius: var(--radius); + box-shadow: var(--shadow); + display: grid; + gap: 1.2rem; +} +.form-row { display: grid; gap: .4rem; } +.form-row label { font-weight: 600; font-size: .9rem; color: var(--marron-dk); } +.contact-form input, +.contact-form textarea { + font: inherit; + padding: .85rem 1rem; + border: 1px solid var(--beige-dk); + border-radius: var(--radius-sm); + background: var(--white); + color: var(--text); + transition: border-color .2s, box-shadow .2s; +} +.contact-form input:focus, +.contact-form textarea:focus { + outline: none; + border-color: var(--cuivre); + box-shadow: 0 0 0 3px rgba(181,101,29,.15); +} +.contact-form input.invalid, +.contact-form textarea.invalid { border-color: #c0392b; box-shadow: 0 0 0 3px rgba(192,57,43,.12); } +.contact-form textarea { min-height: 150px; resize: vertical; } +.contact-form .btn { justify-self: start; } +.form-feedback { margin: 0; font-weight: 500; font-size: .92rem; } +.form-feedback.success { color: #1e7d4c; } +.form-feedback.error { color: #c0392b; } + +/* ---------- Footer ---------- */ +.site-footer { + background: var(--marron-dk); + color: var(--beige); + padding: 3.5rem 0 1.8rem; +} +.site-footer__top { + display: flex; + justify-content: space-between; + align-items: center; + gap: 2rem; + flex-wrap: wrap; + padding-bottom: 2rem; + border-bottom: 1px solid rgba(232,213,169,.18); +} +.site-logo--footer img { height: 46px; } +.site-footer__tagline { margin: 1rem 0 0; color: var(--beige); opacity: .8; font-size: .92rem; } +.site-footer__nav { display: flex; gap: 1.8rem; flex-wrap: wrap; } +.site-footer__nav a { color: var(--beige); transition: color .2s; } +.site-footer__nav a:hover { color: var(--ocre); } +.site-footer__bottom { + margin-top: 1.8rem; + text-align: center; + font-size: .85rem; + color: rgba(232,213,169,.7); +} +.site-footer__bottom p { margin: .2rem 0; } + +/* ---------- Animations au scroll ---------- */ +.reveal { + opacity: 0; + transform: translateY(28px); + transition: opacity .7s ease, transform .7s ease; +} +.reveal.is-visible { opacity: 1; transform: none; } + +@media (prefers-reduced-motion: reduce) { + .reveal { opacity: 1; transform: none; transition: none; } + html { scroll-behavior: auto; } + .hero__scroll span { animation: none; } +} + +/* ---------- Responsive ---------- */ +@media (max-width: 960px) { + .about { grid-template-columns: 1fr; gap: 2.5rem; } + .about__media { order: -1; } + .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; } + .stats__grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; } + .modal__content { grid-template-columns: 1fr; } + .modal__media { padding: 2rem; } + .modal__media img { max-height: 220px; } +} + +@media (max-width: 760px) { + .nav-toggle { display: flex; } + .main-nav { + position: fixed; + top: 0; right: 0; + height: 100vh; + width: min(80vw, 320px); + background: var(--marron-dk); + padding: calc(var(--header-h) + 1.5rem) 2rem 2rem; + transform: translateX(100%); + transition: transform .35s ease; + box-shadow: -10px 0 40px rgba(0,0,0,.4); + z-index: 90; + } + .main-nav.is-open { transform: translateX(0); } + .main-nav ul { flex-direction: column; gap: 0; align-items: stretch; } + .main-nav li { border-bottom: 1px solid rgba(232,213,169,.15); } + .main-nav a { display: block; padding: 1rem 0; font-size: 1.05rem; } + .main-nav a::after { display: none; } + .nav-backdrop { + position: fixed; inset: 0; + background: rgba(0,0,0,.45); + z-index: 80; + opacity: 0; visibility: hidden; + transition: opacity .3s; + } + .nav-backdrop.is-open { opacity: 1; visibility: visible; } + .section { padding: 4.5rem 0; } + .contact-info { grid-template-columns: 1fr; } +} + +@media (max-width: 460px) { + .stats__grid { grid-template-columns: 1fr 1fr; } + .site-logo .site-title { font-size: 1.1rem; } + .contact-form { padding: 1.5rem; } +} diff --git a/index.html b/index.html new file mode 100644 index 0000000..1c4a75c --- /dev/null +++ b/index.html @@ -0,0 +1,222 @@ + + + + + + + Brasserie Terroir & Savoirs — Bières & spiritueux artisanaux des Hauts-de-France + + + + + + + + + + + +
+ L'abus d'alcool est dangereux pour la santé. À consommer avec modération. +
+ + + + +
+ +
+
+
+ Artisans brasseurs · Hauts-de-France +

L'art du brassage,
au cœur du Nord

+

Bières artisanales et spiritueux d'exception, élaborés avec passion et respect du terroir des Hauts-de-France.

+ +
+ + + +
+ + +
+
+
+ 5 + Créations artisanales +
+
+ 100% + Terroir des Hauts-de-France +
+
+ 2014 + Année de fondation +
+
+ ∞ + Passion du métier +
+
+
+ + +
+
+
+ Notre passion +

Tradition & savoir-faire

+
+ +
+
+

Nichée au cœur du nord de la France, la Brasserie Terroir & Savoirs incarne la passion du brassage artisanal et la richesse des produits du terroir.

+

Fondée par des amoureux de la bière et des spiritueux, notre brasserie associe tradition et innovation pour offrir des créations uniques, empreintes d'authenticité et de caractère.

+

Grâce à une sélection rigoureuse des matières premières, nous élaborons des bières aux arômes subtils et équilibrés, ainsi que des spiritueux d'exception, distillés avec patience et savoir-faire.

+ +
    +
  • Matières premières locales
  • +
  • Brassage en petites séries
  • +
  • Recettes maison exclusives
  • +
+
+
+
+ Logo Brasserie Terroir & Savoirs +
+
+
+
+
+ + +
+
+
+ Notre gamme +

Bières & spiritueux

+
+ +
+ +
+
+
+ + +
+
+
+ Nous écrire +

Contact

+
+ +
+
+
+

Adresse

+

Brasserie Terroir & Savoirs
Hauts-de-France

+
+
+

Téléphone

+

03 20 00 00 00

+
+ +
+

Horaires

+

Du mardi au samedi
10h – 19h

+
+
+ +
+
+ + +
+
+ + +
+
+ + +
+ + +
+
+
+
+
+ + + + + + + + + + diff --git a/js/main.js b/js/main.js new file mode 100644 index 0000000..ee7eb9f --- /dev/null +++ b/js/main.js @@ -0,0 +1,208 @@ +/* ============================================================ + Brasserie Terroir & Savoirs — JavaScript (Vanilla) + Catalogue produits, modal, navigation, formulaire, scroll. + ============================================================ */ +(function () { + 'use strict'; + + /* ---------- Catalogue produits ---------- */ + const PRODUCTS = [ + { + slug: 'blonde', + name: 'Bière Blonde', + category: 'Bière', + tagline: 'Équilibre parfait entre douceur et amertume.', + image: 'assets/img/produits-01.png', + desc: "Légère et rafraîchissante, la bière blonde de la Brasserie Terroir & Savoirs séduit par son équilibre parfait entre douceur et amertume. Brassée avec des malts soigneusement sélectionnés et des houblons aromatiques, elle offre des notes subtiles de céréales et une touche florale. Sa robe dorée limpide et sa mousse onctueuse en font un classique incontournable, idéal pour accompagner des moments conviviaux." + }, + { + slug: 'brune', + name: 'Bière Brune', + category: 'Bière', + tagline: 'Riche et intense, arômes torréfiés.', + image: 'assets/img/produits-02.png', + desc: "Riche et intense, la bière brune de la Brasserie Terroir & Savoirs dévoile une palette de saveurs profondes. Ses malts torréfiés révèlent des arômes de chocolat noir, de caramel et une légère pointe de café. Sa texture ronde et son caractère généreux en font une bière réconfortante, parfaite pour les amateurs de saveurs puissantes et complexes." + }, + { + slug: 'ipa', + name: 'Bière IPA', + category: 'Bière', + tagline: 'Audacieuse, houblonnée, finale sèche.', + image: 'assets/img/produits-03.png', + desc: "Audacieuse et aromatique, la bière IPA (India Pale Ale) de la Brasserie Terroir & Savoirs se distingue par ses houblons expressifs et son amertume affirmée. Elle libère des arômes intenses d'agrumes, de fruits tropicaux et de résine de pin. Avec son profil vibrant et sa finale sèche, cette IPA est un choix parfait pour les amateurs de bières modernes et audacieuses." + }, + { + slug: 'whisky', + name: 'Whisky', + category: 'Spiritueux', + tagline: 'Vieilli en fûts de chêne, notes de vanille et de tourbe.', + image: 'assets/img/produits-04.png', + desc: "Le whisky de la Brasserie Terroir & Savoirs est un hommage à l'artisanat et au terroir. Distillé avec soin et vieilli en fûts de chêne, il révèle une richesse aromatique exceptionnelle : des notes de vanille, d'épices douces, de fruits secs et une pointe de tourbe. Ronde et élégante, cette eau-de-vie offre une dégustation unique, parfaite pour les connaisseurs." + }, + { + slug: 'gin', + name: 'Gin', + category: 'Spiritueux', + tagline: "Plantes aromatiques locales, zestes d'agrumes.", + image: 'assets/img/produits-05.png', + desc: "Ce gin artisanal signé Brasserie Terroir & Savoirs est une véritable ode à la nature. Élaboré à partir de plantes aromatiques locales et d'épices soigneusement sélectionnées, il combine des notes fraîches de genièvre, des zestes d'agrumes et des touches herbacées. Sa complexité et sa pureté en font un spiritueux raffiné, idéal pour des cocktails sophistiqués ou une dégustation pure." + } + ]; + + /* ---------- Génération des cartes produit ---------- */ + const grid = document.getElementById('products-grid'); + if (grid) { + PRODUCTS.forEach((p) => { + const card = document.createElement('article'); + card.className = 'product-card reveal'; + card.dataset.slug = p.slug; + card.innerHTML = + '
' + p.name + '
' + + '' + p.category + '' + + '

' + p.name + '

' + + '

' + p.tagline + '

' + + '
En savoir plus →
'; + card.addEventListener('click', () => openModal(p)); + grid.appendChild(card); + }); + } + + /* ---------- Modal produit ---------- */ + const modal = document.getElementById('product-modal'); + const modalImg = document.getElementById('modal-img'); + const modalCat = document.getElementById('modal-cat'); + const modalTit = document.getElementById('modal-title'); + const modalDsc = document.getElementById('modal-desc'); + let lastFocused = null; + + function openModal(p) { + if (!modal) return; + lastFocused = document.activeElement; + modalImg.src = p.image; + modalImg.alt = p.name; + modalCat.textContent = p.category; + modalTit.textContent = p.name; + modalDsc.textContent = p.desc; + modal.classList.add('is-open'); + modal.setAttribute('aria-hidden', 'false'); + document.body.style.overflow = 'hidden'; + const closeBtn = modal.querySelector('.modal__close'); + if (closeBtn) closeBtn.focus(); + } + + function closeModal() { + if (!modal) return; + modal.classList.remove('is-open'); + modal.setAttribute('aria-hidden', 'true'); + document.body.style.overflow = ''; + if (lastFocused) lastFocused.focus(); + } + + if (modal) { + modal.querySelectorAll('[data-close]').forEach((el) => { + el.addEventListener('click', closeModal); + }); + document.addEventListener('keydown', (e) => { + if (e.key === 'Escape' && modal.classList.contains('is-open')) closeModal(); + }); + } + + /* ---------- Menu mobile ---------- */ + const toggle = document.querySelector('.nav-toggle'); + const nav = document.querySelector('.main-nav'); + let backdrop = null; + + if (toggle && nav) { + backdrop = document.createElement('div'); + backdrop.className = 'nav-backdrop'; + document.body.appendChild(backdrop); + + const setOpen = (open) => { + nav.classList.toggle('is-open', open); + backdrop.classList.toggle('is-open', open); + toggle.setAttribute('aria-expanded', String(open)); + document.body.style.overflow = open ? 'hidden' : ''; + }; + + toggle.addEventListener('click', () => setOpen(!nav.classList.contains('is-open'))); + backdrop.addEventListener('click', () => setOpen(false)); + nav.querySelectorAll('a').forEach((a) => a.addEventListener('click', () => setOpen(false))); + } + + /* ---------- Header au scroll ---------- */ + const header = document.getElementById('site-header'); + const onScroll = () => { + if (header) header.classList.toggle('scrolled', window.scrollY > 30); + }; + onScroll(); + window.addEventListener('scroll', onScroll, { passive: true }); + + /* ---------- Lien actif selon la section ---------- */ + const navLinks = Array.from(document.querySelectorAll('.main-nav a')); + const sections = navLinks + .map((a) => document.querySelector(a.getAttribute('href'))) + .filter(Boolean); + + if ('IntersectionObserver' in window && sections.length) { + const spy = new IntersectionObserver((entries) => { + entries.forEach((entry) => { + if (entry.isIntersecting) { + const id = entry.target.id; + navLinks.forEach((a) => a.classList.toggle('active', a.getAttribute('href') === '#' + id)); + } + }); + }, { rootMargin: '-45% 0px -50% 0px' }); + sections.forEach((s) => spy.observe(s)); + } + + /* ---------- Animations au scroll (reveal) ---------- */ + if ('IntersectionObserver' in window) { + const revealObserver = new IntersectionObserver((entries, obs) => { + entries.forEach((entry) => { + if (entry.isIntersecting) { + entry.target.classList.add('is-visible'); + obs.unobserve(entry.target); + } + }); + }, { threshold: 0.12 }); + document.querySelectorAll('.reveal').forEach((el) => revealObserver.observe(el)); + } else { + document.querySelectorAll('.reveal').forEach((el) => el.classList.add('is-visible')); + } + + /* ---------- Formulaire de contact ---------- */ + const form = document.getElementById('contact-form'); + const feedback = document.getElementById('form-feedback'); + + if (form) { + form.addEventListener('submit', (e) => { + e.preventDefault(); + feedback.textContent = ''; + feedback.className = 'form-feedback'; + + const fields = ['name', 'email', 'message']; + let valid = true; + fields.forEach((id) => { + const input = form.elements[id]; + const ok = input.value.trim() !== '' && + (id !== 'email' || /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(input.value.trim())); + input.classList.toggle('invalid', !ok); + if (!ok) valid = false; + }); + + if (!valid) { + feedback.textContent = 'Merci de remplir correctement tous les champs.'; + feedback.classList.add('error'); + return; + } + + feedback.textContent = 'Merci ! Votre message a bien été envoyé. Nous vous répondrons rapidement.'; + feedback.classList.add('success'); + form.reset(); + }); + } + + /* ---------- Année du footer ---------- */ + const yearEl = document.getElementById('year'); + if (yearEl) yearEl.textContent = new Date().getFullYear(); +})();