Tutoriels

Créer une vitrine produit

1. Exemple complet

{
  "meta": {
    "version": "2.0.0",
    "width": 1920,
    "height": 1080,
    "fps": 30,
    "background": "#050816"
  },
  "assets": {
    "images": [
      {
        "id": "product-shot",
        "src": "https://example.com/product.png"
      }
    ]
  },
  "tracks": [
    {
      "id": "main",
      "clips": [
        {
          "type": "rect",
          "start": 0,
          "duration": 8,
          "transform": {
            "x": "50%",
            "y": "50%",
            "width": "100%",
            "height": "100%"
          },
          "style": {
            "fill": {
              "type": "linear",
              "angle": 135,
              "stops": [
                { "offset": 0, "color": "#020617" },
                { "offset": 1, "color": "#1d4ed8" }
              ]
            }
          }
        },
        {
          "type": "image",
          "start": 0,
          "duration": 8,
          "src": { "$ref": "product-shot" },
          "transform": {
            "x": "30%",
            "y": "54%",
            "width": 560,
            "height": 560
          },
          "style": {
            "objectFit": "contain"
          }
        },
        {
          "type": "text",
          "start": 0.5,
          "duration": 7.5,
          "text": "New Release",
          "transform": {
            "x": "72%",
            "y": "28%"
          },
          "style": {
            "fontSize": 30,
            "fontWeight": 600,
            "fill": "#93c5fd"
          },
          "animations": [
            {
              "type": "fadeIn",
              "duration": 0.4
            }
          ]
        },
        {
          "type": "text",
          "start": 0.8,
          "duration": 7.2,
          "text": "Smart Watch Pro",
          "transform": {
            "x": "72%",
            "y": "40%"
          },
          "style": {
            "fontSize": 72,
            "fontWeight": 800,
            "fill": "#ffffff"
          },
          "animations": [
            {
              "type": "slideIn",
              "direction": "right",
              "distance": 140,
              "duration": 0.6
            }
          ]
        },
        {
          "type": "text",
          "start": 1.4,
          "duration": 6.6,
          "text": "$299",
          "transform": {
            "x": "72%",
            "y": "56%"
          },
          "style": {
            "fontSize": 56,
            "fontWeight": 700,
            "fill": "#22c55e"
          }
        }
      ]
    }
  ]
}

2. Logique de composition

  • Utilisez un rect plein écran comme arrière-plan
  • Placez l'image du produit sur un côté
  • Gardez l'accroche, le titre et le prix de l'autre côté
  • Décalez le timing du texte au lieu d'animer tous les éléments en même temps

3. Notes

  • Préférez assets.images + $ref lorsque vous réutilisez des médias
  • Utilisez Élément image pour le comportement de objectFit
  • Pour un vrai bloc CTA, ajoutez un autre text ou une paire rect + text