{# # ============================================================================ # ORGANISM: STEPS TOOL # ============================================================================ # # Section "Comment ça marche" paramétrée pour les pages de présentation d'outils. # Deux variantes disponibles : cercles (défaut) et cards (design Moodia). # # ============================================================================ # PARAMÈTRES # ============================================================================ # # | Paramètre | Type | Défaut | Description | # |--------------|--------|---------------------|--------------------------------------| # | surtitle | string | 'Comment ça marche' | Mono label au-dessus | # | titleHtml | string | '' | Titre H2 (HTML brut autorisé) | # | subtitle | string | '' | Sous-titre descriptif | # | steps | array | [] | [{num?, time?, title, desc}] | # | variant | string | 'circles' | 'circles' ou 'cards' | # | bgClass | string | 'bg-[#F6F9FE]' | Classe background (variant circles) | # | bgStyle | string | null | CSS background inline (variant cards)| # | accentColor | string | '#1281E4' | Couleur principale | # | gradientEnd | string | accentColor | Couleur fin dégradé (variant cards) | # | id | string | 'how-it-works' | Ancre HTML | # | class | string | '' | Classes additionnelles | # # ============================================================================ # EXEMPLE variant 'cards' # ============================================================================ # # {% include '_organisms/landing/steps-tool.html.twig' with { # variant: 'cards', # titleHtml: '4 étapes. 1 minute.', # accentColor: '#ED8600', # gradientEnd: '#F59E0B', # steps: [ # { num: '1', time: '10 secondes', title: 'Importez', desc: 'Décrivez...' }, # { num: '2', time: '1 minute', title: 'Générez', desc: 'L\'IA...' }, # ] # } only %} # # ============================================================================ #} {% set surtitle = surtitle ?? 'Comment ça marche' %} {% set titleHtml = titleHtml ?? '' %} {% set subtitle = subtitle ?? '' %} {% set steps = steps ?? [] %} {% set variant = variant ?? 'circles' %} {% set bgClass = bgClass ?? 'bg-[#F6F9FE]' %} {% set bgStyle = bgStyle ?? null %} {% set accentColor = accentColor ?? '#1281E4' %} {% set gradientEnd = gradientEnd ?? accentColor %} {% set id = id ?? 'how-it-works' %} {% set class = class ?? '' %} {% set sectionBg = bgStyle ? 'style="' ~ bgStyle ~ '"' : '' %}
{# ===== Header commun ===== #}
{{ surtitle }}
{% if titleHtml %}

{{ titleHtml|raw }}

{% endif %} {% if subtitle %}

{{ subtitle }}

{% else %}
{% endif %} {# ===== Variant CARDS ===== #} {% if variant == 'cards' %} {% set cols = steps|length == 3 ? 'lg:grid-cols-3' : (steps|length == 2 ? 'lg:grid-cols-2' : 'lg:grid-cols-4') %}
{% for step in steps %}
{# Numéro + badge temps #}
{{ step.num ?? loop.index }}
{% if step.time is defined and step.time %} {{ step.time }} {% endif %}
{# Texte #}
{{ step.title }}

{{ step.desc }}

{# Trait gradient au hover #}
{% endfor %}
{# ===== Variant CIRCLES (défaut) ===== #} {% else %}
{% for step in steps %}
{{ step.num ?? loop.index }}
{{ step.title }}

{{ step.desc }}

{% if step.time is defined and step.time %}
{% include '_atoms/badge/badge.html.twig' with { label: step.time, variant: 'info', size: 'xs', rounded: 'full' } only %}
{% endif %}
{% endfor %}
{% endif %}