@tongue-core/templates 0.0.0-stage → 0.1.0-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +53 -2
- package/dist/index.d.ts +9 -0
- package/dist/index.js +60 -0
- package/package.json +34 -4
- package/templates/blank/README.md +22 -0
- package/templates/blank/assets/fonts/Inter.woff2 +0 -0
- package/templates/blank/assets/fonts/OFL-Inter.txt +93 -0
- package/templates/blank/assets.ts +9 -0
- package/templates/blank/film.tsx +15 -0
- package/templates/blank/scenes/outro.tsx +21 -0
- package/templates/blank/scenes/title.tsx +40 -0
- package/templates/blank/template.json +9 -0
- package/templates/promo/README.md +24 -0
- package/templates/promo/assets/fonts/Fraunces.woff2 +0 -0
- package/templates/promo/assets/fonts/Inter.woff2 +0 -0
- package/templates/promo/assets/fonts/OFL-Fraunces.txt +93 -0
- package/templates/promo/assets/fonts/OFL-Inter.txt +93 -0
- package/templates/promo/assets/images/dusk.jpg +0 -0
- package/templates/promo/assets/video/aurora.mp4 +0 -0
- package/templates/promo/assets.ts +14 -0
- package/templates/promo/film.tsx +28 -0
- package/templates/promo/kit/brand.ts +21 -0
- package/templates/promo/kit/ui.tsx +11 -0
- package/templates/promo/scenes/caption.tsx +28 -0
- package/templates/promo/scenes/intro.tsx +36 -0
- package/templates/promo/scenes/lower-third.tsx +39 -0
- package/templates/promo/scenes/outro.tsx +36 -0
- package/templates/promo/template.json +9 -0
- package/templates/social-post/README.md +21 -0
- package/templates/social-post/assets/fonts/Figtree.woff2 +0 -0
- package/templates/social-post/assets/fonts/Fraunces.woff2 +0 -0
- package/templates/social-post/assets/fonts/OFL-Figtree.txt +93 -0
- package/templates/social-post/assets/fonts/OFL-Fraunces.txt +93 -0
- package/templates/social-post/assets/images/dusk.jpg +0 -0
- package/templates/social-post/assets.ts +12 -0
- package/templates/social-post/film.tsx +20 -0
- package/templates/social-post/kit/brand.ts +26 -0
- package/templates/social-post/kit/ui.tsx +48 -0
- package/templates/social-post/scenes/cta.tsx +37 -0
- package/templates/social-post/scenes/hook.tsx +39 -0
- package/templates/social-post/scenes/points.tsx +51 -0
- package/templates/social-post/template.json +9 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Backpine
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,54 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @tongue-core/templates
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The film projects `tongue init` starts from. Each is a complete project (it builds and renders as
|
|
4
|
+
it is) plus a `template.json` that says what it makes.
|
|
5
|
+
|
|
6
|
+
| Template | Size | What it shows |
|
|
7
|
+
|---|---|---|
|
|
8
|
+
| `blank` | 1920×1080 | the smallest project: a title, a fade, an outro |
|
|
9
|
+
| `social-post` | 1080×1920 | a Reel or Short: a photo hook with words landing one by one, a numbered list, a call to action; a brand kit; safe areas for the apps' buttons |
|
|
10
|
+
| `promo` | 1920×1080 | footage: a title card, a video clip with a lower third over it on a second track, a still with a typed quote, an end card |
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
tongue templates # the list
|
|
14
|
+
tongue init my-film --template social-post # a project from one
|
|
15
|
+
tongue init my-film --template ./my-template # or from any template folder
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { builtInTemplates, readTemplateFolder, templateFolders } from "@tongue-core/templates";
|
|
20
|
+
|
|
21
|
+
await builtInTemplates.list(); // TemplateManifest[]
|
|
22
|
+
await builtInTemplates.read("promo"); // { manifest, files }
|
|
23
|
+
templateFolders("/srv/templates"); // a TemplateSource over a folder of your own
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Reading templates uses the file system (Bun or Node). The format itself (`template.json`,
|
|
27
|
+
`TemplateSource`, `projectFromTemplate`) is `@tongue-core/project/template`'s, so other sources (an app's
|
|
28
|
+
own catalog, a URL) implement the same interface.
|
|
29
|
+
|
|
30
|
+
Templates ship local, generated media for offline use. Applications should normally declare
|
|
31
|
+
hosted footage by URL in `assets.ts`, with an immutable SHA-256 when available. The SDK's media
|
|
32
|
+
store prepares and hosts previews outside the project; builds retain only their references.
|
|
33
|
+
|
|
34
|
+
## A template
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
my-template/
|
|
38
|
+
template.json { "name", "title", "description", "width", "height", "fps", "tags" }
|
|
39
|
+
README.md copied into the project: what the scenes are and which props they take
|
|
40
|
+
film.tsx, scenes/, kit/, lib/, assets.ts, assets/
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
`tongue init` copies the files, writes a fresh `tongue.json` (the project's name, the Tongue
|
|
44
|
+
version, the template), and the `tsconfig.json` and `.gitignore` every project has.
|
|
45
|
+
|
|
46
|
+
## Rules
|
|
47
|
+
|
|
48
|
+
- **It builds as it is.** The test suite builds every template into film.json, and
|
|
49
|
+
`tools/project-check.ts` takes each through the CLI (init, check, build, stills, render) and the
|
|
50
|
+
social post through the browser player.
|
|
51
|
+
- **Type-checked and cast-free,** like the rest of the repo (`tsconfig.templates.json`).
|
|
52
|
+
- **Deterministic:** scene code uses `math` from `@tongue-core/film`, never `Math.sin` and friends.
|
|
53
|
+
- **Assets it can ship:** fonts are OFL (licences beside them); the image and the footage are
|
|
54
|
+
generated with ffmpeg and free to use.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Template, type TemplateSource } from "@tongue-core/project";
|
|
2
|
+
/** Where the built-in templates are. */
|
|
3
|
+
export declare const TEMPLATES_DIR: string;
|
|
4
|
+
/** The template in `dir`: its template.json and its files. Rejects with a TemplateError. */
|
|
5
|
+
export declare function readTemplateFolder(dir: string): Promise<Template>;
|
|
6
|
+
/** The templates in the folders of `root`, by name. */
|
|
7
|
+
export declare function templateFolders(root: string): TemplateSource;
|
|
8
|
+
/** The templates that come with Tongue. */
|
|
9
|
+
export declare const builtInTemplates: TemplateSource;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { readdir, readFile, stat } from "node:fs/promises";
|
|
2
|
+
import { join, relative, sep } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { IGNORED_DIRS, parseTemplateManifest, TEMPLATE_FILE, TemplateError } from "@tongue-core/project";
|
|
5
|
+
import { Effect } from "effect";
|
|
6
|
+
// @tongue-core/templates: the film projects `tongue init` starts from, and reading templates from
|
|
7
|
+
// folders (these, or anyone's). Each template is a complete project plus template.json; the
|
|
8
|
+
// test suite builds every one, so a template can't ship broken.
|
|
9
|
+
/** Where the built-in templates are. */
|
|
10
|
+
export const TEMPLATES_DIR = fileURLToPath(new URL("../templates", import.meta.url));
|
|
11
|
+
/** Every file under `dir` (but what Tongue writes there), as a template's files. */
|
|
12
|
+
async function filesOf(dir) {
|
|
13
|
+
const out = [];
|
|
14
|
+
const walk = async (at) => {
|
|
15
|
+
for (const name of (await readdir(at)).sort()) {
|
|
16
|
+
const path = join(at, name);
|
|
17
|
+
if ((await stat(path)).isDirectory()) {
|
|
18
|
+
if (!IGNORED_DIRS.has(name))
|
|
19
|
+
await walk(path);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
out.push({ path: relative(dir, path).split(sep).join("/"), bytes: new Uint8Array(await readFile(path)) });
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
await walk(dir);
|
|
27
|
+
return out;
|
|
28
|
+
}
|
|
29
|
+
/** The template in `dir`: its template.json and its files. Rejects with a TemplateError. */
|
|
30
|
+
export async function readTemplateFolder(dir) {
|
|
31
|
+
const text = await readFile(join(dir, TEMPLATE_FILE), "utf8").catch(() => null);
|
|
32
|
+
if (text === null)
|
|
33
|
+
throw new TemplateError({ template: dir, message: `${dir} isn't a template: it has no ${TEMPLATE_FILE}.` });
|
|
34
|
+
const manifest = await Effect.runPromise(parseTemplateManifest(text, dir));
|
|
35
|
+
const files = (await filesOf(dir)).filter((f) => f.path !== TEMPLATE_FILE);
|
|
36
|
+
return { manifest, files };
|
|
37
|
+
}
|
|
38
|
+
/** The templates in the folders of `root`, by name. */
|
|
39
|
+
export function templateFolders(root) {
|
|
40
|
+
const folders = async () => {
|
|
41
|
+
const names = await readdir(root).catch(() => []);
|
|
42
|
+
const found = [];
|
|
43
|
+
for (const name of names.sort()) {
|
|
44
|
+
if ((await stat(join(root, name, TEMPLATE_FILE)).catch(() => null))?.isFile())
|
|
45
|
+
found.push(name);
|
|
46
|
+
}
|
|
47
|
+
return found;
|
|
48
|
+
};
|
|
49
|
+
return {
|
|
50
|
+
list: async () => Promise.all((await folders()).map(async (name) => (await readTemplateFolder(join(root, name))).manifest)),
|
|
51
|
+
read: async (name) => {
|
|
52
|
+
const known = await folders();
|
|
53
|
+
if (!known.includes(name))
|
|
54
|
+
throw new TemplateError({ template: name, message: `There is no template "${name}" (templates: ${known.join(", ")}).` });
|
|
55
|
+
return readTemplateFolder(join(root, name));
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/** The templates that come with Tongue. */
|
|
60
|
+
export const builtInTemplates = templateFolders(TEMPLATES_DIR);
|
package/package.json
CHANGED
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tongue-core/templates",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0-rc.10",
|
|
4
|
+
"description": "The film projects `tongue init` starts from: a blank film, a vertical social post, a promo with footage. Each is a complete project that builds as it is.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Backpine",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/backpine/tongue-core.git",
|
|
11
|
+
"directory": "packages/templates"
|
|
12
|
+
},
|
|
13
|
+
"sideEffects": false,
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"default": "./dist/index.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"main": "./dist/index.js",
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"templates",
|
|
25
|
+
"README.md"
|
|
26
|
+
],
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@tongue-core/project": "0.1.0-rc.10"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"effect": "^4.0.6"
|
|
32
|
+
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# A Tongue film
|
|
2
|
+
|
|
3
|
+
- `film.tsx` is the timeline: which scenes play, for how long, and how they join.
|
|
4
|
+
- `scenes/` has one scene per file, named for its id (`scenes/title.tsx` is scene `title`).
|
|
5
|
+
- `assets.ts` declares media at module scope. Application footage normally uses hosted URLs;
|
|
6
|
+
the template's local fonts live in `assets/` so it also works offline.
|
|
7
|
+
|
|
8
|
+
For hosted footage, declare `video("https://…/screen.mp4", { name: "screen", sha256: "<64 hex digits>" })`.
|
|
9
|
+
Set `TONGUE_MEDIA_DIR` and `TONGUE_MEDIA_URL` to the host's prepared-media store for portable builds,
|
|
10
|
+
or supply a hosted `prepared` manifest on the asset. Studio serves a local media store automatically.
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
tongue check . # does it build? (layout, code, timeline)
|
|
14
|
+
tongue stills . --sheet # a contact sheet of frames
|
|
15
|
+
tongue stills . --scene title
|
|
16
|
+
tongue build . # dist/: film.json, build.json, a bundle per scene
|
|
17
|
+
tongue render . # out/<name>.mp4
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Scenes take their content as props (`props={{ headline: "…" }}` in film.tsx), so the same scene
|
|
21
|
+
plays with different words. Use `math` from `@tongue-core/film` (not `Math.sin`) in scene code so every
|
|
22
|
+
frame is the same everywhere.
|
|
Binary file
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2020 The Inter Project Authors (https://github.com/rsms/inter)
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
https://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { font } from "@tongue-core/film";
|
|
2
|
+
|
|
3
|
+
// Every file the film uses, declared once. Paths are relative to the project.
|
|
4
|
+
|
|
5
|
+
export const inter = font("assets/fonts/Inter.woff2");
|
|
6
|
+
|
|
7
|
+
// Application media normally uses hosted URLs, declared here before rendering.
|
|
8
|
+
// Example: video("https://cdn.example/screen.mp4", { name: "screen", sha256: "<64 hex digits>" }).
|
|
9
|
+
// A portable build uses the host media store or an asset's prepared manifest URL.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Clip, Film, Track, Transition } from "@tongue-core/film";
|
|
2
|
+
import Outro from "./scenes/outro.tsx";
|
|
3
|
+
import Title from "./scenes/title.tsx";
|
|
4
|
+
|
|
5
|
+
// The timeline: a title, then the outro, joined by a crossfade. 5 seconds at 30 fps.
|
|
6
|
+
|
|
7
|
+
export default (
|
|
8
|
+
<Film width={1920} height={1080} fps={30} background="#0f1115">
|
|
9
|
+
<Track id="main">
|
|
10
|
+
<Clip scene={Title} props={{ headline: "Your film starts here", subline: "Edit film.tsx and the scenes, then look with tongue stills" }} />
|
|
11
|
+
<Transition.Fade frames={15} />
|
|
12
|
+
<Clip scene={Outro} props={{ line: "Made with Tongue" }} />
|
|
13
|
+
</Track>
|
|
14
|
+
</Film>
|
|
15
|
+
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Center, Fill, scene, Show, Stage, t } from "@tongue-core/film";
|
|
2
|
+
import { inter } from "../assets.ts";
|
|
3
|
+
|
|
4
|
+
// The last word: one line that pops in and holds.
|
|
5
|
+
|
|
6
|
+
export default scene({
|
|
7
|
+
name: "outro",
|
|
8
|
+
props: { line: t.string({ maxLength: 60 }) },
|
|
9
|
+
duration: 60,
|
|
10
|
+
keys: ["headline"],
|
|
11
|
+
render: ({ line }) => (
|
|
12
|
+
<Stage>
|
|
13
|
+
<Fill color="#ff7a45" />
|
|
14
|
+
<Center>
|
|
15
|
+
<Show from={6} enter="pop">
|
|
16
|
+
<div morph="headline" style={{ fontFamily: inter, fontSize: 96, fontWeight: 700, letterSpacing: -2, color: "#0f1115" }}>{line}</div>
|
|
17
|
+
</Show>
|
|
18
|
+
</Center>
|
|
19
|
+
</Stage>
|
|
20
|
+
),
|
|
21
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Center, Fill, now, scene, Show, Stage, t } from "@tongue-core/film";
|
|
2
|
+
import { inter } from "../assets.ts";
|
|
3
|
+
|
|
4
|
+
// A headline that rises in over a line drawn underneath it, with an optional line of detail. Each
|
|
5
|
+
// part has its own fixed height, so nothing moves when the next part appears.
|
|
6
|
+
|
|
7
|
+
export default scene({
|
|
8
|
+
name: "title",
|
|
9
|
+
props: {
|
|
10
|
+
headline: t.string({ maxLength: 48 }),
|
|
11
|
+
subline: t.optional(t.string({ maxLength: 80 })),
|
|
12
|
+
},
|
|
13
|
+
duration: 90,
|
|
14
|
+
keys: ["headline"],
|
|
15
|
+
render: ({ headline, subline }) => {
|
|
16
|
+
const line = now().progress(14, 44, "glide");
|
|
17
|
+
return (
|
|
18
|
+
<Stage>
|
|
19
|
+
<Fill color="#0f1115" />
|
|
20
|
+
<Center>
|
|
21
|
+
<div style={{ display: "flex", flexDirection: "column", alignItems: "center", gap: 28 }}>
|
|
22
|
+
<div style={{ height: 136, display: "flex", alignItems: "center" }}>
|
|
23
|
+
<Show from={4} enter="rise">
|
|
24
|
+
<div morph="headline" style={{ fontFamily: inter, fontSize: 112, fontWeight: 700, letterSpacing: -3, color: "#f5f3ee", whiteSpace: "nowrap" }}>{headline}</div>
|
|
25
|
+
</Show>
|
|
26
|
+
</div>
|
|
27
|
+
<div style={{ width: 640 * line, height: 6, borderRadius: 3, background: "#ff7a45" }} />
|
|
28
|
+
{subline ? (
|
|
29
|
+
<div style={{ height: 52 }}>
|
|
30
|
+
<Show from={26} enter="fade">
|
|
31
|
+
<div style={{ fontFamily: inter, fontSize: 40, color: "#a9adb6", whiteSpace: "nowrap" }}>{subline}</div>
|
|
32
|
+
</Show>
|
|
33
|
+
</div>
|
|
34
|
+
) : null}
|
|
35
|
+
</div>
|
|
36
|
+
</Center>
|
|
37
|
+
</Stage>
|
|
38
|
+
);
|
|
39
|
+
},
|
|
40
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# A promo
|
|
2
|
+
|
|
3
|
+
A 16:9 film of 12.5 seconds built on footage. Two tracks:
|
|
4
|
+
|
|
5
|
+
- **base**: the title card, the footage (`assets/video/aurora.mp4`, 4 s), a still
|
|
6
|
+
(`assets/images/dusk.jpg`) and the end card, joined by a wipe and fades.
|
|
7
|
+
- **titles**, drawn over base: a lower third while the footage plays, a quote over the still.
|
|
8
|
+
Their scenes have no background, so the footage shows through.
|
|
9
|
+
|
|
10
|
+
| Scene | Props |
|
|
11
|
+
|---|---|
|
|
12
|
+
| `intro` | `kicker`, `title` |
|
|
13
|
+
| `lower-third` | `label`, `title` |
|
|
14
|
+
| `caption` | `quote`, `credit` |
|
|
15
|
+
| `outro` | `headline`, `url` |
|
|
16
|
+
|
|
17
|
+
Swap the footage and the still in `assets.ts` (any MP4, JPEG or PNG), and the brand in
|
|
18
|
+
`kit/brand.ts`. The media is generated, free to use.
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
tongue stills . --sheet
|
|
22
|
+
tongue stills . --scene lower-third
|
|
23
|
+
tongue render .
|
|
24
|
+
```
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2018 The Fraunces Project Authors (https://github.com/undercasetype/Fraunces)
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
http://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2020 The Inter Project Authors (https://github.com/rsms/inter)
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
https://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { font, image, video } from "@tongue-core/film";
|
|
2
|
+
|
|
3
|
+
// Every file the film uses, declared once. Paths are relative to the project.
|
|
4
|
+
|
|
5
|
+
export const fraunces = font("assets/fonts/Fraunces.woff2");
|
|
6
|
+
export const inter = font("assets/fonts/Inter.woff2");
|
|
7
|
+
/** Generated footage of an aurora, 4 seconds; swap in your own. */
|
|
8
|
+
export const aurora = video("assets/video/aurora.mp4");
|
|
9
|
+
/** A generated dusk landscape. */
|
|
10
|
+
export const dusk = image("assets/images/dusk.jpg", { maxSize: 2000 });
|
|
11
|
+
|
|
12
|
+
// Application media normally uses hosted URLs, declared here before rendering.
|
|
13
|
+
// Example: video("https://cdn.example/screen.mp4", { name: "screen", sha256: "<64 hex digits>" }).
|
|
14
|
+
// A portable build uses the host media store or an asset's prepared manifest URL.
|