Skip to content

project.json ​

Everything about a commercial lives in its folder's project.json. The editor writes it, and you can write it by hand or from a script. It's checked every time it loads, and an error names the field that's wrong. The schema is ProjectSchema in src/core/project.ts.

Example ​

json
{
  "version": 1,
  "name": "@forinda/kickjs-db",
  "formats": ["16:9", "9:16", "1:1"],
  "theme": {
    "colors": {
      "bg": "#0d2226", "panel": "#13313a", "line": "#24505a", "fg": "#efe9da",
      "muted": "#9db4b3", "accent": "#f2c14e", "good": "#7fd1b9", "bad": "#e3735e"
    },
    "fonts": { "display": "Unbounded", "body": "IBM Plex Sans", "mono": "JetBrains Mono" }
  },
  "voice": { "tts": "en-US-AvaNeural", "rate": "-4%" },
  "captions": true,
  "scenes": [
    {
      "id": "one-schema",
      "kind": "blocks",
      "minSeconds": 8,
      "transition": "slide",
      "caption": "@forinda/kickjs-db puts it in one place.",
      "spoken": "KickJS D-B puts it in one place.",
      "blocks": [
        { "type": "headline", "text": "One schema. In TypeScript.", "accent": "In TypeScript." },
        { "type": "code", "at": 1.2, "lang": "ts", "label": "schema.ts", "source": "const users = table('users', {})" }
      ]
    }
  ]
}

Top level ​

FieldTypeDefault
version1requiredThe format version.
namestringrequiredShown in the editor and page titles.
formatsarray of "16:9", "9:16", "1:1"required, at least oneWhat Render and --format all make.
themeobjectrequiredTheme
voice{ tts, rate }requiredGenerated voice: an edge-tts voice name and rate, like "-4%".
music{ file, volume, duck }noneMusic
captionsbooleantrueDraw captions into the picture.
captionStyle"lines" or "words""lines"words lights each word as it's said. It needs word times from the voice, which edge-tts gives; without them captions show as lines.
pauseSecondsnumber, 0 to 51.3Picture kept after each spoken line, before the next scene. 0.3 feels tight, for shorts.
scenesarrayrequired, at least oneScenes, in order. Ids must be unique.

Theme ​

Field
colors.bg, panel, line, fg, muted, accent, good, badHex colors (#f2c14e, #fff). They're written into CSS, so other forms are refused.
fonts.display, body, monoFont family names: letters, digits and spaces.
fonts.filesFont files kept in the project, written when you press Download: [{ "family", "weight", "path" }], with path under media/fonts/.
logoOptional path under media/.

A font family without files in the project falls back to what's installed on the machine.

Music ​

FieldDefault
filerequiredPath in the project, like media/music.mp3. Loops under the whole spot.
volume0.250–1
duck0.350–1: roughly how loud the music stays while someone speaks.

Scenes ​

Every scene has:

FieldTypeDefault
idstringrequiredLetters, digits, - and _, starting with a letter or digit. Used in file names.
kind"blocks" or "custom"required
captionstringrequiredOn screen and in the .srt.
spokenstringthe captionWhat the voice says. Whitespace only makes a silent scene.
minSecondsnumber4The shortest the scene may be.
transition"fade", "cut", "slide", "wipe", "zoom", "iris", "flip", "blinds", "break", "shatter" or "crumble""fade"Into this scene.
transitionSecondsnumber, up to 5a length that suits the kindHow long the transition takes. It's part of this scene's time.
voice"tts" or "recording""tts""recording" uses voice/<id>.rec.webm when it exists.

A blocks scene adds blocks: an array of blocks.

A custom scene adds html, css (both default "") and script, which must export draw(t, ctx). See Custom scenes.

Scene length ​

A scene lasts the longest of minSeconds, the time its blocks need plus one second, and its voice clip plus 1.3 seconds. The result is rounded up to a tenth of a second.

Released under the Apache License 2.0.