NAHNAH AI

🌅 HérosGratuit · 0 NahnahPar NAHNAH AI

Héros vitrine collections

Accroche à gauche et jusqu’à quatre collections en cartes à droite, avec le nombre réel de produits de chacune (lu dans Shopify).

Aperçu en direct

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

Code à copier

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

{%- comment -%} NAHNAH AI · Héros vitrine collections (bibliothèque Sections & effets) {%- endcomment -%}
<div class="nn-hero-vitrine-collections" 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 }};">
  <div class="nn-hero-vitrine-collections__grille">
    <div class="nn-hero-vitrine-collections__contenu">
    {%- if section.settings.surtitre != blank -%}
      <p class="nn-hero-vitrine-collections__surtitre">{{ section.settings.surtitre | escape }}</p>
    {%- endif -%}
    {%- if section.settings.titre != blank -%}
      <h2 class="nn-hero-vitrine-collections__titre">{{ section.settings.titre }}</h2>
    {%- endif -%}
    {%- if section.settings.texte != blank -%}
      <div class="nn-hero-vitrine-collections__texte">{{ section.settings.texte }}</div>
    {%- endif -%}
    {%- if section.settings.bouton_texte != blank -%}
      <div class="nn-hero-vitrine-collections__boutons">
        <a class="nn-hero-vitrine-collections__bouton" href="{{ section.settings.bouton_lien | default: routes.collections_url }}">{{ section.settings.bouton_texte | escape }}</a>
      </div>
    {%- endif -%}
    </div>
    <ul class="nn-hero-vitrine-collections__cartes" role="list">
      {%- if section.settings.collections != blank -%}
        {%- for coll in section.settings.collections limit: 4 -%}
          <li class="nn-hero-vitrine-collections__carte">
            <a class="nn-hero-vitrine-collections__lien" href="{{ coll.url }}">
              <span class="nn-hero-vitrine-collections__media">
                {%- if coll.featured_image -%}
                  {{ coll.featured_image | image_url: width: 800 | image_tag: class: 'nn-hero-vitrine-collections__img', sizes: '(min-width: 900px) 25vw, 50vw', widths: '300, 500, 800', alt: '' }}
                {%- else -%}
                  {{ 'collection-1' | placeholder_svg_tag: 'nn-hero-vitrine-collections__img' }}
                {%- endif -%}
              </span>
              <span class="nn-hero-vitrine-collections__infos">
                <span class="nn-hero-vitrine-collections__nom">{{ coll.title | escape }}</span>
                {%- if section.settings.compte -%}
                  <span class="nn-hero-vitrine-collections__compte">{{ coll.all_products_count }} {% if coll.all_products_count == 1 %}produit{% else %}produits{% endif %}</span>
                {%- endif -%}
              </span>
              <span class="nn-hero-vitrine-collections__fleche" aria-hidden="true"><svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 6l6 6-6 6"/></svg></span>
            </a>
          </li>
        {%- endfor -%}
      {%- else -%}
        {%- for i in (1..4) -%}
          <li class="nn-hero-vitrine-collections__carte">
            <span class="nn-hero-vitrine-collections__lien">
              <span class="nn-hero-vitrine-collections__media">{{ 'collection-' | append: i | placeholder_svg_tag: 'nn-hero-vitrine-collections__img' }}</span>
              <span class="nn-hero-vitrine-collections__infos"><span class="nn-hero-vitrine-collections__nom">Collection {{ i }}</span></span>
            </span>
          </li>
        {%- endfor -%}
      {%- endif -%}
    </ul>
  </div>
</div>

{% schema %}
{
  "name": "Héros vitrine collections",
  "tag": "section",
  "class": "nn-section-hero-vitrine-collections",
  "settings": [
    {
      "type": "text",
      "id": "surtitre",
      "label": "Sur-titre (vide : masqué)",
      "default": "Nos rayons"
    },
    {
      "type": "inline_richtext",
      "id": "titre",
      "label": "Titre",
      "default": "Trouve ton bonheur en un clic"
    },
    {
      "type": "richtext",
      "id": "texte",
      "label": "Texte",
      "default": "<p>Parcours la boutique par univers : chaque carte mène directement à sa collection.</p>"
    },
    {
      "type": "header",
      "content": "Boutons"
    },
    {
      "type": "text",
      "id": "bouton_texte",
      "label": "Texte du bouton (vide : masqué)",
      "default": "Toutes les collections"
    },
    {
      "type": "url",
      "id": "bouton_lien",
      "label": "Lien du bouton (vide : tous les produits)"
    },
    {
      "type": "header",
      "content": "Collections"
    },
    {
      "type": "collection_list",
      "id": "collections",
      "label": "Collections (4 au plus)",
      "limit": 4
    },
    {
      "type": "checkbox",
      "id": "compte",
      "label": "Afficher le nombre de produits",
      "default": true
    },
    {
      "type": "header",
      "content": "Couleurs"
    },
    {
      "type": "color",
      "id": "couleur_fond",
      "label": "Fond",
      "default": "#F4F1EC"
    },
    {
      "type": "color",
      "id": "couleur_texte",
      "label": "Texte",
      "default": "#1F1B16"
    },
    {
      "type": "color",
      "id": "couleur_accent",
      "label": "Accent",
      "default": "#3E7C59"
    },
    {
      "type": "color",
      "id": "couleur_bouton",
      "label": "Bouton",
      "default": "#1F1B16"
    },
    {
      "type": "color",
      "id": "couleur_texte_bouton",
      "label": "Texte du bouton",
      "default": "#FFFFFF"
    },
    {
      "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 vitrine collections"
    }
  ]
}
{% endschema %}

