Aller au contenu

🌅 HérosGratuit · 0 NahnahPar NAHNAH AI

Héros bandeau défilant

Image et grand titre, puis un bandeau de mots-clés qui défile sans fin sous les boutons (jamais par-dessus), avec bouton pause accessible.

Aperçu en direct

Données de démonstration (produits, menus, textes d’exemple) : dans ta boutique, ce sont les tiennes.

Photos : Unsplash / Pexels (exemples de l’aperçu, jamais inclus dans le code).

Code à copier

Fichier complet sections/nahnah-hero-bandeau-defilant.liquid (Liquid, CSS et JS inclus).

{%- comment -%} NAHNAH AI · Héros bandeau défilant (bibliothèque Sections & effets) {%- endcomment -%}
<nn-hero-bandeau-defilant class="nn-hero-bandeau-defilant" style="--nn-mh: {{ section.settings.marge_haut }}px; --nn-mb: {{ section.settings.marge_bas }}px; --nn-fond: {{ section.settings.couleur_fond }}; --nn-texte: {{ section.settings.couleur_texte }}; --nn-accent: {{ section.settings.couleur_accent }}; --nn-bouton: {{ section.settings.couleur_bouton }}; --nn-texte-bouton: {{ section.settings.couleur_texte_bouton }}; --nn-duree: {{ section.settings.vitesse }}s;">
  <div class="nn-hero-bandeau-defilant__grille">
    <div class="nn-hero-bandeau-defilant__contenu">
    {%- if section.settings.surtitre != blank -%}
      <p class="nn-hero-bandeau-defilant__surtitre">{{ section.settings.surtitre | escape }}</p>
    {%- endif -%}
    {%- if section.settings.titre != blank -%}
      <h2 class="nn-hero-bandeau-defilant__titre">{{ section.settings.titre }}</h2>
    {%- endif -%}
    {%- if section.settings.texte != blank -%}
      <div class="nn-hero-bandeau-defilant__texte">{{ section.settings.texte }}</div>
    {%- endif -%}
    {%- if section.settings.bouton_texte != blank or section.settings.bouton2_texte != blank -%}
      <div class="nn-hero-bandeau-defilant__boutons">
        {%- if section.settings.bouton_texte != blank -%}
          <a class="nn-hero-bandeau-defilant__bouton" href="{{ section.settings.bouton_lien | default: routes.all_products_collection_url }}">{{ section.settings.bouton_texte | escape }}</a>
        {%- endif -%}
        {%- if section.settings.bouton2_texte != blank -%}
          <a class="nn-hero-bandeau-defilant__bouton nn-hero-bandeau-defilant__bouton--second" href="{{ section.settings.bouton2_lien | default: routes.collections_url }}">{{ section.settings.bouton2_texte | escape }}</a>
        {%- endif -%}
      </div>
    {%- endif -%}
    </div>
    <div class="nn-hero-bandeau-defilant__media">
      {%- if section.settings.image != blank -%}
        {{ section.settings.image | image_url: width: 1600 | image_tag: class: 'nn-hero-bandeau-defilant__img', sizes: '(min-width: 900px) 45vw, 100vw', widths: '600, 900, 1200, 1600', loading: 'eager' }}
      {%- else -%}
        {{ 'hero-apparel-1' | placeholder_svg_tag: 'nn-hero-bandeau-defilant__img nn-hero-bandeau-defilant__img--vide' }}
      {%- endif -%}
    </div>
  </div>
  {%- if section.settings.mots != blank -%}
    {%- assign mots = section.settings.mots | split: '·' -%}
    <div class="nn-hero-bandeau-defilant__bandeau" data-nn-bandeau>
      <p class="nn-hero-bandeau-defilant__vh">{{ section.settings.mots | escape }}</p>
      <div class="nn-hero-bandeau-defilant__piste" aria-hidden="true">
        {%- for tour in (1..2) -%}
          <span class="nn-hero-bandeau-defilant__serie">
            {%- for mot in mots -%}
              {%- assign mot_net = mot | strip -%}
              {%- if mot_net != blank -%}<span class="nn-hero-bandeau-defilant__mot">{{ mot_net | escape }}</span><span class="nn-hero-bandeau-defilant__etoile">✦</span>{%- endif -%}
            {%- endfor -%}
          </span>
        {%- endfor -%}
      </div>
      <button type="button" class="nn-hero-bandeau-defilant__pause" data-nn-pause aria-pressed="false" aria-label="Mettre le bandeau en pause"><svg class="nn-hero-bandeau-defilant__ico-pause" aria-hidden="true" focusable="false" viewBox="0 0 24 24" fill="currentColor"><rect x="6" y="5" width="4" height="14" rx="1"/><rect x="14" y="5" width="4" height="14" rx="1"/></svg><svg class="nn-hero-bandeau-defilant__ico-lecture" aria-hidden="true" focusable="false" viewBox="0 0 24 24" fill="currentColor"><path d="M8 5.5v13a1 1 0 0 0 1.5.86l10.5-6.5a1 1 0 0 0 0-1.72L9.5 4.64A1 1 0 0 0 8 5.5z"/></svg></button>
    </div>
  {%- endif -%}
