🌅 HérosGratuit · 0 NahnahPar NAHNAH AI
Héros collection mosaïque
Présente une collection : texte d’accroche à gauche et mosaïque de ses quatre premiers produits, chacun cliquable.
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-collection-mosaique.liquid (Liquid, CSS et JS inclus).
{%- comment -%} NAHNAH AI · Héros collection mosaïque (bibliothèque Sections & effets) {%- endcomment -%}
<div class="nn-hero-collection-mosaique" 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 }};">
{%- assign collection_choisie = section.settings.collection -%}
<div class="nn-hero-collection-mosaique__grille">
<div class="nn-hero-collection-mosaique__contenu">
{%- if section.settings.surtitre != blank -%}
<p class="nn-hero-collection-mosaique__surtitre">{{ section.settings.surtitre | escape }}</p>
{%- endif -%}
{%- if section.settings.titre != blank -%}
<h2 class="nn-hero-collection-mosaique__titre">{{ section.settings.titre }}</h2>
{%- endif -%}
{%- if section.settings.texte != blank -%}
<div class="nn-hero-collection-mosaique__texte">{{ section.settings.texte }}</div>
{%- endif -%}
{%- if section.settings.bouton_texte != blank -%}
<div class="nn-hero-collection-mosaique__boutons">
<a class="nn-hero-collection-mosaique__bouton" href="{{ section.settings.bouton_lien | default: collection_choisie.url | default: routes.collections_url }}">{{ section.settings.bouton_texte | escape }}</a>
</div>
{%- endif -%}
</div>
<ul class="nn-hero-collection-mosaique__mosaique" role="list">
{%- if collection_choisie != blank and collection_choisie.products.size > 0 -%}
{%- for produit in collection_choisie.products limit: 4 -%}
<li class="nn-hero-collection-mosaique__tuile">
<a class="nn-hero-collection-mosaique__tuile-lien" href="{{ produit.url }}">
{%- if produit.featured_media -%}
{{ produit.featured_media | image_url: width: 900 | image_tag: class: 'nn-hero-collection-mosaique__img', sizes: '(min-width: 750px) 30vw, 50vw', widths: '300, 600, 900' }}
{%- else -%}
{{ 'product-1' | placeholder_svg_tag: 'nn-hero-collection-mosaique__img' }}
{%- endif -%}
<span class="nn-hero-collection-mosaique__nom">{{ produit.title | escape }}</span>
</a>
</li>
{%- endfor -%}
{%- else -%}
{%- for i in (1..4) -%}
<li class="nn-hero-collection-mosaique__tuile">{{ 'product-' | append: i | placeholder_svg_tag: 'nn-hero-collection-mosaique__img' }}</li>
{%- endfor -%}
{%- endif -%}
</ul>
</div>
</div>
{% schema %}
{
"name": "Héros collection mosaïque",
"tag": "section",
"class": "nn-section-hero-collection-mosaique",
"settings": [
{
"type": "collection",
"id": "collection",
"label": "Collection"
},
{
"type": "text",
"id": "surtitre",
"label": "Sur-titre (vide : masqué)",
"default": "Sélection du moment"
},
{
"type": "inline_richtext",
"id": "titre",
"label": "Titre",
"default": "Découvre la collection"
},
{
"type": "richtext",
"id": "texte",
"label": "Texte",
"default": "<p>Une sélection de pièces faciles à associer, pour composer ton style en quelques clics.</p>"
},
{
"type": "header",
"content": "Boutons"
},
{
"type": "text",
"id": "bouton_texte",
"label": "Texte du bouton (vide : masqué)",
"default": "Voir toute la collection"
},
{
"type": "url",
"id": "bouton_lien",
"label": "Lien du bouton (vide : tous les produits)"
},
{
"type": "header",
"content": "Couleurs"
},
{
"type": "color",
"id": "couleur_fond",
"label": "Fond",
"default": "#FBF7F2"
},
{
"type": "color",
"id": "couleur_texte",
"label": "Texte",
"default": "#2B2118"
},
{
"type": "color",
"id": "couleur_accent",
"label": "Accent",
"default": "#C8754B"
},
{
"type": "color",
"id": "couleur_bouton",
"label": "Bouton",
"default": "#2B2118"
},
{
"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 collection mosaïque"
}
]
}
{% endschema %}
{% stylesheet %}
.nn-hero-collection-mosaique {
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-collection-mosaique *, .nn-hero-collection-mosaique *::before, .nn-hero-collection-mosaique *::after { box-sizing: border-box; }
.nn-hero-collection-mosaique :where(a, button):focus-visible { outline: 3px solid var(--nn-accent); outline-offset: 3px; }
.nn-hero-collection-mosaique__surtitre { margin: 0 0 12px; font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--nn-accent); }
.nn-hero-collection-mosaique__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-collection-mosaique__texte { margin: 0 0 28px; font-size: clamp(16px, 1.6vw, 19px); line-height: 1.6; opacity: 0.88; max-width: 560px; }
.nn-hero-collection-mosaique__texte p { margin: 0 0 0.6em; }
.nn-hero-collection-mosaique__boutons { display: flex; flex-wrap: wrap; gap: 12px; }
.nn-hero-collection-mosaique__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-collection-mosaique__bouton--second { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
@media (hover: hover) {
.nn-hero-collection-mosaique__bouton:hover { transform: translateY(-2px); box-shadow: 0 12px 26px color-mix(in srgb, var(--nn-bouton) 35%, transparent); }
.nn-hero-collection-mosaique__bouton--second:hover { box-shadow: inset 0 0 0 2px currentColor, 0 12px 26px rgba(0, 0, 0, 0.12); }
}
.nn-hero-collection-mosaique__vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nn-hero-collection-mosaique__grille { display: grid; gap: clamp(24px, 4vw, 56px); align-items: center; max-width: 1240px; margin: 0 auto; padding: clamp(32px, 6vw, 80px) 16px; }
@media (min-width: 900px) { .nn-hero-collection-mosaique__grille { grid-template-columns: 0.8fr 1.2fr; padding-inline: 32px; } }
.nn-hero-collection-mosaique__surtitre { color: var(--nn-accent); }
.nn-hero-collection-mosaique__mosaique { display: grid; grid-template-columns: 1.3fr 1fr 1fr; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; aspect-ratio: 4 / 3; }
.nn-hero-collection-mosaique__tuile { position: relative; min-width: 0; overflow: hidden; border-radius: 18px; background: color-mix(in srgb, var(--nn-texte) 8%, transparent); }
.nn-hero-collection-mosaique__tuile:first-child { grid-row: span 2; }
.nn-hero-collection-mosaique__tuile:nth-child(4) { grid-column: span 2; }
.nn-hero-collection-mosaique__tuile-lien { display: block; width: 100%; height: 100%; color: inherit; text-decoration: none; }
.nn-hero-collection-mosaique__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-collection-mosaique__nom {
position: absolute;
left: 10px;
right: 10px;
bottom: 10px;
padding: 8px 12px;
overflow: hidden;
border-radius: 10px;
background: color-mix(in srgb, var(--nn-fond) 88%, transparent);
color: var(--nn-texte);
font-size: 13px;
font-weight: 600;
white-space: nowrap;
text-overflow: ellipsis;
transform: translateY(4px);
opacity: 0.94;
transition: transform 0.3s ease, opacity 0.3s ease;
}
@media (hover: hover) {
.nn-hero-collection-mosaique__tuile-lien:hover .nn-hero-collection-mosaique__img { transform: scale(1.06); }
.nn-hero-collection-mosaique__tuile-lien:hover .nn-hero-collection-mosaique__nom { transform: translateY(0); opacity: 1; }
}
@media (max-width: 599px) {
.nn-hero-collection-mosaique__mosaique { grid-template-columns: 1fr 1fr; grid-template-rows: auto; aspect-ratio: auto; }
.nn-hero-collection-mosaique__tuile { aspect-ratio: 1; }
.nn-hero-collection-mosaique__tuile:first-child { grid-row: auto; grid-column: span 2; aspect-ratio: 16 / 10; }
.nn-hero-collection-mosaique__tuile:nth-child(4) { grid-column: span 2; aspect-ratio: 16 / 10; }
}
.nn-hero-collection-mosaique__bouton { border-radius: 999px; }
@media (prefers-reduced-motion: reduce) {
.nn-hero-collection-mosaique, .nn-hero-collection-mosaique *, .nn-hero-collection-mosaique *::before, .nn-hero-collection-mosaique *::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
- Dans Shopify : Boutique en ligne → Thèmes → bouton « … » du thème → Modifier le code.
- Dossier « sections » → « Ajouter une section » (ou « Nouveau fichier ») → nomme-la « nahnah-hero-collection-mosaique ».
- Efface le contenu proposé, colle le code de l’onglet Liquid (fichier complet), puis Enregistrer.
- 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-collection-mosaique 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