{% stylesheet %}
.nn-hero-vitrine-collections {
  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-vitrine-collections *, .nn-hero-vitrine-collections *::before, .nn-hero-vitrine-collections *::after { box-sizing: border-box; }
.nn-hero-vitrine-collections :where(a, button):focus-visible { outline: 3px solid var(--nn-accent); outline-offset: 3px; }
.nn-hero-vitrine-collections__surtitre { margin: 0 0 12px; font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--nn-accent); }
.nn-hero-vitrine-collections__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-vitrine-collections__texte { margin: 0 0 28px; font-size: clamp(16px, 1.6vw, 19px); line-height: 1.6; opacity: 0.88; max-width: 560px; }
.nn-hero-vitrine-collections__texte p { margin: 0 0 0.6em; }
.nn-hero-vitrine-collections__boutons { display: flex; flex-wrap: wrap; gap: 12px; }
.nn-hero-vitrine-collections__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-vitrine-collections__bouton--second { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
@media (hover: hover) {
  .nn-hero-vitrine-collections__bouton:hover { transform: translateY(-2px); box-shadow: 0 12px 26px color-mix(in srgb, var(--nn-bouton) 35%, transparent); }
  .nn-hero-vitrine-collections__bouton--second:hover { box-shadow: inset 0 0 0 2px currentColor, 0 12px 26px rgba(0, 0, 0, 0.12); }
}
.nn-hero-vitrine-collections__vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nn-hero-vitrine-collections__grille { display: grid; gap: clamp(28px, 5vw, 64px); align-items: center; max-width: 1240px; margin: 0 auto; padding: clamp(40px, 7vw, 96px) 16px; }
@media (min-width: 900px) { .nn-hero-vitrine-collections__grille { grid-template-columns: 0.85fr 1.15fr; padding-inline: 32px; } }
.nn-hero-vitrine-collections__cartes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.nn-hero-vitrine-collections__carte { min-width: 0; animation: nn-hero-vitrine-collections-entree 0.7s ease both; }
.nn-hero-vitrine-collections__carte:nth-child(2) { animation-delay: 0.08s; }
.nn-hero-vitrine-collections__carte:nth-child(3) { animation-delay: 0.16s; }
.nn-hero-vitrine-collections__carte:nth-child(4) { animation-delay: 0.24s; }
.nn-hero-vitrine-collections__carte:last-child:nth-child(odd) { grid-column: 1 / -1; }
.nn-hero-vitrine-collections__carte:last-child:nth-child(odd) .nn-hero-vitrine-collections__media { aspect-ratio: 16 / 7; }
@keyframes nn-hero-vitrine-collections-entree { from { transform: translateY(20px); opacity: 0; } }
.nn-hero-vitrine-collections__lien { position: relative; display: flex; flex-direction: column; height: 100%; overflow: hidden; border-radius: 18px; background: color-mix(in srgb, var(--nn-texte) 6%, var(--nn-fond)); color: inherit; text-decoration: none; }
.nn-hero-vitrine-collections__media { display: block; aspect-ratio: 4 / 3; overflow: hidden; }
.nn-hero-vitrine-collections__img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.nn-hero-vitrine-collections__infos { display: flex; flex-direction: column; gap: 2px; padding: 12px 44px 14px 14px; }
.nn-hero-vitrine-collections__nom { font-size: clamp(15px, 1.6vw, 18px); font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.nn-hero-vitrine-collections__compte { font-size: 13px; opacity: 0.7; }
.nn-hero-vitrine-collections__fleche { position: absolute; right: 12px; bottom: 14px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--nn-accent); color: #fff; transition: transform 0.3s ease; }
.nn-hero-vitrine-collections__fleche svg { width: 16px; height: 16px; }
@media (hover: hover) {
  .nn-hero-vitrine-collections__lien:hover .nn-hero-vitrine-collections__img { transform: scale(1.06); }
  .nn-hero-vitrine-collections__lien:hover .nn-hero-vitrine-collections__fleche { transform: translateX(3px); }
}
.nn-hero-vitrine-collections__bouton { border-radius: 999px; }
@media (prefers-reduced-motion: reduce) {
  .nn-hero-vitrine-collections, .nn-hero-vitrine-collections *, .nn-hero-vitrine-collections *::before, .nn-hero-vitrine-collections *::after {
    animation: none !important;
    transition: none !important;
  }
}
{% endstylesheet %}

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

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-vitrine-collections ».
  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-vitrine-collections 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