Aller au contenu

🌅 HérosGratuit · 0 NahnahPar NAHNAH AI

Héros Galerie de cartes

Badge d’annonce en pastille, titre aux mots mis en couleur (italique et gras) puis une grille de 2 à 6 cartes image cliquables qui montent l’une après l’autre, avec un lent zoom.

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-galerie-cartes.liquid (Liquid, CSS et JS inclus).

{%- comment -%} NAHNAH AI · Héros Galerie de cartes (bibliothèque Sections & effets) {%- endcomment -%}
<div class="nn-hero-galerie-cartes" 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-accent-2: {{ section.settings.couleur_accent_2 }};">
  <div class="nn-hero-galerie-cartes__cadre">
    <div class="nn-hero-galerie-cartes__entete">
      {%- if section.settings.badge != blank -%}
        <a class="nn-hero-galerie-cartes__badge" href="{{ section.settings.badge_lien | default: routes.all_products_collection_url }}">
          {%- if section.settings.badge_etiquette != blank -%}<span class="nn-hero-galerie-cartes__etiquette">{{ section.settings.badge_etiquette | escape }}</span>{%- endif -%}
          <span>{{ section.settings.badge | escape }}</span><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>
        </a>
      {%- endif -%}
      {%- if section.settings.titre != blank -%}<h2 class="nn-hero-galerie-cartes__titre">{{ section.settings.titre }}</h2>{%- endif -%}
      {%- if section.settings.texte != blank -%}<div class="nn-hero-galerie-cartes__texte">{{ section.settings.texte }}</div>{%- endif -%}
    </div>
    {%- if section.blocks.size > 0 -%}
      <ul class="nn-hero-galerie-cartes__cartes nn-hero-galerie-cartes--col-{{ section.settings.colonnes }}" role="list">
        {%- for block in section.blocks -%}
          <li class="nn-hero-galerie-cartes__carte" style="--i: {{ forloop.index0 }};" {{ block.shopify_attributes }}>
            <a class="nn-hero-galerie-cartes__lien nn-hero-galerie-cartes__lien--{{ section.settings.format }}" href="{{ block.settings.lien | default: routes.collections_url }}">
              {%- if block.settings.image != blank -%}
                {{ block.settings.image | image_url: width: 900 | image_tag: class: 'nn-hero-galerie-cartes__img', sizes: '(min-width: 990px) 30vw, (min-width: 600px) 45vw, 92vw', widths: '400, 600, 900' }}
              {%- else -%}
                {%- capture nom_illustration -%}collection-{{ forloop.index0 | modulo: 6 | plus: 1 }}{%- endcapture -%}
                {{ nom_illustration | placeholder_svg_tag: 'nn-hero-galerie-cartes__img nn-hero-galerie-cartes__img--vide' }}
              {%- endif -%}
              <span class="nn-hero-galerie-cartes__nom">{{ block.settings.titre | default: 'Voir la sélection' | escape }}<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="M4 12h15"/><path d="M13 6l6 6-6 6"/></svg></span>
            </a>
          </li>
        {%- endfor -%}
      </ul>
    {%- endif -%}
  </div>
</div>

