🌅 HérosGratuit · 0 NahnahPar NAHNAH AI
Héros image divisée
Deux grandes images côte à côte, chacune avec son titre et son lien (ex. Femme / Homme) ; le panneau survolé s’élargit, empilés sur mobile.
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-image-divisee.liquid (Liquid, CSS et JS inclus).
{%- comment -%} NAHNAH AI · Héros image divisée (bibliothèque Sections & effets) {%- endcomment -%}
<div class="nn-hero-image-divisee" 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-voile: {{ section.settings.voile | divided_by: 100.0 }};">
{%- if section.settings.surtitre != blank -%}
<h2 class="nn-hero-image-divisee__surtitre nn-hero-image-divisee__entete">{{ section.settings.surtitre | escape }}</h2>
{%- endif -%}
<div class="nn-hero-image-divisee__panneaux">
<a class="nn-hero-image-divisee__panneau nn-hero-image-divisee--h-{{ section.settings.hauteur }}" href="{{ section.settings.lien_gauche | default: routes.collections_url }}">
<span class="nn-hero-image-divisee__media">
{%- if section.settings.image_gauche != blank -%}
{{ section.settings.image_gauche | image_url: width: 1600 | image_tag: class: 'nn-hero-image-divisee__img', sizes: '(min-width: 750px) 50vw, 100vw', widths: '600, 900, 1200, 1600', loading: 'eager' }}
{%- else -%}
{{ 'lifestyle-1' | placeholder_svg_tag: 'nn-hero-image-divisee__img nn-hero-image-divisee__img--vide' }}
{%- endif -%}
</span>
<span class="nn-hero-image-divisee__voile" aria-hidden="true"></span>
<span class="nn-hero-image-divisee__contenu">
{%- if section.settings.titre_gauche != blank -%}<span class="nn-hero-image-divisee__nom">{{ section.settings.titre_gauche | escape }}</span>{%- endif -%}
{%- if section.settings.bouton_gauche != blank -%}<span class="nn-hero-image-divisee__bouton">{{ section.settings.bouton_gauche | escape }}</span>{%- endif -%}
</span>
</a>
<a class="nn-hero-image-divisee__panneau nn-hero-image-divisee--h-{{ section.settings.hauteur }}" href="{{ section.settings.lien_droite | default: routes.collections_url }}">
<span class="nn-hero-image-divisee__media">
{%- if section.settings.image_droite != blank -%}
{{ section.settings.image_droite | image_url: width: 1600 | image_tag: class: 'nn-hero-image-divisee__img', sizes: '(min-width: 750px) 50vw, 100vw', widths: '600, 900, 1200, 1600', loading: 'eager' }}
{%- else -%}
{{ 'lifestyle-2' | placeholder_svg_tag: 'nn-hero-image-divisee__img nn-hero-image-divisee__img--vide' }}
{%- endif -%}
</span>
<span class="nn-hero-image-divisee__voile" aria-hidden="true"></span>
<span class="nn-hero-image-divisee__contenu">
{%- if section.settings.titre_droite != blank -%}<span class="nn-hero-image-divisee__nom">{{ section.settings.titre_droite | escape }}</span>{%- endif -%}
{%- if section.settings.bouton_droite != blank -%}<span class="nn-hero-image-divisee__bouton">{{ section.settings.bouton_droite | escape }}</span>{%- endif -%}
</span>
</a>
</div>
</div>
{% schema %}
{
"name": "Héros image divisée",
"tag": "section",
"class": "nn-section-hero-image-divisee",
"settings": [
{
"type": "text",
"id": "surtitre",
"label": "Sur-titre au-dessus des images (vide : masqué)",
"default": "Choisis ton univers"
},
{
"type": "select",
"id": "hauteur",
"label": "Hauteur",
"options": [
{
"value": "petite",
"label": "Petite"
},
{
"value": "moyenne",
"label": "Moyenne"
},
{
"value": "grande",
"label": "Grande"
},
{
"value": "ecran",
"label": "Plein écran"
}
],
"default": "moyenne"
},
{
"type": "range",
"id": "voile",
"label": "Opacité du voile",
"min": 0,
"max": 80,
"step": 5,
"default": 35,
"unit": "%"
},
{
"type": "header",
"content": "Panneau de gauche"
},
{
"type": "image_picker",
"id": "image_gauche",
"label": "Image"
},
{
"type": "text",
"id": "titre_gauche",
"label": "Titre",
"default": "Femme"
},
{
"type": "text",
"id": "bouton_gauche",
"label": "Texte du lien",
"default": "Découvrir"
},
{
"type": "url",
"id": "lien_gauche",
"label": "Lien (vide : collections)"
},
{
"type": "header",
"content": "Panneau de droite"
},
{
"type": "image_picker",
"id": "image_droite",
"label": "Image"
},
{
"type": "text",
"id": "titre_droite",
"label": "Titre",
"default": "Homme"
},
{
"type": "text",
"id": "bouton_droite",
"label": "Texte du lien",
"default": "Découvrir"
},
{
"type": "url",
"id": "lien_droite",
"label": "Lien (vide : collections)"
},
{
"type": "header",
"content": "Couleurs"
},
{
"type": "color",
"id": "couleur_fond",
"label": "Fond",
"default": "#111111"
},
{
"type": "color",
"id": "couleur_texte",
"label": "Texte",
"default": "#FFFFFF"
},
{
"type": "color",
"id": "couleur_accent",
"label": "Accent",
"default": "#F5C451"
},
{
"type": "color",
"id": "couleur_bouton",
"label": "Bouton",
"default": "#FFFFFF"
},
{
"type": "color",
"id": "couleur_texte_bouton",
"label": "Texte du bouton",
"default": "#111111"
},
{
"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 image divisée"
}
]
}
{% endschema %}
{% stylesheet %}
.nn-hero-image-divisee {
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-image-divisee *, .nn-hero-image-divisee *::before, .nn-hero-image-divisee *::after { box-sizing: border-box; }
.nn-hero-image-divisee :where(a, button):focus-visible { outline: 3px solid var(--nn-accent); outline-offset: 3px; }
.nn-hero-image-divisee__surtitre { margin: 0 0 12px; font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--nn-accent); }
.nn-hero-image-divisee__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-image-divisee__texte { margin: 0 0 28px; font-size: clamp(16px, 1.6vw, 19px); line-height: 1.6; opacity: 0.88; max-width: 560px; }
.nn-hero-image-divisee__texte p { margin: 0 0 0.6em; }
.nn-hero-image-divisee__boutons { display: flex; flex-wrap: wrap; gap: 12px; }
.nn-hero-image-divisee__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-image-divisee__bouton--second { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
@media (hover: hover) {
.nn-hero-image-divisee__bouton:hover { transform: translateY(-2px); box-shadow: 0 12px 26px color-mix(in srgb, var(--nn-bouton) 35%, transparent); }
.nn-hero-image-divisee__bouton--second:hover { box-shadow: inset 0 0 0 2px currentColor, 0 12px 26px rgba(0, 0, 0, 0.12); }
}
.nn-hero-image-divisee__vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nn-hero-image-divisee__entete { margin: 0; padding: 18px 16px; text-align: center; color: var(--nn-accent); }
.nn-hero-image-divisee__panneaux { display: flex; flex-direction: column; gap: 4px; }
@media (min-width: 750px) { .nn-hero-image-divisee__panneaux { flex-direction: row; } }
.nn-hero-image-divisee__panneau { position: relative; display: flex; align-items: flex-end; flex: 1 1 0; min-width: 0; overflow: hidden; isolation: isolate; color: var(--nn-texte); text-decoration: none; transition: flex-grow 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.nn-hero-image-divisee--h-petite { min-height: 320px; }
.nn-hero-image-divisee--h-moyenne { min-height: clamp(360px, 58vh, 560px); }
.nn-hero-image-divisee--h-grande { min-height: clamp(420px, 75vh, 720px); }
.nn-hero-image-divisee--h-ecran { min-height: 50vh; min-height: 50svh; }
@media (min-width: 750px) { .nn-hero-image-divisee--h-ecran { min-height: 100vh; min-height: 100svh; } }
.nn-hero-image-divisee__media { position: absolute; inset: 0; z-index: -2; }
.nn-hero-image-divisee__img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); }
.nn-hero-image-divisee__voile { position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, var(--nn-fond), transparent 70%); opacity: calc(var(--nn-voile) + 0.35); }
.nn-hero-image-divisee__contenu { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; width: 100%; padding: clamp(20px, 4vw, 48px); }
.nn-hero-image-divisee__nom { font-size: clamp(30px, 5vw, 56px); font-weight: 800; line-height: 1; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.nn-hero-image-divisee__bouton { min-height: 44px; padding: 12px 22px; border-radius: 999px; font-size: 15px; }
.nn-hero-image-divisee__panneau:focus-visible { outline-offset: -6px; }
@media (hover: hover) and (min-width: 750px) {
.nn-hero-image-divisee__panneau:hover { flex-grow: 1.35; }
.nn-hero-image-divisee__panneau:hover .nn-hero-image-divisee__img { transform: scale(1.05); }
.nn-hero-image-divisee__panneau:hover .nn-hero-image-divisee__bouton { transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) {
.nn-hero-image-divisee, .nn-hero-image-divisee *, .nn-hero-image-divisee *::before, .nn-hero-image-divisee *::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-image-divisee ».
- 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-image-divisee 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