{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:bolted:aperture:recipe:1",
  "title": "Aperture recipe v1",
  "description": "A portable reveal configuration, containing no markup, callbacks, or executable code.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "version",
    "preset",
    "duration",
    "spread",
    "rotation",
    "easing",
    "origin",
    "colors"
  ],
  "properties": {
    "version": {
      "const": 1
    },
    "preset": {
      "enum": [
        "folded-iris",
        "memory-portal",
        "liquid-lens",
        "record-bloom",
        "editorial-fold"
      ]
    },
    "duration": {
      "type": "number",
      "minimum": 0.4,
      "maximum": 2.4
    },
    "spread": {
      "type": "number",
      "minimum": 0,
      "maximum": 2
    },
    "rotation": {
      "type": "number",
      "minimum": -90,
      "maximum": 90
    },
    "easing": {
      "enum": [
        "smooth",
        "gentle",
        "snappy"
      ]
    },
    "origin": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "x",
        "y"
      ],
      "properties": {
        "x": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "y": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        }
      }
    },
    "colors": {
      "type": "array",
      "minItems": 2,
      "maxItems": 2,
      "items": {
        "type": "string",
        "pattern": "^#[0-9a-fA-F]{6}$"
      }
    }
  }
}