</nn-hero-bandeau-defilant>

{% schema %}
{
  "name": "Héros bandeau défilant",
  "tag": "section",
  "class": "nn-section-hero-bandeau-defilant",
  "settings": [
    {
      "type": "image_picker",
      "id": "image",
      "label": "Image"
    },
    {
      "type": "text",
      "id": "surtitre",
      "label": "Sur-titre (vide : masqué)",
      "default": "Drop de la semaine"
    },
    {
      "type": "inline_richtext",
      "id": "titre",
      "label": "Titre",
      "default": "Fait pour bouger"
    },
    {
      "type": "richtext",
      "id": "texte",
      "label": "Texte",
      "default": "<p>Des pièces confortables, résistantes et faciles à associer, du matin au soir.</p>"
    },
    {
      "type": "header",
      "content": "Boutons"
    },
    {
      "type": "text",
      "id": "bouton_texte",
      "label": "Texte du bouton (vide : masqué)",
      "default": "Shopper le drop"
    },
    {
      "type": "url",
      "id": "bouton_lien",
      "label": "Lien du bouton (vide : tous les produits)"
    },
    {
      "type": "text",
      "id": "bouton2_texte",
      "label": "Texte du bouton secondaire (vide : masqué)",
      "default": "Voir le lookbook"
    },
    {
      "type": "url",
      "id": "bouton2_lien",
      "label": "Lien du bouton secondaire (vide : collections)"
    },
    {
      "type": "header",
      "content": "Bandeau défilant"
    },
    {
      "type": "text",
      "id": "mots",
      "label": "Mots (séparés par « · », vide : masqué)",
      "default": "Nouveautés · Édition limitée · Livraison suivie · Retours simplifiés"
    },
    {
      "type": "range",
      "id": "vitesse",
      "label": "Durée d’un tour",
      "min": 10,
      "max": 60,
      "step": 2,
      "default": 28,
      "unit": "s"
    },
    {
      "type": "header",
      "content": "Couleurs"
    },
    {
      "type": "color",
      "id": "couleur_fond",
      "label": "Fond",
      "default": "#F2F0E9"
    },
    {
      "type": "color",
      "id": "couleur_texte",
      "label": "Texte",
      "default": "#121212"
    },
    {
      "type": "color",
      "id": "couleur_accent",
      "label": "Accent",
      "default": "#D7FF3A"
    },
    {
      "type": "color",
      "id": "couleur_bouton",
      "label": "Bouton",
      "default": "#121212"
    },
    {
      "type": "color",
      "id": "couleur_texte_bouton",
      "label": "Texte du bouton",
      "default": "#D7FF3A"
    },
    {
      "type": "header",
      "content": "Espacement"
    },
    {
      "type": "range",
      "id": "marge_haut",
      "label": "Marge haute",
      "min": 0,
      "max": 120,
      "step": 4,
      "unit": "px",
      "default": 0
    },
    {
      "type": "range",
      "id": "marge_bas",
      "label": "Marge basse",
      "min": 0,
      "max": 120,
      "step": 4,
      "unit": "px",
      "default": 0
    }
  ],
  "presets": [
    {
      "name": "Héros bandeau défilant"
    }
  ]
}
{% endschema %}