{% schema %}
{
  "name": "Héros Galerie de cartes",
  "tag": "section",
  "class": "nn-section-hero-galerie-cartes",
  "max_blocks": 6,
  "settings": [
    {
      "type": "text",
      "id": "badge_etiquette",
      "label": "Étiquette du badge (vide : masquée)",
      "default": "Nouveau"
    },
    {
      "type": "text",
      "id": "badge",
      "label": "Badge (vide : masqué)",
      "default": "Découvre les dernières arrivées"
    },
    {
      "type": "url",
      "id": "badge_lien",
      "label": "Lien du badge (vide : tous les produits)"
    },
    {
      "type": "inline_richtext",
      "id": "titre",
      "label": "Titre (italique : 1re couleur, gras : 2de couleur)",
      "default": "Des pièces <em>uniques</em> pour un quotidien <strong>sublimé</strong>"
    },
    {
      "type": "richtext",
      "id": "texte",
      "label": "Texte",
      "default": "<p>Parcours nos univers en un coup d’œil : chaque carte mène à une sélection choisie avec soin.</p>"
    },
    {
      "type": "color",
      "id": "couleur_accent_2",
      "label": "Seconde couleur (mots en gras)",
      "default": "#3D7BF7"
    },
    {
      "type": "select",
      "id": "colonnes",
      "label": "Cartes par ligne (ordinateur)",
      "options": [
        {
          "value": "2",
          "label": "2"
        },
        {
          "value": "3",
          "label": "3"
        }
      ],
      "default": "3"
    },
    {
      "type": "select",
      "id": "format",
      "label": "Format des cartes",
      "options": [
        {
          "value": "paysage",
          "label": "Paysage"
        },
        {
          "value": "carre",
          "label": "Carré"
        },
        {
          "value": "portrait",
          "label": "Portrait"
        }
      ],
      "default": "paysage"
    },
    {
      "type": "header",
      "content": "Couleurs"
    },
    {
      "type": "color",
      "id": "couleur_fond",
      "label": "Fond",
      "default": "#FFFFFF"
    },
    {
      "type": "color",
      "id": "couleur_texte",
      "label": "Texte",
      "default": "#111111"
    },
    {
      "type": "color",
      "id": "couleur_accent",
      "label": "Accent",
      "default": "#F2542D"
    },
    {
      "type": "color",
      "id": "couleur_bouton",
      "label": "Bouton",
      "default": "#111111"
    },
    {
      "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
    }
  ],
  "blocks": [
    {
      "type": "carte",
      "name": "Carte",
      "settings": [
        {
          "type": "image_picker",
          "id": "image",
          "label": "Image"
        },
        {
          "type": "text",
          "id": "titre",
          "label": "Légende",
          "default": "Ta sélection"
        },
        {
          "type": "url",
          "id": "lien",
          "label": "Lien (vide : collections)"
        }
      ]
    }
  ],
  "presets": [
    {
      "name": "Héros Galerie de cartes",
      "blocks": [
        {
          "type": "carte",
          "settings": {
            "titre": "Nouveautés"
          }
        },
        {
          "type": "carte",
          "settings": {
            "titre": "Idées cadeaux"
          }
        },
        {
          "type": "carte",
          "settings": {
            "titre": "Essentiels"
          }
        },
        {
          "type": "carte",
          "settings": {
            "titre": "Petits prix"
          }
        },
        {
          "type": "carte",
          "settings": {
            "titre": "Collections"
          }
        },
        {
          "type": "carte",
          "settings": {
            "titre": "Éditions limitées"
          }
        }
      ]
    }
  ]
}
{% endschema %}

{% stylesheet %}
.nn-hero-galerie-cartes {
  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-galerie-cartes *, .nn-hero-galerie-cartes *::before, .nn-hero-galerie-cartes *::after { box-sizing: border-box; }
.nn-hero-galerie-cartes :where(a, button):focus-visible { outline: 3px solid var(--nn-accent); outline-offset: 3px; }
.nn-hero-galerie-cartes__surtitre { margin: 0 0 12px; font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--nn-accent); }
.nn-hero-galerie-cartes__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-galerie-cartes__texte { margin: 0 0 28px; font-size: clamp(16px, 1.6vw, 19px); line-height: 1.6; opacity: 0.88; max-width: 560px; }
.nn-hero-galerie-cartes__texte p { margin: 0 0 0.6em; }
.nn-hero-galerie-cartes__boutons { display: flex; flex-wrap: wrap; gap: 12px; }
.nn-hero-galerie-cartes__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-galerie-cartes__bouton--second { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
@media (hover: hover) {
  .nn-hero-galerie-cartes__bouton:hover { transform: translateY(-2px); box-shadow: 0 12px 26px color-mix(in srgb, var(--nn-bouton) 35%, transparent); }
  .nn-hero-galerie-cartes__bouton--second:hover { box-shadow: inset 0 0 0 2px currentColor, 0 12px 26px rgba(0, 0, 0, 0.12); }
}
.nn-hero-galerie-cartes__vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nn-hero-galerie-cartes__cadre { max-width: 1240px; margin: 0 auto; padding: clamp(48px, 8vw, 96px) 16px; }
@media (min-width: 750px) { .nn-hero-galerie-cartes__cadre { padding-inline: 32px; } }
.nn-hero-galerie-cartes__entete { max-width: 780px; margin: 0 auto clamp(32px, 5vw, 56px); text-align: center; animation: nn-hero-galerie-cartes-entete 0.8s ease both; }
@keyframes nn-hero-galerie-cartes-entete { from { opacity: 0; transform: translateY(16px); } }
.nn-hero-galerie-cartes__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 34px;
  margin: 0 0 22px;
  padding: 4px 12px 4px 4px;
  border: 1px solid color-mix(in srgb, var(--nn-accent-2) 45%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--nn-accent-2) 8%, var(--nn-fond));
  color: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.nn-hero-galerie-cartes__badge svg { flex: none; width: 14px; height: 14px; }
.nn-hero-galerie-cartes__etiquette { flex: none; padding: 3px 10px; border-radius: 999px; background: var(--nn-accent-2); color: var(--nn-fond); font-size: 12px; }
.nn-hero-galerie-cartes__titre { font-size: clamp(34px, 6vw, 64px); font-weight: 600; }
.nn-hero-galerie-cartes__titre em { font-style: normal; color: var(--nn-accent); }
.nn-hero-galerie-cartes__titre strong { font-weight: inherit; color: var(--nn-accent-2); }
.nn-hero-galerie-cartes__texte { margin-inline: auto; margin-bottom: 0; }
.nn-hero-galerie-cartes__cartes { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 600px) { .nn-hero-galerie-cartes__cartes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 990px) { .nn-hero-galerie-cartes--col-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.nn-hero-galerie-cartes__carte { min-width: 0; animation: nn-hero-galerie-cartes-monte 0.8s calc(0.25s + var(--i) * 0.1s) cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes nn-hero-galerie-cartes-monte { from { opacity: 0; transform: translateY(28px) scale(0.98); } }
.nn-hero-galerie-cartes__lien { position: relative; display: block; overflow: hidden; border-radius: 14px; background: linear-gradient(135deg, color-mix(in srgb, var(--nn-accent) 28%, var(--nn-fond)), color-mix(in srgb, var(--nn-accent-2) 28%, var(--nn-fond))); color: #FFFFFF; text-decoration: none; }
.nn-hero-galerie-cartes__lien--paysage { aspect-ratio: 16 / 10; }
.nn-hero-galerie-cartes__lien--carre { aspect-ratio: 1; }
.nn-hero-galerie-cartes__lien--portrait { aspect-ratio: 4 / 5; }
.nn-hero-galerie-cartes__lien::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.6)); pointer-events: none; }
.nn-hero-galerie-cartes__img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; animation: nn-hero-galerie-cartes-zoom 14s calc(var(--i) * -2.3s) ease-in-out infinite alternate; }
@keyframes nn-hero-galerie-cartes-zoom { from { transform: scale(1); } to { transform: scale(1.08); } }
.nn-hero-galerie-cartes__img--vide { fill: color-mix(in srgb, var(--nn-texte) 30%, transparent); }
.nn-hero-galerie-cartes__nom { position: absolute; left: 16px; right: 16px; bottom: 14px; z-index: 1; display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; line-height: 1.25; }
.nn-hero-galerie-cartes__nom svg { flex: none; width: 18px; height: 18px; transition: transform 0.25s ease; }
@media (hover: hover) { .nn-hero-galerie-cartes__lien:hover .nn-hero-galerie-cartes__nom svg { transform: translateX(5px); } }
.nn-hero-galerie-cartes[data-nn-demo] .nn-hero-galerie-cartes__nom svg { animation: nn-hero-galerie-cartes-pousse 1.6s ease-in-out infinite; }
@keyframes nn-hero-galerie-cartes-pousse { 50% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) {
  .nn-hero-galerie-cartes, .nn-hero-galerie-cartes *, .nn-hero-galerie-cartes *::before, .nn-hero-galerie-cartes *::after {
    animation: none !important;
    transition: none !important;
  }
}
{% endstylesheet %}
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 Galerie de cartes » (Héros)
Description : Badge d’annonce en pastille, titre aux mots mis en couleur (italique et gras) puis une grille de 2 à 6 cartes image cliquables qui montent l’une après l’autre, avec un lent zoom.
Page de l’élément (aperçu en direct) : https://ai.nahnah.shop/bibliotheque-shopify/hero-galerie-cartes
Fichier : nahnah-hero-galerie-cartes.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-galerie-cartes.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-galerie-cartes ».
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-galerie-cartes).

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-galerie-cartes ».
  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-galerie-cartes 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