{% stylesheet %}
.nn-hero-bandeau-defilant {
  position: relative;
  display: block;
  padding: var(--nn-mh) 0 var(--nn-mb);
  background: var(--nn-fond);
  color: var(--nn-texte);
  overflow-x: clip;
}
.nn-hero-bandeau-defilant *, .nn-hero-bandeau-defilant *::before, .nn-hero-bandeau-defilant *::after { box-sizing: border-box; }
.nn-hero-bandeau-defilant :where(a, button):focus-visible { outline: 3px solid var(--nn-accent); outline-offset: 3px; }
.nn-hero-bandeau-defilant__surtitre { margin: 0 0 12px; font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--nn-accent); }
.nn-hero-bandeau-defilant__titre { margin: 0 0 16px; font-size: clamp(32px, 6vw, 60px); line-height: 1.08; letter-spacing: -0.02em; overflow-wrap: anywhere; color: inherit; }
.nn-hero-bandeau-defilant__texte { margin: 0 0 28px; font-size: clamp(16px, 1.6vw, 19px); line-height: 1.6; opacity: 0.88; max-width: 560px; }
.nn-hero-bandeau-defilant__texte p { margin: 0 0 0.6em; }
.nn-hero-bandeau-defilant__boutons { display: flex; flex-wrap: wrap; gap: 12px; }
.nn-hero-bandeau-defilant__bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  max-width: 100%;
  padding: 14px 28px;
  border-radius: var(--nn-arrondi-bouton, 8px);
  background: var(--nn-bouton);
  color: var(--nn-texte-bouton);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.nn-hero-bandeau-defilant__bouton--second { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
@media (hover: hover) {
  .nn-hero-bandeau-defilant__bouton:hover { transform: translateY(-2px); box-shadow: 0 12px 26px color-mix(in srgb, var(--nn-bouton) 35%, transparent); }
  .nn-hero-bandeau-defilant__bouton--second:hover { box-shadow: inset 0 0 0 2px currentColor, 0 12px 26px rgba(0, 0, 0, 0.12); }
}
.nn-hero-bandeau-defilant__vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nn-hero-bandeau-defilant__grille { display: grid; gap: clamp(28px, 5vw, 64px); align-items: center; max-width: 1240px; margin: 0 auto; padding: clamp(40px, 7vw, 96px) 16px clamp(32px, 5vw, 64px); }
@media (min-width: 900px) { .nn-hero-bandeau-defilant__grille { grid-template-columns: 1.1fr 0.9fr; padding-inline: 32px; } }
.nn-hero-bandeau-defilant__titre { font-size: clamp(42px, 9vw, 112px); line-height: 0.92; letter-spacing: -0.045em; font-weight: 900; text-transform: uppercase; }
.nn-hero-bandeau-defilant__surtitre { display: inline-block; padding: 6px 12px; background: var(--nn-texte); color: var(--nn-accent); }
.nn-hero-bandeau-defilant__bouton { border-radius: 0; }
.nn-hero-bandeau-defilant__media { overflow: hidden; aspect-ratio: 4 / 5; background: color-mix(in srgb, var(--nn-texte) 8%, transparent); transform: rotate(1.5deg); }
@media (max-width: 899px) { .nn-hero-bandeau-defilant__media { aspect-ratio: 4 / 3; transform: none; } }
.nn-hero-bandeau-defilant__img { display: block; width: 100%; height: 100%; object-fit: cover; }
.nn-hero-bandeau-defilant__bandeau { position: relative; display: flex; align-items: center; overflow: hidden; background: var(--nn-texte); color: var(--nn-accent); }
.nn-hero-bandeau-defilant__piste { display: flex; flex: none; width: max-content; padding: 16px 0; animation: nn-hero-bandeau-defilant-defile var(--nn-duree) linear infinite; }
.nn-hero-bandeau-defilant__bandeau--arret .nn-hero-bandeau-defilant__piste { animation-play-state: paused; }
@media (hover: hover) { .nn-hero-bandeau-defilant__bandeau:hover .nn-hero-bandeau-defilant__piste { animation-play-state: paused; } }
.nn-hero-bandeau-defilant__serie { display: flex; flex: none; align-items: center; }
.nn-hero-bandeau-defilant__mot { padding: 0 20px; font-size: clamp(18px, 3vw, 30px); font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; white-space: nowrap; }
.nn-hero-bandeau-defilant__etoile { font-size: 0.9em; opacity: 0.8; }
@keyframes nn-hero-bandeau-defilant-defile { to { transform: translateX(-50%); } }
.nn-hero-bandeau-defilant__pause { position: absolute; top: 50%; right: 8px; display: grid; place-items: center; width: 44px; height: 44px; margin-top: -22px; padding: 0; border: 0; border-radius: 50%; background: var(--nn-accent); color: var(--nn-texte); cursor: pointer; }
.nn-hero-bandeau-defilant__pause svg { width: 18px; height: 18px; }
.nn-hero-bandeau-defilant__ico-lecture { display: none; }
.nn-hero-bandeau-defilant__bandeau--arret .nn-hero-bandeau-defilant__ico-pause { display: none; }
.nn-hero-bandeau-defilant__bandeau--arret .nn-hero-bandeau-defilant__ico-lecture { display: block; }
.nn-hero-bandeau-defilant__bandeau .nn-hero-bandeau-defilant__pause:focus-visible { outline-color: var(--nn-fond); }
@media (prefers-reduced-motion: reduce) {
  .nn-hero-bandeau-defilant__piste { width: auto; flex-wrap: wrap; justify-content: center; padding-right: 56px; }
  .nn-hero-bandeau-defilant__serie { flex-wrap: wrap; justify-content: center; row-gap: 8px; }
  .nn-hero-bandeau-defilant__serie + .nn-hero-bandeau-defilant__serie, .nn-hero-bandeau-defilant__pause { display: none; }
  .nn-hero-bandeau-defilant__mot { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  .nn-hero-bandeau-defilant, .nn-hero-bandeau-defilant *, .nn-hero-bandeau-defilant *::before, .nn-hero-bandeau-defilant *::after {
    animation: none !important;
    transition: none !important;
  }
}
{% endstylesheet %}

{% javascript %}
if (!customElements.get("nn-hero-bandeau-defilant")) {
  // Bouton pause / lecture du bandeau défilant (le défilement CSS est déjà coupé si les animations sont réduites)
  customElements.define("nn-hero-bandeau-defilant", class extends HTMLElement {
    connectedCallback() {
      if (this.dataset.nnPret) return;
      this.dataset.nnPret = "1";
      var bandeau = this.querySelector("[data-nn-bandeau]");
      var bouton = this.querySelector("[data-nn-pause]");
      if (!bandeau || !bouton) return;
      bouton.addEventListener("click", function () {
        var arret = !bandeau.classList.contains("nn-hero-bandeau-defilant__bandeau--arret");
        bandeau.classList.toggle("nn-hero-bandeau-defilant__bandeau--arret", arret);
        bouton.setAttribute("aria-pressed", arret ? "true" : "false");
        bouton.setAttribute("aria-label", arret ? "Relancer le bandeau" : "Mettre le bandeau en pause");
      });
    }
  });
}
{% endjavascript %}
Télécharger le fichier .liquid

Licence NAHNAH AI : utilisation libre dans tes boutiques (y compris commerciales), modification permise, revente de l’élément seul interdite.

Prompt à copier

À coller dans Claude ou ChatGPT avec le fichier téléchargé (ou le code copié) : l’assistant t’aide à l’installer et à l’adapter à ta marque.

Tu es un expert des thèmes Shopify Online Store 2.0. Aide-moi à installer puis à adapter à ma marque cet élément gratuit de la bibliothèque NAHNAH AI.

Élément : « Héros bandeau défilant » (Héros)
Description : Image et grand titre, puis un bandeau de mots-clés qui défile sans fin sous les boutons (jamais par-dessus), avec bouton pause accessible.
Page de l’élément (aperçu en direct) : https://ai.nahnah.shop/bibliotheque-shopify/hero-bandeau-defilant
Fichier : nahnah-hero-bandeau-defilant.liquid (bouton « Télécharger » de la page) ou le code copié avec le bouton « Copier » : je te le joins ou je le colle après ce message.
Emplacement dans le thème : sections/nahnah-hero-bandeau-defilant.liquid (Liquid, puis {% stylesheet %} et {% javascript %}, dans ce seul fichier).

Étapes d’installation :
1. Dans Shopify : Boutique en ligne → Thèmes → bouton « … » du thème → Modifier le code.
2. Dossier « sections » → « Ajouter une section » (ou « Nouveau fichier ») → nomme-la « nahnah-hero-bandeau-defilant ».
3. Efface le contenu proposé, colle le code de l’onglet Liquid (fichier complet), puis Enregistrer.
4. Ouvre Personnaliser → Ajouter une section → choisis-la, règle les textes et les couleurs, puis Enregistrer.

Ce que j’attends de toi :
- Guide-moi pas à pas dans Shopify : Boutique en ligne → Thèmes → « … » → Modifier le code → dossier sections → Ajouter une section, puis Personnaliser → Ajouter une section.
- Propose-moi d’adapter les couleurs, les textes et les liens à ma marque : demande d’abord mes couleurs (codes hexadécimaux), mon ton et mes liens.
- Garde le bloc {% schema %} et tous ses réglages (identifiants, types, presets) : je dois pouvoir tout régler ensuite dans l’éditeur de thème.
- Rends-moi le fichier complet modifié, prêt à coller, sans faux avis, fausse urgence ni chiffre inventé.

Si tu as le connecteur NAHNAH AI (MCP), récupère directement le code exact avec l’outil obtenir_code_element (id : hero-bandeau-defilant).

Installer dans ma boutique

En un clic, la section est ajoutée à un thème de ta boutique Shopify connectée (un thème non publié par défaut).

Chargement de tes boutiques…

Installer dans Shopify

  1. Dans Shopify : Boutique en ligne → Thèmes → bouton « … » du thème → Modifier le code.
  2. Dossier « sections » → « Ajouter une section » (ou « Nouveau fichier ») → nomme-la « nahnah-hero-bandeau-defilant ».
  3. Efface le contenu proposé, colle le code de l’onglet Liquid (fichier complet), puis Enregistrer.
  4. Ouvre Personnaliser → Ajouter une section → choisis-la, règle les textes et les couleurs, puis Enregistrer.

Installer via le MCP

Depuis Claude, Claude Code ou ChatGPT connecté à NAHNAH AI, demande : « Donne-moi le code de l’élément hero-bandeau-defilant de la bibliothèque NAHNAH AI et les étapes pour l’installer ». L’assistant récupère le code et les étapes (outil obtenir_code_element), gratuitement.

Boutique connectée à NAHNAH AI : l’assistant peut aussi l’installer directement (outil installer_element).

Connecter le MCP

Dans la même catégorie