Cartoon: mãos, membros e cenários novos; elenco de Noé e a Arca

- Mãos com formas e rotações próprias, membros articulados (limbs) e animais.
- Elementos de cenário separados (natureza, construções, interiores) e testes de lugares.
- Personagens reaproveitáveis de Noé e a Arca (Noé, esposa, Sem, Cam e Jafé) e a fonte Barlow Semi Condensed.
- História noe-e-a-arca: pauta, bíblia, roteiro do ep. 1, tomadas Cartoon e montagem.
- Montagem: narração mais corrida (tira silêncios longos) e cabeçalho com o número do vídeo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-18 01:51:11 -03:00
co-authored by Claude Opus 5.5
parent 3f600c55b1
commit 2d8b1a582d
66 changed files with 19575 additions and 455 deletions
+41
View File
@@ -0,0 +1,41 @@
{
"schemaVersion": 1,
"id": "cam",
"name": "Cam",
"kind": "cartoon",
"look": {
"build": "heavy",
"height": 1,
"skin": "#9a6440",
"hair": {
"style": "curly",
"color": "#3a2a1e"
},
"beard": {
"style": "stubble",
"color": "#3a2a1e"
},
"glasses": "none",
"brows": "thin",
"top": {
"style": "robe",
"color": "#56704a",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "round",
"lids": 0.1,
"wrinkles": 0,
"head": "wide",
"belly": true
},
"caption": "Filho de Noé",
"description": "homem de 40 anos, moreno, forte, cabelo cacheado preto, barba por fazer, túnica verde, sandália",
"createdAt": "2026-11-18T03:23:14.030Z",
"updatedAt": "2026-11-18T03:23:57.151Z"
}
@@ -0,0 +1,40 @@
{
"schemaVersion": 1,
"id": "esposa-de-noe",
"name": "Esposa de Noé",
"kind": "cartoon",
"look": {
"build": "average",
"height": 0.92,
"skin": "#d09a70",
"hair": {
"style": "long",
"color": "#c9c9cf"
},
"beard": {
"style": "none",
"color": "#a9a9b0"
},
"glasses": "none",
"brows": "thick",
"top": {
"style": "robe",
"color": "#8a6f9e",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "button",
"lids": 0.3,
"wrinkles": 0.7,
"head": "round"
},
"caption": "Família de Noé",
"description": "senhora idosa, mulher, cabelo longo grisalho, túnica roxa, sandália, rugas, olhar gentil",
"createdAt": "2026-11-18T03:23:13.978Z",
"updatedAt": "2026-11-18T03:23:57.084Z"
}
+40
View File
@@ -0,0 +1,40 @@
{
"schemaVersion": 1,
"id": "jafe",
"name": "Jafé",
"kind": "cartoon",
"look": {
"build": "slim",
"height": 1.08,
"skin": "#d4a074",
"hair": {
"style": "side",
"color": "#6b4226"
},
"beard": {
"style": "goatee",
"color": "#6b4226"
},
"glasses": "none",
"brows": "thin",
"top": {
"style": "robe",
"color": "#c8443a",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "round",
"lids": 0.1,
"wrinkles": 0,
"head": "round"
},
"caption": "Filho de Noé",
"description": "homem de 35 anos, magro, alto, cabelo repartido castanho, cavanhaque, túnica vermelha, sandália",
"createdAt": "2026-11-18T03:23:14.057Z",
"updatedAt": "2026-11-18T03:23:57.183Z"
}
+40
View File
@@ -0,0 +1,40 @@
{
"schemaVersion": 1,
"id": "noe",
"name": "Noé",
"kind": "cartoon",
"look": {
"build": "slim",
"height": 0.96,
"skin": "#c98a5e",
"hair": {
"style": "long",
"color": "#e2e2e8"
},
"beard": {
"style": "long",
"color": "#eeeef2"
},
"glasses": "none",
"brows": "thick",
"top": {
"style": "robe",
"color": "#a8865a",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "long",
"lids": 0.5,
"wrinkles": 0.85,
"head": "oval"
},
"caption": "Construtor da arca",
"description": "idoso de 600 anos, barba branca longa, cabelo longo grisalho, túnica, sandália, rugas, pálpebra caída, olhar sereno, magro",
"createdAt": "2026-11-18T03:23:13.290Z",
"updatedAt": "2026-11-18T03:23:57.049Z"
}
+40
View File
@@ -0,0 +1,40 @@
{
"schemaVersion": 1,
"id": "sem",
"name": "Sem",
"kind": "cartoon",
"look": {
"build": "average",
"height": 1.02,
"skin": "#c08055",
"hair": {
"style": "short",
"color": "#6b4226"
},
"beard": {
"style": "full",
"color": "#6b4226"
},
"glasses": "none",
"brows": "thin",
"top": {
"style": "robe",
"color": "#2f6db3",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "round",
"lids": 0.1,
"wrinkles": 0.4,
"head": "round"
},
"caption": "Filho de Noé",
"description": "homem de 45 anos, barba cheia castanha, cabelo curto castanho, túnica azul, sandália",
"createdAt": "2026-11-18T03:23:14.006Z",
"updatedAt": "2026-11-18T03:23:57.118Z"
}
@@ -0,0 +1,93 @@
Copyright 2017 The Barlow Project Authors (https://github.com/jpt/barlow)
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file not shown.
+36
View File
@@ -45,6 +45,42 @@ function readJobs(): Job[] {
async function still() { async function still() {
const propsFile = arg("props"); const propsFile = arg("props");
const out = arg("out"); const out = arg("out");
// `--still --spec <trecho.json> --out <png> [--frame N]`: um quadro de um trecho (conferir peças sem gerar o vídeo).
// `--still --list <lista.json>` ([{spec, out, frame?}]): vários quadros num empacotamento só (folhas de conferência).
const listFile = arg("list");
if (listFile) {
const list = JSON.parse(fs.readFileSync(resolve(listFile), "utf8")) as { spec: string; out: string; frame?: number }[];
const serveUrl = await bundle({ entryPoint: path.join(HERE, "src", "index.ts"), publicDir: path.join(REPO, "assets") });
const results: { out: string; frames: number; ms: number }[] = [];
for (const item of list) {
const t0 = Date.now();
const spec = JSON.parse(fs.readFileSync(resolve(item.spec), "utf8")) as ShotSpec;
const errors = validateSpec(spec);
if (errors.length) throw new Error(`${item.spec}: ${errors.join("; ")}`);
const inputProps = spec as unknown as Record<string, unknown>;
const composition = await selectComposition({ serveUrl, id: "Shot", inputProps });
fs.mkdirSync(path.dirname(resolve(item.out)), { recursive: true });
const frame = Math.min(frameCount(spec) - 1, item.frame ?? Math.floor(frameCount(spec) / 2));
await renderStill({ composition, serveUrl, inputProps, output: resolve(item.out), frame, imageFormat: "png", browserExecutable: process.env.CARTOON_CHROME || null });
results.push({ out: path.relative(REPO, resolve(item.out)).replace(/\\/g, "/"), frames: 1, ms: Date.now() - t0 });
}
console.log(JSON.stringify({ ok: true, results }));
return;
}
const specFile = arg("spec");
if (specFile && out) {
const spec = JSON.parse(fs.readFileSync(resolve(specFile), "utf8")) as ShotSpec;
const errors = validateSpec(spec);
if (errors.length) throw new Error(`spec: ${errors.join("; ")}`);
const serveUrl = await bundle({ entryPoint: path.join(HERE, "src", "index.ts"), publicDir: path.join(REPO, "assets") });
const inputProps = spec as unknown as Record<string, unknown>;
const composition = await selectComposition({ serveUrl, id: "Shot", inputProps });
fs.mkdirSync(path.dirname(resolve(out)), { recursive: true });
const frame = Math.min(frameCount(spec) - 1, Number(arg("frame") ?? Math.floor(frameCount(spec) / 2)));
await renderStill({ composition, serveUrl, inputProps, output: resolve(out), frame, imageFormat: "png", browserExecutable: process.env.CARTOON_CHROME || null });
console.log(JSON.stringify({ ok: true, results: [{ out: path.relative(REPO, resolve(out)).replace(/\\/g, "/"), frames: 1, ms: 0 }] }));
return;
}
if (!propsFile || !out) throw new Error("--still precisa de --props e --out"); if (!propsFile || !out) throw new Error("--still precisa de --props e --out");
const inputProps = JSON.parse(fs.readFileSync(resolve(propsFile), "utf8")) as Record<string, unknown>; const inputProps = JSON.parse(fs.readFileSync(resolve(propsFile), "utf8")) as Record<string, unknown>;
const looks = (inputProps.figures as { look: unknown }[] | undefined) ?? []; const looks = (inputProps.figures as { look: unknown }[] | undefined) ?? [];
+1 -1
View File
@@ -30,7 +30,7 @@ export function CharacterCard({ figures, background = "#2a2e45", framing = "full
{f.label && <div style={{ marginBottom: "4%" }}><TagLabel text={f.label} size={n > 3 ? 2.2 : 3.4} /></div>} {f.label && <div style={{ marginBottom: "4%" }}><TagLabel text={f.label} size={n > 3 ? 2.2 : 3.4} /></div>}
{framing === "face" ? ( {framing === "face" ? (
<div style={{ width: "92%", aspectRatio: "1 / 1", overflow: "hidden", position: "relative" }}> <div style={{ width: "92%", aspectRatio: "1 / 1", overflow: "hidden", position: "relative" }}>
<div style={{ position: "absolute", left: "-60%", top: "-64%", width: "220%", aspectRatio: "200 / 440" }}> <div style={{ position: "absolute", left: "-15%", top: "-36%", width: "130%", aspectRatio: "200 / 440" }}>
<CharacterFigure look={f.look} expression={f.expression} pose={f.pose} item={f.item} t={frame / fps} /> <CharacterFigure look={f.look} expression={f.expression} pose={f.pose} item={f.item} t={frame / fps} />
</div> </div>
</div> </div>
+613 -189
View File
@@ -3,48 +3,92 @@
// viewBox 200×440, pés em (100, 440). O movimento (andar, pular, falar…) vem de motion.ts como `state`; sem ele, // viewBox 200×440, pés em (100, 440). O movimento (andar, pular, falar…) vem de motion.ts como `state`; sem ele,
// usa a expressão/pose pedida com a "vida" (piscar, respirar). Posição, giro e espelho ficam por conta de quem // usa a expressão/pose pedida com a "vida" (piscar, respirar). Posição, giro e espelho ficam por conta de quem
// desenha a cena (Shot.tsx). // desenha a cena (Shot.tsx).
//
// Acabamento de ilustração (v2): cabeça grande (~1/3 da altura), tronco em "pera" com ombros redondos, membros
// afinando na ponta, SOMBREADO CEL em 2 tons em tudo (luz de um lado só, `shadeSide`), sem contorno preto (a borda
// é o tom escuro da própria cor), sobrancelha como forma, nariz de traço, pálpebra pesada, mãos com dedos que
// seguram o objeto por cima, roupa com gola/zíper/botões/dobras/barra e sapato com volume.
import React, { useId } from "react"; import React, { useId } from "react";
import { Icon } from "./icons"; import { Icon } from "./icons";
import type { IconId } from "./spec"; import type { IconId } from "./spec";
import { DEFAULT_LOOK, type CharacterLook } from "./character"; import { DEFAULT_LOOK, type CharacterLook } from "./character";
import { evaluate, type ActorState } from "./motion"; import { evaluate, type ActorState } from "./motion";
import type { BodyParams, FaceParams, Limb } from "./rig"; import { POSE_PRESETS, type BodyParams, type FaceParams, type Limb } from "./rig";
import { armLayer } from "./limbs";
import { GRIP, HandArt, TWO_HANDED, handPlacement, wristForHold, type HandShape } from "./hands";
const INK = "#15161f"; const INK = "#1d1a22";
/** Escala da cabeça sobre o desenho-base da cabeça (centro (100,106), queixo em y 156). */
const HEAD_SCALE = 1.2;
function shade(hex: string, k: number): string { export function shade(hex: string, k: number): string {
const n = parseInt(hex.slice(1), 16); const n = parseInt(hex.slice(1), 16);
const c = (v: number) => Math.max(0, Math.min(255, Math.round(v * k))).toString(16).padStart(2, "0"); const c = (v: number) => Math.max(0, Math.min(255, Math.round(v * k))).toString(16).padStart(2, "0");
return `#${c((n >> 16) & 255)}${c((n >> 8) & 255)}${c(n & 255)}`; return `#${c((n >> 16) & 255)}${c((n >> 8) & 255)}${c(n & 255)}`;
} }
/** Sombra com um pouco de azul (sombra fria sob luz quente, como na ilustração). */
function cool(hex: string, k = 0.78): string {
const n = parseInt(hex.slice(1), 16);
const r = ((n >> 16) & 255) * k * 0.94, g = ((n >> 8) & 255) * k * 0.97, b = (n & 255) * k + 10;
const c = (v: number) => Math.max(0, Math.min(255, Math.round(v))).toString(16).padStart(2, "0");
return `#${c(r)}${c(g)}${c(b)}`;
}
/** Ponta de um segmento: ângulo de tela em graus (0 = para baixo). */ /** Ponta de um segmento: ângulo de tela em graus (0 = para baixo). */
const tip = (x: number, y: number, deg: number, len: number) => { const tip = (x: number, y: number, deg: number, len: number) => {
const r = (deg * Math.PI) / 180; const r = (deg * Math.PI) / 180;
return { x: x - Math.sin(r) * len, y: y + Math.cos(r) * len }; return { x: x - Math.sin(r) * len, y: y + Math.cos(r) * len };
}; };
function Segment({ x, y, deg, len, w, fill }: { x: number; y: number; deg: number; len: number; w: number; fill: string }) { /**
return <rect x={x - w / 2} y={y - w / 2} width={w} height={len + w / 2} rx={w / 2} fill={fill} transform={`rotate(${deg} ${x} ${y})`} />; * Forma com sombra cel: desenha a forma no tom da sombra e por cima a cópia iluminada deslocada para o lado da
* luz, recortada pela própria forma. Sobra um crescente de sombra no lado oposto à luz (e embaixo).
*/
function Cel({ id, d, fill, side, dx = 8, dy = -4, k = 0.8, transform }: { id: string; d: string; fill: string; side: number; dx?: number; dy?: number; k?: number; transform?: string }) {
return (
<g transform={transform}>
<defs><clipPath id={id}><path d={d} /></clipPath></defs>
<g clipPath={`url(#${id})`}>
<path d={d} fill={cool(fill, k)} />
<path d={d} fill={fill} transform={`translate(${-side * dx} ${dy})`} />
</g>
</g>
);
} }
function Mouth({ f, uid }: { f: FaceParams; uid: string }) { /** Membro afinando (ombro→cotovelo, cotovelo→punho, quadril→joelho…), com sombra cel no lado oposto à luz. */
const w = 32 * f.mouthWidth * (1 - f.mouthRound * 0.35); export function Limb2({ id, x, y, deg, len, w1, w2, fill, side }: { id: string; x: number; y: number; deg: number; len: number; w1: number; w2: number; fill: string; side: number }) {
const cy = 137 - f.smile * 6; const d = `M${-w1 / 2} 0 L${-w2 / 2} ${len} A${w2 / 2} ${w2 / 2} 0 0 0 ${w2 / 2} ${len} L${w1 / 2} 0 A${w1 / 2} ${w1 / 2} 0 0 0 ${-w1 / 2} 0 Z`;
// A sombra fica do lado da tela oposto à luz; no sistema local do membro esse lado gira junto.
const r = (deg * Math.PI) / 180;
const local = Math.cos(r) >= 0 ? side : -side;
return <Cel id={id} d={d} fill={fill} side={local} dx={w1 * 0.32} dy={0} transform={`translate(${x} ${y}) rotate(${deg})`} />;
}
function Mouth({ f, uid, skin }: { f: FaceParams; uid: string; skin: string }) {
const w = 30 * f.mouthWidth * (1 - f.mouthRound * 0.35);
const cy = 138 - f.smile * 6;
if (f.mouthOpen < 0.06 && f.mouthRound < 0.3) { if (f.mouthOpen < 0.06 && f.mouthRound < 0.3) {
return <path d={`M${100 - w / 2} ${cy} Q100 ${137 + f.smile * 12} ${100 + w / 2} ${cy}`} stroke={INK} strokeWidth={5} fill="none" strokeLinecap="round" />; return (
<g>
<path d={`M${100 - w / 2} ${cy} Q100 ${138 + f.smile * 12} ${100 + w / 2} ${cy}`} stroke={shade(skin, 0.42)} strokeWidth={4.6} fill="none" strokeLinecap="round" />
{/* Lábio de baixo: sombra curta sob a boca. */}
<path d={`M${100 - w * 0.22} ${cy + 7 + f.smile * 5} Q100 ${cy + 10 + f.smile * 6} ${100 + w * 0.22} ${cy + 7 + f.smile * 5}`} stroke={shade(skin, 0.82)} strokeWidth={3} fill="none" strokeLinecap="round" />
</g>
);
} }
const open = Math.max(f.mouthOpen, f.mouthRound * 0.25); const open = Math.max(f.mouthOpen, f.mouthRound * 0.25);
// A curva quadrática só chega à metade do ponto de controle: os controles ficam no dobro da abertura desejada. // A curva quadrática só chega à metade do ponto de controle: os controles ficam no dobro da abertura desejada.
const up = cy + f.smile * 2 - open * 8 - f.mouthRound * 6; const up = cy + f.smile * 2 - open * 8 - f.mouthRound * 6;
const low = cy + open * 46 * (1 + f.mouthRound * 0.3) + f.smile * 12; // A boca aberta (riso, grito) nunca passa do queixo (y ≈ 156): cresce até ali e para.
const low = Math.min(152, cy + open * 44 * (1 + f.mouthRound * 0.3) + f.smile * 12);
const d = `M${100 - w / 2} ${cy} Q100 ${up} ${100 + w / 2} ${cy} Q100 ${low} ${100 - w / 2} ${cy} Z`; const d = `M${100 - w / 2} ${cy} Q100 ${up} ${100 + w / 2} ${cy} Q100 ${low} ${100 - w / 2} ${cy} Z`;
return ( return (
<g> <g>
<defs><clipPath id={`m${uid}`}><path d={d} /></clipPath></defs> <defs><clipPath id={`m${uid}`}><path d={d} /></clipPath></defs>
<path d={d} fill={INK} /> <path d={d} fill="#4a1f24" />
<g clipPath={`url(#m${uid})`}> <g clipPath={`url(#m${uid})`}>
{f.teeth && open > 0.12 && <rect x={60} y={Math.min(up, cy) - 10} width={80} height={(cy - Math.min(up, cy)) + 10 + (low - cy) * 0.16} fill="#f7f7f2" />} {f.teeth && open > 0.12 && <rect x={60} y={Math.min(up, cy) - 10} width={80} height={(cy - Math.min(up, cy)) + 10 + (low - cy) * 0.16} fill="#f7f4ec" />}
{open > 0.4 && <ellipse cx={100} cy={cy + (low - cy) * 0.5} rx={w * 0.3} ry={(low - cy) * 0.16} fill="#d9534f" />} {open > 0.35 && <ellipse cx={100} cy={cy + (low - cy) * 0.55} rx={w * 0.32} ry={(low - cy) * 0.2} fill="#d9606a" />}
</g> </g>
</g> </g>
); );
@@ -52,83 +96,129 @@ function Mouth({ f, uid }: { f: FaceParams; uid: string }) {
function Eyes({ f, lid, skin, uid }: { f: FaceParams; lid: number; skin: string; uid: string }) { function Eyes({ f, lid, skin, uid }: { f: FaceParams; lid: number; skin: string; uid: string }) {
const big = Math.max(f.eyeL, f.eyeR); const big = Math.max(f.eyeL, f.eyeR);
const r = 10.5 + Math.max(0, big - 1) * 7; const r = 11 + Math.max(0, big - 1) * 7;
const cover = Math.max(0, Math.min(0.85, lid)); const cover = Math.max(0, Math.min(0.85, lid));
const eye = (x: number, open: number) => { const lidColor = shade(skin, 0.96);
const crease = shade(skin, 0.7);
const eye = (x: number, open: number, sideSign: number) => {
// Olho de riso: fechado em arco para cima quando quase fechado e sorrindo. // Olho de riso: fechado em arco para cima quando quase fechado e sorrindo.
if (open < 0.3 && f.smile > 0.55) return <path key={x} d={`M${x - 10} 110 Q${x} 98 ${x + 10} 110`} stroke={INK} strokeWidth={4.5} fill="none" strokeLinecap="round" />; if (open < 0.3 && f.smile > 0.55) return <path key={x} d={`M${x - 11} 110 Q${x} 97 ${x + 11} 110`} stroke={INK} strokeWidth={4.5} fill="none" strokeLinecap="round" />;
if (open < 0.14) return <path key={x} d={`M${x - 10} 108 Q${x} 113 ${x + 10} 108`} stroke={INK} strokeWidth={4} fill="none" strokeLinecap="round" />; if (open < 0.14) return <path key={x} d={`M${x - 11} 108 Q${x} 114 ${x + 11} 108`} stroke={shade(skin, 0.45)} strokeWidth={4} fill="none" strokeLinecap="round" />;
const rx = r * 1.12;
return ( return (
<g key={x} transform={`translate(${x} 108) scale(1 ${Math.min(1.2, open)})`}> <g key={x} transform={`translate(${x} 108) scale(1 ${Math.min(1.2, open)})`}>
<defs><clipPath id={`e${uid}${x}`}><circle r={r} /></clipPath></defs> <defs><clipPath id={`e${uid}${x}`}><ellipse rx={rx} ry={r} /></clipPath></defs>
<circle r={r} fill="#ffffff" /> {/* Cavidade: leve sombra ao redor do olho. */}
<circle r={Math.max(2.2, 5 * f.pupil)} cx={f.gazeX * 4} cy={f.gazeY * 3 + cover * 3} fill={INK} /> <ellipse rx={rx + 3} ry={r + 2.5} fill={shade(skin, 0.9)} />
<circle r={1.6} cx={f.gazeX * 4 + 1.8} cy={f.gazeY * 3 - 1.8 + cover * 3} fill="#ffffff" opacity={0.85} /> <ellipse rx={rx} ry={r} fill="#fbfaf6" />
{cover > 0.02 && ( <g clipPath={`url(#e${uid}${x})`}>
<g clipPath={`url(#e${uid}${x})`}> <ellipse cx={0} cy={-r * 0.55} rx={rx} ry={r * 0.5} fill="#000" opacity={0.07} />
<rect x={-r - 1} y={-r - 1} width={2 * r + 2} height={2 * r * cover + 1} fill={skin} /> <circle r={Math.max(2.6, 4.6 * f.pupil + 0.6)} cx={f.gazeX * 4.5 + sideSign * 0.6} cy={f.gazeY * 3 + cover * 3.5 + 1} fill="#2a2228" />
<path d={`M${-r} ${-r + 2 * r * cover} Q0 ${-r + 2 * r * cover + 3} ${r} ${-r + 2 * r * cover}`} stroke={shade(skin, 0.6)} strokeWidth={2.6} fill="none" /> <circle r={1.5} cx={f.gazeX * 4.5 + 1.6} cy={f.gazeY * 3 - 1 + cover * 3.5} fill="#ffffff" opacity={0.9} />
</g> {cover > 0.02 && <>
)} <rect x={-rx - 1} y={-r - 1} width={2 * rx + 2} height={2 * r * cover + 1} fill={lidColor} />
<path d={`M${-rx} ${-r + 2 * r * cover} Q0 ${-r + 2 * r * cover + 3.5} ${rx} ${-r + 2 * r * cover}`} stroke={crease} strokeWidth={3} fill="none" />
</>}
</g>
{/* Dobra da pálpebra acima do olho. */}
<path d={`M${-rx * 0.9} ${-r - 3} Q0 ${-r - 8} ${rx * 0.9} ${-r - 3}`} stroke={crease} strokeWidth={2.2} fill="none" strokeLinecap="round" opacity={0.75} />
</g> </g>
); );
}; };
return <g>{eye(82, f.eyeL)}{eye(118, f.eyeR)}</g>; return <g>{eye(81, f.eyeL, -1)}{eye(119, f.eyeR, 1)}</g>;
} }
/** Sobrancelha como FORMA grossa (afina na ponta de fora), girando pelo rig. */
function Brows({ f, thick, color }: { f: FaceParams; thick: boolean; color: string }) { function Brows({ f, thick, color }: { f: FaceParams; thick: boolean; color: string }) {
return ( const h = thick ? 8 : 5.5;
<g stroke={color} strokeWidth={thick ? 7 : 4.5} strokeLinecap="round"> const brow = (x0: number, x1: number, y: number, tilt: number, pivotX: number, inner: number) => {
<line x1={71} y1={89 + f.browL.y} x2={92} y2={89 + f.browL.y} transform={`rotate(${-f.browL.tilt} 92 ${89 + f.browL.y})`} /> // Ponta de dentro (pivô) mais grossa; a de fora afina.
<line x1={108} y1={89 + f.browR.y} x2={129} y2={89 + f.browR.y} transform={`rotate(${f.browR.tilt} 108 ${89 + f.browR.y})`} /> const outer = x0 === pivotX ? x1 : x0;
</g> const d = `M${pivotX} ${y - h * 0.55} Q${(pivotX + outer) / 2} ${y - h * 1.15} ${outer} ${y - h * 0.1} Q${(pivotX + outer) / 2} ${y + h * 0.15} ${pivotX} ${y + h * 0.55} Z`;
); return <path d={d} fill={color} transform={`rotate(${inner * tilt} ${pivotX} ${y})`} />;
} };
function Extras({ f, t }: { f: FaceParams; t: number }) {
return ( return (
<g> <g>
{f.blush > 0.02 && <><ellipse cx={72} cy={124} rx={11} ry={6} fill="#ff6b8b" opacity={0.55 * f.blush} /><ellipse cx={128} cy={124} rx={11} ry={6} fill="#ff6b8b" opacity={0.55 * f.blush} /></>} {brow(68, 93, 88 + f.browL.y, f.browL.tilt, 93, -1)}
{f.sweat && <path d="M146 74 Q152 86 146 92 Q140 86 146 74 Z" fill="#8fd3ff" stroke="#3a8fd0" strokeWidth={1.5} />} {brow(107, 132, 88 + f.browR.y, f.browR.tilt, 107, 1)}
{f.tears && [78, 122].map((x, i) => {
const k = ((t * 1.4 + i * 0.5) % 1);
return <path key={x} d={`M${x} ${116 + k * 26} q4 6 0 9 q-4 -3 0 -9 Z`} fill="#8fd3ff" opacity={1 - k * 0.6} />;
})}
{f.anger && <g stroke="#e8463d" strokeWidth={4} strokeLinecap="round" fill="none"><path d="M128 62 q6 4 12 0" /><path d="M128 74 q6 -4 12 0" /><path d="M128 62 q-4 6 0 12" /><path d="M140 62 q4 6 0 12" /></g>}
</g> </g>
); );
} }
function Beard({ style, color }: { style: CharacterLook["beard"]["style"]; color: string }) { function Extras({ f, t, skin }: { f: FaceParams; t: number; skin: string }) {
return (
<g>
{/* Bochechas: rubor leve sempre; mais forte com vergonha. */}
<ellipse cx={72} cy={126} rx={12} ry={7} fill="#e8707a" opacity={0.16 + 0.45 * f.blush} />
<ellipse cx={128} cy={126} rx={12} ry={7} fill="#e8707a" opacity={0.16 + 0.45 * f.blush} />
{f.sweat && <path d="M148 74 Q155 87 148 94 Q141 87 148 74 Z" fill="#9fdcff" />}
{f.tears && [80, 120].map((x, i) => {
const k = ((t * 1.4 + i * 0.5) % 1);
return <path key={x} d={`M${x} ${118 + k * 26} q4 6 0 9 q-4 -3 0 -9 Z`} fill="#9fdcff" opacity={1 - k * 0.6} />;
})}
{f.anger && <g stroke="#e8463d" strokeWidth={4} strokeLinecap="round" fill="none"><path d="M130 60 q6 4 12 0" /><path d="M130 72 q6 -4 12 0" /><path d="M130 60 q-4 6 0 12" /><path d="M142 60 q4 6 0 12" /></g>}
{skin && null}
</g>
);
}
function Beard({ style, color, uid, side }: { style: CharacterLook["beard"]["style"]; color: string; uid: string; side: number }) {
const strands = (d: string) => <path d={d} stroke={shade(color, 1.18)} strokeWidth={2.2} fill="none" strokeLinecap="round" opacity={0.6} />;
switch (style) { switch (style) {
case "full": return <path d="M56 108 Q58 168 100 172 Q142 168 144 108 Q138 128 124 126 Q100 122 76 126 Q62 128 56 108 Z" fill={color} />; case "full": {
case "stubble": return <path d="M60 116 Q64 162 100 166 Q136 162 140 116 Q130 132 100 128 Q70 132 60 116 Z" fill={color} opacity={0.35} />; const d = "M54 106 Q56 166 100 174 Q144 166 146 106 Q140 128 125 127 Q100 122 75 127 Q60 128 54 106 Z";
case "goatee": return <path d="M88 150 Q100 168 112 150 Q100 156 88 150 Z" fill={color} />; return <g><Cel id={`bd${uid}`} d={d} fill={color} side={side} dx={9} />{strands("M78 150 Q84 162 92 166 M108 166 Q116 162 122 150")}
case "mustache": return <path d="M76 134 Q80 117 100 121 Q120 117 124 134 Q113 128 100 131 Q87 128 76 134 Z" fill={color} />; <path d="M74 136 Q80 118 100 122 Q120 118 126 136 Q113 129 100 132 Q87 129 74 136 Z" fill={shade(color, 0.9)} /></g>;
}
case "stubble": return <path d="M58 116 Q62 164 100 168 Q138 164 142 116 Q130 133 100 129 Q70 133 58 116 Z" fill={color} opacity={0.3} />;
case "goatee": return <g><path d="M86 150 Q100 172 114 150 Q100 157 86 150 Z" fill={color} /><path d="M80 136 Q88 124 100 127 Q112 124 120 136 Q110 131 100 133 Q90 131 80 136 Z" fill={color} /></g>;
case "mustache": return (
<g>
{/* Bigode cheio, com volume (claro em cima, escuro embaixo). */}
<path d="M70 140 Q74 116 100 121 Q126 116 130 140 Q120 131 110 134 Q104 128 100 129 Q96 128 90 134 Q80 131 70 140 Z" fill={color} />
<path d="M72 138 Q80 132 90 134 Q96 128 100 129 Q104 128 110 134 Q120 132 128 138 Q118 137 110 137 Q100 133 90 137 Q80 137 72 138 Z" fill={shade(color, 0.78)} />
{strands("M84 126 L86 131 M96 124 L97 129 M106 124 L105 129 M116 126 L114 131")}
</g>
);
// Barba longa: desce do rosto até o peito em ponta, com fios marcados e bigode por cima.
case "long": {
const d = "M54 104 Q52 152 68 192 Q84 230 100 246 Q116 230 132 192 Q148 152 146 104 Q138 128 124 126 Q100 121 76 126 Q62 128 54 104 Z";
return (
<g>
<Cel id={`bd${uid}`} d={d} fill={color} side={side} dx={12} dy={-2} k={0.84} />
<path d="M80 160 Q84 196 94 222 M100 168 L100 236 M120 160 Q116 196 106 222 M68 140 Q70 170 78 192 M132 140 Q130 170 122 192" stroke={shade(color, 0.82)} strokeWidth={2.6} fill="none" strokeLinecap="round" />
<path d="M72 138 Q80 118 100 122 Q120 118 128 138 Q114 130 100 133 Q86 130 72 138 Z" fill={shade(color, 0.9)} />
</g>
);
}
default: return null; default: return null;
} }
} }
function Nose({ kind, skin }: { kind: NonNullable<CharacterLook["nose"]>; skin: string }) { /** Nariz: traço curvo simples no tom escuro da pele (padrão, como na ilustração) ou formas cheias. */
const dark = shade(skin, 0.72); function Nose({ kind, skin }: { kind: CharacterLook["nose"]; skin: string }) {
const dark = shade(skin, 0.62);
const shadow = <ellipse cx={101} cy={131} rx={9} ry={3} fill={shade(skin, 0.82)} opacity={0.8} />;
switch (kind) { switch (kind) {
case "curve": return <path d="M97 110 Q86 123 95 128 Q101 131 105 126" stroke={dark} strokeWidth={3.6} fill="none" strokeLinecap="round" />; case "round": return <>{shadow}<circle cx={100} cy={121} r={10} fill={shade(skin, 0.93)} /><path d="M92 126 Q100 132 108 126" stroke={dark} strokeWidth={2.8} fill="none" strokeLinecap="round" /><circle cx={96} cy={117} r={2.6} fill="#ffffff" opacity={0.35} /></>;
case "round": return <><circle cx={100} cy={121} r={9} fill={shade(skin, 0.9)} /><circle cx={97} cy={118} r={2.5} fill="#ffffff" opacity={0.35} /></>; case "long": return <>{shadow}<path d="M98 102 Q104 116 106 126 Q101 132 93 128" stroke={dark} strokeWidth={3.4} fill="none" strokeLinecap="round" strokeLinejoin="round" /></>;
case "long": return <path d="M99 104 L104 126 Q100 131 94 127" stroke={dark} strokeWidth={3.4} fill="none" strokeLinecap="round" strokeLinejoin="round" />; case "wide": return <>{shadow}<path d="M88 126 Q92 116 100 116 Q108 116 112 126 Q106 131 100 129 Q94 131 88 126 Z" fill={shade(skin, 0.92)} /><path d="M89 126 Q94 131 100 129 Q106 131 111 126" stroke={dark} strokeWidth={2.6} fill="none" strokeLinecap="round" /></>;
case "wide": return <><ellipse cx={100} cy={123} rx={11} ry={7} fill={shade(skin, 0.9)} /><circle cx={95} cy={125} r={2} fill={dark} /><circle cx={105} cy={125} r={2} fill={dark} /></>; case "button": return <>{shadow}<path d="M95 124 Q100 128 105 124" stroke={dark} strokeWidth={3} fill="none" strokeLinecap="round" /></>;
default: return <ellipse cx={100} cy={123} rx={6} ry={4.5} fill={shade(skin, 0.86)} />; default: return <>{shadow}<path d="M99 106 Q89 121 95 127 Q101 131 107 126" stroke={dark} strokeWidth={3.6} fill="none" strokeLinecap="round" /></>;
} }
} }
function Wrinkles({ k, skin }: { k: number; skin: string }) { function Wrinkles({ k, skin }: { k: number; skin: string }) {
if (k <= 0.05) return null; if (k <= 0.05) return null;
const c = shade(skin, 0.78); const c = shade(skin, 0.8);
return ( return (
<g stroke={c} strokeWidth={3} fill="none" strokeLinecap="round" opacity={Math.min(1, 0.5 + k * 0.5)}> <g stroke={c} strokeWidth={2.6} fill="none" strokeLinecap="round" opacity={Math.min(0.85, 0.4 + k * 0.4)}>
<path d="M80 72 Q100 66 120 72" /> {/* Testa: arcos suaves no tom da pele. */}
{k > 0.35 && <path d="M84 80 Q100 75 116 80" />} <path d="M78 70 Q100 62 122 70" />
{k > 0.5 && <><path d="M62 104 l-6 -3 M62 110 l-7 0" /><path d="M138 104 l6 -3 M138 110 l7 0" /></>} {k > 0.3 && <path d="M83 78 Q100 72 117 78" />}
{k > 0.4 && <><path d="M76 128 Q72 138 76 146" /><path d="M124 128 Q128 138 124 146" /></>} {k > 0.6 && <path d="M88 63 Q100 58 112 63" />}
{k > 0.5 && <><path d="M60 104 l-6 -3 M60 110 l-7 0" /><path d="M140 104 l6 -3 M140 110 l7 0" /></>}
{k > 0.4 && <><path d="M75 126 Q70 137 75 146" /><path d="M125 126 Q130 137 125 146" /><path d="M74 120 Q81 123 88 121" opacity={0.6} /><path d="M112 121 Q119 123 126 120" opacity={0.6} /></>}
</g> </g>
); );
} }
@@ -136,225 +226,559 @@ function Wrinkles({ k, skin }: { k: number; skin: string }) {
/** Formato da cabeça (centro (100,106)). */ /** Formato da cabeça (centro (100,106)). */
function headPath(shape: CharacterLook["head"]): string { function headPath(shape: CharacterLook["head"]): string {
switch (shape) { switch (shape) {
case "oval": return "M100 54 C126 54 143 76 143 106 C143 140 124 160 100 160 C76 160 57 140 57 106 C57 76 74 54 100 54 Z"; case "oval": return "M100 52 C127 52 144 76 144 106 C144 141 124 162 100 162 C76 162 56 141 56 106 C56 76 73 52 100 52 Z";
case "square": return "M100 56 C130 56 147 72 147 100 L146 128 C144 150 126 158 100 158 C74 158 56 150 54 128 L53 100 C53 72 70 56 100 56 Z"; case "square": return "M100 54 C131 54 149 71 149 100 L148 128 C146 151 127 160 100 160 C73 160 54 151 52 128 L51 100 C51 71 69 54 100 54 Z";
case "wide": return "M100 58 C124 58 140 74 143 98 C148 124 140 154 100 158 C60 154 52 124 57 98 C60 74 76 58 100 58 Z"; case "wide": return "M100 56 C128 56 146 72 149 98 C153 128 142 158 100 160 C58 158 47 128 51 98 C54 72 72 56 100 56 Z";
default: return "M100 56 C126 56 147 78 147 106 C147 134 126 156 100 156 C74 156 53 134 53 106 C53 78 74 56 100 56 Z"; default: return "M100 54 C127 54 148 77 148 106 C148 135 127 158 100 158 C73 158 52 135 52 106 C52 77 73 54 100 54 Z";
} }
} }
function Glasses({ kind }: { kind: CharacterLook["glasses"] }) { function Glasses({ kind }: { kind: CharacterLook["glasses"] }) {
if (kind === "none") return null; if (kind === "none") return null;
const frame = kind === "sun" ? "#1c1a20" : "#4a2e1e";
const lens = (x: number) => kind === "square"
? <rect x={x - 17} y={94} width={34} height={28} rx={7} />
: <ellipse cx={x} cy={108} rx={17} ry={15} />;
return ( return (
<g stroke={INK} strokeWidth={4} fill={kind === "sun" ? INK : "none"}> <g>
{kind === "square" <g fill={kind === "sun" ? "#1c1a20" : "#ffffff"} opacity={kind === "sun" ? 0.92 : 0.1}>{lens(81)}{lens(119)}</g>
? <><rect x={67} y={95} width={30} height={25} rx={5} /><rect x={103} y={95} width={30} height={25} rx={5} /></> {/* Reflexo diagonal na lente. */}
: <><circle cx={82} cy={108} r={15} /><circle cx={118} cy={108} r={15} /></>} <g stroke="#ffffff" strokeWidth={3} strokeLinecap="round" opacity={kind === "sun" ? 0.5 : 0.45}><path d="M71 101 L78 96" /><path d="M109 101 L116 96" /></g>
<line x1={97} y1={107} x2={103} y2={107} /> <g stroke={frame} strokeWidth={4.4} fill="none">{lens(81)}{lens(119)}</g>
<line x1={55} y1={104} x2={67} y2={106} /><line x1={133} y1={106} x2={145} y2={104} /> <path d="M97 106 Q100 103 103 106" stroke={frame} strokeWidth={4} fill="none" />
<path d="M52 103 L64 105 M136 105 L148 103" stroke={frame} strokeWidth={5} strokeLinecap="round" />
</g> </g>
); );
} }
function HairFront({ look }: { look: CharacterLook }) { function HairFront({ look, uid, side }: { look: CharacterLook; uid: string; side: number }) {
const c = look.hair.color; const c = look.hair.color;
const lite = shade(c, 1.25);
const cel = (d: string, k = 0.78) => <Cel id={`hf${uid}`} d={d} fill={c} side={side} dx={10} dy={4} k={k} />;
switch (look.hair.style) { switch (look.hair.style) {
case "bald": return <><path d="M53 112 Q50 86 62 80 L62 112 Z" fill={c} /><path d="M147 112 Q150 86 138 80 L138 112 Z" fill={c} /></>; case "bald": return <>{cel("M50 100 Q46 78 64 68 Q72 82 62 100 Z M150 100 Q154 78 136 68 Q128 82 138 100 Z")}</>;
case "short": return <path d="M53 104 Q52 50 100 50 Q148 50 147 104 Q140 76 100 74 Q60 76 53 104 Z" fill={c} />; case "short": return <>{cel("M51 104 Q50 48 100 48 Q150 48 149 104 Q141 74 100 72 Q59 74 51 104 Z")}<path d="M70 62 Q86 56 100 58 M110 56 Q124 58 134 66" stroke={lite} strokeWidth={3} fill="none" strokeLinecap="round" opacity={0.6} /></>;
case "side": return <path d="M53 106 Q50 48 104 50 Q150 54 147 104 Q134 70 92 80 Q66 86 53 106 Z" fill={c} />; case "side": return <>{cel("M51 106 Q48 46 104 48 Q152 52 149 104 Q134 68 92 78 Q64 86 51 106 Z")}<path d="M74 70 Q92 60 120 60" stroke={lite} strokeWidth={3} fill="none" strokeLinecap="round" opacity={0.6} /></>;
case "bun": return <><circle cx={100} cy={46} r={20} fill={c} /><path d="M53 104 Q52 52 100 52 Q148 52 147 104 Q138 74 100 72 Q62 74 53 104 Z" fill={c} /></>; case "bun": return <><circle cx={100} cy={42} r={21} fill={shade(c, 0.9)} />{cel("M51 104 Q50 50 100 50 Q150 50 149 104 Q139 72 100 70 Q61 72 51 104 Z")}</>;
case "long": return <path d="M53 108 Q50 50 100 50 Q150 50 147 108 Q136 72 100 70 Q64 72 53 108 Z" fill={c} />; case "long": return <>{cel("M51 110 Q48 48 100 48 Q152 48 149 110 Q137 70 100 68 Q63 70 51 110 Z")}<path d="M72 64 Q88 56 104 58" stroke={lite} strokeWidth={3} fill="none" strokeLinecap="round" opacity={0.55} /></>;
case "curly": return <g fill={c}>{[[60, 84], [72, 64], [90, 54], [110, 54], [128, 64], [140, 84], [100, 62], [80, 74], [120, 74]].map(([x, y], i) => <circle key={i} cx={x} cy={y} r={15} />)}</g>; case "curly": return <g>{[[58, 86], [70, 64], [89, 52], [111, 52], [130, 64], [142, 86], [100, 62], [79, 74], [121, 74]].map(([x, y], i) => <g key={i}><circle cx={x} cy={y} r={16} fill={shade(c, 0.8)} /><circle cx={x - 3} cy={y - 3} r={12} fill={c} /></g>)}</g>;
case "spiky": return <path d="M54 102 L58 66 L72 76 L80 48 L94 70 L104 44 L114 70 L128 50 L132 76 L146 66 L146 102 Q130 80 100 80 Q70 80 54 102 Z" fill={c} />; case "spiky": return cel("M52 102 L56 64 L71 75 L79 46 L94 69 L104 42 L115 69 L129 48 L133 75 L148 64 L148 102 Q130 79 100 79 Q70 79 52 102 Z");
case "cap": return <><path d="M54 96 Q54 50 100 50 Q146 50 146 96 Z" fill={c} /><path d="M120 92 Q160 92 172 100 L120 102 Z" fill={shade(c, 0.8)} /></>; case "cap": return <><Cel id={`hf${uid}`} d="M52 96 Q52 46 100 46 Q148 46 148 96 Z" fill={c} side={side} dx={10} dy={4} /><path d="M118 92 Q162 90 176 100 L118 103 Z" fill={shade(c, 0.78)} /><circle cx={100} cy={47} r={4} fill={shade(c, 0.7)} /></>;
default: return null; default: return null;
} }
} }
/** Cabeça inteira no sistema antigo (centro ~ (100,106)); `turn` desloca o rosto para fingir 3/4, `nod` sobe/desce. */ /** Cabeça inteira no sistema de 200×440 (centro ~ (100,106)); `turn` desloca o rosto para fingir 3/4, `nod` sobe/desce. */
function Head({ look, f, b, t, uid }: { look: CharacterLook; f: FaceParams; b: BodyParams; t: number; uid: string }) { function Head({ look, f, b, t, uid, side }: { look: CharacterLook; f: FaceParams; b: BodyParams; t: number; uid: string; side: number }) {
const fx = b.headTurn * 9; // Girar/acenar a cabeça: o rosto anda pouco e o contorno da cabeça acompanha um pouco (senão o rosto parece um
const fy = b.headNod * 6; // adesivo descolando). Barba e bigode ficam presos ao queixo (andam junto com o contorno, não com os olhos).
const fx = b.headTurn * 6;
const fy = b.headNod * 4;
const hx = fx * 0.35;
const browColor = look.hair.style === "bald" || look.hair.style === "cap" ? look.beard.color : look.hair.color; const browColor = look.hair.style === "bald" || look.hair.style === "cap" ? look.beard.color : look.hair.color;
const skinDark = shade(look.skin, 0.72);
return ( return (
<g> <g>
{[53, 147].map((x, i) => ( {[52, 148].map((x, i) => (
<g key={x} transform={`translate(${x + b.headTurn * 7} 112) scale(${1 - (i === 0 ? Math.max(0, b.headTurn) : -Math.min(0, b.headTurn)) * 0.5} 1)`}> <g key={x} transform={`translate(${x + b.headTurn * 7} 112) scale(${1 - (i === 0 ? Math.max(0, b.headTurn) : -Math.min(0, b.headTurn)) * 0.5} 1)`}>
<ellipse rx={9} ry={12} fill={shade(look.skin, 0.94)} /> <ellipse rx={11} ry={15} fill={(i === 0 ? -1 : 1) === side ? cool(look.skin, 0.86) : look.skin} />
<path d={i === 0 ? "M3 -6 Q-4 0 3 6" : "M-3 -6 Q4 0 -3 6"} stroke={shade(look.skin, 0.72)} strokeWidth={2.4} fill="none" strokeLinecap="round" /> {/* Dobra interna da orelha em tom escuro. */}
<path d={i === 0 ? "M4 -8 Q-5 -2 1 4 Q5 7 2 10" : "M-4 -8 Q5 -2 -1 4 Q-5 7 -2 10"} stroke={skinDark} strokeWidth={3} fill="none" strokeLinecap="round" />
</g> </g>
))} ))}
<defs><clipPath id={`h${uid}`}><path d={headPath(look.head)} /></clipPath></defs> <g transform={`translate(${hx} 0)`}>
<path d={headPath(look.head)} fill={look.skin} /> <Cel id={`hd${uid}`} d={headPath(look.head)} fill={look.skin} side={side} dx={14} dy={-8} k={0.8} />
{/* Sombra suave do lado de baixo/direito e brilho na testa: volume de ilustração. */} {/* Brilho suave na testa (lado da luz). */}
<g clipPath={`url(#h${uid})`}> <ellipse cx={100 - side * 16} cy={72} rx={20} ry={11} fill="#ffffff" opacity={0.1} />
<ellipse cx={128} cy={140} rx={44} ry={34} fill={shade(look.skin, 0.86)} opacity={0.55} />
<ellipse cx={86} cy={72} rx={22} ry={12} fill="#ffffff" opacity={0.12} />
</g> </g>
<g transform={`translate(${fx} ${fy})`}> <g transform={`translate(${fx} ${fy})`}>
<Wrinkles k={look.wrinkles ?? 0} skin={look.skin} /> <Wrinkles k={look.wrinkles ?? 0} skin={look.skin} />
<Beard style={look.beard.style} color={look.beard.color} /> <Extras f={f} t={t} skin={look.skin} />
<Extras f={f} t={t} /> </g>
{/* Barba presa ao queixo: segue o contorno da cabeça e só um pouco o aceno. */}
<g transform={`translate(${hx} ${fy * 0.4})`}>
<Beard style={look.beard.style} color={look.beard.color} uid={uid} side={side} />
</g>
<g transform={`translate(${fx} ${fy})`}>
<Eyes f={f} lid={(look.lids ?? 0) + f.lid} skin={look.skin} uid={uid} /> <Eyes f={f} lid={(look.lids ?? 0) + f.lid} skin={look.skin} uid={uid} />
{look.nose && <Nose kind={look.nose} skin={look.skin} />} <Nose kind={look.nose} skin={look.skin} />
<Brows f={f} thick={look.brows === "thick"} color={browColor} /> <Brows f={f} thick={look.brows === "thick"} color={browColor} />
<Glasses kind={look.glasses} /> <Glasses kind={look.glasses} />
<Mouth f={f} uid={uid} /> <Mouth f={f} uid={uid} skin={look.skin} />
{(look.beard.style === "full" || look.beard.style === "long") && <path d="M74 136 Q80 118 100 122 Q120 118 126 136 Q113 129 100 132 Q87 129 74 136 Z" fill={shade(look.beard.color, 0.9)} opacity={0} />}
</g> </g>
<g transform={`translate(${fx * 0.4} 0)`}><HairFront look={look} /></g> <g transform={`translate(${fx * 0.4} 0)`}><HairFront look={look} uid={uid} side={side} /></g>
{look.accessories?.includes("helmet") && ( {look.accessories?.includes("helmet") && (
<g transform={`translate(${fx * 0.4} 0)`}> <g transform={`translate(${fx * 0.4} 0)`}>
<path d="M50 92 Q50 42 100 42 Q150 42 150 92 Z" fill={look.accessoryColor ?? "#f2c230"} /> <Cel id={`hm${uid}`} d="M48 92 Q48 38 100 38 Q152 38 152 92 Z" fill={look.accessoryColor ?? "#f2c230"} side={side} dx={12} dy={4} />
<rect x={42} y={88} width={116} height={10} rx={5} fill={shade(look.accessoryColor ?? "#f2c230", 0.85)} /> <rect x={40} y={88} width={120} height={11} rx={5} fill={shade(look.accessoryColor ?? "#f2c230", 0.82)} />
<path d="M100 44 L100 90" stroke={shade(look.accessoryColor ?? "#f2c230", 0.85)} strokeWidth={6} /> <path d="M100 40 L100 90" stroke={shade(look.accessoryColor ?? "#f2c230", 0.85)} strokeWidth={8} />
<ellipse cx={78} cy={56} rx={12} ry={6} fill="#ffffff" opacity={0.3} />
</g> </g>
)} )}
{look.accessories?.includes("headset") && ( {look.accessories?.includes("headset") && (
<g><path d="M52 100 Q52 44 100 44 Q148 44 148 100" stroke={INK} strokeWidth={6} fill="none" /><rect x={142} y={96} width={14} height={26} rx={6} fill={INK} /><path d="M150 120 Q140 142 116 140" stroke={INK} strokeWidth={3} fill="none" /></g> <g><path d="M50 100 Q50 42 100 42 Q150 42 150 100" stroke={INK} strokeWidth={6} fill="none" /><rect x={144} y={96} width={14} height={26} rx={6} fill={INK} /><path d="M152 120 Q142 142 116 140" stroke={INK} strokeWidth={3} fill="none" /></g>
)} )}
</g> </g>
); );
} }
/** Acessórios por cima da roupa (combináveis). Capacete e fone são desenhados na cabeça. */ /**
function Accessories({ look, x0, x1, top, bottom, hipY }: { look: CharacterLook; x0: number; x1: number; top: number; bottom: number; hipY: number }) { * Mão: escolhe a forma desenhada da biblioteca (hands.tsx) pelo estado — gesto, apontar, pegada de borda, punho
const acc = look.accessories ?? []; * segurando, mão no rosto, braço erguido (aberta) ou caída — e a põe no pulso (x, y) com o giro do antebraço (`deg`).
const c = look.accessoryColor; * `scale` = escala do desenho de 120×120. `layer`: com objeto, "back" = atrás dele e "front" = na frente.
*/
function Hand({ x, y, deg, s, skin, curl, point, gesture, scale = 1, uid, light = 1, layer = "all", thumbFront, onFace }: {
x: number; y: number; deg: number; s: number; skin: string; curl: number; point?: boolean; gesture?: "thumbs_up";
scale?: number; uid: string; light?: number; layer?: "all" | "back" | "front";
/** Pegada de borda (objeto largo, em par): dedos atrás do objeto e só o polegar por cima dele. */
thumbFront?: boolean;
/** Mão apoiada no rosto (queixo, boca, testa). */
onFace?: boolean;
}) {
const raised = Math.cos((deg * Math.PI) / 180) < -0.2;
// Joinha só com o antebraço perto do ângulo para o qual o desenho foi feito (subindo na diagonal); fora disso,
// o polegar apontaria para o lado: vira punho fechado.
const thumbOk = Math.abs(((deg - 135 * (s >= 0 ? 1 : -1) + 540) % 360) - 180) <= 70;
const shape: HandShape = gesture === "thumbs_up" ? (thumbOk ? "thumbs_up" : "fist") : point ? "point" : thumbFront ? (raised ? "pinch_low" : "pinch_edge")
: curl >= 0.6 ? "grip" : onFace ? "on_face" : raised ? "open" : "relaxed";
return <HandArt shape={shape} x={x} y={y} foreDeg={deg} s={s} k={scale} skin={skin} light={light} layer={layer} uid={uid} />;
}
/**
* Fim da manga: barra (punho) com espessura e dobra, a abertura escura por dentro e o pulso saindo DE DENTRO dela,
* com a sombra da manga caindo sobre a pele. Eixo local: (x, y) = borda da manga, +y = para fora (para a mão).
* `w` = largura da manga na borda. Sem `cuff` (manga curta), a barra fica no tom escuro do pano.
*/
export function SleeveEnd({ x, y, deg, w, cloth, cuff, skin, wrist, light, uid, scale = 1, part = "all" }: {
x: number; y: number; deg: number; w: number; cloth: string; cuff?: string; skin: string; wrist: number; light: number; uid: string; scale?: number;
/** "back" = abertura escura (e o pulso, se `wrist` > 0), antes da mão; "front" = sombra no pulso e barra, depois. */
part?: "all" | "back" | "front";
}) {
const up = Math.cos((deg * Math.PI) / 180) >= 0;
const band = cuff ?? shade(cloth, 0.86);
const h = cuff ? 7.5 : 5;
return ( return (
<g> <g transform={`translate(${x} ${y}) rotate(${deg}) scale(${scale})`}>
{acc.includes("vest") && <> {/* Abertura da manga (o escuro de dentro) e o pulso saindo dela. */}
<path d={`M${x0 + 2} ${top + 8} L${x0 + 30} ${top + 4} L${x0 + 30} ${bottom} L${x0 + 2} ${bottom} Z`} fill={c ?? "#ff8a2a"} /> {part !== "front" && <>
<path d={`M${x1 - 2} ${top + 8} L${x1 - 30} ${top + 4} L${x1 - 30} ${bottom} L${x1 - 2} ${bottom} Z`} fill={c ?? "#ff8a2a"} /> <ellipse cx={0} cy={0} rx={w * 0.5} ry={w * 0.17} fill={shade(cloth, 0.32)} />
<rect x={x0 + 2} y={hipY - 70} width={x1 - x0 - 4} height={8} fill="#d9dde3" opacity={0.95} /> {wrist > 0 && <rect x={-wrist / 2} y={-1.5} width={wrist} height={7} fill={skin} />}
<rect x={x0 + 2} y={hipY - 40} width={x1 - x0 - 4} height={8} fill="#d9dde3" opacity={0.95} /> </>}
{part !== "back" && <>
{/* Sombra da manga caindo no pulso e a barra do punho por cima da sobra do pulso. */}
<path d={`M${-8.6} -1.5 L${8.6} -1.5 L${8.6} 2.2 Q0 4.4 ${-8.6} 2.2 Z`} fill={cool(skin, 0.72)} opacity={0.9} />
<Cel id={`cf${uid}`} d={`M${-w / 2} ${-h} L${w / 2} ${-h} Q${w / 2 + 1} 0 ${w / 2} 0.6 Q0 2.4 ${-w / 2} 0.6 Q${-w / 2 - 1} 0 ${-w / 2} ${-h} Z`}
fill={band} side={up ? light : -light} dx={w * 0.22} dy={0} k={0.8} />
<path d={`M${-w / 2 + 1.5} ${-h + 2.2} Q0 ${-h + 3.6} ${w / 2 - 1.5} ${-h + 2.2}`} stroke={shade(band, 0.78)} strokeWidth={1.2} fill="none" strokeLinecap="round" />
</>} </>}
{acc.includes("apron") && <path d={`M${x0 + 10} ${top + 30} L${x1 - 10} ${top + 30} L${x1 - 4} ${hipY + 70} L${x0 + 4} ${hipY + 70} Z`} fill={c ?? "#e9ecef"} />}
{acc.includes("tie") && <><path d={`M95 ${top + 4} L105 ${top + 4} L102 ${top + 14} L98 ${top + 14} Z`} fill={c ?? "#2b3a67"} /><path d={`M98 ${top + 14} L102 ${top + 14} L108 ${top + 80} L100 ${top + 92} L92 ${top + 80} Z`} fill={c ?? "#2b3a67"} /></>}
{acc.includes("scarf") && <><rect x={82} y={top - 6} width={36} height={16} rx={7} fill={c ?? "#c8443a"} /><rect x={104} y={top + 6} width={12} height={40} rx={5} fill={c ?? "#c8443a"} /></>}
{acc.includes("whistle") && <><path d={`M86 ${top + 4} L100 ${top + 52} L114 ${top + 4}`} stroke="#e8463d" strokeWidth={2.5} fill="none" /><rect x={94} y={top + 50} width={14} height={9} rx={4} fill="#c0c4cc" /></>}
{acc.includes("chain") && <path d={`M84 ${top + 4} Q100 ${top + 48} 116 ${top + 4}`} stroke="#d4a63a" strokeWidth={3.5} fill="none" strokeDasharray="4 2" />}
{acc.includes("badge") && <rect x={x0 + 14} y={top + 26} width={18} height={12} rx={2} fill={c ?? "#d4a63a"} />}
{acc.includes("towel") && <path d={`M${x1 - 26} ${top - 4} Q${x1 - 6} ${top - 6} ${x1 - 4} ${top + 12} L${x1 - 10} ${hipY - 20} L${x1 - 34} ${hipY - 24} L${x1 - 36} ${top + 6} Z`} fill={c ?? "#efe6d2"} stroke={shade(c ?? "#efe6d2", 0.85)} strokeWidth={2} />}
</g> </g>
); );
} }
export function CharacterFigure({ look = DEFAULT_LOOK, expression, pose, item, t = 0, state }: { /**
* Acessórios em camadas: "torso" = parte da roupa (colete, avental), por baixo de qualquer braço; "chest" = sobre o
* peito (toalha, cachecol, gravata, apito, corrente, crachá), entre o braço ao lado do corpo e o braço na frente do
* peito; "drape" = o pano da toalha apoiado no ombro, sempre por cima da raiz do braço daquele lado.
*/
function Accessories({ look, x0, x1, top, bottom, hipY, side, part, uid }: { look: CharacterLook; x0: number; x1: number; top: number; bottom: number; hipY: number; side: number; part: "torso" | "chest" | "drape"; uid: string }) {
const acc = look.accessories ?? [];
const c = look.accessoryColor;
if (part === "drape") return acc.includes("towel") ? <TowelDrape x1={x1} top={top} color={c ?? "#efe8d6"} side={side} uid={uid} /> : null;
if (part === "chest") {
return (
<g>
{acc.includes("tie") && <><path d={`M95 ${top + 6} L105 ${top + 6} L102 ${top + 16} L98 ${top + 16} Z`} fill={c ?? "#2b3a67"} /><path d={`M98 ${top + 16} L102 ${top + 16} L109 ${top + 82} L100 ${top + 94} L91 ${top + 82} Z`} fill={c ?? "#2b3a67"} /><path d={`M100 ${top + 16} L100 ${top + 92}`} stroke={shade(c ?? "#2b3a67", 0.75)} strokeWidth={2} /></>}
{acc.includes("scarf") && <><rect x={78} y={top - 6} width={44} height={18} rx={8} fill={c ?? "#c8443a"} /><rect x={106} y={top + 8} width={13} height={44} rx={5} fill={shade(c ?? "#c8443a", 0.85)} /></>}
{acc.includes("whistle") && <><path d={`M86 ${top + 4} L100 ${top + 54} L114 ${top + 4}`} stroke="#e8463d" strokeWidth={2.8} fill="none" /><rect x={93} y={top + 52} width={16} height={10} rx={4} fill="#c0c4cc" /><rect x={93} y={top + 52} width={16} height={4} rx={2} fill="#ffffff" opacity={0.5} /></>}
{acc.includes("chain") && <path d={`M84 ${top + 4} Q100 ${top + 48} 116 ${top + 4}`} stroke="#d4a63a" strokeWidth={3.5} fill="none" strokeDasharray="4 2" />}
{acc.includes("badge") && <><rect x={x0 + 16} y={top + 28} width={20} height={14} rx={2} fill={c ?? "#d4a63a"} /><rect x={x0 + 19} y={top + 31} width={8} height={8} rx={1} fill="#ffffff" opacity={0.6} /></>}
{acc.includes("towel") && <TowelBody x1={x1} top={top} hipY={hipY} color={c ?? "#efe8d6"} side={side} uid={uid} />}
</g>
);
}
return (
<g>
{acc.includes("vest") && <>
<path d={`M${x0 + 4} ${top + 12} L${x0 + 32} ${top + 6} L${x0 + 30} ${bottom} L${x0 + 6} ${bottom} Z`} fill={c ?? "#ff8a2a"} />
<path d={`M${x1 - 4} ${top + 12} L${x1 - 32} ${top + 6} L${x1 - 30} ${bottom} L${x1 - 6} ${bottom} Z`} fill={shade(c ?? "#ff8a2a", side > 0 ? 0.82 : 1)} />
<rect x={x0 + 4} y={hipY - 66} width={28} height={9} fill="#e3e6ea" /><rect x={x1 - 32} y={hipY - 66} width={28} height={9} fill="#cfd3d8" />
<rect x={x0 + 4} y={hipY - 36} width={28} height={9} fill="#e3e6ea" /><rect x={x1 - 32} y={hipY - 36} width={28} height={9} fill="#cfd3d8" />
</>}
{acc.includes("apron") && <path d={`M${x0 + 14} ${top + 34} L${x1 - 14} ${top + 34} L${x1 - 6} ${hipY + 70} L${x0 + 6} ${hipY + 70} Z`} fill={c ?? "#eceae3"} />}
</g>
);
}
/**
* Toalha no ombro, parte de baixo: pano largo caindo pela frente do peito, com volume (sombra cel), dobras, listras
* e franja na ponta, e a sombra que ela faz no casaco.
*/
function TowelBody({ x1, top, hipY, color, side, uid }: { x1: number; top: number; hipY: number; color: string; side: number; uid: string }) {
const end = hipY - 18;
const d = `M${x1 - 47} ${top + 6} C${x1 - 44} ${top + 40} ${x1 - 49} ${end - 30} ${x1 - 47} ${end} L${x1 - 9} ${end + 4} C${x1 - 8} ${end - 30} ${x1 - 4} ${top + 40} ${x1 - 6} ${top + 10} Z`;
const stripe = shade(color, 0.72);
return (
<g>
{/* Sombra do pano no casaco (lado de dentro). */}
<path d={`M${x1 - 47} ${top + 10} C${x1 - 44} ${top + 40} ${x1 - 49} ${end - 30} ${x1 - 47} ${end} L${x1 - 53} ${end - 2} C${x1 - 54} ${end - 30} ${x1 - 50} ${top + 40} ${x1 - 52} ${top + 12} Z`} fill="#000000" opacity={0.16} />
<Cel id={`tw${uid}`} d={d} fill={color} side={side} dx={9} dy={0} k={0.82} />
{/* Dobras verticais do pano. */}
<path d={`M${x1 - 33} ${top + 16} C${x1 - 31} ${top + 50} ${x1 - 35} ${end - 30} ${x1 - 33} ${end - 6} M${x1 - 20} ${top + 18} C${x1 - 18} ${top + 52} ${x1 - 22} ${end - 30} ${x1 - 20} ${end - 4}`} stroke={shade(color, 0.86)} strokeWidth={2.4} fill="none" strokeLinecap="round" />
{/* Duas listras perto da ponta e a franja. */}
<path d={`M${x1 - 47.5} ${end - 22} L${x1 - 8.5} ${end - 18} M${x1 - 47.5} ${end - 13} L${x1 - 8.5} ${end - 9}`} stroke={stripe} strokeWidth={3.2} />
<path d={Array.from({ length: 7 }, (_, i) => { const x = x1 - 45 + i * 5.6; const y = end + 0.6 + i * 0.6; return `M${x} ${y} L${x - 0.6} ${y + 5}`; }).join(" ")} stroke={shade(color, 0.8)} strokeWidth={2} strokeLinecap="round" />
</g>
);
}
/** Toalha no ombro, parte de cima: a dobra arredondada sobre o ombro, por cima da raiz do braço. */
function TowelDrape({ x1, top, color, side, uid }: { x1: number; top: number; color: string; side: number; uid: string }) {
// Pano dobrado deitado sobre o ombro (segue a linha do ombro, não sobe no pescoço) e caindo um pouco para trás.
const d = `M${x1 - 48} ${top + 10} C${x1 - 44} ${top - 4} ${x1 - 16} ${top - 9} ${x1 + 4} ${top - 4} C${x1 + 14} ${top} ${x1 + 17} ${top + 12} ${x1 + 13} ${top + 24}`
+ ` C${x1 + 9} ${top + 29} ${x1 + 2} ${top + 27} ${x1} ${top + 20} C${x1 - 6} ${top + 8} ${x1 - 28} ${top + 6} ${x1 - 48} ${top + 16} Z`;
return (
<g>
<Cel id={`td${uid}`} d={d} fill={shade(color, 1.03)} side={side} dx={6} dy={-2} k={0.8} />
{/* Dobra do pano por cima do ombro e a borda de baixo que cai para trás. */}
<path d={`M${x1 - 40} ${top + 7} C${x1 - 28} ${top - 1} ${x1 - 8} ${top - 3} ${x1 + 6} ${top + 5}`} stroke={shade(color, 0.84)} strokeWidth={2} fill="none" strokeLinecap="round" />
<path d={`M${x1 + 13} ${top + 24} C${x1 + 9} ${top + 29} ${x1 + 2} ${top + 27} ${x1} ${top + 20}`} stroke={shade(color, 0.7)} strokeWidth={2} fill="none" strokeLinecap="round" />
</g>
);
}
export function CharacterFigure({ look = DEFAULT_LOOK, expression, pose, item, t = 0, state, shadeSide = 1, gesture }: {
look?: CharacterLook; expression?: string; pose?: string; item?: IconId; t?: number; look?: CharacterLook; expression?: string; pose?: string; item?: IconId; t?: number;
/** Gesto da mão direita quando ela não segura nem aponta ("thumbs_up" = polegar para cima). */
gesture?: "thumbs_up";
/** Estado calculado pela linha do tempo (motion.ts). Sem ele: expressão/pose pedidas + piscar/respirar. */ /** Estado calculado pela linha do tempo (motion.ts). Sem ele: expressão/pose pedidas + piscar/respirar. */
state?: Pick<ActorState, "face" | "body" | "emote">; state?: Pick<ActorState, "face" | "body" | "emote">;
/** Lado da sombra no desenho (1 = direita, -1 = esquerda). Quem espelha o personagem inverte para a luz ficar
* do mesmo lado da cena. */
shadeSide?: 1 | -1;
}) { }) {
const uid = useId().replace(/:/g, ""); const uid = useId().replace(/:/g, "");
const st = state ?? evaluate({ x: 0, expression, pose }, t, 3600, 1); const st = state ?? evaluate({ x: 0, expression, pose }, t, 3600, 1);
const f = st.face; const f = st.face;
const b = st.body; // Objeto largo (livro, tábua) vai nas DUAS mãos: os dois braços vão para a pose de segurar pelas bordas.
const w = look.build === "slim" ? 0.86 : look.build === "heavy" ? 1.22 : 1; const twoHanded = !!item && TWO_HANDED.includes(item) && (st.body.armR.raise > 20 || st.body.armR.bend > 40);
const b: BodyParams = twoHanded ? { ...st.body, armL: { ...POSE_PRESETS.hold_both.arms }, armR: { ...POSE_PRESETS.hold_both.arms } } : st.body;
const gest = gesture ?? (pose === "thumbs_up" ? "thumbs_up" : undefined);
/** Escala do desenho da mão (quadro 120×120): mão ≈ do nariz ao queixo. */
const HAND_K = 0.62;
const side = shadeSide;
const w = look.build === "slim" ? 0.86 : look.build === "heavy" ? 1.2 : 1;
const breathe = Math.sin(t * 2.2) * 1.4; const breathe = Math.sin(t * 2.2) * 1.4;
const top = look.top;
// Quadril desce ao sentar; coxas abrem e encurtam (perspectiva), canelas voltam para baixo. // Quadril desce ao sentar; coxas abrem e encurtam (perspectiva), canelas voltam para baixo.
const hipY = 290 + b.crouch * 62; const hipY = 306 + b.crouch * 56;
const legW = 20 * w; const legW = 30 * w;
const pants = look.top.style === "dress" || look.bottom.style !== "pants" ? look.skin : look.bottom.color; const longTop = top.style === "dress" || top.style === "robe";
const pants = longTop || look.bottom.style !== "pants" ? look.skin : look.bottom.color;
const footwear = look.footwear ?? "shoes";
const thighLen = 62 * (1 - 0.72 * b.crouch);
const leg = (s: 1 | -1, l: Limb) => { const leg = (s: 1 | -1, l: Limb) => {
const hx = 100 + s * 20 * w; const hx = 100 + s * 24 * w;
const thighDeg = -s * (l.raise + b.crouch * 55); const thighDeg = -s * (l.raise + b.crouch * 55);
const knee = tip(hx, hipY, thighDeg, 72 * (1 - 0.72 * b.crouch)); const knee = tip(hx, hipY, thighDeg, thighLen);
const shinDeg = thighDeg + s * (l.bend + b.crouch * 55); const shinDeg = thighDeg + s * (l.bend + b.crouch * 55);
const foot = tip(knee.x, knee.y, shinDeg, 68); const foot = tip(knee.x, knee.y, shinDeg, 58);
const shorts = look.bottom.style === "shorts" && look.top.style !== "dress"; const shorts = look.bottom.style === "shorts" && !longTop;
const fw = legW + 14;
const fy = foot.y + 2;
return ( return (
<g key={s}> <g key={s}>
<Segment x={hx} y={hipY} deg={thighDeg} len={72 * (1 - 0.72 * b.crouch)} w={legW} fill={shorts ? look.bottom.color : pants} /> <Limb2 id={`th${uid}${s}`} x={hx} y={hipY} deg={thighDeg} len={thighLen} w1={legW + 4} w2={legW * 0.92} fill={shorts ? look.bottom.color : pants} side={side} />
<Segment x={knee.x} y={knee.y} deg={shinDeg} len={68} w={legW * 0.95} fill={pants} /> <Limb2 id={`sh${uid}${s}`} x={knee.x} y={knee.y} deg={shinDeg} len={58} w1={legW * 0.92} w2={legW * 0.78} fill={pants} side={side} />
<rect x={foot.x - legW * 0.5 - (s < 0 ? 6 : 0)} y={foot.y - 8} width={legW + 10} height={16} rx={7} fill={look.shoes} /> {/* Barra da calça. */}
{pants !== look.skin && <rect x={foot.x - legW * 0.48} y={foot.y - 9} width={legW * 0.96} height={6} rx={3} fill={shade(pants, 0.8)} />}
{footwear === "shoes" && <>
<path d={`M${foot.x - fw / 2} ${fy + 6} Q${foot.x - fw / 2} ${fy - 12} ${foot.x} ${fy - 12} Q${foot.x + fw / 2} ${fy - 12} ${foot.x + fw / 2} ${fy + 6} Z`} fill={look.shoes} />
<rect x={foot.x - fw / 2 - 1} y={fy + 3} width={fw + 2} height={6} rx={3} fill={shade(look.shoes, look.shoes === "#f2f2f2" ? 0.8 : 0.6)} />
<ellipse cx={foot.x - side * 4} cy={fy - 6} rx={fw * 0.2} ry={3} fill="#ffffff" opacity={0.22} />
</>}
{footwear !== "shoes" && <path d={`M${foot.x - fw / 2 + 3} ${fy + 6} Q${foot.x - fw / 2 + 3} ${fy - 10} ${foot.x} ${fy - 10} Q${foot.x + fw / 2 - 3} ${fy - 10} ${foot.x + fw / 2 - 3} ${fy + 6} Z`} fill={shade(look.skin, 0.95)} />}
{/* Sandália: sola fina e duas tiras cruzando o peito do pé. */}
{footwear === "sandals" && <>
<rect x={foot.x - fw / 2 + 1} y={fy + 3} width={fw - 2} height={6} rx={3} fill={look.shoes} />
<path d={`M${foot.x - fw / 2 + 6} ${fy - 6} L${foot.x + fw / 2 - 6} ${fy + 3} M${foot.x + fw / 2 - 6} ${fy - 6} L${foot.x - fw / 2 + 6} ${fy + 3}`} stroke={look.shoes} strokeWidth={3.6} strokeLinecap="round" />
</>}
</g> </g>
); );
}; };
const sx = 34 * w; const shY = hipY - 100;
const shY = hipY - 122; const torsoTop = hipY - 114;
const longSleeve = ["jacket", "hoodie", "uniform"].includes(look.top.style); const longSleeve = ["jacket", "hoodie", "uniform", "robe"].includes(top.style);
const sleeve = look.top.style === "dress" ? look.skin : look.top.color; const sleeve = top.style === "dress" ? look.skin : top.color;
const arm = (s: 1 | -1, l: Limb, holds?: IconId) => { const holdItem = !twoHanded && (b.armR.raise > 20 || b.armR.bend > 40) ? item : undefined;
const x = 100 + s * sx; const arm = (s: 1 | -1, l: Limb, holds?: IconId, part: "all" | "upper" | "lower" = "all") => {
const x = 100 + s * 54 * w;
const upperDeg = -s * l.raise; const upperDeg = -s * l.raise;
const elbow = tip(x, shY, upperDeg, 54); const elbow = tip(x, shY, upperDeg, 56);
const foreDeg = upperDeg + s * l.bend; const foreDeg = upperDeg + s * l.bend;
const hand = tip(elbow.x, elbow.y, foreDeg, 50); // Aponta com o braço esticado para a frente (point, reach); erguido acima da cabeça (wave, arms_up) a mão fica aberta.
const pointing = !holds && s > 0 && l.raise > 60 && l.raise < 125 && Math.abs(l.bend) < 30;
// Manga longa termina numa borda (punho) e o pulso sai de dentro dela; manga curta: o braço segue em pele até a
// mão. A mão nasce do pulso, com a mesma pele e a mesma luz do rosto.
const HAND = HAND_K;
const cuffL = 40;
const wristL = longSleeve ? 43 : 41;
const wrist = tip(elbow.x, elbow.y, foreDeg, wristL);
// Objeto de uma mão: o cabo passa por dentro do punho (ponto `hold` da forma "grip"), em pé.
const gp = handPlacement("grip", wrist.x, wrist.y, foreDeg, s, HAND);
const gi = holds ? (GRIP[holds] ?? { x: 50, y: 60, rot: 0 }) : null;
const cuffEnd = tip(elbow.x, elbow.y, foreDeg, cuffL);
const bareArm = !longSleeve;
// Borda de dentro do braço no tom escuro do pano: separa o braço caído do tronco da mesma cor.
const innerEdge = (px: number, py: number, d: number, len: number, w1: number, w2: number, color: string) => {
const ix = Math.cos((d * Math.PI) / 180) >= 0 ? -s : s;
return <path d={`M${(ix * w1) / 2} 3 L${(ix * w2) / 2} ${len - 2}`} transform={`translate(${px} ${py}) rotate(${d})`} stroke={shade(color, 0.55)} strokeWidth={2.4} strokeLinecap="round" opacity={0.85} />;
};
const hand = { x: wrist.x, y: wrist.y, deg: foreDeg, s, skin: look.skin, light: side, scale: HAND, uid: `${uid}${s}`, onFace: (s > 0 ? layerR : layerL) === "face" };
// Parte de cima (braço e manga curta) e de baixo (antebraço, punho, mão e objeto) podem ir em camadas diferentes:
// o antebraço que cruza o peito passa por cima do pano no ombro, a raiz do braço fica por baixo dele.
const up = part !== "lower";
const low = part !== "upper";
return ( return (
<g key={s}> <g key={`${s}${part}`}>
<Segment x={x} y={shY} deg={upperDeg} len={54} w={18} fill={sleeve} /> {up && <>
<Segment x={elbow.x} y={elbow.y} deg={foreDeg} len={50} w={16} fill={longSleeve ? sleeve : look.skin} /> <Limb2 id={`ua${uid}${s}`} x={x} y={shY} deg={upperDeg} len={56} w1={33 * Math.max(0.9, w * 0.95)} w2={26} fill={bareArm && top.style !== "dress" ? look.skin : sleeve} side={side} />
<circle cx={hand.x} cy={hand.y} r={11} fill={look.skin} /> {!bareArm && innerEdge(x, shY, upperDeg, 56, 33 * Math.max(0.9, w * 0.95), 26, sleeve)}
<ellipse cx={hand.x - s * 8} cy={hand.y - 6} rx={4.5} ry={7} fill={shade(look.skin, 0.94)} transform={`rotate(${-s * 25} ${hand.x - s * 8} ${hand.y - 6})`} /> {!longSleeve && top.style !== "dress" && <>
{s < 0 && look.accessories?.includes("watch") && <rect x={hand.x - 9} y={hand.y - 22} width={18} height={8} rx={3} fill="#d4a63a" />} {/* Manga curta com a ponta reta (borda de pano), não arredondada: o braço sai de dentro dela. */}
{holds && <svg x={hand.x - 26} y={hand.y - 30} width={52} height={52} viewBox="0 0 100 100" overflow="visible"><Icon id={holds} /></svg>} <Cel id={`sl${uid}${s}`} d="M-18.5 0 L-16.2 34 Q0 35.6 16.2 34 L18.5 0 A18.5 18.5 0 0 0 -18.5 0 Z" fill={sleeve}
side={Math.cos((upperDeg * Math.PI) / 180) >= 0 ? side : -side} dx={11} dy={0} transform={`translate(${x} ${shY - 2}) rotate(${upperDeg})`} />
{innerEdge(x, shY - 2, upperDeg, 34, 37, 32.4, sleeve)}
{(() => { const e = tip(x, shY - 2, upperDeg, 34.4); return <SleeveEnd x={e.x} y={e.y} deg={upperDeg} w={32.6} cloth={sleeve} skin={look.skin} wrist={28} light={side} uid={`${uid}s${s}`} />; })()}
</>}
</>}
{low && <>
{longSleeve
? <Limb2 id={`fa${uid}${s}`} x={elbow.x} y={elbow.y} deg={foreDeg} len={cuffL - 11} w1={25} w2={23} fill={sleeve} side={side} />
: <Limb2 id={`fa${uid}${s}`} x={elbow.x} y={elbow.y} deg={foreDeg} len={wristL + 4} w1={22} w2={17} fill={look.skin} side={side} />}
{longSleeve && innerEdge(elbow.x, elbow.y, foreDeg, cuffL - 6, 25, 23, sleeve)}
{/* Dobra no cotovelo e punho da manga. */}
{longSleeve && <path d={`M${elbow.x - 7} ${elbow.y - 3} Q${elbow.x} ${elbow.y + 3} ${elbow.x + 7} ${elbow.y - 3}`} stroke={shade(sleeve, 0.72)} strokeWidth={2.4} fill="none" strokeLinecap="round" transform={`rotate(${foreDeg} ${elbow.x} ${elbow.y})`} />}
{/* Punho da manga com espessura e a abertura escura; o pulso sai de dentro, com a sombra da manga por cima. */}
{longSleeve && <SleeveEnd x={cuffEnd.x} y={cuffEnd.y} deg={foreDeg} w={25.5} cloth={sleeve} skin={look.skin} wrist={0} light={side} uid={`${uid}${s}`} part="back" />}
{s < 0 && look.accessories?.includes("watch") && (() => { const c = tip(elbow.x, elbow.y, foreDeg, wristL + 1); return <rect x={c.x - 10} y={c.y - 4.5} width={20} height={8} rx={3} fill="#d4a63a" transform={`rotate(${foreDeg} ${c.x} ${c.y})`} />; })()}
{/* Segurando: dorso atrás do objeto, dedos dobrados e polegar por cima dele. */}
{holds && gi && gp.hold && (
<g transform={`translate(${gp.hold.x} ${gp.hold.y}) rotate(${gp.rot + gi.rot}) scale(0.88) translate(${-gi.x} ${-gi.y})`}>
<svg width={100} height={100} viewBox="0 0 100 100" overflow="visible"><Icon id={holds} /></svg>
</g>
)}
{/* Duas mãos num objeto largo: aqui só a parte de trás (dedos atrás do objeto); objeto e polegares depois. */}
{twoHanded && <Hand {...hand} curl={1} thumbFront layer="back" />}
{!twoHanded && <Hand {...hand} curl={holds ? 1 : 0.35} point={pointing} gesture={s > 0 && !holds && !pointing ? gest : undefined} layer={holds ? "front" : "all"} />}
{longSleeve && <SleeveEnd x={cuffEnd.x} y={cuffEnd.y} deg={foreDeg} w={25.5} cloth={sleeve} skin={look.skin} wrist={17} light={side} uid={`${uid}${s}`} part="front"
cuff={top.style === "uniform" || top.style === "jacket" ? (top.accent ?? shade(sleeve, 0.8)) : undefined} />}
</>}
</g> </g>
); );
}; };
// Mão perto do rosto (pensar, tapar a boca, mão na testa) é desenhada por cima da cabeça. // Profundidade de cada braço pelo estado do rig (limbs.ts): ao lado do corpo, na frente do peito ou no rosto.
const handOnFace = b.armR.raise < 45 && b.armR.bend > 135; // Com o personagem de frente, braço e mão nunca somem atrás do tronco, de acessório ou da barba.
const layerL = armLayer(b, -1, { w, holds: twoHanded });
const layerR = armLayer(b, 1, { w, holds: !!holdItem || twoHanded });
// Objeto largo: entre as duas pegadas de borda, na frente do tronco; os polegares por cima dele.
const twoHand = () => {
if (!twoHanded || !item) return null;
const grab = (s: 1 | -1) => {
const l = s > 0 ? b.armR : b.armL;
const upperDeg = -s * l.raise;
const elbow = tip(100 + s * 54 * w, shY, upperDeg, 56);
const foreDeg = upperDeg + s * l.bend;
const wrist = tip(elbow.x, elbow.y, foreDeg, longSleeve ? 43 : 41);
return { s, wrist, foreDeg, hold: handPlacement("pinch_edge", wrist.x, wrist.y, foreDeg, s, HAND_K).hold! };
};
const [L, R] = [grab(-1), grab(1)];
// Borda do desenho do ícone (fração da largura): o livro vai de 8 a 92, a tábua de 14 a 86.
const span = item === "tablet" ? 0.72 : 0.84;
const size = Math.abs(R.hold.x - L.hold.x) / span;
const cx = (L.hold.x + R.hold.x) / 2;
const cy = (L.hold.y + R.hold.y) / 2;
return <>
<svg x={cx - size / 2} y={cy - size * 0.56} width={size} height={size} viewBox="0 0 100 100" overflow="visible"><Icon id={item} /></svg>
{[L, R].map((g) => <Hand key={g.s} x={g.wrist.x} y={g.wrist.y} deg={g.foreDeg} s={g.s} skin={look.skin} light={side} scale={HAND_K} uid={`${uid}${g.s}`} curl={1} thumbFront layer="front" />)}
</>;
};
// Braço "side" inteiro na camada dele; braço "front"/"face": a raiz junto com os de lado (por baixo do pano do
// ombro) e o antebraço/mão na camada própria (por cima do pano, do peito ou do rosto).
const arms = (layer: string) => <>
{layer === "side" && <>
{layerL === "side" ? arm(-1, b.armL) : arm(-1, b.armL, undefined, "upper")}
{layerR === "side" ? arm(1, b.armR, holdItem) : arm(1, b.armR, undefined, "upper")}
</>}
{layer !== "side" && layerL === layer && arm(-1, b.armL, undefined, "lower")}
{layer !== "side" && layerR === layer && arm(1, b.armR, layer === "face" ? undefined : holdItem, "lower")}
</>;
const top = look.top; const x0 = 100 - 56 * w;
const x0 = 100 - 36 * w; const x1 = 100 + 56 * w;
const x1 = 100 + 36 * w; const torsoBottom = top.style === "dress" ? hipY + 58 : top.style === "robe" ? hipY + 108 - b.crouch * 40 : hipY + 6;
const torsoTop = hipY - 134; const flare = top.style === "dress" ? 16 : top.style === "robe" ? 20 : 0;
const torsoBottom = top.style === "dress" ? hipY + 55 : hipY;
const flare = top.style === "dress" ? 14 : 0;
const accent = top.accent ?? shade(top.color, 1.3); const accent = top.accent ?? shade(top.color, 1.3);
const belly = !!look.belly; const bulge = look.belly ? 14 : look.build === "heavy" ? 8 : 2;
const torsoPath = `M${x0} ${torsoTop + 16} Q${x0} ${torsoTop + 2} ${x0 + 14} ${torsoTop} L${x1 - 14} ${torsoTop} Q${x1} ${torsoTop + 2} ${x1} ${torsoTop + 16} L${x1 + flare} ${torsoBottom} L${x0 - flare} ${torsoBottom} Z`; // Tronco em "pera": ombros redondos, cintura e barriga mais largas embaixo.
const holdItem = b.armR.raise > 20 || b.armR.bend > 40 ? item : undefined; const torsoPath = `M${100 - 36 * w} ${torsoTop} C${x0 - 6} ${torsoTop + 2} ${x0 - 8} ${torsoTop + 34} ${x0 - 2} ${torsoTop + 62}`
+ ` C${x0 - bulge} ${torsoTop + 88} ${x0 - flare - bulge * 0.6} ${torsoBottom - 10} ${x0 - flare + 2} ${torsoBottom}`
+ ` L${x1 + flare - 2} ${torsoBottom} C${x1 + flare + bulge * 0.6} ${torsoBottom - 10} ${x1 + bulge} ${torsoTop + 88} ${x1 + 2} ${torsoTop + 62}`
+ ` C${x1 + 8} ${torsoTop + 34} ${x1 + 6} ${torsoTop + 2} ${100 + 36 * w} ${torsoTop} Z`;
const fold = shade(top.color, 0.74);
const neckH = 28;
// Largura do pescoço proporcional à cabeça (≈ metade dela), um pouco mais grosso em corpo forte.
const nw = 26 * (HEAD_SCALE / 1.2) * (look.build === "heavy" ? 1.12 : look.build === "slim" ? 0.92 : 1);
const headTransform = `translate(0 ${torsoTop - neckH + 6 + breathe * 0.4}) rotate(${b.headTilt} 100 0) translate(100 0) scale(${HEAD_SCALE}) translate(-100 -156)`;
return ( return (
<svg viewBox="0 0 200 440" width="100%" height="100%" overflow="visible"> <svg viewBox="0 0 200 440" width="100%" height="100%" overflow="visible">
<g transform={`translate(100 440) scale(${look.height}) translate(-100 -440)`}> <g transform={`translate(100 440) scale(${look.height}) translate(-100 -440)`}>
{/* Sombra de contato no chão. */}
<ellipse cx={100} cy={438} rx={66 * w} ry={8} fill="#000000" opacity={0.18} />
{look.hair.style === "long" && ( {look.hair.style === "long" && (
<g transform={`rotate(${b.lean} 100 ${hipY})`}> <g transform={`rotate(${b.lean} 100 ${hipY})`}>
<path d={`M50 ${torsoTop - 34} Q48 ${torsoTop - 94} 100 ${torsoTop - 96} Q152 ${torsoTop - 94} 150 ${torsoTop - 34} L156 ${torsoTop + 56} Q100 ${torsoTop + 71} 44 ${torsoTop + 56} Z`} fill={look.hair.color} /> <g transform={headTransform}>
<Cel id={`hb${uid}`} d="M50 104 Q46 46 100 46 Q154 46 150 104 L158 214 Q100 232 42 214 Z" fill={shade(look.hair.color, 0.9)} side={side} dx={10} dy={0} />
</g>
</g> </g>
)} )}
{leg(-1, b.legL)} {leg(-1, b.legL)}
{leg(1, b.legR)} {leg(1, b.legR)}
{look.bottom.style === "skirt" && look.top.style !== "dress" && ( {look.bottom.style === "skirt" && !longTop && (
<path d={`M${100 - 30 * w} ${hipY - 6} L${100 + 30 * w} ${hipY - 6} L${100 + 42 * w} ${hipY + 52} L${100 - 42 * w} ${hipY + 52} Z`} fill={look.bottom.color} /> <path d={`M${100 - 34 * w} ${hipY - 6} L${100 + 34 * w} ${hipY - 6} L${100 + 46 * w} ${hipY + 52} L${100 - 46 * w} ${hipY + 52} Z`} fill={look.bottom.color} />
)} )}
{!longTop && <path d={`M${100 - 40 * w} ${hipY - 4} L${100 + 40 * w} ${hipY - 4} L${100 + 38 * w} ${hipY + 16} L${100 - 38 * w} ${hipY + 16} Z`} fill={look.bottom.style === "pants" ? look.bottom.color : look.bottom.color} />}
<g transform={`rotate(${b.lean} 100 ${hipY}) translate(0 ${breathe * 0.3})`}> <g transform={`rotate(${b.lean} 100 ${hipY}) translate(0 ${breathe * 0.3})`}>
{arm(-1, b.armL)}
<g> <g>
{top.style === "hoodie" && <path d={`M${x0 + 6} ${torsoTop + 4} Q100 ${torsoTop - 24} ${x1 - 6} ${torsoTop + 4} Z`} fill={shade(top.color, 0.8)} />} {top.style === "hoodie" && <path d={`M${x0 + 4} ${torsoTop + 8} Q100 ${torsoTop - 30} ${x1 - 4} ${torsoTop + 8} Z`} fill={shade(top.color, 0.78)} />}
<defs><clipPath id={`t${uid}`}><path d={torsoPath} /></clipPath></defs> {/* Pescoço com a sombra do queixo. */}
<path d={torsoPath} fill={top.color} /> {/* Pescoço visível: alarga na base (trapézio), sombra do queixo em cima e o lado da sombra mais escuro. */}
{belly && <ellipse cx={100} cy={hipY - 44} rx={44 * w} ry={40} fill={top.color} />} <path d={`M${100 - nw} ${torsoTop - neckH - 8} L${100 + nw} ${torsoTop - neckH - 8} L${100 + nw + 6} ${torsoTop + 10} L${100 - nw - 6} ${torsoTop + 10} Z`} fill={look.skin} />
<g clipPath={`url(#t${uid})`}> <path d={`M${100 + side * 4} ${torsoTop - neckH - 8} L${100 + side * nw} ${torsoTop - neckH - 8} L${100 + side * (nw + 6)} ${torsoTop + 10} L${100 + side * 8} ${torsoTop + 10} Z`} fill={cool(look.skin, 0.84)} />
<rect x={100 + 14 * w} y={torsoTop} width={40 * w} height={torsoBottom - torsoTop + 2} fill="#000000" opacity={0.1} /> <path d={`M${100 - nw} ${torsoTop - neckH - 8} L${100 + nw} ${torsoTop - neckH - 8} L${100 + nw + 0.5} ${torsoTop - neckH + 6} Q100 ${torsoTop - neckH + 12} ${100 - nw - 0.5} ${torsoTop - neckH + 6} Z`} fill={cool(look.skin, 0.74)} />
</g> <path d={`M${100 - 6} ${torsoTop - 4} Q100 ${torsoTop + 2} ${100 + 6} ${torsoTop - 4}`} stroke={shade(look.skin, 0.72)} strokeWidth={2} fill="none" strokeLinecap="round" />
{/* Volume da barriga: curva de baixo mais escura e brilho em cima, sem "mancha". */} <Cel id={`to${uid}`} d={torsoPath} fill={top.color} side={side} dx={16} dy={-4} k={0.8} />
{belly && <><path d={`M${100 - 38 * w} ${hipY - 22} Q100 ${hipY + 4} ${100 + 38 * w} ${hipY - 22}`} stroke={shade(top.color, 0.72)} strokeWidth={4} fill="none" strokeLinecap="round" /> {/* Barra / cós embaixo do tronco. */}
<ellipse cx={100 - 14 * w} cy={hipY - 62} rx={16 * w} ry={10} fill="#ffffff" opacity={0.035} /></>} {!longTop && <path d={`M${x0 - 1} ${torsoBottom - 9} L${x1 + 1} ${torsoBottom - 9} L${x1 + 1} ${torsoBottom} L${x0 - 1} ${torsoBottom} Z`} fill={shade(top.color, 0.82)} />}
{(top.style === "shirt" || top.style === "uniform") && <path d={`M88 ${torsoTop} L100 ${torsoTop + 16} L112 ${torsoTop} Z`} fill={shade(top.color, 0.78)} />} {/* Dobras do tecido: axilas, barriga. */}
{(top.style === "jacket" || top.style === "hoodie") && <path d={`M100 ${torsoTop + 6} L100 ${torsoBottom}`} stroke={shade(top.color, 0.65)} strokeWidth={3} />} <path d={`M${x0 + 8} ${torsoTop + 46} Q${x0 + 18} ${torsoTop + 58} ${x0 + 14} ${torsoTop + 72} M${x1 - 8} ${torsoTop + 46} Q${x1 - 18} ${torsoTop + 58} ${x1 - 14} ${torsoTop + 72}`} stroke={fold} strokeWidth={2.6} fill="none" strokeLinecap="round" />
{top.style === "uniform" && <rect x={x0} y={hipY - 42} width={x1 - x0} height={11} fill={accent} />} {(look.belly || look.build === "heavy") && <path d={`M${100 - 30 * w} ${hipY - 16} Q100 ${hipY + 2} ${100 + 30 * w} ${hipY - 16}`} stroke={fold} strokeWidth={3} fill="none" strokeLinecap="round" />}
{top.style === "shirt" && top.accent && <rect x={x0} y={hipY - 38} width={x1 - x0} height={9} fill={accent} />} <path d={`M${100 - 18 * w} ${hipY - 34} Q${100 - 8} ${hipY - 28} ${100 - 4} ${hipY - 36}`} stroke={fold} strokeWidth={2.2} fill="none" strokeLinecap="round" opacity={0.7} />
{top.style === "jacket" && <><path d={`M100 ${torsoTop + 2} L100 ${torsoBottom}`} stroke={shade(top.color, 0.6)} strokeWidth={4} /><path d={`M86 ${torsoTop + 2} L100 ${torsoTop + 30} L114 ${torsoTop + 2} Z`} fill={accent} /></>} {/* Construção da roupa por estilo. */}
{top.style === "hoodie" && <rect x={84} y={hipY - 50} width={32} height={22} rx={6} fill={shade(top.color, 0.85)} />} {top.style === "shirt" && <>
{top.style === "dress" && [0, 1, 2, 3].map((i) => <circle key={i} cx={84 + (i % 2) * 32} cy={torsoTop + 40 + Math.floor(i / 2) * 70} r={3.5} fill="#ffffff" opacity={0.5} />)} <path d={`M84 ${torsoTop - 2} L100 ${torsoTop + 20} L94 ${torsoTop + 2} Z M116 ${torsoTop - 2} L100 ${torsoTop + 20} L106 ${torsoTop + 2} Z`} fill={shade(top.color, 1.15)} />
<Accessories look={look} x0={x0} x1={x1} top={torsoTop} bottom={torsoBottom} hipY={hipY} /> <path d={`M100 ${torsoTop + 20} L100 ${torsoBottom - 10}`} stroke={fold} strokeWidth={2} />
{[0, 1, 2].map((i) => <circle key={i} cx={103} cy={torsoTop + 34 + i * 24} r={2.6} fill={shade(top.color, 0.65)} />)}
{top.accent && <rect x={x0 - 4} y={hipY - 40} width={x1 - x0 + 8} height={9} fill={accent} />}
</>}
{top.style === "uniform" && <>
<path d={`M84 ${torsoTop - 2} L100 ${torsoTop + 16} L116 ${torsoTop - 2} L110 ${torsoTop + 6} L100 ${torsoTop + 12} L90 ${torsoTop + 6} Z`} fill={shade(top.color, 0.7)} />
<path d={`M100 ${torsoTop + 14} L100 ${torsoBottom - 10}`} stroke={fold} strokeWidth={2.4} />
{[0, 1, 2, 3].map((i) => <circle key={i} cx={103} cy={torsoTop + 28 + i * 20} r={2.6} fill={accent} />)}
<rect x={x0 + 12} y={torsoTop + 28} width={24} height={16} rx={3} fill={shade(top.color, 0.86)} />
<rect x={x0 - 4} y={hipY - 44} width={x1 - x0 + 8} height={10} fill={accent} />
</>}
{(top.style === "jacket" || top.style === "hoodie") && <>
{/* Camiseta clara por baixo, zíper com puxador, gola. */}
<path d={`M88 ${torsoTop} L100 ${torsoTop + 28} L112 ${torsoTop} Z`} fill={top.style === "jacket" ? "#efeae0" : shade(top.color, 0.8)} />
<path d={`M100 ${torsoTop + 26} L100 ${torsoBottom - 4}`} stroke={shade(top.color, 0.58)} strokeWidth={3.4} />
<rect x={97} y={torsoTop + 40} width={6} height={11} rx={2} fill={shade(top.color, 1.35)} />
{top.style === "jacket" && <>
<path d={`M80 ${torsoTop - 4} L100 ${torsoTop + 28} L92 ${torsoTop - 2} Z M120 ${torsoTop - 4} L100 ${torsoTop + 28} L108 ${torsoTop - 2} Z`} fill={accent} />
<path d={`M${x0 + 2} ${torsoTop + 58} L${x0 + 2} ${torsoBottom - 10} M${x1 - 2} ${torsoTop + 58} L${x1 - 2} ${torsoBottom - 10}`} stroke={accent} strokeWidth={5} />
</>}
{top.style === "hoodie" && <>
<rect x={80} y={hipY - 52} width={40} height={24} rx={7} fill={shade(top.color, 0.86)} />
<path d={`M93 ${torsoTop + 4} L91 ${torsoTop + 34} M107 ${torsoTop + 4} L109 ${torsoTop + 34}`} stroke="#efeae0" strokeWidth={2.4} strokeLinecap="round" />
</>}
</>}
{top.style === "dress" && <>
<path d={`M86 ${torsoTop} Q100 ${torsoTop + 20} 114 ${torsoTop}`} stroke={shade(top.color, 0.7)} strokeWidth={4} fill="none" />
{[0, 1, 2, 3, 4, 5].map((i) => <circle key={i} cx={78 + (i % 3) * 22} cy={torsoTop + 44 + Math.floor(i / 3) * 70} r={3.5} fill="#ffffff" opacity={0.45} />)}
<path d={`M${x0 - flare + 4} ${torsoBottom - 4} L${x1 + flare - 4} ${torsoBottom - 4}`} stroke={shade(top.color, 0.78)} strokeWidth={6} />
</>}
{top.style === "robe" && <>
{/* Gola em V, dobras do pano e faixa amarrada na cintura com a ponta caindo. */}
<path d={`M84 ${torsoTop} L100 ${torsoTop + 30} L116 ${torsoTop} Z`} fill={shade(top.color, 0.7)} />
<path d={`M${100 - 18 * w} ${hipY + 6} Q${100 - 22 * w} ${hipY + 50} ${100 - 26 * w} ${torsoBottom - 4} M${100 + 12 * w} ${hipY + 8} Q${100 + 16 * w} ${hipY + 50} ${100 + 22 * w} ${torsoBottom - 4} M100 ${hipY + 14} L100 ${torsoBottom - 6}`} stroke={fold} strokeWidth={3} fill="none" strokeLinecap="round" />
<rect x={x0 - 3} y={hipY - 30} width={x1 - x0 + 6} height={13} rx={5} fill={accent} />
<path d={`M${100 + 10 * w} ${hipY - 20} L${100 + 16 * w} ${hipY + 28} L${100 + 25 * w} ${hipY + 26} L${100 + 19 * w} ${hipY - 20} Z`} fill={shade(accent, 0.82)} />
<path d={`M${x0 - flare + 4} ${torsoBottom - 3} L${x1 + flare - 4} ${torsoBottom - 3}`} stroke={shade(top.color, 0.72)} strokeWidth={5} />
</>}
<Accessories look={look} x0={x0} x1={x1} top={torsoTop} bottom={torsoBottom} hipY={hipY} side={side} part="torso" uid={uid} />
</g> </g>
{!handOnFace && arm(1, b.armR, holdItem)} {/* Camadas: braço ao lado do corpo (e a raiz dos outros) → pano do peito → pano no ombro → antebraço/mão na
<rect x={90} y={torsoTop - 12} width={20} height={16} fill={shade(look.skin, 0.9)} /> frente do peito → cabeça → mão no rosto. */}
<g transform={`translate(0 ${torsoTop - 156 + breathe * 0.4}) rotate(${b.headTilt} 100 150)`}> {arms("side")}
<Head look={look} f={f} b={b} t={t} uid={uid} /> <Accessories look={look} x0={x0} x1={x1} top={torsoTop} bottom={torsoBottom} hipY={hipY} side={side} part="chest" uid={uid} />
<Accessories look={look} x0={x0} x1={x1} top={torsoTop} bottom={torsoBottom} hipY={hipY} side={side} part="drape" uid={uid} />
{arms("front")}
{twoHand()}
<g transform={headTransform}>
<Head look={look} f={f} b={b} t={t} uid={uid} side={side} />
{st.emote && ( {st.emote && (
<g transform={`translate(150 30) scale(${0.4 + 0.6 * st.emote.k})`} opacity={st.emote.k}> <g transform={`translate(156 40) scale(${0.4 + 0.6 * st.emote.k})`} opacity={st.emote.k}>
<circle r={24} fill="#ffffff" stroke={INK} strokeWidth={3} /> <circle r={22} fill="#ffffff" />
<text y={10} textAnchor="middle" fontSize={30} fontWeight={800} fill={st.emote.text === "!" || st.emote.text === "💢" ? "#e8463d" : INK}>{st.emote.text}</text> <text y={10} textAnchor="middle" fontSize={28} fontWeight={800} fill={st.emote.text === "!" || st.emote.text === "💢" ? "#e8463d" : INK}>{st.emote.text}</text>
</g> </g>
)} )}
</g> </g>
{handOnFace && arm(1, b.armR)} {arms("face")}
</g> </g>
</g> </g>
</svg> </svg>
); );
} }
/**
* Vista "insert": close das MÃOS fazendo algo (segurando o objeto, escrevendo), antebraços entrando por baixo
* com a manga da roupa do personagem. Ocupa a área inteira de quem desenha (viewBox 1080×1080).
*/
export function HandsInsert({ look = DEFAULT_LOOK, item, t = 0, shadeSide = 1 }: { look?: CharacterLook; item?: IconId; t?: number; shadeSide?: 1 | -1 }) {
const uid = useId().replace(/:/g, "");
const sway = Math.sin(t * 1.6) * 6;
const long = ["jacket", "hoodie", "uniform", "robe"].includes(look.top.style);
const cloth = look.top.style === "dress" ? look.skin : look.top.color;
const cuff = look.top.style === "uniform" || look.top.style === "jacket" ? (look.top.accent ?? shade(cloth, 0.8)) : undefined;
// Mão grande (close): a mesma biblioteca de mãos em escala; a manga/punho na mesma proporção do braço.
const K = 2.7;
const S = 5;
const cy = 560 + sway * 0.5;
const arms = ([-1, 1] as const).map((s) => {
// O antebraço sobe do canto de baixo, inclinado para dentro; no pulso a mão dobra: os dedos ficam ATRÁS da
// borda lateral do objeto e o polegar comprido apoia por cima da página (pegada de quem segura um livro aberto).
const deg = 180 - s * 30;
const edge = { x: 540 + s * 250 + (s > 0 ? sway : 0), y: 660 + (s > 0 ? -sway : 0) };
// Pegada de borda com o antebraço vindo de baixo: o pulso segue o eixo do antebraço até a mão.
const wrist = item ? wristForHold("pinch_low", edge.x, edge.y, deg, s, K) : { x: edge.x + s * 40, y: edge.y + 120 };
const end = tip(wrist.x, wrist.y, deg, -3 * S);
const start = tip(end.x, end.y, deg, -560);
const hand = { x: wrist.x, y: wrist.y, deg, s, skin: look.skin, light: shadeSide, scale: K, uid: `${uid}i${s}` };
return { s, deg, wrist, end, start, hand };
});
return (
<svg viewBox="0 0 1080 1080" width="100%" height="100%" overflow="visible">
{arms.map(({ s, deg, end, start, hand }) => (
<g key={s}>
{long
? <>
<Limb2 id={`if${uid}${s}`} x={start.x} y={start.y} deg={deg} len={560 - 11 * S} w1={34 * S} w2={23 * S} fill={cloth} side={shadeSide} />
{/* Dobras do pano no antebraço. */}
<path d={`M${-9 * S} 300 Q0 ${300 + 4 * S} ${8 * S} 296 M${-7 * S} 420 Q${-1 * S} ${420 + 3 * S} ${7 * S} 418`} stroke={shade(cloth, 0.74)} strokeWidth={2.2 * S} fill="none" strokeLinecap="round" transform={`translate(${start.x} ${start.y}) rotate(${deg})`} />
<SleeveEnd x={end.x} y={end.y} deg={deg} w={25.5} cloth={cloth} cuff={cuff} skin={look.skin} wrist={0} light={shadeSide} uid={`${uid}ie${s}`} scale={S} part="back" />
</>
: <Limb2 id={`if${uid}${s}`} x={start.x} y={start.y} deg={deg} len={560 + 6 * S} w1={26 * S} w2={17 * S} fill={look.skin} side={shadeSide} />}
{item && <Hand {...hand} curl={1} layer="back" thumbFront />}
</g>
))}
{item && <g transform={`translate(540 ${cy})`}><svg x={-300} y={-300} width={600} height={600} viewBox="0 0 100 100" overflow="visible"><Icon id={item} /></svg></g>}
{/* Só o polegar por cima do objeto; sem objeto, as mãos relaxadas inteiras. */}
{arms.map(({ s, hand }) => <Hand key={s} {...hand} curl={item ? 1 : 0.35} layer={item ? "front" : "all"} thumbFront={!!item} />)}
{/* Barra do punho por cima da sobra do pulso. */}
{long && arms.map(({ s, deg, end }) => <SleeveEnd key={`f${s}`} x={end.x} y={end.y} deg={deg} w={25.5} cloth={cloth} cuff={cuff} skin={look.skin} wrist={17} light={shadeSide} uid={`${uid}ie${s}`} scale={S} part="front" />)}
</svg>
);
}
+55 -10
View File
@@ -6,9 +6,10 @@ import { CrowdFigure, PersonFigure } from "./actors";
import { Icon } from "./icons"; import { Icon } from "./icons";
import { Captions, CrossOut, Grain, Hud, Rings, TagLabel, TextLayer, pop, shake } from "./overlays"; import { Captions, CrossOut, Grain, Hud, Rings, TagLabel, TextLayer, pop, shake } from "./overlays";
import { SceneBackground } from "./scenes"; import { SceneBackground } from "./scenes";
import { CharacterFigure } from "./CharacterFigure"; import { CharacterFigure, HandsInsert } from "./CharacterFigure";
import { evaluate } from "./motion"; import { evaluate } from "./motion";
import { LightLayer } from "./places"; import { LightLayer, PlaceForeground, WeatherLayer } from "./places";
import { AnimalFigure, BIRDS, SPECIES_HEIGHT } from "./animals";
import type { ShotSpec } from "./spec"; import type { ShotSpec } from "./spec";
import { loadFonts } from "./theme"; import { loadFonts } from "./theme";
@@ -29,30 +30,72 @@ export function Shot(spec: ShotSpec) {
const k = pop(frame, fps, a.enterS ?? 0); const k = pop(frame, fps, a.enterS ?? 0);
if (a.kind === "crowd") { if (a.kind === "crowd") {
return ( return (
<div key={i} style={{ position: "absolute", left: "-2%", width: "104%", top: `${(a.y - 0.16) * 100}%`, height: "16%", <div key={i} style={{ position: "absolute", left: "-2%", width: "104%", top: `${(a.y - 0.34) * 100}%`, height: "34%",
opacity: k, transform: `translateY(${(1 - k) * 8}%)` }}> opacity: k, transform: `translateY(${(1 - k) * 8}%)` }}>
<CrowdFigure c={a} frame={frame} /> <CrowdFigure c={a} frame={frame} fps={fps} />
</div> </div>
); );
} }
if (a.kind === "animal") {
// Animal (ou fila/casal): anda de x até walk.to; ave voando sobe e desce em onda. Olha para onde anda.
const t = frame / fps;
const w = a.walk;
const s0 = w?.startS ?? 0;
const d = w?.dur ?? Math.max(0.5, spec.durationS - s0);
const p = w ? Math.max(0, Math.min(1, (t - s0) / d)) : 0;
const moving = !!w && t >= s0 && p < 1;
const flip = w ? w.to < a.x !== !!a.flip : !!a.flip;
const h = height * SPECIES_HEIGHT[a.species] * (a.scale ?? 1);
const n = a.count ?? 1;
const gap = a.gap ?? 0.16 * (a.scale ?? 1) * (SPECIES_HEIGHT[a.species] / 0.12);
const dir = w ? Math.sign(w.to - a.x) || 1 : flip ? -1 : 1;
const fly = !!a.fly && BIRDS.includes(a.species);
return (
<React.Fragment key={i}>
{Array.from({ length: n }, (_, j) => (a.pair ? [0, 1] : [0]).map((m) => {
const x0 = a.x - dir * j * gap + (w ? (w.to - a.x) * p : 0);
const y = a.y - m * 0.012 + (fly ? Math.sin(t * 2.4 + j) * 0.012 : 0);
const x = x0 - dir * m * gap * 0.35;
return (
<div key={`${j}-${m}`} style={{ position: "absolute", left: x * width - h / 2, top: y * height - h, width: h, height: h,
opacity: Math.min(1, k * 1.5), transform: `scale(${flip ? -1 : 1}, 1) translateY(${(1 - k) * 10}%)`, zIndex: m ? 0 : 1 }}>
<AnimalFigure species={a.species} color={a.color} t={t} walking={moving && !fly} flying={fly} carry={a.carry} seed={j * 3 + m} />
</div>
);
}))}
</React.Fragment>
);
}
if (a.character) { if (a.character) {
// Personagem da biblioteca: mesmo visual em toda cena. Expressão, pose, andar, pular, falar… saem da // Personagem da biblioteca: mesmo visual em toda cena. Expressão, pose, andar, pular, falar… saem da
// linha do tempo (motion.ts), com a boca na fala (palavras + volume do áudio). // linha do tempo (motion.ts), com a boca na fala (palavras + volume do áudio).
const t = frame / fps; const t = frame / fps;
const st = evaluate({ x: a.x, expression: a.expression, pose: a.pose, face: a.face, body: a.body, flip: a.flip, timeline: a.timeline }, const st = evaluate({ x: a.x, expression: a.expression, pose: a.pose, face: a.face, body: a.body, flip: a.flip, timeline: a.timeline },
t, spec.durationS, spec.seed + i * 13, { words: spec.words ?? [], env: spec.audioEnv }); t, spec.durationS, spec.seed + i * 13, { words: spec.words ?? [], env: spec.audioEnv });
// Meio corpo / de perto: o personagem cresce e os pés saem do quadro (cabeça perto do terço de cima). // Vista "insert": close das mãos (antebraços entrando por baixo) segurando o objeto.
const zoom = a.framing === "close" ? 2.9 : a.framing === "medium" ? 1.9 : 1; if (a.framing === "insert") {
const ch = height * 0.36 * (a.scale ?? 1) * zoom; return (
<div key={i} style={{ position: "absolute", left: "-6%", width: "112%", top: `${(0.92 - 0.62) * 100}%`, aspectRatio: "1 / 1", opacity: Math.min(1, k * 1.5),
transform: `translateY(${(1 - k) * 8}%)` }}>
<HandsInsert look={a.character.look} item={a.item} t={t} />
</div>
);
}
// Caixa do desenho (200×440, cabeça ~1/3): corpo inteiro ~52% da altura do quadro; meio corpo corta nos
// joelhos; close corta na cintura, com a cabeça ocupando ~1/3 do quadro.
const box = a.framing === "close" ? 1.05 : a.framing === "medium" ? 0.8 : 0.52 * (a.scale ?? 1);
const zoom = box / 0.52;
const ch = height * box;
const cw = (ch * 200) / 440; const cw = (ch * 200) / 440;
const baseY = a.framing === "close" ? 1.15 : a.framing === "medium" ? 0.98 : a.y; const baseY = a.framing === "close" ? 1.17 : a.framing === "medium" ? 1.04 : a.y;
const label = a.label ?? a.character.name; const label = a.label ?? a.character.name;
const showLabel = label && Math.abs(st.rot) < 30; const showLabel = label && Math.abs(st.rot) < 30;
return ( return (
<div key={i} style={{ position: "absolute", left: (st.x + st.dx) * width - cw / 2, top: (baseY + st.dy) * height - ch, width: cw, height: ch, <div key={i} style={{ position: "absolute", left: (st.x + st.dx) * width - cw / 2, top: (baseY + st.dy) * height - ch, width: cw, height: ch,
opacity: Math.min(1, k * 1.5), transformOrigin: "50% 100%", opacity: Math.min(1, k * 1.5), transformOrigin: "50% 100%",
transform: `translateY(${(1 - k) * 10}%) rotate(${st.rot}deg) scale(${(st.flip ? -1 : 1) * st.sx}, ${st.sy})` }}> transform: `translateY(${(1 - k) * 10}%) rotate(${st.rot}deg) scale(${(st.flip ? -1 : 1) * st.sx}, ${st.sy})` }}>
<CharacterFigure look={a.character.look} item={a.item} t={t} state={st} /> {/* A luz da cena vem sempre do mesmo lado: espelhado, a sombra do desenho troca de lado. */}
<CharacterFigure look={a.character.look} item={a.item} t={t} state={st} shadeSide={st.flip ? -1 : 1} />
{showLabel && ( {showLabel && (
<div style={{ position: "absolute", left: zoom > 1 ? "8%" : "50%", top: zoom > 1 ? "22%" : "-15%", transform: `translateX(-50%) scaleX(${st.flip ? -1 : 1})`, textAlign: "center" }}> <div style={{ position: "absolute", left: zoom > 1 ? "8%" : "50%", top: zoom > 1 ? "22%" : "-15%", transform: `translateX(-50%) scaleX(${st.flip ? -1 : 1})`, textAlign: "center" }}>
<TagLabel text={label} /> <TagLabel text={label} />
@@ -87,7 +130,9 @@ export function Shot(spec: ShotSpec) {
</div> </div>
); );
})} })}
<LightLayer light={spec.light} palette={spec.palette} /> {spec.scene.kind === "place" && <PlaceForeground spec={spec} frame={frame} progress={progress} />}
<WeatherLayer spec={spec} frame={frame} />
<LightLayer light={spec.light} palette={spec.palette} spec={spec} />
{(spec.texts ?? []).map((t, i) => <TextLayer key={i} t={t} frame={frame} fps={fps} />)} {(spec.texts ?? []).map((t, i) => <TextLayer key={i} t={t} frame={frame} fps={fps} />)}
</AbsoluteFill> </AbsoluteFill>
{(spec.grain ?? 0.11) > 0 && <Grain opacity={spec.grain ?? 0.11} seed={spec.seed} />} {(spec.grain ?? 0.11) > 0 && <Grain opacity={spec.grain ?? 0.11} seed={spec.seed} />}
+43 -13
View File
@@ -4,6 +4,9 @@ import React from "react";
import { COLORS } from "./colors"; import { COLORS } from "./colors";
import { rng } from "./random"; import { rng } from "./random";
import type { Crowd, Person } from "./spec"; import type { Crowd, Person } from "./spec";
import type { CharacterLook } from "./character";
import { CharacterFigure } from "./CharacterFigure";
import { evaluate } from "./motion";
/** Pessoa em pé num viewBox 200×420; (0,0) do grupo = pés no centro. */ /** Pessoa em pé num viewBox 200×420; (0,0) do grupo = pés no centro. */
export function PersonFigure({ p, frame, fps }: { p: Person; frame: number; fps: number }) { export function PersonFigure({ p, frame, fps }: { p: Person; frame: number; fps: number }) {
@@ -44,23 +47,50 @@ export function PersonFigure({ p, frame, fps }: { p: Person; frame: number; fps:
); );
} }
/** Fila de silhuetas pretas (multidão no portão). */ const SKINS = ["#f1c7a3", "#e0b48f", "#d09a70", "#c08055", "#a8704a", "#8d5a3b", "#6e4630"];
export function CrowdFigure({ c, frame }: { c: Crowd; frame: number }) { const HAIRS = ["#2a1e16", "#3a2a1e", "#6b4226", "#c9c9cf", "#e8c35a", "#1e1612", "#8a8a92"];
const CLOTHES = ["#3f6b8a", "#c8443a", "#5b6b3a", "#e8b13a", "#7a5ce0", "#2f6db3", "#d98a5c", "#4f7a4a", "#8a6f9e", "#56704a", "#e9ecef"];
const pick = <T,>(r: () => number, list: readonly T[]): T => list[Math.floor(r() * list.length) % list.length];
/** Aparência sorteada de quem está na multidão: cada um diferente (cabeça, altura, cabelo, roupa, acessório). */
export function crowdLook(seed: number): CharacterLook {
const r = rng(seed * 7919 + 17);
const female = r() < 0.45;
const old = r() < 0.25;
const hairStyle = female ? pick(r, ["long", "bun", "curly", "side"] as const) : pick(r, ["short", "side", "bald", "curly", "spiky", "cap"] as const);
const top = pick(r, female ? (["shirt", "dress", "hoodie", "jacket"] as const) : (["shirt", "jacket", "hoodie", "uniform", "shirt"] as const));
const acc: NonNullable<CharacterLook["accessories"]> = [];
const roll = r();
if (!female && roll < 0.14) { acc.push("helmet", "vest"); } else if (roll < 0.22) acc.push("scarf"); else if (roll < 0.3) acc.push("watch");
return {
build: pick(r, ["slim", "average", "average", "heavy"] as const), height: 0.86 + r() * 0.26, skin: pick(r, SKINS),
hair: { style: hairStyle, color: old ? "#c9c9cf" : pick(r, HAIRS) },
beard: { style: female ? "none" : pick(r, ["none", "none", "stubble", "mustache", "full", "goatee"] as const), color: old ? "#b0b0b8" : pick(r, HAIRS) },
glasses: r() < 0.22 ? pick(r, ["round", "square"] as const) : "none", brows: r() < 0.5 ? "thick" : "thin",
top: { style: top, color: pick(r, CLOTHES), accent: pick(r, CLOTHES) }, bottom: { style: female && r() < 0.3 ? "skirt" : "pants", color: pick(r, ["#2c3346", "#3a3f4a", "#5a4a3a", "#2b3a5a"]) },
shoes: pick(r, ["#1d1d24", "#5a3a22", "#f2f2f2"]), head: pick(r, ["round", "oval", "square", "wide"] as const), nose: pick(r, ["curve", "round", "button", "wide", "long"] as const),
lids: 0.1 + r() * 0.35, wrinkles: old ? 0.6 : 0, belly: !female && r() < 0.2, ...(acc.length ? { accessories: acc, accessoryColor: acc[0] === "helmet" ? "#f2a31a" : undefined } : {}),
};
}
/** Multidão: pessoas desenhadas com o mesmo traço dos personagens, cada uma diferente, em duas fileiras. */
export function CrowdFigure({ c, frame, fps = 30 }: { c: Crowd; frame: number; fps?: number }) {
const rand = rng(c.count * 31 + 3); const rand = rng(c.count * 31 + 3);
const people = Array.from({ length: c.count }, (_, i) => ({ x: (i + 0.5) / c.count, h: 0.8 + rand() * 0.35, p: rand() * 6 })); const people = Array.from({ length: c.count }, (_, i) => ({ i, x: (i + 0.5) / c.count + (rand() - 0.5) * 0.04, back: i % 2 === 1, p: rand() * 6 }))
.sort((a, b) => Number(b.back) - Number(a.back));
const t = frame / fps;
return ( return (
<svg viewBox="0 0 1000 300" width="100%" height="100%" preserveAspectRatio="none" overflow="visible"> <div style={{ position: "absolute", inset: 0 }}>
{people.map((m, i) => { {people.map((m) => {
const bob = Math.sin(frame / 14 + m.p) * 3; const h = m.back ? 78 : 92;
const x = m.x * 1000; const st = evaluate({ x: 0, expression: pick(rng(m.i + 5), ["neutral", "smile", "happy", "neutral", "smirk", "surprised"] as const) }, t, 3600, m.i * 7 + 3);
const h = 260 * m.h;
return ( return (
<g key={i} transform={`translate(${x} ${300 + bob})`} fill="#06070f"> <div key={m.i} style={{ position: "absolute", left: `${m.x * 100 - h * 0.11}%`, bottom: `${(m.back ? 8 : 0) + Math.sin(t * 2 + m.p) * 0.4}%`, height: `${h}%`, aspectRatio: "200 / 440",
<rect x={-26} y={-h * 0.62} width={52} height={h * 0.62} rx={18} /> filter: m.back ? "brightness(0.82)" : undefined }}>
<circle cx={0} cy={-h * 0.75} r={h * 0.13} /> <CharacterFigure look={crowdLook(m.i + c.count * 13)} t={t} state={st} shadeSide={1} />
</g> </div>
); );
})} })}
</svg> </div>
); );
} }
+157
View File
@@ -0,0 +1,157 @@
// Animais do estilo Cartoon: figuras reaproveitáveis em qualquer história (não são cena pronta). Cada espécie
// é desenhada por formas chapadas no mesmo traço dos personagens, olhando para a direita, com as patas em
// (100, 200) num viewBox 200×200. Andar mexe as patas; ave voando bate as asas. Cor e escala vêm do spec.
import React from "react";
export const SPECIES = ["dove", "raven", "elephant", "giraffe", "lion", "sheep", "horse", "camel"] as const;
export type Species = (typeof SPECIES)[number];
/** Altura de referência de cada espécie (fração da altura do quadro, com scale 1). */
export const SPECIES_HEIGHT: Record<Species, number> = {
dove: 0.05, raven: 0.055, elephant: 0.2, giraffe: 0.3, lion: 0.12, sheep: 0.085, horse: 0.17, camel: 0.19,
};
/** Aves podem voar (asas batendo, sem patas no chão). */
export const BIRDS: readonly Species[] = ["dove", "raven"];
const INK = "#15161f";
const DEFAULT_COLOR: Record<Species, string> = {
dove: "#f4f4f8", raven: "#23242e", elephant: "#9aa0ab", giraffe: "#e8b54a", lion: "#d99a3a", sheep: "#f1ece0", horse: "#8a5a3a", camel: "#c9a06a",
};
function shade(hex: string, k: number): string {
const n = parseInt(hex.slice(1), 16);
const c = (v: number) => Math.max(0, Math.min(255, Math.round(v * k))).toString(16).padStart(2, "0");
return `#${c((n >> 16) & 255)}${c((n >> 8) & 255)}${c(n & 255)}`;
}
/** Perna que balança pelo quadril: `phase` vem do passo (0 parado). */
function Leg({ x, y, len, w, fill, swing }: { x: number; y: number; len: number; w: number; fill: string; swing: number }) {
return <rect x={x - w / 2} y={y} width={w} height={len} rx={w / 2.4} fill={fill} transform={`rotate(${swing} ${x} ${y})`} />;
}
function Eye({ x, y, r = 4.5, light }: { x: number; y: number; r?: number; light?: boolean }) {
return <g><circle cx={x} cy={y} r={r} fill={light ? "#ffffff" : INK} />{light ? <circle cx={x + 1} cy={y} r={r * 0.55} fill={INK} /> : <circle cx={x + 1.3} cy={y - 1.3} r={r * 0.3} fill="#ffffff" />}</g>;
}
/** Ramo de oliveira no bico (pomba da história do dilúvio, mas serve para qualquer ave). */
function Branch({ x, y }: { x: number; y: number }) {
return (
<g transform={`translate(${x} ${y})`}>
<path d="M0 0 Q14 6 30 4" stroke="#6b4a2a" strokeWidth={2.4} fill="none" strokeLinecap="round" />
{[[8, 2, -30], [16, 6, 30], [22, 2, -30], [28, 6, 25]].map(([lx, ly, r], i) => <ellipse key={i} cx={lx} cy={ly} rx={6} ry={2.6} fill={i % 2 ? "#7fa24a" : "#5f8a3a"} transform={`rotate(${r} ${lx} ${ly})`} />)}
</g>
);
}
export function AnimalFigure({ species, color, t = 0, walking = false, flying = false, carry, seed = 0 }: {
species: Species; color?: string; t?: number; walking?: boolean; flying?: boolean; carry?: "olive"; seed?: number;
}) {
const c = color ?? DEFAULT_COLOR[species];
const dark = shade(c, 0.78);
// Passo: pernas da frente e de trás em oposição; corpo sobe e desce de leve.
const ph = walking ? Math.sin((t + seed * 0.37) * Math.PI * 2 * 1.6) : 0;
const bob = walking ? Math.abs(ph) * -3 : Math.sin(t * 2 + seed) * 0.8;
const flap = flying ? Math.sin((t + seed * 0.21) * Math.PI * 2 * 3.2) : 0;
const body = (inner: React.ReactNode) => <svg viewBox="0 0 200 200" width="100%" height="100%" overflow="visible"><g transform={`translate(0 ${bob})`}>{inner}</g></svg>;
switch (species) {
case "dove": case "raven": {
const beak = species === "dove" ? "#e8a04a" : "#3a3b46";
if (flying) {
return body(<g>
<path d={`M78 112 Q60 ${100 - flap * 50} 30 ${96 - flap * 70} Q66 ${112 - flap * 20} 84 124 Z`} fill={dark} />
<ellipse cx={100} cy={122} rx={36} ry={18} fill={c} />
<path d="M66 120 L40 112 L44 132 Z" fill={dark} />
<circle cx={134} cy={112} r={15} fill={c} />
<path d="M147 110 L162 114 L147 118 Z" fill={beak} />
<Eye x={138} y={109} r={3.2} />
<path d={`M104 116 Q118 ${100 - flap * 48} 150 ${92 - flap * 64} Q124 ${114 - flap * 18} 112 126 Z`} fill={c} stroke={dark} strokeWidth={2} />
{carry === "olive" && <Branch x={156} y={116} />}
</g>);
}
return body(<g>
<path d="M86 186 L84 200 M106 186 L108 200" stroke="#e07a4a" strokeWidth={4} strokeLinecap="round" />
<ellipse cx={96} cy={164} rx={36} ry={26} fill={c} />
<path d="M64 160 L36 150 L42 176 Z" fill={dark} />
<path d="M80 158 Q100 146 118 166 Q100 178 80 158 Z" fill={dark} />
<circle cx={128} cy={134} r={17} fill={c} />
<path d="M143 132 L160 137 L143 142 Z" fill={beak} />
<Eye x={132} y={130} r={3.4} />
{carry === "olive" && <Branch x={154} y={138} />}
</g>);
}
case "elephant": return body(<g>
<Leg x={52} y={128} len={70} w={26} fill={dark} swing={-ph * 10} />
<Leg x={128} y={128} len={70} w={26} fill={dark} swing={ph * 10} />
<ellipse cx={92} cy={112} rx={66} ry={50} fill={c} />
<Leg x={72} y={130} len={68} w={26} fill={c} swing={ph * 10} />
<Leg x={148} y={128} len={70} w={26} fill={c} swing={-ph * 10} />
<path d="M28 104 Q16 116 22 134" stroke={dark} strokeWidth={5} fill="none" strokeLinecap="round" />
<circle cx={154} cy={90} r={34} fill={c} />
<path d={`M176 98 Q192 128 182 158 Q178 ${170 + ph * 4} 190 ${172 + ph * 4}`} stroke={c} strokeWidth={16} fill="none" strokeLinecap="round" />
<path d="M130 70 Q100 74 104 108 Q116 132 140 116 Z" fill={dark} />
<path d="M172 112 L184 124" stroke="#f4f0e4" strokeWidth={6} strokeLinecap="round" />
<Eye x={166} y={84} r={4} />
</g>);
case "giraffe": return body(<g>
<Leg x={58} y={118} len={80} w={11} fill={dark} swing={-ph * 12} />
<Leg x={118} y={118} len={80} w={11} fill={dark} swing={ph * 12} />
<ellipse cx={90} cy={112} rx={44} ry={24} fill={c} />
<Leg x={70} y={120} len={78} w={11} fill={c} swing={ph * 12} />
<Leg x={128} y={118} len={80} w={11} fill={c} swing={-ph * 12} />
<path d="M116 100 L150 10 L166 16 L134 108 Z" fill={c} />
{[[80, 104], [100, 116], [66, 116], [104, 98], [138, 60], [148, 34], [130, 84]].map(([x, y], i) => <circle key={i} cx={x} cy={y} r={6} fill={shade(c, 0.62)} />)}
<ellipse cx={168} cy={14} rx={22} ry={12} fill={c} />
<path d="M156 0 L154 -14 M164 0 L164 -14" stroke={dark} strokeWidth={4} strokeLinecap="round" />
<Eye x={170} y={9} r={3.4} />
<path d="M46 104 Q36 120 40 136" stroke={dark} strokeWidth={3} fill="none" />
</g>);
case "lion": {
const mane = shade(c, 0.62);
return body(<g>
<Leg x={58} y={138} len={60} w={15} fill={dark} swing={-ph * 12} />
<Leg x={124} y={138} len={60} w={15} fill={dark} swing={ph * 12} />
<ellipse cx={92} cy={138} rx={52} ry={26} fill={c} />
<Leg x={72} y={140} len={58} w={15} fill={c} swing={ph * 12} />
<Leg x={136} y={138} len={60} w={15} fill={c} swing={-ph * 12} />
<path d={`M42 132 Q20 ${120 + ph * 6} 22 102`} stroke={c} strokeWidth={6} fill="none" strokeLinecap="round" />
<circle cx={22} cy={100} r={7} fill={mane} />
<circle cx={146} cy={112} r={34} fill={mane} />
<circle cx={150} cy={116} r={22} fill={c} />
<ellipse cx={164} cy={124} rx={9} ry={7} fill={shade(c, 1.15)} />
<circle cx={168} cy={121} r={3.4} fill={INK} />
<Eye x={156} y={108} r={3.4} />
</g>);
}
case "sheep": return body(<g>
<Leg x={70} y={150} len={50} w={9} fill="#3a3540" swing={-ph * 12} />
<Leg x={118} y={150} len={50} w={9} fill="#3a3540" swing={ph * 12} />
{[[66, 140], [86, 128], [108, 128], [126, 140], [96, 152], [76, 156], [116, 156]].map(([x, y], i) => <circle key={i} cx={x} cy={y} r={22} fill={c} />)}
<Leg x={82} y={160} len={40} w={9} fill="#2e2a33" swing={ph * 12} />
<Leg x={128} y={156} len={44} w={9} fill="#2e2a33" swing={-ph * 12} />
<ellipse cx={152} cy={128} rx={16} ry={20} fill="#3a3540" />
<ellipse cx={140} cy={116} rx={10} ry={5} fill="#3a3540" transform="rotate(-20 140 116)" />
<circle cx={146} cy={110} r={12} fill={c} />
<Eye x={158} y={124} r={3.2} light />
</g>);
case "horse": case "camel": {
const camel = species === "camel";
return body(<g>
<Leg x={60} y={116} len={84} w={13} fill={dark} swing={-ph * 14} />
<Leg x={124} y={116} len={84} w={13} fill={dark} swing={ph * 14} />
<ellipse cx={92} cy={110} rx={52} ry={28} fill={c} />
{camel && <path d="M62 92 Q76 50 96 88 Q110 54 126 92 Z" fill={c} />}
<Leg x={74} y={118} len={82} w={13} fill={c} swing={ph * 14} />
<Leg x={134} y={116} len={84} w={13} fill={c} swing={-ph * 14} />
<path d={camel ? "M132 100 Q160 96 158 60 L174 56 Q178 104 142 116 Z" : "M128 96 L152 50 L170 58 L146 112 Z"} fill={c} />
<ellipse cx={camel ? 178 : 168} cy={camel ? 56 : 56} rx={camel ? 17 : 22} ry={camel ? 11 : 13} fill={c} transform={`rotate(${camel ? 10 : 30} ${camel ? 178 : 168} 56)`} />
{!camel && <path d="M150 48 Q132 70 128 98" stroke={shade(c, 0.5)} strokeWidth={9} fill="none" strokeLinecap="round" />}
{!camel && <path d={`M42 104 Q24 ${120 + ph * 4} 30 146`} stroke={shade(c, 0.5)} strokeWidth={9} fill="none" strokeLinecap="round" />}
{camel && <path d="M42 106 Q34 120 38 134" stroke={dark} strokeWidth={4} fill="none" />}
<path d="M158 42 L156 30 L166 40 Z" fill={dark} />
<Eye x={camel ? 182 : 170} y={camel ? 52 : 50} r={3.4} />
</g>);
}
default: return null;
}
}
+8 -2
View File
@@ -4,13 +4,16 @@
export const BUILDS = ["slim", "average", "heavy"] as const; export const BUILDS = ["slim", "average", "heavy"] as const;
export const HAIR_STYLES = ["short", "side", "bun", "long", "curly", "spiky", "bald", "cap"] as const; export const HAIR_STYLES = ["short", "side", "bun", "long", "curly", "spiky", "bald", "cap"] as const;
export const BEARD_STYLES = ["none", "stubble", "mustache", "full", "goatee"] as const; export const BEARD_STYLES = ["none", "stubble", "mustache", "full", "goatee", "long"] as const;
export const GLASSES = ["none", "round", "square", "sun"] as const; export const GLASSES = ["none", "round", "square", "sun"] as const;
export const BROWS = ["thin", "thick"] as const; export const BROWS = ["thin", "thick"] as const;
export const TOP_STYLES = ["shirt", "jacket", "hoodie", "dress", "uniform"] as const; /** "robe" = túnica longa até a canela (com faixa na cintura), de roupa antiga. */
export const TOP_STYLES = ["shirt", "jacket", "hoodie", "dress", "uniform", "robe"] as const;
export const BOTTOM_STYLES = ["pants", "shorts", "skirt"] as const; export const BOTTOM_STYLES = ["pants", "shorts", "skirt"] as const;
export const HEAD_SHAPES = ["round", "oval", "square", "wide"] as const; export const HEAD_SHAPES = ["round", "oval", "square", "wide"] as const;
export const NOSES = ["button", "curve", "round", "long", "wide"] as const; export const NOSES = ["button", "curve", "round", "long", "wide"] as const;
/** Calçado: sapato fechado (cor em `shoes`), sandália de tiras ou pé descalço. */
export const FOOTWEAR = ["shoes", "sandals", "bare"] as const;
/** Acessórios desenhados por cima da roupa (combináveis). */ /** Acessórios desenhados por cima da roupa (combináveis). */
export const ACCESSORIES = ["towel", "whistle", "tie", "vest", "helmet", "watch", "badge", "apron", "scarf", "headset", "chain"] as const; export const ACCESSORIES = ["towel", "whistle", "tie", "vest", "helmet", "watch", "badge", "apron", "scarf", "headset", "chain"] as const;
export type Accessory = (typeof ACCESSORIES)[number]; export type Accessory = (typeof ACCESSORIES)[number];
@@ -34,6 +37,8 @@ export type CharacterLook = {
top: { style: (typeof TOP_STYLES)[number]; color: string; accent?: string }; top: { style: (typeof TOP_STYLES)[number]; color: string; accent?: string };
bottom: { style: (typeof BOTTOM_STYLES)[number]; color: string }; bottom: { style: (typeof BOTTOM_STYLES)[number]; color: string };
shoes: string; shoes: string;
/** Tipo de calçado (padrão "shoes"); a cor continua em `shoes`. */
footwear?: (typeof FOOTWEAR)[number];
/** Detalhe de ilustração (opcionais; sem eles o personagem sai no traço simples). */ /** Detalhe de ilustração (opcionais; sem eles o personagem sai no traço simples). */
head?: (typeof HEAD_SHAPES)[number]; head?: (typeof HEAD_SHAPES)[number];
nose?: (typeof NOSES)[number]; nose?: (typeof NOSES)[number];
@@ -97,6 +102,7 @@ export function validateLook(look: unknown): string[] {
if (l.lids !== undefined && !(typeof l.lids === "number" && l.lids >= 0 && l.lids <= 0.8)) errors.push("lids entre 0 e 0,8"); if (l.lids !== undefined && !(typeof l.lids === "number" && l.lids >= 0 && l.lids <= 0.8)) errors.push("lids entre 0 e 0,8");
if (l.wrinkles !== undefined && !(typeof l.wrinkles === "number" && l.wrinkles >= 0 && l.wrinkles <= 1)) errors.push("wrinkles entre 0 e 1"); if (l.wrinkles !== undefined && !(typeof l.wrinkles === "number" && l.wrinkles >= 0 && l.wrinkles <= 1)) errors.push("wrinkles entre 0 e 1");
if (l.accessories !== undefined && (!Array.isArray(l.accessories) || l.accessories.some((a) => !one(ACCESSORIES, a)))) errors.push(`accessories: ${ACCESSORIES.join("|")}`); if (l.accessories !== undefined && (!Array.isArray(l.accessories) || l.accessories.some((a) => !one(ACCESSORIES, a)))) errors.push(`accessories: ${ACCESSORIES.join("|")}`);
if (l.footwear !== undefined && !one(FOOTWEAR, l.footwear)) errors.push(`footwear: ${FOOTWEAR.join("|")}`);
if (l.accessoryColor !== undefined && !HEX.test(l.accessoryColor)) errors.push("accessoryColor: cor #rrggbb"); if (l.accessoryColor !== undefined && !HEX.test(l.accessoryColor)) errors.push("accessoryColor: cor #rrggbb");
return errors; return errors;
} }
+379
View File
@@ -0,0 +1,379 @@
// Construções e objetos de exterior: casa, prédio, muro, fachada com colunas, loja com toldo, cerca, poste…
// Base em (0,0); luz da esquerda (a face da direita fica na sombra). Medidas pensadas para uma pessoa de ~600.
import React from "react";
import { mix, type Paint } from "./paint";
import type { Draw } from "./nature";
/** Caixa em 2 tons: frente na cor base, faixa da direita na sombra e (opcional) topo iluminado. */
export function Box({ x, y, w, h, fill, p, side = 0.14, top = 0, rx = 0, k = 0.32 }: {
x: number; y: number; w: number; h: number; fill: string; p: Paint; side?: number; top?: number; rx?: number; k?: number;
}) {
return <g>
<rect x={x} y={y} width={w} height={h} rx={rx} fill={p.c(fill)} />
{side > 0 && <rect x={x + w * (1 - side)} y={y} width={w * side} height={h} rx={Math.min(rx, (w * side) / 2)} fill={p.lo(fill, k)} />}
{top > 0 && <rect x={x} y={y} width={w} height={top} rx={Math.min(rx, top / 2)} fill={p.hi(fill, 0.28)} />}
</g>;
}
/** Janela de fachada: moldura, vidro (aceso à noite, céu refletido de dia), cruz e peitoril. */
export function FacadeWindow({ x, y, w, h, p, lit, frame = "#efe6d6", arch = false }: { x: number; y: number; w: number; h: number; p: Paint; lit: boolean; frame?: string; arch?: boolean }) {
const glass = lit ? mix(p.pal.light, "#ffb050", 0.15) : mix(p.pal.sky[1], p.pal.ink, p.night ? 0.55 : 0.18);
const top = arch ? `M${x} ${y + w / 2} A${w / 2} ${w / 2} 0 0 1 ${x + w} ${y + w / 2} L${x + w} ${y + h} L${x} ${y + h} Z` : "";
const inset = 10;
return <g>
{arch ? <path d={top} fill={p.c(frame)} /> : <rect x={x} y={y} width={w} height={h} rx={4} fill={p.c(frame)} />}
{arch
? <path d={`M${x + inset} ${y + w / 2} A${w / 2 - inset} ${w / 2 - inset} 0 0 1 ${x + w - inset} ${y + w / 2} L${x + w - inset} ${y + h - inset} L${x + inset} ${y + h - inset} Z`} fill={p.c(glass)} />
: <rect x={x + inset} y={y + inset} width={w - inset * 2} height={h - inset * 2} fill={p.c(glass)} />}
<path d={`M${x + inset} ${y + h - inset} L${x + w - inset} ${y + h - inset} L${x + w - inset} ${y + h * 0.45} Z`} fill={lit ? p.hi(glass, 0.3) : p.lo(glass, 0.25)} opacity={0.6} />
{!lit && <path d={`M${x + w * 0.25} ${y + h * 0.75} L${x + w * 0.55} ${y + h * 0.2} L${x + w * 0.68} ${y + h * 0.2} L${x + w * 0.38} ${y + h * 0.75} Z`} fill="#ffffff" opacity={0.18} />}
<rect x={x + w / 2 - 4} y={y + inset} width={8} height={h - inset * 2} fill={p.c(frame)} />
<rect x={x + inset} y={y + h * 0.48} width={w - inset * 2} height={8} fill={p.c(frame)} />
<rect x={x - 8} y={y + h - 4} width={w + 16} height={14} rx={3} fill={p.hi(frame, 0.2)} />
<rect x={x - 8} y={y + h + 10} width={w + 16} height={8} fill={p.lo(frame, 0.5)} opacity={0.6} />
</g>;
}
/** Linhas de telha num trapézio (um path só: fileiras + juntas desencontradas). */
function tiles(x0: number, x1: number, y0: number, y1: number, rows: number, inset: number): string {
let d = "";
for (let k = 1; k <= rows; k++) {
const t = k / rows;
const y = y0 + (y1 - y0) * t;
const l = x0 + inset * (1 - t);
const r = x1 - inset * (1 - t);
d += `M${l} ${y} L${r} ${y} `;
const yPrev = y0 + (y1 - y0) * ((k - 1) / rows);
for (let x = l + (k % 2 ? 22 : 0); x < r; x += 44) d += `M${x} ${y} L${x} ${yPrev + 6} `;
}
return d;
}
export const BUILT: Record<string, Draw> = {
house: (p, color) => {
const wall = color ?? mix(p.pal.near, "#f2e2c6", 0.45);
const roof = mix("#c4613a", p.pal.near, 0.15);
const lit = () => p.night && p.r() > 0.35;
const doorX = p.r() > 0.5 ? 60 : -170;
return <g>
{/* lado da casa (fundo, na sombra) */}
<polygon points="300,0 300,-460 392,-430 392,-14" fill={p.lo(wall, 0.42)} />
<polygon points="300,-460 392,-430 392,-400 300,-424" fill={p.lo(wall, 0.6)} />
<rect x={-300} y={-460} width={600} height={460} fill={p.c(wall)} />
<rect x={-300} y={-460} width={26} height={460} fill={p.hi(wall, 0.14)} />
{[[-240, -120, 70, 26], [140, -320, 90, 22], [-80, -380, 60, 18]].map(([x, y, w, h], i) => <rect key={i} x={x} y={y} width={w} height={h} rx={h / 2} fill={p.lo(wall, 0.14)} />)}
<rect x={-300} y={-36} width={600} height={36} fill={p.lo(wall, 0.38)} />
{/* telhado de telha: frente, quina iluminada à esquerda e água da direita na sombra */}
<polygon points="-350,-452 -235,-660 235,-660 350,-452" fill={p.c(roof)} />
<path d={tiles(-350, 350, -660, -452, 5, 115)} stroke={p.lo(roof, 0.4)} strokeWidth={5} fill="none" />
<polygon points="-350,-452 -235,-660 -205,-660 -300,-452" fill={p.hi(roof, 0.22)} />
<polygon points="235,-660 350,-452 430,-430 300,-640" fill={p.lo(roof, 0.4)} />
<rect x={-356} y={-458} width={712} height={16} rx={4} fill={p.lo(roof, 0.2)} />
<rect x={-300} y={-442} width={600} height={30} fill={p.lo(wall, 0.5)} opacity={0.8} />
<rect x={150} y={-720} width={54} height={90} fill={p.c(mix(roof, "#8a5a4a", 0.4))} /><rect x={184} y={-720} width={20} height={90} fill={p.lo(roof, 0.5)} />
{/* janelas e porta */}
{(doorX > 0 ? [-230, -60] : [-20, 160]).map((x) => <FacadeWindow key={x} x={x} y={-330} w={110} h={130} p={p} lit={lit()} />)}
<rect x={doorX - 12} y={-282} width={124} height={282} rx={4} fill={p.c("#efe6d6")} />
<rect x={doorX} y={-270} width={100} height={270} fill={p.c(mix("#7a4a2c", wall, 0.1))} />
<rect x={doorX + 74} y={-270} width={26} height={270} fill={p.lo("#7a4a2c", 0.4)} />
<rect x={doorX + 14} y={-250} width={60} height={90} rx={3} fill={p.lo("#7a4a2c", 0.25)} />
<circle cx={doorX + 80} cy={-130} r={7} fill={p.c("#e6c27a")} />
<rect x={doorX - 24} y={-12} width={148} height={12} fill={p.hi("#b0a898", 0.1)} />
</g>;
},
building: (p, color) => {
const floors = 4 + Math.floor(p.r() * 4);
const fh = 150;
const H = floors * fh;
const body = color ?? p.pal.far;
const rows = Array.from({ length: floors - 1 }, (_, f) => f);
return <g>
<polygon points={`210,0 210,${-H} 276,${-H + 26} 276,0`} fill={p.lo(body, 0.42)} />
<rect x={-210} y={-H} width={420} height={H} fill={p.c(body)} />
<rect x={-210} y={-H} width={22} height={H} fill={p.hi(body, 0.14)} />
<rect x={-224} y={-H - 26} width={448} height={30} fill={p.hi(body, 0.2)} />
<polygon points={`224,${-H - 26} 290,${-H} 290,${-H + 4} 224,${-H + 4}`} fill={p.lo(body, 0.5)} />
{rows.map((f) => <rect key={f} x={-210} y={-(f + 1) * fh - 6} width={420} height={8} fill={p.lo(body, 0.2)} />)}
{rows.flatMap((f) => [-160, -40, 80].map((x) => (
<FacadeWindow key={`${f}${x}`} x={x} y={-(f + 2) * fh + 28} w={80} h={90} p={p} lit={p.night ? p.r() > 0.55 : false} frame={mix(body, "#ffffff", 0.45)} />
)))}
<rect x={-70} y={-130} width={140} height={130} fill={p.c(mix(body, p.pal.ink, 0.6))} />
<rect x={-60} y={-120} width={120} height={120} fill={p.c(p.night ? mix(p.pal.light, "#ffb050", 0.3) : mix(p.pal.sky[1], p.pal.ink, 0.4))} opacity={0.85} />
<rect x={-96} y={-150} width={192} height={22} fill={p.c(mix(body, p.pal.ink, 0.35))} />
<rect x={-210} y={-20} width={420} height={20} fill={p.lo(body, 0.45)} />
</g>;
},
wall: (p, color) => {
// Muro comprido de reboco com capa por cima e pilares (passa da borda do quadro).
const w = color ?? mix(p.pal.near, "#c8885e", 0.5);
const patches = Array.from({ length: 7 }, () => [-660 + p.r() * 1260, -250 + p.r() * 190, 40 + p.r() * 90]);
return <g>
<rect x={-720} y={-300} width={1440} height={300} fill={p.c(w)} />
{patches.map(([x, y, s], i) => <rect key={i} x={x} y={y} width={s} height={s * 0.36} rx={s * 0.18} fill={i % 2 ? p.lo(w, 0.14) : p.hi(w, 0.14)} />)}
{[-540, -180, 180, 540].map((x) => <g key={x}><rect x={x - 26} y={-312} width={52} height={312} fill={p.c(w)} /><rect x={x + 8} y={-312} width={18} height={312} fill={p.lo(w, 0.3)} /></g>)}
<rect x={-730} y={-324} width={1460} height={28} rx={4} fill={p.hi(w, 0.22)} />
<rect x={-730} y={-300} width={1460} height={22} fill={p.lo(w, 0.5)} opacity={0.75} />
<rect x={-720} y={-34} width={1440} height={34} fill={p.lo(w, 0.4)} />
</g>;
},
facade: (p, color) => {
// Prédio público visto de frente: escadaria, colunas, frontão triangular.
const stone = color ?? "#e6dac2";
const back = p.lo(stone, 0.42);
const cols = [-400, -240, -80, 80, 240, 400];
return <g>
<rect x={-470} y={-690} width={940} height={600} fill={back} />
{[-320, -160, 0, 160, 320].map((x) => <path key={x} d={`M${x - 42} -180 L${x - 42} -470 A42 42 0 0 1 ${x + 42} -470 L${x + 42} -180 Z`} fill={p.c(mix(p.pal.sky[1], p.pal.ink, p.night ? 0.7 : 0.45))} />)}
{[-320, -160, 0, 160, 320].map((x) => <rect key={x} x={x - 42} y={-200} width={84} height={20} fill={p.lo(stone, 0.45)} />)}
{cols.map((x) => <g key={x}>
<rect x={x - 32} y={-660} width={64} height={560} fill={p.c(stone)} />
<rect x={x - 32} y={-660} width={14} height={560} fill={p.hi(stone, 0.3)} />
<rect x={x + 8} y={-660} width={24} height={560} fill={p.lo(stone, 0.42)} />
<rect x={x - 46} y={-686} width={92} height={28} rx={4} fill={p.hi(stone, 0.12)} />
<rect x={x + 18} y={-686} width={28} height={28} fill={p.lo(stone, 0.3)} />
<rect x={x - 44} y={-120} width={88} height={24} fill={p.c(stone)} /><rect x={x + 16} y={-120} width={28} height={24} fill={p.lo(stone, 0.3)} />
</g>)}
<rect x={-500} y={-770} width={1000} height={86} fill={p.c(stone)} />
<rect x={-500} y={-704} width={1000} height={20} fill={p.lo(stone, 0.35)} />
<rect x={-500} y={-770} width={1000} height={14} fill={p.hi(stone, 0.3)} />
<polygon points="-530,-770 0,-930 530,-770" fill={p.c(stone)} />
<polygon points="-440,-786 0,-904 440,-786" fill={p.lo(stone, 0.22)} />
<polygon points="0,-930 530,-770 500,-770 0,-916" fill={p.lo(stone, 0.4)} />
<polygon points="-530,-770 0,-930 0,-916 -500,-770" fill={p.hi(stone, 0.3)} />
{/* base e degraus */}
<rect x={-490} y={-100} width={980} height={30} fill={p.c(stone)} />
{[0, 1, 2].map((i) => <g key={i}>
<rect x={-520 - i * 30} y={-70 + i * 24} width={1040 + i * 60} height={24} fill={p.c(mix(stone, "#a8a090", 0.2))} />
<rect x={-520 - i * 30} y={-70 + i * 24} width={1040 + i * 60} height={6} fill={p.hi(stone, 0.35)} />
</g>)}
</g>;
},
shopfront: (p, color) => {
// Loja/oficina de rua: toldo listrado, letreiro em branco, porta de enrolar meio aberta e o interior escuro.
const wall = mix(p.pal.near, "#eeb04a", 0.75);
const awn = color ?? "#d65a3a";
const inside = mix(wall, p.pal.ink, 0.62);
const n = 9;
const stripe = 800 / n;
return <g>
<polygon points="400,0 400,-700 470,-670 470,-10" fill={p.lo(wall, 0.42)} />
<rect x={-400} y={-700} width={800} height={700} fill={p.c(wall)} />
<rect x={-400} y={-700} width={24} height={700} fill={p.hi(wall, 0.16)} />
{/* vão da garagem com ferramentas na parede do fundo */}
<rect x={-300} y={-420} width={600} height={420} fill={p.c(inside)} />
<rect x={-300} y={-420} width={600} height={60} fill={p.lo(inside, 0.4)} />
<rect x={40} y={-330} width={220} height={150} rx={6} fill={p.c(mix(inside, "#8a6a4a", 0.35))} />
{[70, 110, 150, 190, 230].map((x, i) => <rect key={x} x={x - 6} y={-310} width={12} height={i % 2 ? 90 : 70} rx={5} fill={p.c(i % 3 ? "#b8bcc4" : "#e8b030")} />)}
<rect x={-270} y={-200} width={200} height={14} fill={p.c(mix(inside, "#8a6a4a", 0.4))} />
{[0, 1].map((i) => <ellipse key={i} cx={-200 + i * 50} cy={-60 - i * 10} rx={60} ry={60} fill={p.c("#2a2a32")} />)}
{[0, 1].map((i) => <ellipse key={i} cx={-200 + i * 50} cy={-60 - i * 10} rx={26} ry={26} fill={p.c("#4a4a56")} />)}
<rect x={-300} y={-440} width={600} height={70} fill={p.c(mix(wall, "#c8c8cc", 0.6))} />
{[0, 1, 2, 3].map((i) => <rect key={i} x={-300} y={-432 + i * 16} width={600} height={4} fill={p.lo("#c8c8cc", 0.35)} />)}
<rect x={-312} y={-452} width={24} height={452} fill={p.hi(wall, 0.1)} /><rect x={288} y={-452} width={24} height={452} fill={p.lo(wall, 0.25)} />
{/* letreiro */}
<rect x={-340} y={-580} width={680} height={110} rx={10} fill={p.c("#f4ecdc")} />
<rect x={-340} y={-490} width={680} height={20} rx={6} fill={p.lo("#f4ecdc", 0.28)} />
{/* toldo listrado com a borda em ondas */}
<polygon points="-380,-700 380,-700 450,-610 -450,-610" fill={p.c(awn)} />
{Array.from({ length: n }, (_, i) => i % 2 === 1 && (
<polygon key={i} points={`${-380 + i * (760 / n)},-700 ${-380 + (i + 1) * (760 / n)},-700 ${-450 + (i + 1) * stripe * 1.125},-610 ${-450 + i * stripe * 1.125},-610`} fill={p.lo(awn, 0.2)} />
))}
{Array.from({ length: n }, (_, i) => <path key={i} d={`M${-450 + i * 100} -610 a50 26 0 0 0 100 0 Z`} fill={i % 2 ? p.lo(awn, 0.2) : p.c(awn)} />)}
<rect x={-450} y={-614} width={900} height={10} fill={p.lo(awn, 0.25)} />
<rect x={-400} y={-584} width={800} height={16} fill={p.lo(wall, 0.45)} opacity={0.7} />
<rect x={-400} y={-28} width={800} height={28} fill={p.lo(wall, 0.4)} />
</g>;
},
fence: (p, color) => {
const wood = color ?? mix(p.pal.trunk, "#d8c0a0", 0.35);
const xs = Array.from({ length: 13 }, (_, i) => -450 + i * 75);
const body = xs.map((x) => `M${x - 18} 0 L${x - 18} -200 L${x} -230 L${x + 18} -200 L${x + 18} 0 Z`).join(" ");
const side = xs.map((x) => `M${x + 6} 0 L${x + 6} -212 L${x} -230 L${x + 18} -200 L${x + 18} 0 Z`).join(" ");
return <g>
<rect x={-470} y={-170} width={940} height={26} fill={p.lo(wood, 0.35)} />
<rect x={-470} y={-70} width={940} height={26} fill={p.lo(wood, 0.35)} />
<path d={body} fill={p.c(wood)} />
<path d={side} fill={p.lo(wood, 0.36)} />
</g>;
},
bench: (p, color) => {
const wood = color ?? "#a0663e";
const iron = p.pal.ink;
return <g>
{[-200, 200].map((x) => <g key={x}>
<path d={`M${x - 16} 0 L${x - 10} -150 L${x + 10} -150 L${x + 16} 0 Z`} fill={p.c(mix(iron, "#555a66", 0.4))} />
<path d={`M${x - 6} -150 L${x - 2} -300 L${x + 14} -300 L${x + 10} -150 Z`} fill={p.c(mix(iron, "#555a66", 0.4))} />
</g>)}
<Box x={-260} y={-168} w={520} h={22} fill={wood} p={p} side={0.08} top={6} rx={5} />
<Box x={-260} y={-140} w={520} h={18} fill={mix(wood, "#000000", 0.1)} p={p} side={0.08} rx={5} />
{[-300, -250].map((y) => <Box key={y} x={-260} y={y} w={520} h={36} fill={wood} p={p} side={0.08} top={8} rx={6} />)}
<rect x={-260} y={-146} width={520} height={10} fill={p.lo(wood, 0.55)} opacity={0.7} />
</g>;
},
lamp: (p) => {
const pole = mix(p.pal.ink, "#4a5060", 0.35);
return <g>
{p.night && <path d="M-40 -780 L-260 0 L260 0 L40 -780 Z" fill={p.pal.light} opacity={0.07} />}
<rect x={-34} y={-60} width={68} height={60} rx={8} fill={p.c(pole)} />
<rect x={-12} y={-820} width={24} height={780} fill={p.c(pole)} /><rect x={2} y={-820} width={10} height={780} fill={p.lo(pole, 0.4)} />
<path d="M-56 -800 L56 -800 L40 -870 L-40 -870 Z" fill={p.c(p.night ? p.pal.light : mix(p.pal.sky[2], "#ffffff", 0.4))} />
<rect x={-64} y={-806} width={128} height={14} rx={5} fill={p.c(pole)} />
<path d="M-50 -870 L50 -870 L0 -904 Z" fill={p.c(pole)} /><path d="M0 -904 L50 -870 L20 -870 Z" fill={p.lo(pole, 0.4)} />
{p.night && <circle cx={0} cy={-836} r={90} fill={p.pal.light} opacity={0.12} />}
</g>;
},
gravestone: (p, color) => {
const s = color ?? p.pal.stone;
return <g>
<path d="M-110 0 L-110 -240 Q-110 -340 0 -340 Q110 -340 110 -240 L110 0 Z" fill={p.c(s)} />
<path d="M60 -330 Q110 -310 110 -240 L110 0 L68 0 L68 -240 Q68 -300 60 -330 Z" fill={p.lo(s, 0.38)} />
<path d="M-110 -240 Q-110 -330 -20 -340 Q-80 -320 -88 -240 Z" fill={p.hi(s, 0.2)} />
{[-230, -192, -156].map((y, i) => <rect key={y} x={-56 + i * 6} y={y} width={112 - i * 12} height={10} rx={5} fill={p.lo(s, 0.5)} />)}
<path d="M-130 0 Q-100 -30 -80 0 M90 0 Q110 -26 130 0" stroke={p.c(p.pal.leaf)} strokeWidth={10} fill="none" />
</g>;
},
cross: (p, color) => {
const s = color ?? p.pal.stone;
return <g>
<rect x={-24} y={-400} width={48} height={400} fill={p.c(s)} /><rect x={6} y={-400} width={18} height={400} fill={p.lo(s, 0.38)} />
<rect x={-120} y={-320} width={240} height={44} fill={p.c(s)} /><rect x={-120} y={-288} width={240} height={12} fill={p.lo(s, 0.45)} />
<rect x={-120} y={-320} width={240} height={8} fill={p.hi(s, 0.25)} />
</g>;
},
car: (p, color) => {
const c = color ?? "#c8443a";
const glass = mix(p.pal.sky[1], "#ffffff", 0.25);
return <g transform="scale(2.5)">
<path d="M-150 -40 L-150 -90 Q-140 -110 -100 -112 L-60 -160 L70 -160 L110 -112 L150 -100 L150 -40 Z" fill={p.c(c)} />
<path d="M-150 -74 L150 -74 L150 -40 L-150 -40 Z" fill={p.lo(c, 0.3)} />
<path d="M-100 -112 L-60 -160 L-40 -160 L-80 -112 Z" fill={p.hi(c, 0.25)} />
<path d="M-50 -150 L-4 -150 L-4 -114 L-78 -114 Z" fill={p.c(glass)} /><path d="M8 -150 L64 -150 L96 -114 L8 -114 Z" fill={p.lo(glass, 0.25)} />
<path d="M-30 -146 L-16 -146 L-34 -118 L-48 -118 Z" fill="#ffffff" opacity={0.5} />
<rect x={140} y={-96} width={12} height={14} rx={3} fill={p.c("#ffe6a0")} /><rect x={-152} y={-92} width={10} height={12} rx={3} fill={p.c("#e84a3a")} />
<rect x={-156} y={-48} width={312} height={10} rx={4} fill={p.lo(c, 0.5)} />
{[-90, 95].map((x) => <g key={x}><circle cx={x} cy={-35} r={32} fill={p.c("#1e1f26")} /><circle cx={x} cy={-35} r={15} fill={p.c("#9ea2ac")} /><circle cx={x + 4} cy={-33} r={8} fill={p.lo("#9ea2ac", 0.4)} /></g>)}
</g>;
},
sign: (p, color) => {
const c = color ?? "#2f6d3a";
return <g>
<rect x={-12} y={-440} width={24} height={440} fill={p.c(p.pal.ink)} /><rect x={2} y={-440} width={10} height={440} fill={p.lo(p.pal.ink, 0.3)} />
<rect x={-180} y={-540} width={360} height={150} rx={14} fill={p.c("#ffffff")} />
<rect x={-170} y={-530} width={340} height={130} rx={10} fill={p.c(c)} />
<rect x={-170} y={-430} width={340} height={30} rx={10} fill={p.lo(c, 0.3)} />
<rect x={-130} y={-500} width={200} height={14} rx={7} fill="#ffffff" opacity={0.55} /><rect x={-130} y={-472} width={140} height={14} rx={7} fill="#ffffff" opacity={0.4} />
</g>;
},
crate: (p, color) => {
const w = color ?? "#b0804a";
const dark = p.lo(w, 0.45);
return <g>
<polygon points="-130,-260 -92,-300 168,-300 130,-260" fill={p.hi(w, 0.25)} />
<polygon points="130,-260 168,-300 168,-38 130,0" fill={p.lo(w, 0.4)} />
<rect x={-130} y={-260} width={260} height={260} fill={p.c(w)} />
{[-195, -130, -65].map((y) => <rect key={y} x={-130} y={y} width={260} height={5} fill={dark} opacity={0.6} />)}
<path d="M-112 -242 L112 -18" stroke={p.c(mix(w, "#5a3a1a", 0.35))} strokeWidth={26} />
<path d="M-104 -250 L120 -26" stroke={dark} strokeWidth={6} />
<rect x={-130} y={-260} width={260} height={260} fill="none" stroke={p.c(mix(w, "#5a3a1a", 0.35))} strokeWidth={22} />
<rect x={108} y={-260} width={22} height={260} fill={dark} opacity={0.6} />
</g>;
},
tent: (p, color) => {
const c = color ?? "#d9773a";
return <g>
<path d="M-340 0 L0 -440 L340 0 Z" fill={p.c(c)} />
<path d="M0 -440 L340 0 L60 0 Z" fill={p.lo(c, 0.36)} />
<path d="M0 -440 L-340 0 L-300 0 Z" fill={p.hi(c, 0.25)} />
<path d="M-90 0 L0 -250 L90 0 Z" fill={p.c(mix(c, p.pal.ink, 0.75))} />
<path d="M0 -250 L-130 0 L-90 0 Z" fill={p.hi(c, 0.15)} />
<path d="M0 -440 L0 -480 M-340 0 L-420 -20 M340 0 L420 -20" stroke={p.c(p.pal.ink)} strokeWidth={6} />
</g>;
},
fire: (p) => <g>
<ellipse cx={0} cy={-8} rx={260} ry={40} fill={p.pal.light} opacity={0.22} />
<path d="M-110 -10 L100 -50 M-100 -50 L110 -10" stroke={p.c(p.pal.trunk)} strokeWidth={30} strokeLinecap="round" />
<path d="M-104 -16 L96 -54" stroke={p.lo(p.pal.trunk, 0.4)} strokeWidth={10} strokeLinecap="round" />
<path d="M-80 -30 Q-100 -150 -24 -230 Q-14 -150 34 -132 Q54 -210 18 -290 Q130 -200 86 -30 Z" fill="#e8562a" />
<path d="M-56 -32 Q-66 -120 -10 -180 Q0 -110 40 -100 Q54 -150 40 -200 Q100 -130 66 -32 Z" fill="#ff9a2a" />
<path d="M-24 -32 Q-34 -96 8 -130 Q16 -84 40 -76 Q48 -54 34 -32 Z" fill="#ffe066" />
</g>,
ark: (p, color) => {
// Arca: casco de tábuas com betume escuro embaixo, casa de um andar em cima com janelinhas e uma porta.
const wood = color ?? "#8a5a32";
const cabin = mix(wood, "#ffffff", 0.12);
return <g>
<path d="M-390 -150 L390 -150 Q362 -26 290 0 L-290 0 Q-362 -26 -390 -150 Z" fill={p.c(wood)} />
<path d="M-390 -150 L-340 -150 Q-330 -40 -270 0 L-290 0 Q-362 -26 -390 -150 Z" fill={p.hi(wood, 0.2)} />
<path d="M180 -150 L390 -150 Q362 -26 290 0 L160 0 Q200 -60 180 -150 Z" fill={p.lo(wood, 0.3)} />
<path d="M-370 -60 Q-330 -6 -290 0 L290 0 Q330 -6 370 -60 Z" fill={p.c("#3a2a22")} opacity={0.8} />
{[-120, -92, -64, -36].map((y) => <path key={y} d={`M${-386 + (y + 150) * 0.2} ${y} L${386 - (y + 150) * 0.2} ${y}`} stroke={p.lo(wood, 0.5)} strokeWidth={5} opacity={0.7} />)}
<rect x={-400} y={-162} width={800} height={18} rx={6} fill={p.hi(mix(wood, "#6b4426", 0.5), 0.2)} />
<rect x={-230} y={-290} width={460} height={130} fill={p.c(cabin)} />
<rect x={150} y={-290} width={80} height={130} fill={p.lo(cabin, 0.32)} />
{[-180, -110, -40, 30, 100].map((x) => <rect key={x} x={x} y={-262} width={34} height={26} rx={3} fill={p.c(mix(p.pal.ink, wood, 0.3))} />)}
<rect x={160} y={-224} width={56} height={64} rx={4} fill={p.lo("#4a2f1c", 0.3)} />
<polygon points="-262,-288 0,-352 262,-288" fill={p.c("#6a4428")} />
<polygon points="0,-352 262,-288 120,-288" fill={p.lo("#6a4428", 0.35)} />
</g>;
},
ark_frame: (p, color) => {
// Arca em construção: quilha, costelas curvas de madeira clara e só as primeiras fileiras de tábuas.
const wood = color ?? "#c9955a";
return <g>
<rect x={-380} y={-26} width={760} height={26} rx={6} fill={p.c("#7a5232")} />
{Array.from({ length: 11 }, (_, i) => {
const x = -330 + i * 66;
const k = 1 - Math.abs(x) / 420;
const d = `M${x} -20 Q${x * 1.02} ${-110 - k * 40} ${x * 1.14} ${-170 - k * 30}`;
return <g key={i}><path d={d} stroke={p.c(wood)} strokeWidth={16} fill="none" strokeLinecap="round" />
<path d={d} transform="translate(5 0)" stroke={p.lo(wood, 0.35)} strokeWidth={6} fill="none" strokeLinecap="round" /></g>;
})}
<path d="M-360 -60 Q-320 -12 -280 -14 L280 -14 Q320 -12 360 -60 L340 -92 Q300 -54 270 -56 L-270 -56 Q-300 -54 -340 -92 Z" fill={p.c("#8a5a32")} />
<path d="M-300 -34 L300 -34" stroke={p.lo("#8a5a32", 0.5)} strokeWidth={5} />
<rect x={-390} y={-200} width={780} height={12} rx={5} fill={p.c(wood)} />
<rect x={-390} y={-192} width={780} height={4} rx={2} fill={p.lo(wood, 0.4)} />
</g>;
},
scaffold: (p, color) => {
const wood = color ?? "#a87a48";
return <g strokeLinecap="round">
<path d="M-110 0 L-110 -330 M110 0 L110 -330" strokeWidth={14} stroke={p.c(wood)} />
<path d="M-104 0 L-104 -330 M116 0 L116 -330" strokeWidth={5} stroke={p.lo(wood, 0.4)} />
<path d="M-130 -120 L130 -120 M-130 -240 L130 -240" strokeWidth={18} stroke={p.c("#7a5232")} />
<path d="M-130 -114 L130 -114 M-130 -234 L130 -234" strokeWidth={6} stroke={p.lo("#7a5232", 0.4)} />
<path d="M-110 -10 L110 -120 M110 -130 L-110 -240" strokeWidth={8} stroke={p.c(wood)} opacity={0.85} />
</g>;
},
planks: (p, color) => {
const w = color ?? "#c9955a";
return <g>{[0, 1, 2, 3].map((i) => <Box key={i} x={-170 + (i % 2) * 22} y={-26 - i * 22} w={340 - i * 14} h={20} fill={i % 2 ? w : mix(w, "#000000", 0.12)} p={p} side={0.1} top={5} rx={4} />)}</g>;
},
};
/**
* Parte da FRENTE das peças que podem ter gente dentro (casco e amurada da arca; lataria abaixo das janelas do
* carro). Com `occupied: true` no lugar, ela é desenhada de novo POR CIMA dos personagens: eles ficam "dentro".
*/
export const FRONT_PART: Record<string, Draw> = {
ark: (p, color) => {
const wood = color ?? "#8a5a32";
return <g>
<path d="M-390 -150 L390 -150 Q362 -26 290 0 L-290 0 Q-362 -26 -390 -150 Z" fill={p.c(wood)} />
<path d="M-390 -150 L-340 -150 Q-330 -40 -270 0 L-290 0 Q-362 -26 -390 -150 Z" fill={p.hi(wood, 0.2)} />
<path d="M180 -150 L390 -150 Q362 -26 290 0 L160 0 Q200 -60 180 -150 Z" fill={p.lo(wood, 0.3)} />
<path d="M-370 -60 Q-330 -6 -290 0 L290 0 Q330 -6 370 -60 Z" fill={p.c("#3a2a22")} opacity={0.8} />
{[-120, -92, -64, -36].map((y) => <path key={y} d={`M${-386 + (y + 150) * 0.2} ${y} L${386 - (y + 150) * 0.2} ${y}`} stroke={p.lo(wood, 0.5)} strokeWidth={5} opacity={0.7} />)}
<rect x={-400} y={-162} width={800} height={18} rx={6} fill={p.hi(mix(wood, "#6b4426", 0.5), 0.2)} />
</g>;
},
car: (p, color) => {
const c = color ?? "#c8443a";
return <g transform="scale(2.5)">
<path d="M-150 -40 L-150 -90 Q-140 -110 -100 -112 L150 -100 L150 -40 Z" fill={p.c(c)} />
<path d="M-150 -74 L150 -74 L150 -40 L-150 -40 Z" fill={p.lo(c, 0.3)} />
<rect x={140} y={-96} width={12} height={14} rx={3} fill={p.c("#ffe6a0")} /><rect x={-152} y={-92} width={10} height={12} rx={3} fill={p.c("#e84a3a")} />
<rect x={-156} y={-48} width={312} height={10} rx={4} fill={p.lo(c, 0.5)} />
{[-90, 95].map((x) => <g key={x}><circle cx={x} cy={-35} r={32} fill={p.c("#1e1f26")} /><circle cx={x} cy={-35} r={15} fill={p.c("#9ea2ac")} /><circle cx={x + 4} cy={-33} r={8} fill={p.lo("#9ea2ac", 0.4)} /></g>)}
</g>;
},
};
+343
View File
@@ -0,0 +1,343 @@
// Peças de interior: porta, janela, mesa, cama, estante, arquivo, armários de metal, quadro, luminárias, escrivaninha,
// varal. Base em (0,0) no chão; as de parede (janela, quadro, varal) já desenham na altura certa acima do chão; a
// luminária pendente tem a origem no TETO (y cresce para baixo). Luz da esquerda.
import React from "react";
import { mix, type Paint } from "./paint";
import { Box } from "./built";
import type { Draw } from "./nature";
const BOOKS = ["#c8483a", "#e0a63a", "#3f78b8", "#4f9a6a", "#e8e0cc", "#7a4a8a", "#2f4a6a", "#b86a3a"];
const CLOTHES = ["#4f9a5a", "#e2b33a", "#c8483a", "#3f6aa8", "#e8e2d6", "#7f9a5a", "#8a5ab0"];
/** Taça de troféu (dourada), base no chão da prateleira. */
function Trophy({ x, y, s, p }: { x: number; y: number; s: number; p: Paint }) {
const g = "#d6a536";
return <g transform={`translate(${x} ${y}) scale(${s})`}>
<rect x={-24} y={-14} width={48} height={14} rx={2} fill={p.c(mix(g, "#5a4020", 0.4))} />
<rect x={-6} y={-40} width={12} height={28} fill={p.c(g)} />
<path d="M-34 -100 L34 -100 Q32 -52 0 -40 Q-32 -52 -34 -100 Z" fill={p.c(g)} />
<path d="M6 -100 L34 -100 Q32 -52 0 -40 Q14 -60 6 -100 Z" fill={p.lo(g, 0.38)} />
<path d="M-34 -92 Q-56 -88 -48 -70 Q-42 -60 -26 -62 M34 -92 Q56 -88 48 -70 Q42 -60 26 -62" stroke={p.c(g)} strokeWidth={6} fill="none" />
<rect x={-26} y={-96} width={8} height={30} rx={4} fill={p.hi(g, 0.5)} />
</g>;
}
/** O que vai numa prateleira (sorteado pela semente): livros, troféu, potes/caixas ou planta. */
function ShelfItems({ x0, x1, y, h, p }: { x0: number; x1: number; y: number; h: number; p: Paint }) {
const kind = p.r();
if (kind < 0.18) return <Trophy x={(x0 + x1) / 2 + (p.r() - 0.5) * 80} y={y} s={h / 110} p={p} />;
if (kind < 0.3) {
return <g>{[0, 1, 2].map((i) => {
const c = BOOKS[Math.floor(p.r() * BOOKS.length)];
const w = 60 + p.r() * 30;
const hh = h * (0.4 + p.r() * 0.35);
const x = x0 + 14 + i * ((x1 - x0) / 3);
return <g key={i}><rect x={x} y={y - hh} width={w} height={hh} rx={6} fill={p.c(c)} /><rect x={x + w * 0.7} y={y - hh} width={w * 0.3} height={hh} rx={4} fill={p.lo(c, 0.35)} /></g>;
})}</g>;
}
if (kind < 0.38) {
const pot = "#c0704a";
const cx = (x0 + x1) / 2;
return <g>
<path d={`M${cx - 40} ${y - 60} L${cx + 40} ${y - 60} L${cx + 30} ${y} L${cx - 30} ${y} Z`} fill={p.c(pot)} />
<path d={`M${cx + 10} ${y - 60} L${cx + 40} ${y - 60} L${cx + 30} ${y} L${cx + 8} ${y} Z`} fill={p.lo(pot, 0.35)} />
{[-50, -15, 20, 50].map((dx, i) => <ellipse key={i} cx={cx + dx} cy={y - 70 - (i % 2) * 30} rx={22} ry={44} transform={`rotate(${dx / 2} ${cx + dx} ${y - 70})`} fill={i % 2 ? p.lo(p.pal.leaf, 0.3) : p.c(p.pal.leaf)} />)}
</g>;
}
// Livros em pé, de alturas e cores variadas (às vezes um deitado no fim da fileira).
const books: React.ReactNode[] = [];
let x = x0 + 6;
while (x < x1 - 30) {
const w = 18 + p.r() * 16;
const hh = h * (0.62 + p.r() * 0.32);
const c = BOOKS[Math.floor(p.r() * BOOKS.length)];
books.push(<g key={x}><rect x={x} y={y - hh} width={w} height={hh} rx={2} fill={p.c(c)} /><rect x={x + w * 0.62} y={y - hh} width={w * 0.38} height={hh} fill={p.lo(c, 0.35)} />
<rect x={x} y={y - hh * 0.8} width={w} height={4} fill={p.hi(c, 0.4)} /></g>);
x += w + 2;
if (p.r() < 0.12) x += 24;
}
return <g>{books}</g>;
}
export const INDOOR: Record<string, Draw> = {
door: (p, color) => {
const d = color ?? "#6e4a30";
const trim = mix(p.pal.wall, "#f4ece0", 0.55);
return <g>
<rect x={-172} y={-664} width={344} height={664} rx={6} fill={p.c(trim)} />
<rect x={140} y={-664} width={32} height={664} fill={p.lo(trim, 0.3)} />
<rect x={-150} y={-640} width={300} height={640} fill={p.c(d)} />
<rect x={110} y={-640} width={40} height={640} fill={p.lo(d, 0.35)} />
{[[-600, 250], [-320, 270]].map(([y, h]) => <g key={y}>
<rect x={-112} y={y} width={200} height={h} rx={4} fill={p.lo(d, 0.16)} />
<rect x={-112} y={y} width={12} height={h} fill={p.lo(d, 0.42)} /><rect x={-112} y={y} width={200} height={10} fill={p.lo(d, 0.42)} />
<rect x={76} y={y} width={12} height={h} fill={p.hi(d, 0.25)} /><rect x={-112} y={y + h - 10} width={200} height={10} fill={p.hi(d, 0.25)} />
</g>)}
<rect x={96} y={-350} width={22} height={70} rx={8} fill={p.c("#c9a560")} />
<circle cx={107} cy={-316} r={12} fill={p.hi("#e6c27a", 0.3)} />
</g>;
},
window: (p, color) => {
// Janela na parede: moldura, céu lá fora (claro de dia, escuro com lua à noite), copa de árvore, cortinas.
const trim = mix(p.pal.wall, "#f4ece0", 0.6);
const out = color ?? (p.night ? "#1c2a5a" : mix(p.pal.sky[2], "#ffffff", 0.25));
const outTop = p.night ? "#121c44" : mix(p.pal.sky[1], "#ffffff", 0.2);
const curtain = p.r() > 0.45 ? ["#b8483a", "#3f6aa8", "#c89a3a", "#6a8a4a"][Math.floor(p.r() * 4)] : null;
return <g>
<rect x={-210} y={-640} width={420} height={420} rx={6} fill={p.c(trim)} />
<rect x={180} y={-640} width={30} height={420} fill={p.lo(trim, 0.3)} />
<rect x={-186} y={-616} width={372} height={372} fill={p.c(out)} />
<rect x={-186} y={-616} width={372} height={170} fill={p.c(outTop)} />
{p.night && <circle cx={-90} cy={-540} r={30} fill={p.c("#f4ecc8")} />}
<g fill={p.night ? p.c("#1a3040") : p.c(mix(p.pal.leaf, out, 0.35))}>
<circle cx={-140} cy={-300} r={90} /><circle cx={-40} cy={-280} r={70} /><circle cx={120} cy={-290} r={80} /><circle cx={-170} cy={-380} r={60} />
</g>
<path d="M-120 -616 L-40 -616 L-186 -380 L-186 -510 Z" fill="#ffffff" opacity={0.14} />
<rect x={-8} y={-616} width={16} height={372} fill={p.c(trim)} /><rect x={-186} y={-438} width={372} height={16} fill={p.c(trim)} />
<rect x={2} y={-616} width={6} height={372} fill={p.lo(trim, 0.3)} />
<rect x={-232} y={-236} width={464} height={26} rx={5} fill={p.hi(trim, 0.2)} />
<rect x={-224} y={-210} width={448} height={14} fill={p.lo(p.pal.wall, 0.45)} opacity={0.7} />
{curtain && [-1, 1].map((s) => <g key={s}>
<path d={`M${s * 190} -666 L${s * 270} -666 L${s * 290} -200 L${s * 200} -200 Q${s * 214} -440 ${s * 190} -666 Z`} fill={p.c(curtain)} />
<path d={`M${s * 236} -666 L${s * 270} -666 L${s * 290} -200 L${s * 250} -200 Z`} fill={s > 0 ? p.lo(curtain, 0.35) : p.hi(curtain, 0.18)} />
<path d={`M${s * 214} -640 L${s * 224} -210`} stroke={p.lo(curtain, 0.3)} strokeWidth={6} />
</g>)}
{curtain && <rect x={-300} y={-680} width={600} height={16} rx={8} fill={p.c(mix(p.pal.trunk, "#8a6a4a", 0.3))} />}
</g>;
},
table: (p, color) => {
const w = color ?? "#9a643c";
return <g>
{[-236, 220].map((x) => <rect key={x} x={x} y={-300} width={18} height={270} fill={p.lo(w, 0.5)} />)}
<polygon points="-280,-270 280,-270 250,-304 -250,-304" fill={p.hi(w, 0.22)} />
<rect x={-280} y={-270} width={560} height={28} fill={p.c(w)} />
<rect x={-280} y={-248} width={560} height={6} fill={p.lo(w, 0.45)} />
<rect x={236} y={-270} width={44} height={28} fill={p.lo(w, 0.32)} />
{[-262, 236].map((x) => <g key={x}><rect x={x} y={-242} width={26} height={242} fill={p.c(w)} /><rect x={x + 14} y={-242} width={12} height={242} fill={p.lo(w, 0.38)} /></g>)}
</g>;
},
bed: (p, color) => {
const blanket = color ?? "#4f64a8";
const wood = mix(p.pal.trunk, "#9a6a40", 0.4);
const sheet = "#ecebe6";
return <g>
<path d="M-390 0 L-390 -330 Q-390 -380 -350 -380 Q-320 -380 -320 -330 L-320 0 Z" fill={p.c(wood)} />
<rect x={-340} y={-380} width={20} height={380} fill={p.lo(wood, 0.35)} />
<rect x={-330} y={-118} width={680} height={50} fill={p.c(wood)} /><rect x={-330} y={-80} width={680} height={12} fill={p.lo(wood, 0.4)} />
<rect x={-320} y={-210} width={660} height={96} rx={18} fill={p.c(sheet)} />
<rect x={-312} y={-262} width={160} height={64} rx={28} fill={p.hi(sheet, 0.2)} />
<path d="M-180 -262 Q-160 -230 -168 -200" stroke={p.lo(sheet, 0.3)} strokeWidth={6} fill="none" />
<path d="M-120 -222 Q100 -238 344 -214 L350 -96 Q120 -88 -120 -100 Z" fill={p.c(blanket)} />
<path d="M-120 -222 Q100 -238 344 -214 L344 -196 Q100 -214 -120 -204 Z" fill={p.hi(blanket, 0.25)} />
<path d="M0 -224 Q20 -160 -10 -100 M150 -228 Q180 -170 160 -94" stroke={p.lo(blanket, 0.35)} strokeWidth={10} fill="none" strokeLinecap="round" />
<rect x={300} y={-216} width={50} height={120} fill={p.lo(blanket, 0.3)} />
<rect x={340} y={-260} width={36} height={260} rx={6} fill={p.c(wood)} /><rect x={360} y={-260} width={16} height={260} fill={p.lo(wood, 0.4)} />
{[-310, 320].map((x) => <rect key={x} x={x} y={-70} width={22} height={70} fill={p.lo(wood, 0.3)} />)}
</g>;
},
shelf: (p, color) => {
const w = color ?? mix(p.pal.trunk, "#8a5a36", 0.4);
const back = p.lo(w, 0.55);
const ys = [-616, -466, -316, -166];
return <g>
<polygon points="200,0 200,-640 236,-664 236,-16" fill={p.lo(w, 0.42)} />
<rect x={-200} y={-640} width={400} height={640} fill={p.c(w)} />
<rect x={-176} y={-616} width={352} height={590} fill={back} />
{ys.map((y) => <g key={y}>
<rect x={-176} y={y + 122} width={352} height={14} fill={p.lo(w, 0.7)} opacity={0.5} />
<ShelfItems x0={-170} x1={170} y={y + 128} h={118} p={p} />
<rect x={-180} y={y + 128} width={360} height={22} fill={p.c(w)} />
<rect x={-180} y={y + 128} width={360} height={6} fill={p.hi(w, 0.3)} />
</g>)}
<rect x={-200} y={-640} width={24} height={640} fill={p.hi(w, 0.14)} />
<rect x={176} y={-640} width={24} height={640} fill={p.lo(w, 0.25)} />
<rect x={-214} y={-664} width={428} height={28} rx={4} fill={p.hi(w, 0.18)} />
<polygon points="214,-664 250,-686 250,-662 214,-636" fill={p.lo(w, 0.5)} />
</g>;
},
cabinet: (p, color) => {
// Arquivo/armário de gavetas.
const m = color ?? "#6f7f8a";
return <g>
<polygon points="150,0 150,-560 192,-584 192,-18" fill={p.lo(m, 0.42)} />
<polygon points="-150,-560 -108,-584 192,-584 150,-560" fill={p.hi(m, 0.3)} />
<rect x={-150} y={-560} width={300} height={560} fill={p.c(m)} />
{[0, 1, 2, 3].map((i) => {
const y = -540 + i * 132;
return <g key={i}>
<rect x={-130} y={y} width={260} height={118} rx={5} fill={p.c(mix(m, "#ffffff", 0.06))} />
<rect x={-130} y={y + 108} width={260} height={10} fill={p.lo(m, 0.4)} />
<rect x={-130} y={y} width={260} height={6} fill={p.hi(m, 0.25)} />
<rect x={-34} y={y + 26} width={68} height={26} rx={3} fill={p.c("#ece6d4")} />
<rect x={-46} y={y + 64} width={92} height={16} rx={8} fill={p.lo(m, 0.55)} />
<rect x={-46} y={y + 64} width={92} height={6} rx={3} fill={p.hi(m, 0.4)} />
</g>;
})}
<rect x={118} y={-560} width={32} height={560} fill={p.lo(m, 0.25)} />
</g>;
},
locker: (p, color) => {
// Fileira de 3 armários de metal (vestiário, escola, fábrica).
const m = color ?? "#3f5f8c";
return <g>
<polygon points="300,0 300,-760 340,-784 340,-20" fill={p.lo(m, 0.45)} />
<polygon points="-300,-760 -260,-784 340,-784 300,-760" fill={p.hi(m, 0.25)} />
<rect x={-300} y={-760} width={600} height={760} fill={p.lo(m, 0.3)} />
{[-1, 0, 1].map((k) => {
const x = k * 198 - 96;
return <g key={k}>
<rect x={x} y={-744} width={192} height={680} rx={4} fill={p.c(m)} />
<rect x={x + 160} y={-744} width={32} height={680} fill={p.lo(m, 0.28)} />
<rect x={x} y={-744} width={192} height={6} fill={p.hi(m, 0.3)} />
{[0, 1, 2, 3].map((i) => <rect key={i} x={x + 36} y={-700 + i * 26} width={110} height={12} rx={6} fill={p.lo(m, 0.55)} />)}
{[0, 1, 2].map((i) => <rect key={i} x={x + 36} y={-150 + i * 26} width={110} height={12} rx={6} fill={p.lo(m, 0.55)} />)}
<rect x={x + 150} y={-430} width={16} height={86} rx={8} fill={p.hi(m, 0.4)} />
<rect x={x + 60} y={-560} width={56} height={34} rx={4} fill={p.c("#ece6d4")} opacity={0.85} />
</g>;
})}
<rect x={-300} y={-64} width={600} height={64} fill={p.lo(m, 0.5)} />
</g>;
},
frame: (p, color) => {
// Quadro na parede (paisagem, foto de grupo, retrato ou abstrato).
const f = color ?? "#9a6a3a";
const kind = Math.floor(p.r() * 4);
const x = -170;
const y = -700;
const w = 340;
const h = 260;
const ix = x + 26;
const iy = y + 26;
const iw = w - 52;
const ih = h - 52;
const sepia = mix("#d8c8a0", p.pal.wall, 0.15);
const pic: React.ReactNode =
kind === 0 ? <g>
<rect x={ix} y={iy} width={iw} height={ih} fill={p.c(mix(p.pal.sky[1], "#ffffff", 0.3))} />
<circle cx={ix + iw * 0.25} cy={iy + ih * 0.3} r={22} fill={p.c("#ffe08a")} />
<path d={`M${ix} ${iy + ih} L${ix} ${iy + ih * 0.62} Q${ix + iw * 0.3} ${iy + ih * 0.4} ${ix + iw * 0.55} ${iy + ih * 0.62} Q${ix + iw * 0.8} ${iy + ih * 0.45} ${ix + iw} ${iy + ih * 0.6} L${ix + iw} ${iy + ih} Z`} fill={p.c("#6a9a5a")} />
<path d={`M${ix + iw * 0.55} ${iy + ih * 0.62} Q${ix + iw * 0.8} ${iy + ih * 0.45} ${ix + iw} ${iy + ih * 0.6} L${ix + iw} ${iy + ih} L${ix + iw * 0.5} ${iy + ih} Z`} fill={p.lo("#6a9a5a", 0.3)} />
</g>
: kind === 1 ? <g>
<rect x={ix} y={iy} width={iw} height={ih} fill={p.c(sepia)} />
{[0, 1, 2, 3, 4].map((i) => {
const cx = ix + 40 + i * ((iw - 80) / 4);
return <g key={i} fill={p.lo(sepia, 0.55)}><circle cx={cx} cy={iy + ih * 0.42} r={17} /><rect x={cx - 24} y={iy + ih * 0.42 + 18} width={48} height={ih * 0.4} rx={14} /></g>;
})}
<rect x={ix} y={iy + ih * 0.86} width={iw} height={ih * 0.14} fill={p.lo(sepia, 0.3)} />
</g>
: kind === 2 ? <g>
<rect x={ix} y={iy} width={iw} height={ih} fill={p.c("#c8b490")} />
<circle cx={ix + iw / 2} cy={iy + ih * 0.42} r={40} fill={p.lo("#c8b490", 0.5)} />
<path d={`M${ix + iw / 2 - 80} ${iy + ih} Q${ix + iw / 2} ${iy + ih * 0.55} ${ix + iw / 2 + 80} ${iy + ih} Z`} fill={p.lo("#c8b490", 0.5)} />
</g>
: <g>
<rect x={ix} y={iy} width={iw} height={ih} fill={p.c("#ece2cc")} />
<rect x={ix + 20} y={iy + 20} width={iw * 0.45} height={ih * 0.5} fill={p.c("#c8483a")} />
<rect x={ix + iw * 0.55} y={iy + ih * 0.35} width={iw * 0.35} height={ih * 0.5} fill={p.c("#3f6aa8")} />
<circle cx={ix + iw * 0.4} cy={iy + ih * 0.7} r={30} fill={p.c("#e2b33a")} />
</g>;
return <g>
<rect x={x + 14} y={y + 16} width={w} height={h} rx={4} fill={p.pal.ink} opacity={0.22} />
<rect x={x} y={y} width={w} height={h} rx={4} fill={p.c(f)} />
<rect x={x} y={y} width={w} height={10} fill={p.hi(f, 0.3)} /><rect x={x} y={y} width={10} height={h} fill={p.hi(f, 0.3)} />
<rect x={x + w - 12} y={y} width={12} height={h} fill={p.lo(f, 0.38)} /><rect x={x} y={y + h - 12} width={w} height={12} fill={p.lo(f, 0.38)} />
{pic}
<rect x={ix} y={iy} width={iw} height={8} fill={p.pal.ink} opacity={0.2} /><rect x={ix} y={iy} width={8} height={ih} fill={p.pal.ink} opacity={0.15} />
</g>;
},
pendant: (p, color) => {
// Luminária pendente: origem no teto, fio descendo, cúpula e a lâmpada acesa por baixo.
const s = color ?? "#2f3f6a";
return <g>
<rect x={-3} y={-20} width={6} height={290} fill={p.c(p.pal.ink)} />
<rect x={-18} y={250} width={36} height={24} rx={4} fill={p.c(mix(s, p.pal.ink, 0.3))} />
<circle cx={0} cy={372} r={150} fill={p.pal.light} opacity={0.14} />
<path d="M-130 370 Q-124 272 0 266 Q124 272 130 370 Z" fill={p.c(s)} />
<path d="M30 268 Q124 274 130 370 L60 370 Q66 300 30 268 Z" fill={p.lo(s, 0.38)} />
<path d="M-104 352 Q-104 296 -40 276 Q-84 300 -84 352 Z" fill={p.hi(s, 0.3)} />
<ellipse cx={0} cy={370} rx={130} ry={20} fill={p.pal.light} />
<ellipse cx={0} cy={376} rx={44} ry={24} fill="#fffbe8" />
</g>;
},
desklamp: (p, color) => {
// Luminária de mesa articulada, acesa (poça de luz na base). Fica em cima de mesa/escrivaninha próxima.
const m = color ?? "#5f7a4a";
return <g>
<path d="M40 -250 L240 0 L-40 0 L-10 -230 Z" fill={p.pal.light} opacity={0.16} />
<ellipse cx={100} cy={-4} rx={150} ry={22} fill={p.pal.light} opacity={0.3} />
<ellipse cx={-60} cy={-12} rx={70} ry={16} fill={p.c(m)} /><rect x={-130} y={-12} width={140} height={12} fill={p.lo(m, 0.35)} />
<path d="M-60 -16 L-100 -200 M-100 -200 L20 -300" stroke={p.c(m)} strokeWidth={18} strokeLinecap="round" fill="none" />
<path d="M-54 -18 L-94 -198" stroke={p.lo(m, 0.4)} strokeWidth={6} strokeLinecap="round" />
<circle cx={-100} cy={-200} r={16} fill={p.lo(m, 0.3)} />
<g transform="translate(20 -300) rotate(35)">
<path d="M-30 -30 L30 -30 L80 60 L-80 60 Z" fill={p.c(m)} />
<path d="M10 -30 L30 -30 L80 60 L40 60 Z" fill={p.lo(m, 0.4)} />
<ellipse cx={0} cy={60} rx={80} ry={14} fill={p.pal.light} />
<ellipse cx={0} cy={62} rx={30} ry={10} fill="#fffbe8" />
</g>
</g>;
},
desk: (p, color) => {
// Escrivaninha de 2 gaveteiros, com papéis, livros e caneca por cima.
const w = color ?? "#8a5a36";
const knob = "#d8b060";
return <g>
<rect x={-110} y={-276} width={220} height={236} fill={p.lo(w, 0.62)} />
{[-310, 110].map((x) => <g key={x}>
<rect x={x} y={-276} width={200} height={276} fill={p.c(w)} />
<rect x={x + 170} y={-276} width={30} height={276} fill={p.lo(w, 0.3)} />
{[0, 1, 2].map((i) => <g key={i}>
<rect x={x + 14} y={-262 + i * 86} width={172} height={74} rx={4} fill={p.c(mix(w, "#ffffff", 0.05))} />
<rect x={x + 14} y={-196 + i * 86} width={172} height={8} fill={p.lo(w, 0.45)} />
<circle cx={x + 100} cy={-226 + i * 86} r={11} fill={p.hi(knob, 0.2)} /><circle cx={x + 104} cy={-223 + i * 86} r={5} fill={p.lo(knob, 0.4)} />
</g>)}
</g>)}
<polygon points="-330,-300 330,-300 304,-330 -304,-330" fill={p.hi(w, 0.22)} />
<rect x={-330} y={-300} width={660} height={26} fill={p.c(w)} /><rect x={-330} y={-280} width={660} height={6} fill={p.lo(w, 0.5)} />
<rect x={290} y={-300} width={40} height={26} fill={p.lo(w, 0.32)} />
<g transform={`translate(${p.r() > 0.5 ? 90 : -230} -312)`}>
{[0, 1, 2].map((i) => <rect key={i} x={i * 4} y={-i * 7} width={130} height={8} rx={2} fill={p.c(i % 2 ? "#f2eee4" : "#e2dccc")} />)}
</g>
<g transform="translate(200 -312)">
<rect x={0} y={-30} width={100} height={30} rx={3} fill={p.c("#3f6aa8")} /><rect x={6} y={-54} width={90} height={24} rx={3} fill={p.c("#c8483a")} />
<rect x={70} y={-30} width={30} height={30} fill={p.lo("#3f6aa8", 0.35)} />
</g>
<g transform="translate(-90 -312)">
<rect x={-22} y={-48} width={44} height={48} rx={6} fill={p.c("#ece6d8")} /><rect x={6} y={-48} width={16} height={48} fill={p.lo("#ece6d8", 0.3)} />
<path d="M22 -38 Q42 -30 22 -14" stroke={p.c("#ece6d8")} strokeWidth={7} fill="none" />
</g>
</g>;
},
clothesline: (p, color) => {
// Varal: corda com roupas presas. Ao ar livre tem dois postes; dentro de casa fica preso na parede.
const rope = mix(p.pal.trunk, "#c8b08a", 0.5);
// Dentro de casa a corda vai de parede a parede (mais alta e mais comprida, sem postes).
const y0 = p.indoor ? -880 : -720;
const half = p.indoor ? 720 : 500;
const yAt = (t: number) => y0 + 120 * t * (1 - t);
const items = p.indoor ? [0.12, 0.25, 0.38, 0.51, 0.64, 0.77, 0.9] : [0.1, 0.26, 0.42, 0.58, 0.74, 0.9];
return <g>
{!p.indoor && [-500, 500].map((x) => <g key={x}><rect x={x - 14} y={-760} width={28} height={760} fill={p.c(p.pal.trunk)} /><rect x={x + 2} y={-760} width={12} height={760} fill={p.lo(p.pal.trunk, 0.4)} /></g>)}
<path d={`M${-half} ${y0} Q0 ${y0 + 120} ${half} ${y0}`} stroke={p.c(rope)} strokeWidth={6} fill="none" />
{items.map((t, i) => {
const x = -half + 2 * half * t;
const y = yAt(t);
const c = color && i % 2 === 0 ? color : CLOTHES[Math.floor(p.r() * CLOTHES.length)];
const towel = p.r() < 0.3;
const tilt = (t - 0.5) * 10;
return <g key={i} transform={`translate(${x} ${y - 4}) rotate(${tilt})`}>
{towel
? <g><rect x={-46} y={0} width={92} height={150} rx={4} fill={p.c(c)} /><rect x={18} y={0} width={28} height={150} fill={p.lo(c, 0.35)} />
<rect x={-46} y={120} width={92} height={10} fill={p.hi(c, 0.4)} /></g>
: <g>
<path d="M-40 0 L-86 26 L-68 64 L-46 54 L-46 168 L46 168 L46 54 L68 64 L86 26 L40 0 Q0 18 -40 0 Z" fill={p.c(c)} />
<path d="M14 8 L40 0 L86 26 L68 64 L46 54 L46 168 L14 168 Z" fill={p.lo(c, 0.35)} />
<path d="M-40 0 Q0 18 40 0 L28 -2 Q0 10 -28 -2 Z" fill={p.hi(c, 0.5)} />
</g>}
<rect x={-30} y={-12} width={10} height={22} rx={2} fill={p.c("#c8a070")} /><rect x={20} y={-12} width={10} height={22} rx={2} fill={p.c("#c8a070")} />
</g>;
})}
</g>;
},
};
+142
View File
@@ -0,0 +1,142 @@
// Peças da natureza: árvores, mato, pedras, montanha, nuvem, palmeira, ondas. Base em (0,0); luz da esquerda.
import React from "react";
import { mix, type Paint } from "./paint";
export type Draw = (p: Paint, color?: string) => React.ReactNode;
type Blob = [number, number, number];
/** Copa/moita/nuvem em 2 tons: tudo na cor da sombra, a parte de cima-esquerda na base e brilho nos topos. */
export function Foliage({ blobs, color, p, shadeK = 0.5, hiK = 0.14, lift = 0.16 }: { blobs: Blob[]; color: string; p: Paint; shadeK?: number; hiK?: number; lift?: number }) {
const cx = blobs.reduce((s, b) => s + b[0], 0) / blobs.length;
const cy = blobs.reduce((s, b) => s + b[1], 0) / blobs.length;
const top = Math.min(...blobs.map((b) => b[1] - b[2]));
return (
<g>
<g fill={p.lo(color, shadeK)}>{blobs.map(([x, y, r], i) => <circle key={i} cx={x} cy={y} r={r} />)}</g>
<g fill={p.c(color)}>{blobs.map(([x, y, r], i) => <circle key={i} cx={x - r * lift * 0.8} cy={y - r * lift} r={r * 0.8} />)}</g>
{hiK > 0 && <g fill={p.hi(color, hiK)}>
{blobs.filter(([x, y, r]) => x <= cx + 40 && y - r <= top + (cy - top) * 0.5).map(([x, y, r], i) => <circle key={i} cx={x - r * 0.24} cy={y - r * 0.3} r={r * 0.6} />)}
</g>}
</g>
);
}
const jitter = (p: Paint, blobs: Blob[], k = 1): Blob[] => blobs.map(([x, y, s]) => [x + (p.r() - 0.5) * 36 * k, y + (p.r() - 0.5) * 28 * k, s * (0.9 + p.r() * 0.2)]);
export const NATURE: Record<string, Draw> = {
tree: (p, color) => {
const leaf = color ?? p.pal.leaf;
const bark = p.pal.trunk;
const blobs = jitter(p, [[-210, -560, 150], [205, -575, 150], [0, -520, 170], [-100, -700, 175], [120, -710, 170], [5, -840, 150],
[-285, -660, 110], [285, -670, 105], [0, -660, 200]]);
return <g>
<path d="M-56 0 Q-30 -10 -30 -200 L-28 -400 L28 -400 Q30 -200 32 -10 Q50 0 62 0 Z" fill={p.c(bark)} />
<path d="M6 -2 Q20 -150 16 -400 L28 -400 Q30 -200 32 -10 Q50 0 62 0 Z" fill={p.lo(bark, 0.4)} />
<path d="M-12 -330 Q-90 -420 -170 -520 M8 -360 Q70 -460 150 -560 M0 -380 L-6 -560" stroke={p.c(bark)} strokeWidth={30} strokeLinecap="round" fill="none" />
<path d="M14 -364 Q76 -456 156 -552" stroke={p.lo(bark, 0.4)} strokeWidth={12} strokeLinecap="round" fill="none" />
<path d="M-20 -60 Q-14 -120 -18 -180 M-4 -240 Q2 -280 -2 -320" stroke={p.lo(bark, 0.3)} strokeWidth={5} strokeLinecap="round" fill="none" />
<Foliage blobs={blobs} color={leaf} p={p} />
</g>;
},
pine: (p, color) => {
const leaf = color ?? mix(p.pal.leaf, "#1f5a46", 0.35);
const tiers: [number, number, number][] = [[-200, -90, -440], [-165, -300, -640], [-125, -500, -840]];
return <g>
<rect x={-22} y={-110} width={44} height={110} fill={p.c(p.pal.trunk)} />
<rect x={4} y={-110} width={18} height={110} fill={p.lo(p.pal.trunk, 0.4)} />
{tiers.map(([w, b, t], i) => <g key={i}>
<polygon points={`0,${t} ${w},${b} ${-w},${b}`} fill={p.c(leaf)} />
<polygon points={`0,${t} ${-w},${b} ${-w * 0.1},${b}`} fill={p.lo(leaf, 0.42)} />
<polygon points={`0,${t} ${w * 0.55},${b - (b - t) * 0.42} ${w * 0.25},${b - (b - t) * 0.4}`} fill={p.hi(leaf, 0.2)} />
<path d={`M${w} ${b} L${-w} ${b} L${-w * 0.92} ${b - 18} L${w * 0.92} ${b - 18} Z`} fill={p.lo(leaf, 0.55)} />
</g>)}
</g>;
},
deadtree: (p, color) => {
const bark = color ?? p.pal.trunk;
return <g strokeLinecap="round" fill="none">
<g stroke={p.c(bark)}>
<path d="M0 0 L0 -440" strokeWidth={52} />
<path d="M0 -240 L-140 -400 M-80 -320 L-160 -300 M0 -340 L120 -500 M60 -420 L160 -430 M0 -440 L-40 -560" strokeWidth={24} />
</g>
<g stroke={p.lo(bark, 0.45)}>
<path d="M14 0 L14 -430" strokeWidth={18} />
<path d="M8 -346 L124 -496" strokeWidth={9} />
</g>
<path d="M-30 0 Q-60 4 -80 0 M30 0 Q60 4 84 0" stroke={p.c(bark)} strokeWidth={20} />
</g>;
},
bush: (p, color) => <Foliage blobs={jitter(p, [[-90, -70, 85], [15, -105, 105], [115, -66, 80], [-165, -42, 56], [180, -38, 52], [40, -50, 70]], 0.6)} color={color ?? p.pal.leaf} p={p} />,
rock: (p, color) => {
const s = color ?? p.pal.stone;
return <g>
<path d="M-120 0 Q-138 -84 -52 -118 Q34 -150 104 -84 Q146 -34 120 0 Z" fill={p.c(s)} />
<path d="M30 -134 Q96 -116 114 -66 Q140 -30 120 0 L6 0 Q44 -64 30 -134 Z" fill={p.lo(s, 0.38)} />
<path d="M-106 -40 Q-110 -98 -44 -116 Q-16 -124 6 -122 Q-44 -100 -66 -40 Z" fill={p.hi(s, 0.25)} />
</g>;
},
mountain: (p, color) => {
const m = color ?? p.pal.far;
return <g>
<polygon points="-520,0 -60,-470 0,-520 70,-460 520,0" fill={p.c(m)} />
<polygon points="0,-520 70,-460 520,0 80,0 150,-140 40,-260 60,-380" fill={p.lo(m, 0.3)} />
<polygon points="-60,-470 0,-520 -40,-400 -140,-250 -260,-150 -150,-300" fill={p.hi(m, 0.12)} />
<polygon points="-110,-410 -60,-470 0,-520 70,-460 110,-410 50,-432 10,-396 -40,-436" fill={p.c("#ffffff")} opacity={0.85} />
<polygon points="0,-520 70,-460 110,-410 50,-432 22,-410" fill={p.lo("#e8ecf4", 0.3)} opacity={0.85} />
</g>;
},
cloud: (p, color) => {
const base = color ?? mix("#ffffff", p.pal.light, 0.12);
return <g opacity={0.95}>
<Foliage blobs={[[-80, -50, 52], [0, -78, 66], [78, -52, 50], [-140, -34, 34], [140, -32, 32]]} color={base} p={p} shadeK={0.2} hiK={0} lift={0.22} />
<rect x={-174} y={-34} width={348} height={34} rx={17} fill={p.lo(base, 0.22)} />
</g>;
},
palm: (p, color) => {
const leaf = color ?? p.pal.leaf;
const bark = mix(p.pal.trunk, "#b08a5a", 0.35);
const fronds: [number, number][] = [[-250, -470], [-210, -600], [-40, -700], [150, -650], [270, -500], [60, -560]];
return <g>
<path d="M-22 0 Q-40 -260 20 -560 L52 -556 Q2 -260 26 0 Z" fill={p.c(bark)} />
<path d="M8 0 Q-6 -260 40 -558 L52 -556 Q2 -260 26 0 Z" fill={p.lo(bark, 0.4)} />
{Array.from({ length: 9 }, (_, i) => {
const y = -40 - i * 58;
const x = -14 + (i / 9) * 40 - Math.sin((i / 9) * 2) * 10;
return <path key={i} d={`M${x - 20} ${y} Q${x + 4} ${y + 10} ${x + 30} ${y}`} stroke={p.lo(bark, 0.5)} strokeWidth={6} fill="none" strokeLinecap="round" />;
})}
{fronds.map(([x, y], i) => {
const ox = 36;
const oy = -560;
const mx = (ox + x) / 2;
const my = Math.min(oy, y) - 70;
return <g key={i}>
<path d={`M${ox} ${oy} Q${mx} ${my - 34} ${x} ${y} Q${mx} ${my + 44} ${ox} ${oy} Z`} fill={p.c(leaf)} />
<path d={`M${ox} ${oy} Q${mx} ${my + 6} ${x} ${y} Q${mx} ${my + 44} ${ox} ${oy} Z`} fill={p.lo(leaf, 0.42)} />
</g>;
})}
<circle cx={24} cy={-540} r={20} fill={p.c("#6a4a2a")} /><circle cx={52} cy={-532} r={18} fill={p.lo("#6a4a2a", 0.3)} />
</g>;
},
outcrop: (p, color) => {
const s = color ?? mix(p.pal.stone, p.pal.ground.dirt, 0.5);
return <g>
<path d="M-330 0 Q-300 -70 -160 -96 Q0 -116 170 -94 Q310 -70 330 0 Z" fill={p.c(s)} />
<path d="M60 -110 Q200 -96 290 -60 Q320 -36 330 0 L40 0 Q110 -50 60 -110 Z" fill={p.lo(s, 0.32)} />
{[-30, -56, -78].map((y, i) => <path key={y} d={`M${-300 + i * 40} ${y} Q0 ${y - 22} ${300 - i * 40} ${y}`} stroke={p.lo(s, 0.5)} strokeWidth={5} fill="none" />)}
<path d="M-330 0 Q-300 -70 -160 -96 L-150 -80 Q-280 -50 -300 0 Z" fill={p.hi(s, 0.3)} />
</g>;
},
rainbow: () => {
const bands = ["#e8463d", "#f28c28", "#f2c230", "#5cc48a", "#4fb0e8", "#7a5ce0"];
return <g fill="none" opacity={0.78}>{bands.map((c, i) => <path key={c} d={`M${-600 + i * 26} 0 A${600 - i * 26} ${600 - i * 26} 0 0 1 ${600 - i * 26} 0`} stroke={c} strokeWidth={27} />)}</g>;
},
waves: (p, color) => {
const water = color ?? p.pal.ground.water;
const d = Array.from({ length: 7 }, (_, i) => `Q${-300 + i * 100 + 50} -70 ${-300 + (i + 1) * 100} 0`).join(" ");
return <g>
<path d={`M-300 0 ${d} L400 40 L-300 40 Z`} fill={p.lo(water, 0.3)} />
<path d={`M-300 6 ${d} L400 12 L-300 12 Z`} fill={p.c(water)} opacity={0.7} />
<path d={`M-300 0 ${d}`} stroke={p.hi("#ffffff", 0)} strokeWidth={9} fill="none" opacity={0.75} strokeLinecap="round" />
</g>;
},
};
+88
View File
@@ -0,0 +1,88 @@
// Tinta do cenário: paletas, mistura de cor e o "pincel" de cada peça. Toda peça pinta em 2 tons (cel): a cor
// base e o lado da sombra, num tom mais escuro e frio da própria cor (nunca contorno preto). A luz vem da
// ESQUERDA em todas as peças. A distância (z) puxa a cor para a do céu/parede (perspectiva atmosférica) e a
// frente fica um pouco mais escura e contrastada — tudo por mistura de cor, sem filtro (render barato).
export const PALETTES = ["night", "sepia", "day", "dusk", "gray"] as const;
export type PaletteId = (typeof PALETTES)[number];
export type Pal = {
/** Céu: topo, meio e perto do horizonte. */
sky: [string, string, string];
wall: string;
ground: Record<string, string>;
far: string; near: string; ink: string; leaf: string; trunk: string; stone: string;
/** Cor da luz (lado iluminado, lâmpada, sol). */
light: string;
/** Cor fria para onde as sombras puxam. */
shade: string;
/** Sol/lua: cor do disco e do halo. */
sun: string; halo: string;
/** Contraluz: quanto toda peça escurece para o frio (entardecer = sol baixo atrás das coisas). */
dim?: number;
};
const P: Record<PaletteId, Pal> = {
night: { sky: ["#070a1c", "#141a3e", "#2a3264"], wall: "#25304f", far: "#2c3463", near: "#3d4a7c", ink: "#0c0d1a", leaf: "#2a4a5a", trunk: "#3a2e40",
stone: "#5a6088", light: "#ffc965", shade: "#05081c", sun: "#f4ecc8", halo: "#8a9ad8",
ground: { grass: "#22384a", street: "#232842", dirt: "#33304a", floor: "#2a2e48", sand: "#4a4868", water: "#16305a" } },
sepia: { sky: ["#b8956a", "#dcc196", "#f0dfb8"], wall: "#6e6248", far: "#b49a74", near: "#7a5e46", ink: "#2a2018", leaf: "#7f8048", trunk: "#5a4330",
stone: "#a39a8a", light: "#ffdc8e", shade: "#2c2a3a", sun: "#fff0c0", halo: "#ffd890",
ground: { grass: "#8f8c54", street: "#76685a", dirt: "#8a6a48", floor: "#7a5e44", sand: "#d8bd8a", water: "#6f8a8a" } },
day: { sky: ["#3f8fd8", "#7fbdec", "#d4ecf8"], wall: "#e6d6b6", far: "#a6c8de", near: "#e09a68", ink: "#22252e", leaf: "#5aa84a", trunk: "#7a5232",
stone: "#a9adb5", light: "#fff2be", shade: "#2a3a78", sun: "#fff8d8", halo: "#fff2b0",
ground: { grass: "#7cc25e", street: "#8a8f99", dirt: "#c49060", floor: "#c69c6c", sand: "#f0d79a", water: "#3f9ad8" } },
dusk: { sky: ["#5c5a9a", "#e49a72", "#f8d08a"], wall: "#5a4658", far: "#b48a98", near: "#c98a6a", ink: "#20141c", leaf: "#6a8540", trunk: "#5e3a2a",
stone: "#9a8a92", light: "#ffcf86", shade: "#3a2a62", sun: "#ffe7a8", halo: "#ffc070", dim: 0.12,
ground: { grass: "#6e8448", street: "#6a5a64", dirt: "#c27a4c", floor: "#6e5048", sand: "#dba878", water: "#5a6aa0" } },
gray: { sky: ["#5f6670", "#8d949c", "#c0c4c8"], wall: "#565b63", far: "#8f969e", near: "#646a72", ink: "#1b1d21", leaf: "#5a6b55", trunk: "#4a4038",
stone: "#9aa0a8", light: "#f2e6c8", shade: "#1e2430", sun: "#e8e8e0", halo: "#c8ccd0",
ground: { grass: "#5f6e55", street: "#4a4f57", dirt: "#5e5246", floor: "#4a4d54", sand: "#a8a08a", water: "#5a6f80" } },
};
export const palette = (id: PaletteId | undefined): Pal => P[id ?? "night"] ?? P.night;
/** Mistura duas cores hex (#rrggbb) em k (0 = a, 1 = b). */
export function mix(a: string, b: string, k: number): string {
const pa = parseInt(a.slice(1, 7), 16);
const pb = parseInt(b.slice(1, 7), 16);
const q = Math.max(0, Math.min(1, k));
const ch = (s: number) => Math.round(((pa >> s) & 255) * (1 - q) + ((pb >> s) & 255) * q);
return `#${[16, 8, 0].map((s) => ch(s).toString(16).padStart(2, "0")).join("")}`;
}
/** Pincel de uma peça: já sabe a profundidade, a paleta e o sorteio da semente. */
export type Paint = {
pal: Pal;
r: () => number;
indoor: boolean;
night: boolean;
/** Cor base (com a névoa da distância). */
c: (hex: string) => string;
/** Lado da sombra: mais escuro e frio (k = quanto). */
lo: (hex: string, k?: number) => string;
/** Lado da luz: mais claro e quente. */
hi: (hex: string, k?: number) => string;
};
/**
* `haze` = quanto a peça puxa para a cor do fundo (0–1); `front` = quanto escurece por estar na frente (0–0,2).
* Os resultados ficam em cache por peça: o mesmo hex sai sempre igual.
*/
export function makePaint(pal: Pal, r: () => number, opts: { haze: number; hazeColor: string; front: number; indoor: boolean; night: boolean }): Paint {
const cache = new Map<string, string>();
const base = (hex: string) => {
const hit = cache.get(hex);
if (hit) return hit;
let v = pal.dim ? mix(hex, pal.shade, pal.dim) : hex;
if (opts.front > 0) v = mix(v, pal.ink, opts.front);
if (opts.haze > 0) v = mix(v, opts.hazeColor, opts.haze);
cache.set(hex, v);
return v;
};
return {
pal, r, indoor: opts.indoor, night: opts.night,
c: base,
lo: (hex, k = 0.3) => base(mix(hex, pal.shade, k)),
hi: (hex, k = 0.2) => base(mix(hex, pal.light, k)),
};
}
+303
View File
@@ -0,0 +1,303 @@
// Biblioteca de MÃOS desenhadas (não montadas com cápsulas): cada forma é um desenho num quadro fixo de 120×120,
// com a silhueta inteira num path só (Bézier contínuas: dedos afinando em 3 falanges, nós em arco, polegar nascendo
// do montinho da base da palma), as linhas internas no tom escuro da pele, unhas, e uma sombra cel DESENHADA
// (recortada pela silhueta). O rig só ESCOLHE a forma, posiciona no pulso, gira e espelha.
//
// Regras de construção seguidas (ensino de desenho de mão): palma ≈ quadrada com laterais curvas; dedo médio ≈ altura
// da palma, médio o maior, indicador ≈ anelar, mínimo o menor; nós da base e pontas em ARCO (o médio mais à frente);
// dedo afina para a ponta; polegar com 2 segmentos e unha, girando em outro eixo; pulso mais estreito que a palma;
// volume com sombra no lado oposto à luz e embaixo dos dedos; linhas internas sempre curvas.
//
// Quadro canônico: braço da DIREITA da tela (s = 1), luz vinda da esquerda (sombra desenhada à direita/embaixo).
// - formas "alinhadas" (relaxed, open, point, fist, on_face): o antebraço chega por cima (pulso em (60, 4)) e os dedos
// apontam para +y; o polegar fica do lado −x. O rig gira pelo ângulo do antebraço.
// - formas "em pé" (thumbs_up, grip, pinch_edge): desenhadas na orientação da tela, com o pulso num canto e o ângulo
// do antebraço para o qual foram feitas (`wristDeg`); o rig só inclina um pouco para acompanhar o braço.
import React from "react";
import type { IconId } from "./spec";
export const HAND_SHAPES = ["relaxed", "open", "point", "thumbs_up", "grip", "pinch_edge", "pinch_low", "fist", "on_face"] as const;
export type HandShape = (typeof HAND_SHAPES)[number];
type ShapeDef = {
/** Silhueta inteira (um path). */
body: string;
/** Sombra cel desenhada (recortada pela silhueta do corpo). */
shadow: string;
/** Linhas internas do corpo: separação dos dedos, nós, dobras. */
lines: string;
/** Peça por cima (polegar dobrado por cima dos dedos ou do objeto), com sombra e linhas próprias. */
over?: { body: string; shadow?: string; lines?: string };
/** Unhas: [cx, cy, rx, ry, giro]. A primeira do corpo, as de `overNails` por cima. */
nails?: [number, number, number, number, number][];
overNails?: [number, number, number, number, number][];
/** Pulso no quadro (onde encosta o fim do antebraço). */
wrist: [number, number];
/** Ângulo do antebraço para o qual a forma foi desenhada (0 = descendo; formas alinhadas = 0). */
wristDeg: number;
upright: boolean;
/** Com objeto: o corpo fica ATRÁS do objeto (só a peça `over` na frente) — pinch_edge. */
bodyBehind?: boolean;
/** Onde fica o objeto: cabo (grip) ou borda (pinch_edge). */
hold?: [number, number];
};
// Pulso: cilindro com ≈ 60 % da largura da palma (27 unidades), centrado no ponto `wrist`, com uma sobra de 10
// unidades que entra por baixo da manga (fica escondida pelo punho da manga). Sombra do lado oposto à luz (direita):
// no pulso ela tem a mesma largura da sombra do antebraço (≈ 1/3) e vai afinando na borda da mão; sob os dedos dobrados
// e sob o polegar.
const WRIST_TOP = "M46.5 -10 L46.5 3";
const WRIST_RIGHT_END = "C74.4 6.5 73.6 3 73.5 0 L73.5 -10 Z";
const SHAPES: Record<HandShape, ShapeDef> = {
// Caída ao lado do corpo, vista pelo dorso: dedos juntos levemente curvos (nós e pontas em arco), polegar na frente.
relaxed: {
body: `${WRIST_TOP} C45.5 12 41 18 38.5 25 C35.5 33 34 42 35 50 C35.8 57 38.5 61 42 60.5 C45 60 46 57 45.6 53 C45.3 49 45 46 44.8 44`
+ " C43.6 52 42.8 62 43 72 C43.2 79 45.2 82.5 48.3 82.5 C51.3 82.5 52.6 80 52.6 76.5 L52.8 74 C53 80 53.4 86 55.2 89"
+ " C56.6 91.6 60 92 61.8 89.8 C63 88 63.2 85 63.2 81 L63.4 78 C63.8 82 64.6 85.5 66.4 87.2 C68.4 89 71.4 88.2 72.2 85.4"
+ " C72.8 83 72.8 80 72.6 77 L72.8 74 C73.8 76.5 75.4 78 77.4 77.6 C79.6 77 80.6 74.6 80.7 71.5 C81 64 81.8 54 82 46"
+ ` C82.2 34 79.5 20 75.5 10 ${WRIST_RIGHT_END}`,
shadow: "M64.6 -12 L65 1 C69 6 75 12 78 22 C79.6 32 80 42 79.6 52 C79.2 62 78.6 70 78.8 76 L96 80 L96 -12 Z"
+ " M40 77 C48 84.5 62 90.5 80 76 L80 100 L40 100 Z M45.2 45 C46.6 52 47 59 46.6 65 L49.6 66 C49.8 58 49.2 50 47.6 44 Z",
lines: "M52.8 74 C52.7 68 52.8 62 53.2 56 M63.4 78 C63.4 71 63.2 64 63 57 M72.8 74 C73 68 73.4 62 73.8 55 M44.8 44 C44.5 38 43 32 41 27",
nails: [[40.6, 54.2, 2.8, 3.8, 6]],
wrist: [60, 0], wristDeg: 0, upright: false,
},
// Aberta, palma para a câmera (acenando): dedos levemente abertos, polegar saindo da eminência tenar.
open: {
body: `${WRIST_TOP} C44 12 39 18 35 22 C29 26 24 31 21 37 C18.5 42 19.5 47 23.5 47.5 C26.5 48 28.5 45.5 30 42.5 C32.5 38 35.5 35 38.5 34.5`
+ " C39 38 39.2 41 39.5 44 C38.6 54 38 64 38.4 72 C38.6 78 41 80.6 44 80.4 C47 80.2 48.4 78 48.4 74.6 C48.6 64 48.8 55 49.4 47.5"
+ " C50.4 58 50.8 70 51.2 80 C51.4 86 54.2 88.6 57.2 88.4 C60.2 88.2 61.6 85.6 61.4 82 C61 70 60.8 58 61.2 48"
+ " C62.6 58 63.6 68 64.4 76 C64.8 81.4 67.6 83.6 70.4 83 C73 82.4 74 79.8 73.6 76.6 C72.6 66 72 56 72 47.4"
+ " C73.8 54 75.6 61 77.6 66.6 C79 70.6 82 71.6 84.2 70 C86 68.6 86 66 85.2 63 C83 54 82.6 42 81.6 30 C80.6 18 76 8 73.5 2 L73.5 -10 Z",
shadow: "M64.6 -12 L65 1 C70 6 77 14 80.6 32 C81.6 44 82 54 83.4 64 L96 64 L96 -12 Z M50 30 C56 36 66 38.4 75 34 C70 42 60 44.4 51 40 Z"
+ " M45.6 50 C46.2 60 46.4 70 46 80.4 L49 80 L49.2 50 Z M58.4 50 C58.8 62 59.2 74 59 88.4 L62 88 L61.6 50 Z M70.4 50 C71.2 60 71.8 70 72 82 L74.6 81 L73.6 50 Z",
lines: "M48 46 C58 42.4 70 42.4 80 46 M42 40 C46 32 50 22 52 12",
wrist: [60, 0], wristDeg: 0, upright: false,
},
// Apontando, vista pelo lado da palma: indicador esticado (3 falanges, afinando, unha na ponta, leve curva); médio,
// anelar e mínimo dobrados como gomos empilhados em arco (médio mais à frente), com a ponta virada para a palma e a
// UNHA de cada um aparecendo; o polegar fecha por cima do médio, com a unha dele.
point: {
body: `${WRIST_TOP} C45 12 40 18 37.5 26 C36 34 36.2 42 38.2 48 C37.8 60 37.9 72 38.5 82 C39 90 39.6 96 40.6 101.4`
+ " C41.4 106.6 46 108.4 49.2 106 C51.6 104.2 52.2 100.4 52.2 96.6 C52.2 88 52.6 76 53.4 64"
+ " C54 68.6 56.8 71 60.6 70.6 C64 70.2 65.6 67.6 65.8 64.8 C68 68 71.6 68.4 74 66.6 C76 65 76.4 62 76 59.8"
+ ` C78.4 60.6 81 59.4 81.8 56.4 C82.6 53 82.4 49 82 46 C82 34 79.5 20 75.5 10 ${WRIST_RIGHT_END}`,
shadow: "M64.6 -12 L65 1 C70 6 78 14 80.8 30 C81.6 40 81 48 79.6 52 C76 50 70 49 64 50 L96 50 L96 -12 Z"
+ " M50 66 C56 72.6 68 72 74 68 C78 66 81 62 83 56 L86 80 L48 80 Z M49.6 66 C50.2 78 50.6 92 50.2 108 L58 108 L58 66 Z"
+ " M44 58 C48 62 52 64.4 56.4 63.6 L58 67 L44 64 Z",
lines: "M65.8 64.8 C65.4 60.6 64.4 57.6 62.8 55.4 M76 59.8 C75.4 56 74.2 53.4 72.6 51.6 M53 57.4 C60 53.6 70 51.4 81 47"
+ " M38.8 81 Q45.4 82.6 52.4 81 M40.2 93 Q46 94.4 52.2 93",
nails: [[59.6, 66.6, 3.2, 2.4, 6], [70.8, 63.4, 2.9, 2.2, -8], [79.2, 54.6, 2.3, 1.9, -30], [45.8, 102, 3, 3.6, -4]],
over: {
body: "M38.4 30 C42 38 47 46 52.8 52 C56.2 55.4 57 60 54 61.6 C51 63.2 47.4 60.4 44.4 56.6 C40.8 52 38 46 37.6 40 Z",
shadow: "M39.6 46 C42 51 46 56 50 59 L46 62 L38 52 Z",
},
overNails: [[53.2, 57.2, 3, 2.6, 40]],
wrist: [60, 0], wristDeg: 0, upright: false,
},
// Joinha: punho de lado, os 4 dedos dobrados na horizontal (um em cima do outro, nós e pontas na frente),
// polegar grosso saindo do topo, com unha, levemente inclinado para trás. Antebraço chegando de baixo, na diagonal.
thumbs_up: {
body: "M56 42 C46 39.5 34 40 29 44.5 C24.6 48.6 25.2 54.4 29.6 56 C25.2 58.6 24.8 65.4 29.4 67.8 C25.8 70.6 26.4 77.6 31 79.4"
+ " C28.6 82.6 30.6 88.4 36 89.4 C46 91.2 60 92.6 72 93.6 C78 94.4 83 97.2 86.5 101.5 L93.6 108.6 L112.6 89.6 L105.5 82.5"
+ " C101 77.6 96 70.4 92 61 C89.4 54.4 85 48 78 45 C77.6 40 76.8 30 75.4 20 C74.4 13 71.6 7 66 6.4"
+ " C60.6 5.8 57.4 9.6 56.8 15.6 C56.2 24 55.8 33 56 42 Z",
shadow: "M84 46 C90 52 95 62 98 72 L104 82 L120 96 L120 40 Z M28 54.6 C38 57.8 50 58 60 56.6 L60 59.6 C48 61 38 60.6 28 58 Z"
+ " M28 66.4 C38 69.6 50 70 60 68.6 L60 71.6 C48 73 38 72.6 28 70 Z M30 78 C40 81 50 81.6 58 80.6 L58 83.6 C48 84.6 40 84 30 81.4 Z"
+ " M30 88 C46 92 62 94 74 95 L86 104 L40 104 Z M71 8 C74 14 76 24 77 40 L84 44 L84 4 Z",
lines: "M29.6 56 C38 58 48 58.4 58 57 M29.4 67.8 C38 70 48 70.4 58 69 M31 79.4 C39 81.4 48 81.8 56 81"
+ " M58 57 C62 55.6 64.6 52.6 65.4 49 M58 69 C62.6 67.6 65.6 64.6 66.4 60.6 M56 81 C60.4 80 63.4 77.4 64.4 73.6 M57 34.5 C62 37 70 37.4 77 33.6",
nails: [[65.4, 13.8, 5, 6, 4]],
wrist: [96, 92], wristDeg: 135, upright: true,
},
// Punho em volta de um cabo (martelo, régua, ramo, celular): o cabo passa por dentro, o polegar fecha por cima.
grip: {
body: "M44 42 C34 41.6 26.6 43.6 26.2 49 C25.8 53.4 26.8 55.6 29.6 56 C25.2 58.6 24.8 65.4 29.4 67.8 C25.8 70.6 26.4 77.6 31 79.4"
+ " C28.6 82.6 30.6 88.4 36 89.4 C48 91.4 64 92 76 89.6 C86 87.4 92.6 80 94.4 70 C96 62 100 55 105.5 49.5 L112.6 42.4 L93.6 23.4 L86.5 30.5"
+ " C80 36 72 39.6 62 41 C56 41.8 50 42 44 42 Z",
shadow: "M86 34 C92 44 95 58 94 70 C92 82 84 90 74 92 L120 120 L120 30 Z M28 54.6 C38 57.8 50 58 60 56.6 L60 59.6 C48 61 38 60.6 28 58 Z"
+ " M28 66.4 C38 69.6 50 70 60 68.6 L60 71.6 C48 73 38 72.6 28 70 Z M30 78 C40 81 50 81.6 58 80.6 L58 83.6 C48 84.6 40 84 30 81.4 Z"
+ " M30 88 C46 92 62 93 78 90 L78 100 L30 100 Z",
lines: "M29.6 56 C38 58 48 58.4 58 57 M29.4 67.8 C38 70 48 70.4 58 69 M31 79.4 C39 81.4 48 81.8 56 81"
+ " M58 57 C62 55.6 64.6 52.6 65.4 49 M58 69 C62.6 67.6 65.6 64.6 66.4 60.6 M56 81 C60.4 80 63.4 77.4 64.4 73.6",
over: {
body: "M80 36 C72 30.6 58 29.6 46 32.6 C37 34.8 33.4 40.6 36.6 44.2 C40.6 47.6 52 46.6 62 45.6 C70 44.8 76 43 79 40.6 Z",
shadow: "M36 43 C44 46.6 58 46.4 72 44 L72 48 L36 48 Z",
},
overNails: [[40.6, 39.4, 4.2, 3.6, -12]],
wrist: [96, 40], wristDeg: 45, upright: true, hold: [44, 66],
},
// Segurando a borda de um objeto largo (em par): dedos atrás do objeto, polegar grosso por cima da frente dele.
// Antebraço chegando de cima, por fora (pose hold_both).
pinch_edge: {
body: "M56 32 C62 27 72 26.6 80 30.6 C83.6 32.6 85.6 37 87 42 L94.4 35.3 L112.4 55.3 L105 62 C102 70.4 97 78 90 83.4"
+ " C82.6 89 72.6 92 64 90.6 C58.6 89.6 55.6 86 55 80 C54 64 54 46 56 32 Z",
shadow: "M82 30 C90 38 94 50 94 62 C92 74 86 82 76 88 L120 120 L120 20 Z M55 78 C60 86 70 90 84 88 L84 96 L54 96 Z",
lines: "M56 46 C62 46 68.6 47.6 74 50.6 M55.6 60 C61.4 60.4 67.6 62 73 64.8 M55.6 73.6 C60.6 74 65.4 75.6 69.6 78",
over: {
body: "M70 46 C62 40 52 34.6 45 31.6 C38.4 28.8 33 32.4 35 38.4 C37.4 45 46.4 51 55.6 57 C62 61 70.4 57.6 70 46 Z",
shadow: "M36.4 40.6 C43 47 52 53 60 58 L68 58 L68 64 L34 46 Z",
},
overNails: [[39.8, 35.2, 4.2, 3.6, 30]],
wrist: [96, 52], wristDeg: 48, upright: true, bodyBehind: true, hold: [56, 52],
},
// A mesma pegada de borda com o antebraço chegando de baixo (close de mãos segurando um livro aberto).
pinch_low: {
body: "M56 30 C64 25 78 26 85 34 C90 41 93 52 95 62 C96.6 70 100 78 105.5 86.5 L112.6 93.6 L93.6 112.6 L86.5 105.5"
+ " C80 98 72 94.6 66 92.4 C59 90 56 85.6 55 79 C53.6 64 53.6 44 56 30 Z",
shadow: "M80 28 C90 40 94 56 96 68 C98 78 102 84 110 92 L120 120 L120 20 Z M55 78 C60 86 68 91 80 96 L80 104 L54 100 Z",
lines: "M56 46 C62 46 68.6 47.6 74 50.6 M55.6 60 C61.4 60.4 67.6 62 73 64.8 M55.6 73.6 C60.6 74 65.4 75.6 69.6 78",
over: {
body: "M70 46 C62 40 52 34.6 45 31.6 C38.4 28.8 33 32.4 35 38.4 C37.4 45 46.4 51 55.6 57 C62 61 70.4 57.6 70 46 Z",
shadow: "M36.4 40.6 C43 47 52 53 60 58 L68 58 L68 64 L34 46 Z",
},
overNails: [[39.8, 35.2, 4.2, 3.6, 30]],
wrist: [96, 96], wristDeg: 135, upright: true, bodyBehind: true, hold: [56, 52],
},
// Fechada, vista pelo lado da palma: os 4 dedos dobrados como gomos em arco (médio mais à frente, mínimo menor),
// com a ponta virada para a palma e a UNHA de cada um; o polegar fecha por cima do indicador e do médio.
fist: {
body: `${WRIST_TOP} C45 12 40 18 37.5 26 C36 34 36.2 42 38 50 C39.4 57 42.4 62 46.6 63.6 C50 65 53.2 64 54.4 61.4`
+ " C56 66.4 60 69 64 68.4 C67.4 67.8 69 65.2 69.2 62.4 C71.4 65.8 75 66.2 77.4 64.2 C79.4 62.4 79.8 59.4 79.4 57"
+ ` C81.6 57 82.6 53 82.4 48 C82.2 34 79.5 20 75.5 10 ${WRIST_RIGHT_END}`,
shadow: "M64.6 -12 L65 1 C70 6 78 14 80.8 30 C81.6 40 81 46 80 50 L96 50 L96 -12 Z M40 58 C48 68 66 72 82 54 L84 80 L38 80 Z",
lines: "M54.4 61.4 C53.8 57 52.4 54 50.6 52 M69.2 62.4 C68.8 58.4 67.6 55.6 66 53.6 M79.4 57 C78.6 53.6 77.4 51.2 75.8 49.6 M44 51 C54 47.6 68 45.6 81 43.6",
nails: [[46, 59.6, 3, 2.3, 10], [62.6, 64.4, 3.2, 2.4, 0], [74.2, 61.2, 2.8, 2.1, -10], [80, 53, 2.2, 1.8, -30]],
over: {
body: "M38 30 C42 39 48 47 55 52 C59 54.6 60.4 59 57 60.6 C53 62.4 47.6 59 43.6 54.6 C39.8 50.4 37.4 42 38 30 Z",
shadow: "M39.4 46 C42.6 52 47 57 52 60 L48 63 L38 52 Z",
},
overNails: [[56.6, 56.8, 3.1, 2.7, 35]],
wrist: [60, 0], wristDeg: 0, upright: false,
},
// Apoiada no rosto (queixo, boca, lateral da cabeça): dorso, dedos juntos e mais retos, polegar recolhido.
on_face: {
body: `${WRIST_TOP} C45.5 12 41.5 18 39.5 25 C37.5 32 37.5 40 39 46 C39.5 58 39.6 70 40.4 82 C40.8 88 43.4 91.4 46.4 91.2`
+ " C49.4 91 50.6 88.4 50.8 85 L51 83 C51.4 90 53.6 94.4 57 94.4 C60.4 94.4 62 91.4 62.2 87.6 L62.3 85.6 C63 91 65.4 93.4 68.4 93"
+ " C71.4 92.6 72.4 89.8 72.4 86.4 L72.5 83.6 C73.6 87 75.6 88.2 77.6 87.6 C79.8 86.8 80.6 84 80.8 80.6 C81.6 70 82.2 56 82 44"
+ ` C81.8 32 79.2 20 75.5 10 ${WRIST_RIGHT_END}`,
shadow: "M64.6 -12 L65 1 C70 6 78 14 80.4 36 C81 50 80.6 66 79.6 84 L96 84 L96 -12 Z M40 84 C48 92 66 97 82 84 L82 104 L40 104 Z",
lines: "M51 83 C51 74 51.2 66 51.6 58 M62.3 85.6 C62.3 76 62.2 67 62 58 M72.5 83.6 C72.8 75 73 66 73.2 57",
over: {
body: "M39.5 25 C35 31 33.6 40 35.4 46 C36.8 50.4 41 50 41.6 46 C42.2 41 42 34 41.8 28 Z",
},
overNails: [[37.4, 44.6, 2.4, 3.2, 6]],
wrist: [60, 0], wristDeg: 0, upright: false,
},
};
/** Objetos seguros com as DUAS mãos (pelas bordas, na frente do peito). O resto vai numa mão só (`grip`). */
export const TWO_HANDED: IconId[] = ["book", "tablet"];
/**
* Como cada objeto entra no punho (`grip`): ponto do cabo no quadro 100×100 do ícone e o giro que deixa o cabo em pé
* (cabeça do martelo, ponta do ramo e da régua para cima). Sem entrada: pelo meio, sem girar.
*/
export const GRIP: Partial<Record<IconId, { x: number; y: number; rot: number }>> = {
hammer: { x: 50, y: 80, rot: 20 },
olive: { x: 26, y: 80, rot: -43 },
ruler: { x: 14, y: 58, rot: -78 },
phone: { x: 50, y: 74, rot: 0 },
fuel: { x: 50, y: 30, rot: 0 },
bulb: { x: 50, y: 82, rot: 0 },
};
/**
* Posição da forma: espelho (`mirror`), giro em graus e escala, a partir do pulso na tela, do ângulo do antebraço e do
* lado do braço. Formas alinhadas giram com o antebraço; as "em pé" só inclinam até ±30° para acompanhá-lo.
*/
export function handPlacement(shape: HandShape, x: number, y: number, foreDeg: number, s: number, k: number) {
const def = SHAPES[shape];
let mirror: number;
let rot: number;
if (def.upright) {
// Desenhada para o braço da direita; o pulso acompanha o eixo do antebraço (gira em torno do centro do pulso).
mirror = s >= 0 ? 1 : -1;
rot = foreDeg - def.wristDeg * mirror;
} else {
// Polegar do lado do corpo; com o braço erguido o eixo local vira e o espelho inverte junto.
const up = Math.cos((foreDeg * Math.PI) / 180) >= 0;
mirror = up ? s : -s;
rot = foreDeg;
}
const [wx, wy] = def.wrist;
const transform = `translate(${x} ${y}) rotate(${rot}) scale(${k * mirror} ${k}) translate(${-wx} ${-wy})`;
const r = (rot * Math.PI) / 180;
/** Ponto do quadro 120×120 → tela. */
const map = (px: number, py: number) => {
const lx = (px - wx) * k * mirror;
const ly = (py - wy) * k;
return { x: x + lx * Math.cos(r) - ly * Math.sin(r), y: y + lx * Math.sin(r) + ly * Math.cos(r) };
};
return { def, mirror, rot, transform, map, hold: def.hold ? map(def.hold[0], def.hold[1]) : null };
}
/** Pulso que põe o ponto `hold` da forma em (hx, hy) — para pôr as mãos nas bordas do objeto. */
export function wristForHold(shape: HandShape, hx: number, hy: number, foreDeg: number, s: number, k: number) {
const p = handPlacement(shape, 0, 0, foreDeg, s, k);
return { x: hx - (p.hold?.x ?? 0), y: hy - (p.hold?.y ?? 0) };
}
function shadeHex(hex: string, k: number): string {
const n = parseInt(hex.slice(1), 16);
const c = (v: number) => Math.max(0, Math.min(255, Math.round(v * k))).toString(16).padStart(2, "0");
return `#${c((n >> 16) & 255)}${c((n >> 8) & 255)}${c(n & 255)}`;
}
/** Mistura duas cores hex (0 = a, 1 = b). */
function mixHex(a: string, b: string, t: number): string {
const pa = parseInt(a.slice(1), 16), pb = parseInt(b.slice(1), 16);
const ch = (sh: number) => Math.round(((pa >> sh) & 255) * (1 - t) + ((pb >> sh) & 255) * t).toString(16).padStart(2, "0");
return `#${ch(16)}${ch(8)}${ch(0)}`;
}
function coolHex(hex: string, k: number): string {
const n = parseInt(hex.slice(1), 16);
const r = ((n >> 16) & 255) * k * 0.94, g = ((n >> 8) & 255) * k * 0.97, b = (n & 255) * k + 10;
const c = (v: number) => Math.max(0, Math.min(255, Math.round(v))).toString(16).padStart(2, "0");
return `#${c(r)}${c(g)}${c(b)}`;
}
/**
* Desenha a forma de mão no lugar. `layer`: "back" = o que fica atrás do objeto, "front" = o que fica na frente,
* "all" = tudo. `light` = lado da sombra na tela (1 = direita). Sem contorno: a borda é o tom escuro da pele.
*/
export function HandArt({ shape, x, y, foreDeg, s, k, skin, light = 1, layer = "all", uid }: {
shape: HandShape; x: number; y: number; foreDeg: number; s: number; k: number; skin: string; light?: number;
layer?: "all" | "back" | "front"; uid: string;
}) {
const p = handPlacement(shape, x, y, foreDeg, s, k);
const def = p.def;
// A sombra foi desenhada à direita; se, depois de espelhar e girar, a direita do desenho não cai do lado da sombra
// pedido, a sombra vira para o outro lado (sempre recortada pela silhueta).
const rightOnScreen = p.mirror * Math.cos((p.rot * Math.PI) / 180);
const flipShadow = Math.sign(rightOnScreen || 1) !== Math.sign(light || 1);
const shadowT = flipShadow ? "translate(120 0) scale(-1 1)" : undefined;
const dark = shadeHex(skin, 0.62);
const shadow = coolHex(skin, 0.8);
const lineProps = { stroke: dark, strokeWidth: 1.7, strokeLinecap: "round" as const, strokeLinejoin: "round" as const, fill: "none", opacity: 0.55 };
const nail = ([cx, cy, rx, ry, a]: [number, number, number, number, number], i: number) => (
<ellipse key={i} cx={cx} cy={cy} rx={rx} ry={ry} transform={`rotate(${a} ${cx} ${cy})`} fill={mixHex(skin, "#f7cfc6", 0.55)} stroke={shadeHex(skin, 0.68)} strokeWidth={0.9} />
);
const bodyLayer = def.bodyBehind ? "back" : def.hold ? "front" : "all";
const showBody = layer === "all" || layer === bodyLayer || (bodyLayer === "all" && layer === "front");
const showOver = layer !== "back";
return (
<g transform={p.transform}>
<defs>
<clipPath id={`hb${uid}${layer}`}><path d={def.body} /></clipPath>
{def.over && <clipPath id={`ho${uid}${layer}`}><path d={def.over.body} /></clipPath>}
</defs>
{showBody && <>
<path d={def.body} fill={skin} />
<g clipPath={`url(#hb${uid}${layer})`}><path d={def.shadow} fill={shadow} transform={shadowT} /></g>
<path d={def.lines} {...lineProps} />
{(def.nails ?? []).map(nail)}
</>}
{showOver && def.over && <>
<path d={def.over.body} fill={shadeHex(skin, 1.03)} />
{def.over.shadow && <g clipPath={`url(#ho${uid}${layer})`}><path d={def.over.shadow} fill={shadow} /></g>}
{def.over.lines && <path d={def.over.lines} {...lineProps} />}
{(def.overNails ?? []).map(nail)}
</>}
</g>
);
}
+28
View File
@@ -70,6 +70,34 @@ const DRAW: Record<IconId, React.ReactNode> = {
<circle cx={50} cy={50} r={40} fill="#f4f6ff" /><circle cx={50} cy={50} r={34} fill="#232850" /> <circle cx={50} cy={50} r={40} fill="#f4f6ff" /><circle cx={50} cy={50} r={34} fill="#232850" />
<rect x={48} y={24} width={4} height={28} rx={2} fill="#fff" /><rect x={48} y={48} width={22} height={4} rx={2} fill={COLORS.key} /> <rect x={48} y={24} width={4} height={28} rx={2} fill="#fff" /><rect x={48} y={48} width={22} height={4} rx={2} fill={COLORS.key} />
</>), </>),
// Itens de mão e objetos de história antiga (também servem como objeto solto na cena).
olive: (<>
<path d="M20 86 Q46 60 86 16" stroke="#6b4a2a" strokeWidth={5} fill="none" strokeLinecap="round" />
{[[34, 66, -40], [44, 56, 30], [54, 46, -40], [64, 36, 30], [74, 26, -40], [28, 76, 30]].map(([x, y, r], i) => (
<ellipse key={i} cx={x} cy={y} rx={13} ry={5.5} fill={i % 2 ? "#7fa24a" : "#5f8a3a"} transform={`rotate(${r} ${x} ${y})`} />
))}
<circle cx={50} cy={58} r={4} fill="#3d3a5a" /><circle cx={70} cy={38} r={4} fill="#3d3a5a" />
</>),
hammer: (<>
<rect x={44} y={34} width={12} height={60} rx={5} fill="#8a5a32" transform="rotate(-20 50 64)" />
<rect x={22} y={14} width={50} height={22} rx={4} fill="#8c929e" transform="rotate(-20 47 25)" />
<rect x={22} y={14} width={12} height={22} rx={3} fill="#6c717c" transform="rotate(-20 47 25)" />
</>),
tablet: (<>
<path d="M18 10 Q50 4 82 10 L86 88 Q50 96 14 88 Z" fill="#b8916a" />
{Array.from({ length: 7 }, (_, i) => <path key={i} d={`M24 ${22 + i * 10} L76 ${22 + i * 10}`} stroke="#8a6646" strokeWidth={2.5} strokeDasharray="5 3 2 3" />)}
<path d="M70 70 L86 60 L86 88 L64 92 Z" fill="#000" opacity={0.18} />
</>),
book: (<>
<path d="M8 24 Q30 16 50 26 Q70 16 92 24 L92 82 Q70 74 50 84 Q30 74 8 82 Z" fill="#f2e8d0" />
<path d="M50 26 L50 84" stroke="#b9a882" strokeWidth={3} />
{[0, 1, 2, 3].map((i) => <g key={i}><path d={`M16 ${36 + i * 11} L42 ${38 + i * 11}`} stroke="#9a8a6a" strokeWidth={2.5} /><path d={`M58 ${38 + i * 11} L84 ${36 + i * 11}`} stroke="#9a8a6a" strokeWidth={2.5} /></g>)}
<path d="M8 82 Q30 74 50 84 Q70 74 92 82 L92 88 Q70 80 50 90 Q30 80 8 88 Z" fill="#7a3a2a" />
</>),
ruler: (<>
<rect x={6} y={38} width={88} height={24} rx={3} fill="#e6c27a" transform="rotate(-12 50 50)" />
{Array.from({ length: 10 }, (_, i) => <rect key={i} x={12 + i * 8.4} y={38} width={2.4} height={i % 2 ? 7 : 12} fill="#6b4a2a" transform="rotate(-12 50 50)" />)}
</>),
}; };
export function Icon({ id }: { id: IconId }) { export function Icon({ id }: { id: IconId }) {
+63
View File
@@ -0,0 +1,63 @@
// Profundidade dos braços do personagem de frente para a câmera (função pura do estado do rig, sem React).
//
// O desenho (CharacterFigure.tsx) empilha as camadas assim:
// tronco → braços "side" → acessórios do peito (toalha, cachecol, crachá, apito) → braços "front" →
// parte da toalha apoiada no ombro → cabeça → braços "face".
// Regra: com o personagem de frente, braço e mão NUNCA somem atrás do tronco, da roupa, de acessório ou da barba.
// - "face": a mão sobe até a altura do pescoço/rosto, dentro da largura da cabeça (pensar, tapar a boca, mão na
// testa) — desenhado por cima da cabeça e da barba;
// - "front": a mão ou o antebraço entram na frente do peito (segurar objeto diante do corpo, cruzar os braços,
// apontar para o outro lado, mão na cintura) — por cima do tronco e dos acessórios do peito;
// - "side": o braço fica ao lado do corpo (caído, acenando para fora, apontando para o lado) — por cima do tronco,
// mas por baixo do pano apoiado no ombro/peito (o braço sai por baixo da toalha).
// Não há caso "atrás do tronco": nenhuma pose do rig leva a mão às costas.
import type { BodyParams } from "./rig";
export type ArmLayer = "side" | "front" | "face";
export type Point = { x: number; y: number };
/** Ponta de um segmento: ângulo de tela em graus (0 = para baixo). Igual ao `tip` do desenho. */
export const tipOf = (x: number, y: number, deg: number, len: number): Point => {
const r = (deg * Math.PI) / 180;
return { x: x - Math.sin(r) * len, y: y + Math.cos(r) * len };
};
/** Medidas do desenho (viewBox 200×440) que a regra usa — as mesmas de CharacterFigure.tsx. */
export const ARM = { shoulderX: 54, upper: 56, wrist: 43, hand: 28, torsoHalf: 56 } as const;
/** Ombro, cotovelo, pulso e centro da mão do braço `s` (1 = direita da tela, -1 = esquerda). `w` = largura do corpo. */
export function armGeometry(b: BodyParams, s: 1 | -1, w = 1) {
const hipY = 306 + b.crouch * 56;
const shY = hipY - 100;
const torsoTop = hipY - 114;
const l = s > 0 ? b.armR : b.armL;
const shoulder = { x: 100 + s * ARM.shoulderX * w, y: shY };
const upperDeg = -s * l.raise;
const elbow = tipOf(shoulder.x, shoulder.y, upperDeg, ARM.upper);
const foreDeg = upperDeg + s * l.bend;
const wrist = tipOf(elbow.x, elbow.y, foreDeg, ARM.wrist);
const hand = tipOf(elbow.x, elbow.y, foreDeg, ARM.wrist + ARM.hand);
return { shoulder, elbow, wrist, hand, upperDeg, foreDeg, torsoTop, hipY };
}
/**
* Camada do braço `s` no quadro. `holds` = segura objeto (sempre na frente do corpo, salvo na altura do rosto).
* O "peito" é o tronco sem as faixas laterais onde o braço caído naturalmente encosta.
*/
export function armLayer(b: BodyParams, s: 1 | -1, opts: { holds?: boolean; w?: number } = {}): ArmLayer {
const w = opts.w ?? 1;
const g = armGeometry(b, s, w);
const half = ARM.torsoHalf * w;
// Altura do pescoço/rosto: acima do topo do tronco (+ folga da gola), dentro da largura da cabeça.
const atFace = (p: Point) => p.y < g.torsoTop + 12 && Math.abs(p.x - 100) < 66;
if (atFace(g.hand)) return "face";
if (opts.holds) return "front";
const chest = { x0: 100 - half + 16, x1: 100 + half - 16, y0: g.torsoTop + 6, y1: g.hipY + 10 };
const inChest = (p: Point) => p.x > chest.x0 && p.x < chest.x1 && p.y > chest.y0 && p.y < chest.y1;
// Amostra o antebraço (cotovelo → mão): basta um trecho na frente do peito.
for (let i = 0; i <= 8; i++) {
const k = i / 8;
if (inChest({ x: g.elbow.x + (g.hand.x - g.elbow.x) * k, y: g.elbow.y + (g.hand.y - g.elbow.y) * k })) return "front";
}
return "side";
}
+8 -2
View File
@@ -7,7 +7,7 @@ import { emphasisAt, speak, visemeAt, type SpokenWord } from "./lipsync";
import { blendBody, blendFace, bodyOf, faceOf, withBody, withFace, type BodyParams, type BodyPatch, type FaceParams, type FacePatch } from "./rig"; import { blendBody, blendFace, bodyOf, faceOf, withBody, withFace, type BodyParams, type BodyPatch, type FaceParams, type FacePatch } from "./rig";
export const ACTIONS = ["express", "pose", "walk", "run", "enter", "exit", "jump", "nod", "shake_head", "tremble", "bounce", "fall", export const ACTIONS = ["express", "pose", "walk", "run", "enter", "exit", "jump", "nod", "shake_head", "tremble", "bounce", "fall",
"sit", "stand_up", "turn", "talk", "look", "emote", "wave"] as const; "sit", "stand_up", "turn", "talk", "look", "emote", "wave", "hammer"] as const;
export type ActionKind = (typeof ACTIONS)[number]; export type ActionKind = (typeof ACTIONS)[number];
export type Action = { export type Action = {
@@ -42,7 +42,7 @@ export type ActorState = {
const DEFAULT_DUR: Record<ActionKind, number> = { const DEFAULT_DUR: Record<ActionKind, number> = {
express: 0.25, pose: 0.35, walk: 1.6, run: 0.9, enter: 1.2, exit: 1.2, jump: 0.8, nod: 0.7, shake_head: 0.8, tremble: 1, bounce: 0.8, express: 0.25, pose: 0.35, walk: 1.6, run: 0.9, enter: 1.2, exit: 1.2, jump: 0.8, nod: 0.7, shake_head: 0.8, tremble: 1, bounce: 0.8,
fall: 0.6, sit: 0.5, stand_up: 0.5, turn: 0.3, talk: 1.5, look: 0.3, emote: 1.2, wave: 1.2, fall: 0.6, sit: 0.5, stand_up: 0.5, turn: 0.3, talk: 1.5, look: 0.3, emote: 1.2, wave: 1.2, hammer: 2.4,
}; };
const clamp01 = (v: number) => Math.max(0, Math.min(1, v)); const clamp01 = (v: number) => Math.max(0, Math.min(1, v));
@@ -189,6 +189,12 @@ export function evaluate(actor: ActorInput, t: number, durationS: number, seed =
break; break;
} }
case "emote": if (active) st.emote = { text: a.text ?? "!", k: env }; break; case "emote": if (active) st.emote = { text: a.text ?? "!", k: env }; break;
// Martelar: braço direito sobe e desce batendo (`times` golpes), cabeça acompanha cada batida.
case "hammer": if (active) {
const beat = Math.abs(Math.sin(p * Math.PI * (a.times ?? 5)));
st.body = withBody(st.body, { armR: { raise: 40 + beat * 95 * Math.min(1, env * 1.5), bend: 60 + beat * 40 }, headNod: st.body.headNod + (1 - beat) * 0.15 * env });
break;
}
case "wave": if (active) st.body = withBody(st.body, { armR: { raise: 140 * Math.min(1, env * 1.5), bend: -25 + Math.sin(p * Math.PI * 2 * (a.times ?? 3)) * 30 } }); break; case "wave": if (active) st.body = withBody(st.body, { armR: { raise: 140 * Math.min(1, env * 1.5), bend: -25 + Math.sin(p * Math.PI * 2 * (a.times ?? 3)) * 30 } }); break;
} }
} }
+330 -33
View File
@@ -1,9 +1,13 @@
// Camadas por cima da cena: etiqueta, onomatopeia, contador, ondas de som, X vermelho, painel do topo (HUD) e a // Camadas por cima da cena: etiqueta, onomatopeia, ondas de som, X vermelho, painel do topo (HUD), cartão de nome,
// legenda palavra por palavra (cada palavra entra pequena e cresce; palavra-chave em amarelo, perigo em vermelho). // cartelas de dado (número grande, lista com caixas, tabela, barra de progresso, grade de quadradinhos) e a legenda
// palavra por palavra (cada palavra entra pequena e cresce; palavra-chave maior e em amarelo, perigo em vermelho).
//
// Tudo é função pura do quadro (mola da Remotion + tempo do spec): o mesmo quadro sai sempre igual.
// Tamanhos em `u(n)` = n% da largura de um quadro vertical 9:16 (num quadro mais largo, limita pela altura).
import React from "react"; import React from "react";
import { spring } from "remotion"; import { spring } from "remotion";
import { COLORS, FONT_CAPTION, FONT_LABEL, TONE_BG, TONE_FG } from "./theme"; import { COLORS, FONT_CAPTION, FONT_LABEL, FONT_TEXT, TONE_BG, TONE_FG } from "./theme";
import type { ShotSpec, TextItem, Tone, Word } from "./spec"; import { numberOf, type Hud as HudSpec, type TextItem, type TextRow, type Tone, type Word } from "./spec";
/** 0 → 1 com mola, a partir de `startS` (antes disso, 0). */ /** 0 → 1 com mola, a partir de `startS` (antes disso, 0). */
export function pop(frame: number, fps: number, startS = 0, stiffness = 220): number { export function pop(frame: number, fps: number, startS = 0, stiffness = 220): number {
@@ -16,6 +20,32 @@ export function shake(frame: number, amp = 3): { x: number; y: number } {
return { x: Math.sin(frame * 12.9898) * amp, y: Math.cos(frame * 78.233) * amp * 0.7 }; return { x: Math.sin(frame * 12.9898) * amp, y: Math.cos(frame * 78.233) * amp * 0.7 };
} }
/** 0 → 1 sem mola (desacelera no fim), de `startS` a `startS + durS`: barra enchendo, número contando. */
export function ease(frame: number, fps: number, startS: number, durS: number): number {
const p = Math.max(0, Math.min(1, (frame / fps - startS) / Math.max(0.01, durS)));
return 1 - (1 - p) ** 3;
}
/** Medida proporcional ao quadro: n% da largura de um vertical 9:16. */
export const u = (n: number) => `calc(${n.toFixed(3)} * min(1cqw, 0.5625cqh))`;
/** Cores do grafismo (cartelas, HUD, cartão de nome). */
export const UI = {
ink: "#151a31",
box: "rgba(15,18,30,0.94)",
boxEdge: "rgba(150,160,210,0.16)",
cell: "#252c48",
cream: "#f3efe6",
yellow: "#fcc430",
red: "#ea4752",
redSoft: "#f4646d",
green: "#2f9a55",
muted: "#c3c8dd",
dim: "#7f87a8",
track: "#2a3050",
};
const TONE_TEXT: Record<Tone, string> = { danger: UI.red, info: UI.yellow, ok: "#45c97a" };
const at = (x: number, y: number): React.CSSProperties => ({ position: "absolute", left: `${x * 100}%`, top: `${y * 100}%` }); const at = (x: number, y: number): React.CSSProperties => ({ position: "absolute", left: `${x * 100}%`, top: `${y * 100}%` });
export function TagLabel({ text, tone = "info", size = 3.6 }: { text: string; tone?: Tone; size?: number }) { export function TagLabel({ text, tone = "info", size = 3.6 }: { text: string; tone?: Tone; size?: number }) {
@@ -28,24 +58,244 @@ export function TagLabel({ text, tone = "info", size = 3.6 }: { text: string; to
); );
} }
/**
* Cartão de nome do personagem: cartão creme arredondado, nome grande em letra condensada escura e 1–2 linhas
* menores (função, dado). Sem posição nem animação: quem usa posiciona e faz a entrada.
*/
export function NameCard({ name, lines = [], size = 1 }: { name: string; lines?: string[]; size?: number }) {
const s = size;
return (
<div style={{ display: "inline-block", background: UI.cream, borderRadius: u(2.4 * s), padding: `${u(2.2 * s)} ${u(3.4 * s)} ${u(2.5 * s)}`,
boxShadow: `0 ${u(0.9 * s)} 0 rgba(8,10,22,0.34)`, textAlign: "left", whiteSpace: "nowrap" }}>
<div style={{ fontFamily: FONT_CAPTION, fontSize: u(6 * s), color: UI.ink, lineHeight: 1.12, letterSpacing: "0.005em" }}>{name.toUpperCase()}</div>
{lines.filter((l) => l.trim()).slice(0, 3).map((l, i) => (
<div key={i} style={{ fontFamily: FONT_TEXT, fontSize: u(3.3 * s), color: "#1c2138", lineHeight: 1.55, letterSpacing: "0.035em",
marginTop: i === 0 ? u(0.3 * s) : 0 }}>
{l.toUpperCase()}
</div>
))}
</div>
);
}
/** Conta o número do texto de 0 até o valor ("R$ 134.273", "-R$ 47.312.904", "297"), mantendo prefixo e sufixo. */
export function countUp(value: string, p: number): string {
const m = /^(\D*?)(\d{1,3}(?:\.\d{3})+|\d+)(,\d+)?(\D*)$/.exec(value.trim());
if (!m || p >= 1) return value;
const target = Number(m[2].replace(/\./g, ""));
if (target < 10) return value;
const n = String(Math.round(target * Math.max(0, p)));
const digits = m[2].includes(".") ? n.replace(/\B(?=(\d{3})+(?!\d))/g, ".") : n;
return `${m[1]}${digits}${m[3] ?? ""}${m[4]}`;
}
/** Caixa escura arredondada das cartelas flutuantes. */
function Box({ s, children, style }: { s: number; children: React.ReactNode; style?: React.CSSProperties }) {
return (
<div style={{ background: UI.box, borderRadius: u(3 * s), border: `${u(0.22 * s)} solid ${UI.boxEdge}`,
boxShadow: `0 ${u(0.8 * s)} 0 rgba(0,0,0,0.3)`, ...style }}>
{children}
</div>
);
}
/** Fundo escuro de tela inteira (cartela "panel"), com leve luz no centro como a referência. */
function PanelBackdrop({ k }: { k: number }) {
return (
<div style={{ position: "absolute", inset: "-4%", opacity: Math.min(1, k * 2.2),
background: "radial-gradient(ellipse 62% 42% at 50% 46%, #1d2342 0%, #151a31 55%, #0e1222 100%)" }} />
);
}
const label = (size: number, color = UI.muted, spacing = 0.16): React.CSSProperties => ({
fontFamily: FONT_TEXT, fontSize: u(size), color, letterSpacing: `${spacing}em`, lineHeight: 1.1, whiteSpace: "nowrap",
});
function StatCard({ t, s, frame, fps }: { t: TextItem; s: number; frame: number; fps: number }) {
const atS = t.atS ?? 0;
const value = countUp(String(t.value ?? ""), ease(frame, fps, atS + 0.1, 0.9));
const inner = (
<div style={{ textAlign: "center" }}>
{t.text.trim() && <div style={{ ...label(4.4 * s), marginBottom: u(1.2 * s), paddingLeft: "0.16em" }}>{t.text.toUpperCase()}</div>}
<div style={{ fontFamily: FONT_CAPTION, fontSize: u(15.5 * s), lineHeight: 1.08, whiteSpace: "nowrap",
color: t.tone ? TONE_TEXT[t.tone] : "#ffffff", textShadow: `0 ${u(0.6 * s)} 0 rgba(0,0,0,0.3)` }}>{value.toUpperCase()}</div>
</div>
);
return t.panel ? inner : <Box s={s} style={{ padding: `${u(2.6 * s)} ${u(5 * s)} ${u(2 * s)}` }}>{inner}</Box>;
}
function CounterCard({ t, s, frame, fps }: { t: TextItem; s: number; frame: number; fps: number }) {
const value = countUp(String(t.value ?? ""), ease(frame, fps, (t.atS ?? 0) + 0.1, 0.8));
return (
<Box s={s} style={{ padding: `${u(2.2 * s)} ${u(4.6 * s)} ${u(1.4 * s)}`, textAlign: "center", borderRadius: u(2.8 * s) }}>
<div style={{ ...label(3.5 * s, UI.muted, 0.12), paddingLeft: "0.12em" }}>{t.text.toUpperCase()}</div>
<div style={{ fontFamily: FONT_CAPTION, fontSize: u(11 * s), color: t.tone ? TONE_TEXT[t.tone] : "#ffffff", lineHeight: 1.12 }}>{value}</div>
</Box>
);
}
/** Caixa de seleção: vazia (contorno), marcada (verde enche da esquerda e o ✓ se desenha) ou riscada (vermelha com X). */
function CheckBox({ state, m, s }: { state: TextRow["state"]; m: number; s: number }) {
const side = u(8.2 * s);
const fill = state === "crossed" ? UI.red : UI.green;
const marked = state === "checked" || state === "crossed";
const draw = Math.max(0, Math.min(1, (m - 0.45) / 0.55));
return (
<div style={{ position: "relative", width: side, height: side, flex: "none", borderRadius: u(1.6 * s), overflow: "hidden",
boxSizing: "border-box", border: `${u(0.7 * s)} solid ${marked && m > 0 ? fill : state === "empty" ? "#4d5476" : "#6d7598"}` }}>
{marked && m > 0 && <div style={{ position: "absolute", left: 0, top: 0, bottom: 0, width: `${Math.min(1, m * 1.8) * 100}%`, background: fill }} />}
{marked && draw > 0 && (
<svg viewBox="0 0 100 100" style={{ position: "absolute", inset: "-12%", width: "124%", height: "124%" }}>
{state === "checked"
? <path d="M27 52 L44 68 L74 34" fill="none" stroke="#fff" strokeWidth={12} strokeLinecap="round" strokeLinejoin="round"
strokeDasharray={80} strokeDashoffset={80 * (1 - draw)} />
: <g stroke="#fff" strokeWidth={12} strokeLinecap="round">
<line x1={34} y1={34} x2={34 + 32 * Math.min(1, draw * 2)} y2={34 + 32 * Math.min(1, draw * 2)} />
{draw > 0.5 && <line x1={66} y1={34} x2={66 - 32 * (draw - 0.5) * 2} y2={34 + 32 * (draw - 0.5) * 2} />}
</g>}
</svg>
)}
</div>
);
}
function ChecklistCard({ t, s, frame, fps }: { t: TextItem; s: number; frame: number; fps: number }) {
const atS = t.atS ?? 0;
const step = t.stepS ?? 0.5;
const items = t.items ?? [];
let order = 0;
return (
<Box s={s} style={{ padding: `${u(5 * s)} ${u(7 * s)} ${u(5 * s)} ${u(6.4 * s)}`, minWidth: u((t.panel ? 84 : 30) * s), boxSizing: "border-box",
...(t.panel ? { background: "rgba(9,11,22,0.6)", boxShadow: "none" } : {}) }}>
{t.text.trim() && <div style={{ ...label(3.8 * s), marginBottom: u(3 * s) }}>{t.text.toUpperCase()}</div>}
{items.map((it, i) => {
const kIn = pop(frame, fps, atS + i * 0.07, 260);
const marked = it.state === "checked" || it.state === "crossed";
// Marcadas e riscadas em sequência, na ordem da lista.
const m = marked ? ease(frame, fps, atS + 0.45 + step * order++, 0.38) : 0;
const color = it.state === "crossed" && m > 0.5 ? UI.redSoft : marked && m > 0.5 ? "#ffffff" : it.state === "empty" ? UI.dim : UI.muted;
return (
<div key={i} style={{ display: "flex", alignItems: "center", gap: u(4 * s), marginTop: i ? u(3.3 * s) : 0,
opacity: Math.min(1, kIn * 1.6), transform: `translateX(${(1 - kIn) * -6}%)` }}>
<CheckBox state={it.state ?? "empty"} m={m} s={s} />
<span style={{ ...label(6.1 * s, color, 0.05) }}>{it.text.toUpperCase()}</span>
</div>
);
})}
</Box>
);
}
function TableCard({ t, s, frame, fps }: { t: TextItem; s: number; frame: number; fps: number }) {
const atS = t.atS ?? 0;
const items = t.items ?? [];
const hl = t.highlight;
const hlK = hl === undefined ? 0 : pop(frame, fps, atS + 0.35 + items.length * 0.1, 200);
const hlColor = t.tone === "ok" ? UI.green : t.tone === "info" ? UI.yellow : UI.red;
return (
<Box s={s} style={{ padding: `${u(3.8 * s)} ${u(3.6 * s)}`, width: u(80 * s), boxSizing: "border-box" }}>
{t.text.trim() && <div style={{ ...label(3.8 * s), marginBottom: u(2.2 * s), paddingLeft: u(1.6 * s) }}>{t.text.toUpperCase()}</div>}
{items.map((it, i) => {
const kIn = pop(frame, fps, atS + 0.1 + i * 0.1, 260);
const on = i === hl;
const fg = on && hlK > 0.5 ? (t.tone === "info" ? UI.ink : "#ffffff") : "#ffffff";
return (
<div key={i} style={{ position: "relative", display: "flex", alignItems: "center", gap: u(2.6 * s), padding: `${u(1.5 * s)} ${u(2.2 * s)}`,
borderTop: i ? `${u(0.2 * s)} solid rgba(255,255,255,0.07)` : "none", opacity: Math.min(1, kIn * 1.6),
transform: `translateY(${(1 - kIn) * 25}%) scale(${on ? 1 + 0.04 * hlK : 1})` }}>
{on && <div style={{ position: "absolute", inset: `${u(-0.3 * s)} ${u(-1 * s)}`, borderRadius: u(1.4 * s), background: hlColor, opacity: hlK,
boxShadow: `0 ${u(0.5 * s)} 0 rgba(0,0,0,0.3)` }} />}
<span style={{ position: "relative", fontFamily: FONT_CAPTION, fontSize: u(4.6 * s), color: on && hlK > 0.5 ? fg : UI.dim, width: u(4.4 * s), lineHeight: 1.15 }}>{i + 1}</span>
<span style={{ position: "relative", ...label(5 * s, fg, 0.04), flex: 1, overflow: "hidden", textOverflow: "ellipsis" }}>{it.text.toUpperCase()}</span>
{it.value !== undefined && <span style={{ position: "relative", fontFamily: FONT_CAPTION, fontSize: u(5.2 * s), color: fg, lineHeight: 1.15 }}>{it.value.toUpperCase()}</span>}
</div>
);
})}
</Box>
);
}
function ProgressCard({ t, s, frame, fps }: { t: TextItem; s: number; frame: number; fps: number }) {
const target = Math.max(0, Math.min(100, numberOf(t.value)));
const f = ease(frame, fps, (t.atS ?? 0) + 0.25, 1.1);
const pct = Math.round(target * f);
const color = t.tone ? TONE_TEXT[t.tone] : UI.yellow;
return (
<Box s={s} style={{ padding: `${u(2.6 * s)} ${u(3.6 * s)} ${u(3 * s)}`, width: u(82 * s), boxSizing: "border-box" }}>
<div style={{ display: "flex", justifyContent: "space-between", alignItems: "baseline" }}>
<span style={{ ...label(4 * s, "#ffffff", 0.12) }}>{t.text.toUpperCase()}</span>
<span style={{ fontFamily: FONT_CAPTION, fontSize: u(5.6 * s), color, lineHeight: 1.1 }}>{pct}%</span>
</div>
<div style={{ marginTop: u(1.6 * s), height: u(2.6 * s), borderRadius: u(1.3 * s), background: UI.track, overflow: "hidden" }}>
<div style={{ height: "100%", width: `${target * f}%`, borderRadius: u(1.3 * s), background: color,
boxShadow: `inset 0 ${u(0.6 * s)} 0 rgba(255,255,255,0.28)` }} />
</div>
</Box>
);
}
function GridCard({ t, s, frame, fps }: { t: TextItem; s: number; frame: number; fps: number }) {
const atS = t.atS ?? 0;
const total = Math.max(1, Math.min(40, Math.round(t.total ?? 1)));
const filled = Math.max(0, Math.min(total, Math.round(numberOf(t.value) || 0)));
const cols = total <= 6 ? total : total <= 24 ? 6 : 8;
const side = 7.4 * s;
return (
<Box s={s} style={{ padding: `${u(3.4 * s)} ${u(4 * s)} ${u(3.2 * s)}` }}>
<div style={{ fontFamily: FONT_CAPTION, fontSize: u(6.4 * s), color: "#ffffff", lineHeight: 1.15, marginBottom: u(2.2 * s), whiteSpace: "nowrap" }}>{t.text.toUpperCase()}</div>
<div style={{ display: "grid", gridTemplateColumns: `repeat(${cols}, ${u(side)})`, gap: u(1.3 * s) }}>
{Array.from({ length: total }, (_, i) => {
const k = i < filled ? pop(frame, fps, atS + 0.35 + i * 0.14, 260) : 0;
return (
<div key={i} style={{ position: "relative", width: u(side), height: u(side), boxSizing: "border-box", borderRadius: u(1 * s),
border: `${u(0.45 * s)} solid #3a4166` }}>
{k > 0.001 && (
<div style={{ position: "absolute", inset: u(-0.45 * s), borderRadius: u(1 * s), background: UI.cream, transform: `scale(${0.4 + 0.6 * k})`,
opacity: Math.min(1, k * 1.8), display: "flex", alignItems: "center", justifyContent: "center",
fontFamily: FONT_CAPTION, fontSize: u(4.4 * s), color: UI.ink, lineHeight: 1 }}>{i + 1}</div>
)}
</div>
);
})}
</div>
<div style={{ ...label(3.6 * s, UI.yellow, 0.12), marginTop: u(2.4 * s) }}>{filled} DE {total}</div>
</Box>
);
}
const CARDS = { stat: StatCard, counter: CounterCard, checklist: ChecklistCard, table: TableCard, progress: ProgressCard, grid: GridCard } as const;
export function TextLayer({ t, frame, fps }: { t: TextItem; frame: number; fps: number }) { export function TextLayer({ t, frame, fps }: { t: TextItem; frame: number; fps: number }) {
const k = pop(frame, fps, t.atS ?? 0); const k = pop(frame, fps, t.atS ?? 0);
if (k <= 0.001) return null; if (k <= 0.001) return null;
const base = { ...at(t.x, t.y), transform: `translate(-50%, -50%) rotate(${t.rotate ?? 0}deg) scale(${0.4 + 0.6 * k})`, opacity: Math.min(1, k * 1.4) }; const s = t.size ?? 1;
if (t.kind === "tag") return <div style={base}><TagLabel text={t.text} tone={t.tone} /></div>; if (t.kind === "namecard") {
if (t.kind === "counter") { // Entra deslizando do lado de fora do quadro, com mola.
const dir = t.x < 0.5 ? -1 : 1;
return ( return (
<div style={{ ...base, textAlign: "center", border: "0.35cqw solid #fff", borderRadius: "1.4cqw", padding: "0.8cqw 2.6cqw", <div style={{ ...at(t.x, t.y), transform: `translate(-50%, -50%) translateX(${dir * (1 - k) * 18}%) scale(${0.82 + 0.18 * k})`,
background: "rgba(10,12,28,0.85)" }}> opacity: Math.min(1, k * 1.6) }}>
<div style={{ fontFamily: FONT_LABEL, fontSize: "2.6cqw", color: "#c9cbe0", letterSpacing: "0.08em" }}>{t.text.toUpperCase()}</div> <NameCard name={t.text} lines={t.lines} size={s} />
<div style={{ fontFamily: FONT_CAPTION, fontSize: "8cqw", color: "#fff", lineHeight: 1 }}>{t.value ?? ""}</div>
</div> </div>
); );
} }
const s = t.kind === "onomatopoeia" ? shake(frame, 4) : { x: 0, y: 0 }; if (t.kind in CARDS) {
const Card = CARDS[t.kind as keyof typeof CARDS];
return (
<>
{t.panel && <PanelBackdrop k={k} />}
<div style={{ ...at(t.x, t.y), transform: `translate(-50%, -50%) translateY(${(1 - k) * 6}%) scale(${0.8 + 0.2 * k})`, opacity: Math.min(1, k * 1.6) }}>
<Card t={t} s={s} frame={frame} fps={fps} />
</div>
</>
);
}
const base = { ...at(t.x, t.y), transform: `translate(-50%, -50%) rotate(${t.rotate ?? 0}deg) scale(${0.4 + 0.6 * k})`, opacity: Math.min(1, k * 1.4) };
if (t.kind === "tag") return <div style={base}><TagLabel text={t.text} tone={t.tone} /></div>;
const sh = t.kind === "onomatopoeia" ? shake(frame, 4) : { x: 0, y: 0 };
const color = t.tone === "danger" ? COLORS.danger : t.kind === "big" ? "#ffffff" : COLORS.key; const color = t.tone === "danger" ? COLORS.danger : t.kind === "big" ? "#ffffff" : COLORS.key;
return ( return (
<div style={{ ...base, transform: `${base.transform} translate(${s.x}px, ${s.y}px)`, fontFamily: FONT_CAPTION, color, <div style={{ ...base, transform: `${base.transform} translate(${sh.x}px, ${sh.y}px)`, fontFamily: FONT_CAPTION, color,
fontSize: t.kind === "big" ? "12cqw" : "9cqw", whiteSpace: "nowrap", WebkitTextStroke: "0.35cqw #121326", fontSize: t.kind === "big" ? "12cqw" : "9cqw", whiteSpace: "nowrap", WebkitTextStroke: "0.35cqw #121326",
paintOrder: "stroke fill", textShadow: "0 0.6cqw 0 rgba(0,0,0,0.35)" }}> paintOrder: "stroke fill", textShadow: "0 0.6cqw 0 rgba(0,0,0,0.35)" }}>
{t.text.toUpperCase()} {t.text.toUpperCase()}
@@ -77,21 +327,61 @@ export function CrossOut({ k }: { k: number }) {
); );
} }
export function Hud({ hud, frame, fps }: { hud: NonNullable<ShotSpec["hud"]>; frame: number; fps: number }) { /** Hora do HUD andando: "10:06" + minutos por segundo de trecho. */
let clock = hud.clock; export function hudClock(clock: string | undefined, t: number, minutesPerSecond?: number): string | undefined {
if (clock && /^\d{1,2}:\d{2}$/.test(clock) && hud.clockMinutesPerSecond) { if (!clock || !/^\d{1,2}:\d{2}$/.test(clock) || !minutesPerSecond) return clock;
const [h, m] = clock.split(":").map(Number); const [h, m] = clock.split(":").map(Number);
const total = (h * 60 + m + Math.floor((frame / fps) * hud.clockMinutesPerSecond)) % (24 * 60); const total = (h * 60 + m + Math.floor(t * minutesPerSecond)) % (24 * 60);
clock = `${String(Math.floor(total / 60)).padStart(2, "0")}:${String(total % 60).padStart(2, "0")}`; return `${String(Math.floor(total / 60)).padStart(2, "0")}:${String(total % 60).padStart(2, "0")}`;
} }
/** Valor do HUD zerado ou negativo ("R$ 0,00", "-12") pede vermelho. */
export function hudValueTone(value: string, tone?: Tone): Tone | undefined {
if (tone) return tone;
const v = value.trim();
if (/^[^\d]*-/.test(v)) return "danger";
const digits = v.replace(/[^\d]/g, "");
return digits && Number(digits) === 0 ? "danger" : undefined;
}
/**
* Painel do topo (fixo, sem animação de entrada: continua igual de um trecho para o outro). Esquerda: bloco amarelo
* (`badge`) + hora com ponto vermelho sobre fundo escuro e, embaixo, faixa clara com o lugar. Direita, opcional:
* rótulo pequeno + valor grande e faixa amarela com a nota.
*/
export function Hud({ hud, frame, fps }: { hud: HudSpec; frame: number; fps: number }) {
const clock = hudClock(hud.clock, frame / fps, hud.clockMinutesPerSecond);
const place = hud.place ?? hud.label;
const row = u(8);
const big: React.CSSProperties = { fontFamily: FONT_CAPTION, fontSize: u(5.8), lineHeight: 1, whiteSpace: "nowrap", paddingTop: u(0.3) };
const strip: React.CSSProperties = { ...label(2.5, UI.ink, 0.07), height: u(4.2), display: "flex", alignItems: "center", padding: `0 ${u(2.2)}` };
const shadow = `0 ${u(0.55)} 0 rgba(6,8,18,0.6)`;
const tone = hud.value ? hudValueTone(hud.value, hud.valueTone) : undefined;
return ( return (
<div style={{ position: "absolute", top: "5.5%", left: 0, right: 0, display: "flex", justifyContent: "center", alignItems: "center", <>
gap: "1.4cqw", fontFamily: FONT_LABEL }}> <div style={{ position: "absolute", left: u(4), top: u(4.5), display: "inline-flex", flexDirection: "column", alignItems: "stretch", boxShadow: shadow }}>
<span style={{ background: COLORS.danger, color: "#fff", fontSize: "3.4cqw", padding: "0.2em 0.5em 0.1em", borderRadius: "0.25em" }}>⚡ {hud.badge.toUpperCase()}</span> <div style={{ display: "flex", height: row, background: clock ? "#11141f" : undefined }}>
<span style={{ color: "#fff", fontSize: "4.2cqw" }}>{hud.label.toUpperCase()}</span> <div style={{ ...big, background: UI.yellow, color: UI.ink, display: "flex", alignItems: "center", padding: `0 ${u(2.2)}` }}>{hud.badge.toUpperCase()}</div>
{clock && <span style={{ background: "#0d0f1f", color: COLORS.key, fontSize: "3.4cqw", padding: "0.2em 0.45em 0.1em", borderRadius: "0.25em", {clock && (
border: "0.25cqw solid #3a3f6b" }}>{clock}</span>} <div style={{ ...big, color: "#ffffff", display: "flex", alignItems: "center", gap: u(1.5), padding: `0 ${u(2.4)} 0 ${u(2.2)}` }}>
</div> <span style={{ width: u(1.6), height: u(1.6), borderRadius: "50%", background: UI.red, marginTop: u(-0.3) }} />
{clock}
</div>
)}
</div>
{place && <div style={{ ...strip, background: UI.cream }}>{place.toUpperCase()}</div>}
</div>
{hud.value && (
<div style={{ position: "absolute", right: u(4), top: u(4.5), display: "inline-flex", flexDirection: "column", alignItems: "flex-end" }}>
<div style={{ display: "flex", height: row, boxShadow: hud.note ? "none" : shadow }}>
{hud.valueLabel && <div style={{ ...label(2.5, UI.muted, 0.1), background: UI.cell, display: "flex", alignItems: "center", padding: `0 ${u(1.5)}` }}>{hud.valueLabel.toUpperCase()}</div>}
<div style={{ ...big, background: "#11141f", color: tone === "danger" ? UI.redSoft : tone ? TONE_TEXT[tone] : "#ffffff", display: "flex", alignItems: "center",
padding: `0 ${u(2.2)}` }}>{hud.value.toUpperCase()}</div>
</div>
{hud.note && <div style={{ ...strip, background: UI.yellow, boxShadow: shadow }}>{hud.note.toUpperCase()}</div>}
</div>
)}
</>
); );
} }
@@ -107,22 +397,29 @@ export function captionChunks(words: Word[]): Word[][] {
return chunks; return chunks;
} }
export function Captions({ words, frame, fps, y = 0.665 }: { words: Word[]; frame: number; fps: number; y?: number }) { /**
* Legenda: 2–3 palavras grandes em letra condensada branca, contorno e sombra escuros (deslocada para baixo e à
* esquerda, como a referência); palavra-chave maior e amarela, perigo vermelho.
*/
export function Captions({ words, frame, fps, y = 0.8 }: { words: Word[]; frame: number; fps: number; y?: number }) {
const t = frame / fps; const t = frame / fps;
const chunks = captionChunks(words); const chunks = captionChunks(words);
const chunk = chunks.find((c, i) => t >= c[0].startS && (i === chunks.length - 1 || t < chunks[i + 1][0].startS)); const chunk = chunks.find((c, i) => t >= c[0].startS && (i === chunks.length - 1 || t < chunks[i + 1][0].startS));
if (!chunk) return null; if (!chunk) return null;
const last = chunk[chunk.length - 1]; const last = chunk[chunk.length - 1];
if (t > last.endS + 0.6) return null; if (t > last.endS + 0.6) return null;
const ink = "#0f1226";
return ( return (
<div style={{ position: "absolute", left: "6%", right: "6%", top: `${y * 100}%`, transform: "translateY(-50%)", display: "flex", <div style={{ position: "absolute", left: "5%", right: "5%", top: `${y * 100}%`, transform: "translateY(-50%)", display: "flex",
flexWrap: "wrap", justifyContent: "center", alignItems: "baseline", columnGap: "2.2cqw", fontFamily: FONT_CAPTION, lineHeight: 1.05 }}> flexWrap: "wrap", justifyContent: "center", alignItems: "baseline", columnGap: u(2.4), fontFamily: FONT_CAPTION, lineHeight: 1.08 }}>
{chunk.filter((w) => t >= w.startS).map((w, i) => { {chunk.filter((w) => t >= w.startS).map((w, i) => {
const k = pop(frame, fps, w.startS, 320); const k = pop(frame, fps, w.startS, 320);
const color = w.tone === "danger" ? COLORS.danger : w.tone === "key" ? COLORS.key : "#ffffff"; const strong = w.tone === "key" || w.tone === "danger";
const color = w.tone === "danger" ? COLORS.danger : w.tone === "key" ? UI.yellow : "#ffffff";
return ( return (
<span key={i} style={{ fontSize: "8.4cqw", color, transform: `scale(${0.55 + 0.45 * k})`, display: "inline-block", <span key={i} style={{ fontSize: u(strong ? 12.2 : 9.6), color, transform: `scale(${0.55 + 0.45 * k})`, transformOrigin: "50% 80%", display: "inline-block",
textShadow: "0 0.5cqw 0 rgba(0,0,0,0.55), 0 0 1.4cqw rgba(0,0,0,0.5)" }}> WebkitTextStroke: `${u(strong ? 1.1 : 0.9)} ${ink}`, paintOrder: "stroke fill",
textShadow: `${u(-0.7)} ${u(0.9)} 0 ${ink}, ${u(-0.35)} ${u(0.45)} 0 ${ink}, 0 0 ${u(2)} rgba(0,0,0,0.35)` }}>
{w.text.toUpperCase().replace(/[.,;:]$/, "")} {w.text.toUpperCase().replace(/[.,;:]$/, "")}
</span> </span>
); );
+513 -93
View File
@@ -1,142 +1,562 @@
// Lugares montados por PEÇAS (não há cenário pronto): paleta + céu/hora + chão + peças posicionadas por // Lugares montados por PEÇAS (não há cenário pronto): paleta + céu/hora + chão + peças posicionadas por
// profundidade (z: 0 = frente, 1 = fundo). Parque de dia, cemitério na névoa, quarto à noite, bunker com foco // profundidade (z: 0 = frente, 1 = fundo). Parque de dia, cemitério na névoa, quarto à noite, bunker com foco
// de luz… tudo sai da mesma gramática. Espaço de desenho 1080×1920; chão começa em `horizon` (fração da altura). // de luz… tudo sai da mesma gramática. Espaço de desenho 1080×1920; chão começa em `horizon` (fração da altura).
//
// Regras de acabamento (valem para toda peça, ver elements/paint.ts): sombreado em 2 tons com a luz vindo da
// esquerda; 3 planos com perspectiva atmosférica (o fundo puxa para a cor do céu/parede, a frente escurece);
// sombra de contato no chão sob cada objeto. Tudo por mistura de cor — nada de blur por quadro.
import React from "react"; import React from "react";
import { rng } from "./random"; import { rng } from "./random";
import type { ShotSpec } from "./spec"; import type { ShotSpec } from "./spec";
import { makePaint, mix, palette, type Pal, type PaletteId } from "./elements/paint";
import { NATURE, type Draw } from "./elements/nature";
import { BUILT, FRONT_PART } from "./elements/built";
import { INDOOR } from "./elements/indoor";
export const PALETTES = ["night", "sepia", "day", "dusk", "gray"] as const; export { PALETTES, palette, type PaletteId } from "./elements/paint";
export type PaletteId = (typeof PALETTES)[number];
export const GROUNDS = ["grass", "street", "dirt", "floor", "sand", "water", "none"] as const; export const GROUNDS = ["grass", "street", "dirt", "floor", "sand", "water", "none"] as const;
export const ELEMENTS = ["tree", "deadtree", "pine", "bush", "rock", "mountain", "cloud", "bench", "lamp", "gravestone", "cross", "fence", export const ELEMENTS = ["tree", "deadtree", "pine", "bush", "rock", "mountain", "cloud", "bench", "lamp", "gravestone", "cross", "fence",
"house", "building", "car", "sign", "door", "window", "table", "bed", "shelf", "crate", "tent", "fire"] as const; "house", "building", "car", "sign", "door", "window", "table", "bed", "shelf", "crate", "tent", "fire",
"ark", "ark_frame", "scaffold", "planks", "rainbow", "waves", "palm", "outcrop",
"cabinet", "locker", "frame", "pendant", "desklamp", "desk", "clothesline", "wall", "facade", "shopfront"] as const;
/** Tempo por cima da cena (chuva caindo; tempestade = chuva forte + relâmpago + céu mais escuro). */
export const WEATHERS = ["none", "rain", "storm"] as const;
export type ElementKind = (typeof ELEMENTS)[number]; export type ElementKind = (typeof ELEMENTS)[number];
/** Fonte de luz posicionada (`spec.lightSource`): luminária, janela ou sol. */
export const LIGHT_SOURCES = ["lamp", "window", "sun"] as const;
export type Place = { export type Place = {
ground: (typeof GROUNDS)[number]; ground: (typeof GROUNDS)[number];
/** Interno: parede no lugar do céu (quarto, bunker, loja). */ /** Interno: parede no lugar do céu (quarto, bunker, loja). */
indoor?: boolean; indoor?: boolean;
/** Linha do horizonte (fração da altura; padrão 0,56). */ /** Linha do horizonte / pé da parede (fração da altura; padrão 0,56 fora e 0,62 dentro). */
horizon?: number; horizon?: number;
fog?: boolean; fog?: boolean;
elements: { kind: ElementKind; x: number; z?: number; scale?: number; flip?: boolean; color?: string }[]; weather?: (typeof WEATHERS)[number];
/** Água cobrindo o lugar: altura da superfície (fração da altura do quadro, 0 = topo) do início ao fim do trecho.
* Ex.: { from: 0.8, to: 0.5 } = a água sobe. O que não boia fica embaixo dela. */
flood?: { from: number; to: number };
elements: {
kind: ElementKind; x: number; z?: number; scale?: number; flip?: boolean; color?: string;
/** Sobe a peça (fração da altura do quadro): arca em cima do monte. */
lift?: number;
/** Boia na água (com `flood`, acompanha a superfície e balança). */
float?: boolean;
/** Tem gente DENTRO (arca, carro): a parte da frente da peça é desenhada por cima dos personagens. */
occupied?: boolean;
}[];
}; };
type Pal = { sky: [string, string]; wall: string; ground: Record<string, string>; far: string; near: string; ink: string; leaf: string; trunk: string; stone: string; light: string };
const P: Record<PaletteId, Pal> = {
night: { sky: ["#0b0e22", "#1c2147"], wall: "#2a2f4a", far: "#2a2d57", near: "#3b3f74", ink: "#0c0d1a", leaf: "#24445a", trunk: "#2b2338", stone: "#5a5f86", light: "#ffc94a",
ground: { grass: "#1d2e3a", street: "#1a1d38", dirt: "#2a2433", floor: "#22243a", sand: "#4a4560", water: "#152a4a" } },
sepia: { sky: ["#c9ad83", "#e8d6ae"], wall: "#7d6a55", far: "#a88f6e", near: "#6e5843", ink: "#2a2018", leaf: "#7b7a45", trunk: "#5a4330", stone: "#9b9387", light: "#ffd98a",
ground: { grass: "#8b8a52", street: "#6a5a4a", dirt: "#7a5a3c", floor: "#5e4c3c", sand: "#d2b886", water: "#6f8a8a" } },
day: { sky: ["#5aa9e6", "#cfeaf8"], wall: "#e9dcc5", far: "#9cc3d9", near: "#d98a5c", ink: "#22252e", leaf: "#4caf50", trunk: "#7a5232", stone: "#a9adb5", light: "#fff3b0",
ground: { grass: "#78c25a", street: "#8a8f99", dirt: "#b88a5a", floor: "#c9a77c", sand: "#f0d79a", water: "#3f9ad8" } },
dusk: { sky: ["#2a2c5c", "#e8946a"], wall: "#4a3a52", far: "#4c3f6e", near: "#6a4a62", ink: "#140f1c", leaf: "#2f4a3f", trunk: "#3a2a2a", stone: "#7a7090", light: "#ffcf7a",
ground: { grass: "#3a4a3a", street: "#3a3348", dirt: "#4a3530", floor: "#3c3040", sand: "#a87d6a", water: "#4a5a8a" } },
gray: { sky: ["#6f7680", "#b4b9bf"], wall: "#565b63", far: "#8a9098", near: "#5c6168", ink: "#1b1d21", leaf: "#5a6b55", trunk: "#4a4038", stone: "#9aa0a8", light: "#f2e6c8",
ground: { grass: "#5f6e55", street: "#4a4f57", dirt: "#5e5246", floor: "#45484f", sand: "#a8a08a", water: "#5a6f80" } },
};
export const palette = (id: PaletteId | undefined): Pal => P[id ?? "night"] ?? P.night;
const W = 1080; const W = 1080;
const H = 1920; const H = 1920;
const DRAW: Record<string, Draw> = { ...NATURE, ...BUILT, ...INDOOR };
function mix(a: string, b: string, k: number): string { /** Peças presas na parede do fundo quando o lugar é interno (o z delas é ignorado). */
const pa = parseInt(a.slice(1), 16); const WALL_MOUNTED = new Set<ElementKind>(["window", "frame", "door"]);
const pb = parseInt(b.slice(1), 16); /** Peças penduradas no teto: a origem é o topo do quadro. */
const ch = (s: number) => Math.round(((pa >> s) & 255) * (1 - k) + ((pb >> s) & 255) * k); const CEILING = new Set<ElementKind>(["pendant"]);
return `#${[16, 8, 0].map((s) => ch(s).toString(16).padStart(2, "0")).join("")}`; /** Objetos de mesa: sobem sozinhos para cima da mesa/escrivaninha mais próxima (se não tiver `lift`). */
const ON_TOP = new Set<ElementKind>(["desklamp"]);
/** Altura do tampo (unidades da peça) das superfícies que recebem objetos de mesa. */
const SURFACE_TOP: Partial<Record<ElementKind, number>> = { desk: 330, table: 304 };
/** Só as peças assimétricas espelham; nas simétricas o `flip` trocaria só o lado da sombra (a luz é sempre da esquerda). */
const FLIPPABLE = new Set<ElementKind>(["deadtree", "palm", "car", "bed", "desklamp", "waves", "clothesline", "outcrop"]);
/** Meia largura da base de cada peça (unidades da peça) para a sombra de contato; 0 = sem sombra. */
const FOOT: Partial<Record<ElementKind, number>> = {
tree: 130, deadtree: 90, pine: 190, bush: 220, rock: 130, bench: 270, lamp: 60, gravestone: 125, cross: 60, fence: 470,
house: 420, building: 280, car: 390, sign: 40, table: 290, bed: 400, shelf: 230, crate: 170, tent: 350, fire: 130,
ark: 380, ark_frame: 380, scaffold: 140, planks: 185, palm: 80, outcrop: 340, cabinet: 185, locker: 330, desk: 340,
wall: 730, facade: 560, shopfront: 460, desklamp: 90, clothesline: 0,
};
const isNight = (id: PaletteId | undefined) => (id ?? "night") === "night";
/** Zoom do fundo pelo enquadramento: em meio corpo/de perto a câmera está mais perto, o fundo cresce junto. */
function backgroundZoom(spec: ShotSpec): number {
const framings = (spec.actors ?? []).flatMap((a) => (a.kind === "person" && a.framing ? [a.framing] : []));
if (framings.includes("close")) return 1.32;
if (framings.includes("medium")) return 1.16;
return 1;
} }
/** Uma peça desenhada com a base em (0,0), altura de referência ~300 px. */ type El = Place["elements"][number] & { i: number; z: number };
function Element({ kind, pal, color, seed }: { kind: ElementKind; pal: Pal; color?: string; seed: number }) { type Placed = { e: El; x: number; y: number; s: number; zEff: number; flip: boolean };
const r = rng(seed); type Layout = { horizon: number; indoor: boolean; zoom: number; items: Placed[] };
switch (kind) {
case "tree": return <g><rect x={-14} y={-150} width={28} height={150} fill={pal.trunk} /><circle cx={0} cy={-210} r={95} fill={color ?? pal.leaf} /><circle cx={-60} cy={-170} r={60} fill={color ?? pal.leaf} /><circle cx={62} cy={-175} r={62} fill={color ?? pal.leaf} /></g>; /** Onde cada peça fica (base, escala, profundidade efetiva). A camada de luz usa a mesma conta. */
case "pine": return <g><rect x={-12} y={-60} width={24} height={60} fill={pal.trunk} /><polygon points="0,-330 -90,-60 90,-60" fill={color ?? pal.leaf} /></g>; export function layoutPlace(spec: ShotSpec): Layout {
case "deadtree": return <g stroke={color ?? pal.trunk} strokeLinecap="round" fill="none"><path d="M0 0 L0 -220" strokeWidth={26} /><path d="M0 -120 L-70 -200 M-40 -160 L-80 -150 M0 -170 L60 -250 M30 -210 L80 -215 M0 -220 L-20 -280" strokeWidth={12} /></g>; const place = spec.place!;
case "bush": return <g fill={color ?? pal.leaf}><circle cx={-40} cy={-35} r={42} /><circle cx={10} cy={-50} r={52} /><circle cx={55} cy={-30} r={38} /></g>; const indoor = !!place.indoor;
case "rock": return <path d="M-70 0 Q-80 -50 -30 -70 Q20 -90 60 -50 Q85 -20 70 0 Z" fill={color ?? pal.stone} />; const horizon = (place.horizon ?? (indoor ? 0.62 : 0.56)) * H;
case "mountain": return <g><polygon points="-520,0 0,-520 520,0" fill={color ?? pal.far} /><polygon points="-110,-410 0,-520 110,-410 50,-430 0,-400 -50,-430" fill="#ffffff" opacity={0.6} /></g>; const near = indoor ? H * 0.8 : H * 0.72;
case "cloud": return <g fill={color ?? "#ffffff"} opacity={0.85}><ellipse cx={0} cy={-40} rx={110} ry={40} /><circle cx={-40} cy={-70} r={45} /><circle cx={30} cy={-80} r={55} /></g>; const items: Placed[] = place.elements.map((raw, i) => {
case "bench": return <g fill={color ?? "#8a5a3a"}><rect x={-110} y={-70} width={220} height={16} rx={4} /><rect x={-110} y={-120} width={220} height={14} rx={4} /><rect x={-95} y={-70} width={12} height={70} fill={pal.ink} /><rect x={83} y={-70} width={12} height={70} fill={pal.ink} /></g>; const e: El = { ...raw, i, z: raw.z ?? 0.3 };
case "lamp": return <g><rect x={-7} y={-420} width={14} height={420} fill={pal.ink} /><rect x={-36} y={-440} width={72} height={26} rx={8} fill={pal.ink} /><ellipse cx={0} cy={-408} rx={26} ry={8} fill={pal.light} /><path d="M-24 -408 L-140 0 L140 0 L24 -408 Z" fill={pal.light} opacity={0.08} /></g>; const wall = indoor && WALL_MOUNTED.has(e.kind);
case "gravestone": return <g><path d="M-55 0 L-55 -130 Q-55 -185 0 -185 Q55 -185 55 -130 L55 0 Z" fill={color ?? pal.stone} /><rect x={-28} y={-120} width={56} height={6} rx={3} fill={pal.ink} opacity={0.35} /><rect x={-22} y={-100} width={44} height={6} rx={3} fill={pal.ink} opacity={0.35} /></g>; const zEff = wall ? 1 : e.z;
case "cross": return <g fill={color ?? pal.stone}><rect x={-12} y={-200} width={24} height={200} /><rect x={-60} y={-160} width={120} height={22} /></g>; const depth = 1 - zEff * (indoor ? 0.35 : 0.62);
case "fence": return <g fill={color ?? pal.ink}>{Array.from({ length: 9 }, (_, i) => <rect key={i} x={-200 + i * 50} y={-130} width={14} height={130} />)}<rect x={-210} y={-110} width={430} height={10} /><rect x={-210} y={-50} width={430} height={10} /></g>; const s = (e.scale ?? 1) * depth * 1.15;
case "house": return <g><polygon points="-150,-180 0,-290 150,-180" fill={pal.ink} opacity={0.6} /><rect x={-140} y={-180} width={280} height={180} fill={color ?? pal.near} /><rect x={-110} y={-140} width={50} height={50} rx={4} fill={pal.light} opacity={r() > 0.5 ? 1 : 0.15} /><rect x={60} y={-140} width={50} height={50} rx={4} fill={pal.light} opacity={r() > 0.5 ? 1 : 0.15} /><rect x={-25} y={-100} width={50} height={100} fill={pal.ink} opacity={0.7} /></g>; let y: number;
case "building": { if (CEILING.has(e.kind)) y = 0;
const floors = 4 + Math.floor(r() * 4); else if (e.kind === "cloud") y = horizon * (0.15 + 0.5 * e.z);
return <g><rect x={-120} y={-floors * 80} width={240} height={floors * 80} fill={color ?? pal.far} />{Array.from({ length: floors * 3 }, (_, i) => <rect key={i} x={-95 + (i % 3) * 70} y={-floors * 80 + 20 + Math.floor(i / 3) * 80} width={44} height={40} fill={pal.light} opacity={r() > 0.7 ? 0.9 : 0.12} />)}</g>; else y = horizon + (1 - zEff) * (near - horizon);
} y -= (e.lift ?? 0) * H;
case "car": return <g><path d="M-150 -40 L-150 -90 Q-140 -110 -100 -112 L-60 -160 L70 -160 L110 -112 L150 -100 L150 -40 Z" fill={color ?? "#c8443a"} /><rect x={-50} y={-150} width={50} height={36} fill="#cfe3f3" opacity={0.85} /><rect x={8} y={-150} width={52} height={36} fill="#cfe3f3" opacity={0.85} /><circle cx={-90} cy={-35} r={32} fill={pal.ink} /><circle cx={95} cy={-35} r={32} fill={pal.ink} /></g>; return { e, x: e.x * W, y, s, zEff, flip: !!e.flip && FLIPPABLE.has(e.kind) };
case "sign": return <g><rect x={-6} y={-220} width={12} height={220} fill={pal.ink} /><rect x={-90} y={-260} width={180} height={70} rx={8} fill={color ?? "#2f6d3a"} stroke="#ffffff" strokeWidth={5} /></g>; });
case "door": return <g><rect x={-80} y={-330} width={160} height={330} rx={4} fill={color ?? "#4a2f22"} /><rect x={-60} y={-305} width={120} height={130} rx={3} fill="#000000" opacity={0.15} /><rect x={-60} y={-155} width={120} height={130} rx={3} fill="#000000" opacity={0.15} /><circle cx={52} cy={-165} r={9} fill="#e6c27a" /></g>; // Objeto de mesa perto de uma mesa (mesma profundidade, dentro do tampo) vai para cima dela.
case "window": return <g><rect x={-120} y={-260} width={240} height={200} rx={6} fill={pal.ink} /><rect x={-108} y={-248} width={216} height={176} fill={color ?? mix(pal.sky[0], pal.sky[1], 0.5)} /><rect x={-4} y={-248} width={8} height={176} fill={pal.ink} /><rect x={-108} y={-164} width={216} height={8} fill={pal.ink} /></g>; for (const it of items) {
case "table": return <g fill={color ?? "#7a5232"}><rect x={-140} y={-130} width={280} height={20} rx={4} /><rect x={-120} y={-110} width={18} height={110} /><rect x={102} y={-110} width={18} height={110} /></g>; if (!ON_TOP.has(it.e.kind) || it.e.lift !== undefined) continue;
case "bed": return <g><rect x={-170} y={-90} width={340} height={60} rx={10} fill={color ?? "#5a6aa8"} /><rect x={-170} y={-150} width={24} height={150} fill={pal.trunk} /><rect x={-140} y={-120} width={90} height={34} rx={12} fill="#eeeeee" /><rect x={146} y={-110} width={24} height={110} fill={pal.trunk} /></g>; const surface = items.find((o) => SURFACE_TOP[o.e.kind] && Math.abs(o.e.z - it.e.z) <= 0.25 && Math.abs(o.x - it.x) < (FOOT[o.e.kind] ?? 0) * o.s);
case "shelf": return <g><rect x={-120} y={-360} width={240} height={360} fill={color ?? pal.trunk} />{[0, 1, 2, 3].map((i) => <g key={i}><rect x={-108} y={-340 + i * 88} width={216} height={70} fill="#000000" opacity={0.25} />{[0, 1, 2, 3, 4].map((j) => <rect key={j} x={-100 + j * 42} y={-330 + i * 88 + (r() * 14)} width={30} height={56 - (r() * 14)} rx={3} fill={["#e8463d", "#f2c230", "#4fb0e8", "#5cc48a", "#e8e8ee"][(i + j) % 5]} />)}</g>)}</g>; if (!surface) continue;
case "crate": return <g><rect x={-70} y={-140} width={140} height={140} fill={color ?? "#a0743f"} /><path d="M-70 -140 L70 0 M70 -140 L-70 0" stroke="#6e4e28" strokeWidth={10} /><rect x={-70} y={-140} width={140} height={140} fill="none" stroke="#6e4e28" strokeWidth={10} /></g>; it.y = surface.y - SURFACE_TOP[surface.e.kind]! * surface.s;
case "tent": return <g><polygon points="-170,0 0,-220 170,0" fill={color ?? "#d9773a"} /><polygon points="-40,0 0,-120 40,0" fill={pal.ink} opacity={0.6} /></g>; it.s = surface.s * (it.e.scale ?? 1) * 0.9;
case "fire": return <g><rect x={-60} y={-18} width={120} height={18} rx={6} fill={pal.trunk} /><path d="M-40 -18 Q-50 -80 -10 -120 Q-5 -80 20 -70 Q30 -110 10 -150 Q70 -100 45 -18 Z" fill="#ff8a2a" /><path d="M-15 -18 Q-20 -60 5 -80 Q10 -50 25 -45 Q30 -30 20 -18 Z" fill="#ffd34a" /></g>; it.zEff = surface.zEff - 0.001;
}
items.sort((a, b) => b.zEff - a.zEff || a.e.i - b.e.i);
return { horizon, indoor, zoom: backgroundZoom(spec), items };
}
/** Sol/lua no céu (sempre do lado esquerdo: é de lá que vem a luz das peças). */
export function sunOf(id: PaletteId | undefined, horizon: number): { x: number; y: number; r: number } | null {
switch (id ?? "night") {
case "day": return { x: W * 0.2, y: H * 0.2, r: 66 };
case "sepia": return { x: W * 0.2, y: H * 0.19, r: 70 };
case "dusk": return { x: W * 0.2, y: horizon - H * 0.13, r: 96 };
case "night": return { x: W * 0.22, y: H * 0.15, r: 44 };
default: return null; default: return null;
} }
} }
export function PlaceBackground({ spec, frame }: { spec: ShotSpec; frame: number }) { /** Altura da superfície da água no instante (fração da altura; null = sem enchente). */
export function floodLevel(place: Place | undefined, progress: number): number | null {
if (!place?.flood) return null;
const p = Math.max(0, Math.min(1, progress));
const k = p < 0.5 ? 2 * p * p : 1 - (-2 * p + 2) ** 2 / 2;
return place.flood.from + (place.flood.to - place.flood.from) * k;
}
/** Uma peça no lugar: sombra de contato + desenho com a tinta da profundidade dela. */
function PlacedElement({ it, pal, spec, hazeColor, y, rot = 0, part }: { it: Placed; pal: Pal; spec: ShotSpec; hazeColor: string; y?: number; rot?: number; part?: "front" }) {
const { e } = it;
const place = spec.place!;
const indoor = !!place.indoor;
const z = it.zEff;
const sky = e.kind === "cloud" || e.kind === "rainbow";
const haze = sky ? 0.12 : indoor ? z * 0.22 : Math.min(0.85, Math.pow(z, 1.8) * 0.66 + (place.fog ? 0.04 + z * 0.16 : 0));
const front = !sky && z < 0.25 ? (0.25 - z) * 0.5 : 0;
const p = makePaint(pal, rng(spec.seed + e.i * 17), { haze, hazeColor, front, indoor, night: isNight(spec.palette) });
const draw = part === "front" ? FRONT_PART[e.kind] : DRAW[e.kind];
if (!draw) return null;
const foot = (CEILING.has(e.kind) || (indoor && WALL_MOUNTED.has(e.kind)) || e.float || (e.lift ?? 0) > 0.02) ? 0 : FOOT[e.kind] ?? 0;
const s = it.s;
return (
<g transform={`translate(${it.x} ${y ?? it.y}) rotate(${rot}) scale(${it.flip ? -s : s} ${s})`}>
{foot > 0 && part !== "front" && <ellipse cx={foot * 0.1} cy={4} rx={foot * 1.12} ry={Math.min(46, Math.max(16, foot * 0.11))} fill="url(#cShadow)" opacity={1 - z * 0.5} />}
{draw(p, e.color)}
</g>
);
}
/** Céu com degradê rico, sol/lua com halo (ou parede do interior). Não muda com o quadro. */
function SkyLayer({ spec, horizon }: { spec: ShotSpec; horizon: number }) {
const pal = palette(spec.palette);
const place = spec.place!;
if (place.indoor) {
const wallTop = mix(pal.wall, pal.ink, 0.42);
return <g>
<defs>
<linearGradient id="placeWall" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stopColor={wallTop} /><stop offset="0.45" stopColor={mix(pal.wall, pal.ink, 0.12)} /><stop offset="1" stopColor={pal.wall} />
</linearGradient>
<linearGradient id="placeCorner" x1="0" y1="0" x2="1" y2="0">
<stop offset="0" stopColor={pal.shade} stopOpacity={0.4} /><stop offset="0.16" stopColor={pal.shade} stopOpacity={0} />
<stop offset="0.84" stopColor={pal.shade} stopOpacity={0} /><stop offset="1" stopColor={pal.shade} stopOpacity={0.45} />
</linearGradient>
</defs>
<rect width={W} height={H} fill="url(#placeWall)" />
</g>;
}
const sun = sunOf(spec.palette, horizon);
const night = isNight(spec.palette);
return <g>
<defs>
<linearGradient id="placeSky" gradientUnits="userSpaceOnUse" x1="0" y1="0" x2="0" y2={horizon}>
<stop offset="0" stopColor={pal.sky[0]} /><stop offset="0.55" stopColor={pal.sky[1]} /><stop offset="1" stopColor={pal.sky[2]} />
</linearGradient>
{sun && <radialGradient id="placeHalo" gradientUnits="userSpaceOnUse" cx={sun.x} cy={sun.y} r={sun.r * 4.2}>
<stop offset="0" stopColor={pal.halo} stopOpacity={night ? 0.35 : 0.75} /><stop offset="0.35" stopColor={pal.halo} stopOpacity={night ? 0.12 : 0.3} />
<stop offset="1" stopColor={pal.halo} stopOpacity={0} />
</radialGradient>}
</defs>
<rect width={W} height={H} fill="url(#placeSky)" />
{sun && <>
<circle cx={sun.x} cy={sun.y} r={sun.r * 4.2} fill="url(#placeHalo)" />
<circle cx={sun.x} cy={sun.y} r={sun.r} fill={pal.sun} />
{night
? <><circle cx={sun.x + 12} cy={sun.y - 8} r={9} fill={mix(pal.sun, "#b0a890", 0.4)} /><circle cx={sun.x - 14} cy={sun.y + 12} r={6} fill={mix(pal.sun, "#b0a890", 0.4)} /></>
: <circle cx={sun.x - sun.r * 0.25} cy={sun.y - sun.r * 0.25} r={sun.r * 0.55} fill="#ffffff" opacity={0.35} />}
</>}
</g>;
}
/** Chão (degradê + textura) e, ao fundo, a silhueta distante (morros ou cidade). */
function GroundLayer({ spec, horizon, hazeColor }: { spec: ShotSpec; horizon: number; hazeColor: string }) {
const place = spec.place!; const place = spec.place!;
const pal = palette(spec.palette); const pal = palette(spec.palette);
const horizon = (place.horizon ?? 0.56) * H; const rand = rng(spec.seed + 29);
const out: React.ReactNode[] = [];
const g = place.ground === "none" ? null : pal.ground[place.ground];
const span = H - horizon;
if (place.indoor) {
// Parede: lambri (meia-parede) ou listras, conforme a semente; rodapé no pé da parede.
const wall = pal.wall;
if (spec.seed % 2 === 0) {
const top = horizon - H * 0.17;
out.push(<rect key="dado" x={0} y={top} width={W} height={horizon - top} fill={mix(wall, pal.ink, 0.16)} />);
out.push(<path key="dadoP" d={Array.from({ length: 8 }, (_, i) => `M${i * 150 + 40} ${top + 30} L${i * 150 + 40} ${horizon - 40} L${i * 150 + 150} ${horizon - 40}`).join(" ")}
stroke={mix(wall, pal.ink, 0.3)} strokeWidth={6} fill="none" />);
out.push(<rect key="rail" x={0} y={top - 16} width={W} height={18} fill={mix(wall, pal.light, 0.22)} />);
out.push(<rect key="railS" x={0} y={top + 2} width={W} height={6} fill={mix(wall, pal.ink, 0.35)} />);
} else {
out.push(<path key="stripes" d={Array.from({ length: 12 }, (_, i) => `M${i * 96 + 30} 0 L${i * 96 + 30} ${horizon}`).join(" ")} stroke={mix(wall, pal.ink, 0.1)} strokeWidth={26} />);
}
out.push(<rect key="corner" x={0} y={0} width={W} height={horizon} fill="url(#placeCorner)" />);
} else if (place.ground === "grass" || place.ground === "dirt" || place.ground === "sand") {
// Morros distantes em 2 camadas, bem apagados (plano de fundo).
const ridge = (h: number, amp: number, seed: number) => {
const r = rng(seed);
let d = `M0 ${horizon + 2} L0 ${horizon - h}`;
for (let x = 0; x <= W + 180; x += 180) d += ` Q${x + 90} ${horizon - h - amp * (0.4 + r())} ${x + 180} ${horizon - h + (r() - 0.5) * amp * 0.5}`;
return d + ` L${W} ${horizon + 2} Z`;
};
out.push(<path key="r1" d={ridge(H * 0.075, H * 0.05, spec.seed + 3)} fill={mix(pal.far, hazeColor, 0.55)} />);
out.push(<path key="r2" d={ridge(H * 0.03, H * 0.03, spec.seed + 7)} fill={mix(g ?? pal.far, hazeColor, 0.45)} />);
} else if (place.ground === "street") {
// Cidade ao longe: blocos apagados com algumas janelas.
let x = -20;
const blocks: React.ReactNode[] = [];
while (x < W) {
const w = 90 + rand() * 120;
const h = H * (0.05 + rand() * 0.09);
blocks.push(<rect key={x} x={x} y={horizon - h} width={w} height={h + 2} fill={mix(pal.far, hazeColor, 0.5 + rand() * 0.15)} />);
x += w - 6;
}
out.push(<g key="city">{blocks}</g>);
}
if (g) {
out.push(<rect key="ground" x={0} y={horizon} width={W} height={span} fill="url(#placeGround)" />);
if (place.ground === "floor") {
// Tábuas em perspectiva: linhas que fogem para o ponto de fuga, juntas desencontradas, tom alternado.
const vpY = horizon - H * 0.3;
const k = (H - vpY) / (horizon - vpY);
const at = (xh: number, y: number) => W / 2 + (xh - W / 2) * ((y - vpY) / (horizon - vpY));
const n = 16;
const step = W / 9;
let seams = "";
for (let i = -n; i <= n; i++) {
const xh = W / 2 + i * step * 0.5;
if (Math.abs(i) % 2 === 1) {
const x2 = W / 2 + (i + 1) * step * 0.5;
out.push(<polygon key={`pl${i}`} points={`${xh},${horizon} ${x2},${horizon} ${W / 2 + (x2 - W / 2) * k},${H} ${W / 2 + (xh - W / 2) * k},${H}`} fill={mix(g, pal.ink, 0.06)} />);
}
seams += `M${xh} ${horizon} L${W / 2 + (xh - W / 2) * k} ${H} `;
for (let j = 0; j < 3; j++) {
const y = horizon + span * Math.pow(rand(), 1.4);
const xa = at(xh, y);
const xb = at(xh + step * 0.5, y);
seams += `M${xa} ${y} L${xb} ${y} `;
}
}
out.push(<path key="seams" d={seams} stroke={mix(g, pal.ink, 0.32)} strokeWidth={4} fill="none" />);
out.push(<rect key="base" x={0} y={horizon - 34} width={W} height={36} fill={mix(pal.wall, pal.ink, 0.38)} />);
out.push(<rect key="baseT" x={0} y={horizon - 34} width={W} height={7} fill={mix(pal.wall, pal.light, 0.15)} />);
out.push(<rect key="ao" x={0} y={horizon} width={W} height={26} fill={pal.ink} opacity={0.18} />);
} else if (place.ground === "street") {
const walk = horizon + span * 0.16;
const walkC = mix(mix("#d2c8b4", g, 0.3), hazeColor, 0.15);
out.push(<rect key="walk" x={0} y={horizon} width={W} height={walk - horizon} fill={walkC} />);
out.push(<path key="tiles" d={Array.from({ length: 14 }, (_, i) => { const x = -120 + i * 110; return `M${x} ${horizon} L${W / 2 + (x - W / 2) * 1.25} ${walk}`; }).join(" ") + ` M0 ${(horizon + walk) / 2} L${W} ${(horizon + walk) / 2}`}
stroke={mix(walkC, pal.ink, 0.18)} strokeWidth={3} fill="none" />);
out.push(<rect key="curb" x={0} y={walk} width={W} height={18} fill={mix(walkC, pal.light, 0.25)} />);
out.push(<rect key="curbS" x={0} y={walk + 18} width={W} height={20} fill={mix(g, pal.ink, 0.35)} />);
const lane = walk + (H - walk) * 0.42;
out.push(<path key="lane" d={Array.from({ length: 7 }, (_, i) => `M${i * 190 - 60} ${lane} l120 0`).join(" ")} stroke="#f2ecd8" strokeWidth={12} opacity={0.55} />);
} else if (place.ground === "grass" || place.ground === "dirt" || place.ground === "sand") {
// Faixas na perspectiva + tufos/pedrinhas/ondulações, maiores perto da câmera.
for (let b = 1; b < 6; b++) {
const y0 = horizon + span * Math.pow(b / 6, 1.7);
const y1 = horizon + span * Math.pow((b + 0.45) / 6, 1.7);
out.push(<rect key={`band${b}`} x={0} y={y0} width={W} height={y1 - y0} fill={b % 2 ? mix(g, pal.light, 0.06) : mix(g, pal.ink, 0.05)} opacity={0.45} />);
}
let marks = "";
for (let i = 0; i < 46; i++) {
const t = Math.pow(rand(), 0.8);
const y = horizon + span * t;
const x = rand() * W;
const s = 6 + t * 26;
if (place.ground === "grass") marks += `M${x - s} ${y} L${x - s * 0.3} ${y - s * 1.4} L${x} ${y} L${x + s * 0.4} ${y - s * 1.6} L${x + s} ${y} `;
else if (place.ground === "sand") marks += `M${x - s * 3} ${y} Q${x} ${y - s * 0.6} ${x + s * 3} ${y} `;
else marks += `M${x - s * 0.6} ${y} a${s * 0.6} ${s * 0.28} 0 1 0 ${s * 1.2} 0 a${s * 0.6} ${s * 0.28} 0 1 0 ${-s * 1.2} 0 `;
}
out.push(<path key="marks" d={marks} fill={place.ground === "dirt" ? mix(g, pal.ink, 0.14) : "none"}
stroke={place.ground === "grass" ? mix(g, pal.ink, 0.25) : place.ground === "sand" ? mix(g, pal.light, 0.35) : "none"} strokeWidth={place.ground === "sand" ? 5 : 4} strokeLinejoin="round" />);
}
}
return <g>{out}</g>;
}
export function PlaceBackground({ spec, frame, progress = 0 }: { spec: ShotSpec; frame: number; progress?: number }) {
const place = spec.place!;
const pal = palette(spec.palette);
const layout = React.useMemo(() => layoutPlace(spec), [spec]);
const { horizon, zoom } = layout;
const hazeColor = place.indoor ? pal.wall : mix(mix(pal.sky[2], pal.sky[1], 0.25), "#c8ccd6", place.fog ? 0.45 : 0);
const level = floodLevel(place, progress);
const waterY = level === null ? null : level * H;
const storm = place.weather === "storm";
const ground = place.ground === "none" ? null : pal.ground[place.ground]; const ground = place.ground === "none" ? null : pal.ground[place.ground];
const elements = [...place.elements].map((e, i) => ({ ...e, i, z: e.z ?? 0.3 })).sort((a, b) => b.z - a.z); // Tudo que não muda com o quadro é desenhado uma vez só (céu, chão, peças paradas).
const sky = React.useMemo(() => <SkyLayer spec={spec} horizon={horizon} />, [spec, horizon]);
const floating = (it: Placed) => !!it.e.float && waterY !== null;
const staticBack = React.useMemo(() => (
<g>
<GroundLayer spec={spec} horizon={horizon} hazeColor={hazeColor} />
{layout.items.filter((it) => !(it.e.float && place.flood)).map((it) => <PlacedElement key={it.e.i} it={it} pal={pal} spec={spec} hazeColor={hazeColor} />)}
</g>
), [spec, layout]); // eslint-disable-line react-hooks/exhaustive-deps
const rand = rng(spec.seed + 13); const rand = rng(spec.seed + 13);
const stars = !place.indoor && (spec.palette ?? "night") === "night" const stars = !place.indoor && isNight(spec.palette)
? Array.from({ length: 60 }, () => ({ x: rand() * W, y: rand() * horizon * 0.8, r: 1 + rand() * 2, p: rand() * 6 })) : []; ? Array.from({ length: 60 }, () => ({ x: rand() * W, y: rand() * horizon * 0.8, r: 1 + rand() * 2, p: rand() * 6 })) : [];
const zoomT = zoom === 1 ? undefined : `translate(${W / 2} ${horizon}) scale(${zoom}) translate(${-W / 2} ${-horizon})`;
return ( return (
<svg viewBox={`0 0 ${W} ${H}`} width="100%" height="100%" preserveAspectRatio="xMidYMid slice"> <svg viewBox={`0 0 ${W} ${H}`} width="100%" height="100%" preserveAspectRatio="xMidYMid slice">
<defs> <defs>
<linearGradient id="placeSky" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stopColor={pal.sky[0]} /><stop offset="1" stopColor={pal.sky[1]} /></linearGradient> <linearGradient id="placeFog" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stopColor="#ffffff" stopOpacity={0} />
<linearGradient id="placeFog" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stopColor="#ffffff" stopOpacity={0} /><stop offset="1" stopColor="#d8dce6" stopOpacity={0.35} /></linearGradient> <stop offset="0.3" stopColor="#d8dce6" stopOpacity={0.3} /><stop offset="1" stopColor="#d8dce6" stopOpacity={0.06} /></linearGradient>
<radialGradient id="cShadow"><stop offset="0" stopColor={pal.ink} stopOpacity={0.5} /><stop offset="0.6" stopColor={pal.ink} stopOpacity={0.28} /><stop offset="1" stopColor={pal.ink} stopOpacity={0} /></radialGradient>
{ground && <linearGradient id="placeGround" x1="0" y1="0" x2="0" y2="1">
{place.indoor
? <><stop offset="0" stopColor={mix(ground, pal.ink, 0.3)} /><stop offset="0.18" stopColor={ground} /><stop offset="1" stopColor={mix(ground, pal.ink, 0.32)} /></>
: <><stop offset="0" stopColor={mix(ground, hazeColor, 0.35)} /><stop offset="0.3" stopColor={ground} /><stop offset="1" stopColor={mix(ground, pal.ink, 0.22)} /></>}
</linearGradient>}
<linearGradient id="placeWater" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stopColor={mix(pal.ground.water, "#ffffff", 0.12)} /><stop offset="1" stopColor={mix(pal.ground.water, pal.ink, 0.35)} /></linearGradient>
</defs> </defs>
<rect width={W} height={H} fill={place.indoor ? pal.wall : "url(#placeSky)"} /> {sky}
{stars.map((s, i) => <circle key={i} cx={s.x} cy={s.y} r={s.r} fill="#fff" opacity={0.3 + 0.3 * Math.sin(frame / 12 + s.p)} />)} {stars.map((s, i) => <circle key={i} cx={s.x} cy={s.y} r={s.r} fill="#fff" opacity={0.3 + 0.3 * Math.sin(frame / 12 + s.p)} />)}
{!place.indoor && (spec.palette ?? "night") === "night" && <circle cx={W * 0.78} cy={H * 0.12} r={40} fill="#f4ecc8" />} <g transform={zoomT}>
{!place.indoor && (spec.palette === "day" || spec.palette === "sepia") && <circle cx={W * 0.8} cy={H * 0.1} r={60} fill={pal.light} opacity={0.9} />} {staticBack}
{place.indoor && <rect x={0} y={horizon - 18} width={W} height={18} fill={pal.ink} opacity={0.25} />} {waterY !== null && (
{ground && <rect x={0} y={horizon} width={W} height={H - horizon} fill={ground} />} <g>
{place.ground === "street" && Array.from({ length: 8 }, (_, i) => <rect key={i} x={i * 150 - 40} y={horizon + (H - horizon) * 0.32} width={90} height={9} rx={4} fill="#ffffff" opacity={0.25} />)} <rect x={0} y={waterY} width={W} height={H - waterY} fill="url(#placeWater)" />
{elements.map((e) => { <path d={`M0 ${waterY} ${Array.from({ length: 10 }, (_, i) => `Q${i * 108 + 54} ${waterY - 22 + Math.sin(frame / 9 + i) * 8} ${(i + 1) * 108} ${waterY}`).join(" ")}`}
// Profundidade: mais ao fundo = mais perto do horizonte, menor e mais apagado (névoa/atmosfera). stroke="#ffffff" strokeWidth={7} fill="none" opacity={0.55} />
const baseY = e.kind === "cloud" ? horizon * (0.15 + 0.5 * e.z) : horizon + (1 - e.z) * (H * 0.72 - horizon);
const scale = (e.scale ?? 1) * (1 - e.z * 0.62) * 1.15;
const fade = e.kind === "cloud" ? 0 : e.z * (place.fog ? 0.7 : 0.35);
return (
<g key={e.i} transform={`translate(${e.x * W} ${baseY}) scale(${e.flip ? -scale : scale} ${scale})`} opacity={1 - fade * 0.3}>
<Element kind={e.kind} pal={pal} color={e.color ?? (fade > 0.05 && e.kind !== "fire" ? undefined : undefined)} seed={spec.seed + e.i * 17} />
</g> </g>
); )}
})} {place.ground === "water" && waterY === null && Array.from({ length: 6 }, (_, i) => (
{place.fog && <rect x={0} y={horizon - H * 0.15} width={W} height={H * 0.5} fill="url(#placeFog)" />} <path key={`w${i}`} d={`M${((i * 197 + frame * 2) % (W + 200)) - 100} ${horizon + 60 + i * ((H - horizon) / 6)} q30 -16 60 0 q30 16 60 0`} stroke="#ffffff" strokeWidth={5} fill="none" opacity={0.35} />
))}
{layout.items.filter(floating).map((it) => (
// Boia: a quilha fica um pouco abaixo da superfície e a peça balança com a água.
<PlacedElement key={it.e.i} it={it} pal={pal} spec={spec} hazeColor={hazeColor}
y={waterY! + H * 0.035 + Math.sin(frame / 14 + it.e.i) * 9} rot={Math.sin(frame / 22 + it.e.i) * (storm ? 3.5 : 1.6)} />
))}
{waterY !== null && <rect x={0} y={waterY + H * 0.03} width={W} height={H} fill={pal.ground.water} opacity={0.35} />}
</g>
{place.fog && <rect x={0} y={horizon - H * 0.18} width={W} height={H - horizon + H * 0.18} fill="url(#placeFog)" />}
</svg> </svg>
); );
} }
/** Foco de luz vindo do teto (bunker, interrogatório) ou vinheta de anoitecer, por cima de tudo. */ type LightSpot = { kind: "lamp" | "window" | "sun" | "glow"; x: number; y: number; w?: number; h?: number; spread?: number; fixture?: boolean };
export function LightLayer({ light, palette: id }: { light: ShotSpec["light"]; palette?: PaletteId }) {
if (!light || light === "none") return null; /** Fonte de luz do trecho: a escolhida no spec, ou deduzida das peças (luminária > janela > sol). */
const pal = palette(id); export function resolveLight(spec: ShotSpec | undefined, light: ShotSpec["light"]): LightSpot | null {
if (light === "vignette") { if (light === "none") return null;
return <div style={{ position: "absolute", inset: 0, background: "radial-gradient(ellipse at 50% 45%, rgba(0,0,0,0) 45%, rgba(0,0,0,0.55) 100%)" }} />; const src = spec?.lightSource;
if (src) {
const dy = src.kind === "lamp" ? 0.2 : src.kind === "window" ? 0.32 : 0.2;
return { kind: src.kind, x: src.x * W, y: (src.y ?? dy) * H, w: W * 0.3, h: H * 0.18 };
}
const place = spec?.scene.kind === "place" ? spec.place : undefined;
const layout = place ? layoutPlace(spec!) : null;
const toScreen = (x: number, y: number) => layout && layout.zoom !== 1
? { x: W / 2 + (x - W / 2) * layout.zoom, y: layout.horizon + (y - layout.horizon) * layout.zoom } : { x, y };
const pendant = layout?.items.find((it) => it.e.kind === "pendant");
if (pendant && (light === "spot" || light === undefined)) {
const z = layout!.zoom;
const b = toScreen(pendant.x, pendant.y + 376 * pendant.s);
return { kind: "lamp", x: b.x, y: b.y, spread: 130 * pendant.s * z };
}
// Luminária de mesa acesa: brilho quente em volta da cúpula, o resto do lugar no escuro.
const desk = layout?.items.find((it) => it.e.kind === "desklamp");
if (desk && light === undefined) {
const k = desk.flip ? -1 : 1;
const a = toScreen(desk.x + k * 40 * desk.s, desk.y - 130 * desk.s);
return { kind: "glow", x: a.x, y: a.y, spread: 420 * desk.s * layout!.zoom };
}
if (light === "spot") return { kind: "lamp", x: W / 2, y: H * 0.045, spread: W * 0.07, fixture: true };
if (light !== undefined || !place || !layout) return null;
if (place.indoor) {
const win = layout.items.find((it) => it.e.kind === "window");
if (!win) return null;
const a = toScreen(win.x - 186 * win.s, win.y - 616 * win.s);
const b = toScreen(win.x + 186 * win.s, win.y - 244 * win.s);
return { kind: "window", x: (a.x + b.x) / 2, y: (a.y + b.y) / 2, w: b.x - a.x, h: b.y - a.y };
}
const sun = sunOf(spec!.palette, layout.horizon);
if (!sun || isNight(spec!.palette)) return null;
return { kind: "sun", x: sun.x, y: sun.y };
}
/**
* Luz por cima de tudo (inclusive dos personagens). Fonte POSICIONADA: luminária (cone + poça no chão), janela
* (raios em diagonal + manchas no piso) ou sol (brilho quente). Contraste quente (luz) × frio (sombra).
* `light: "vignette"` escurece as bordas; `"none"` desliga; sem `light`, a fonte sai das peças do lugar.
*/
export function LightLayer({ light, palette: id, spec }: { light: ShotSpec["light"]; palette?: PaletteId; spec?: ShotSpec }) {
const pal = palette(id ?? spec?.palette);
const src = resolveLight(spec, light);
const vignette = light === "vignette";
if (!src && !vignette) return null;
const indoor = !!spec?.place?.indoor;
const horizon = spec?.place ? (spec.place.horizon ?? (indoor ? 0.62 : 0.56)) * H : H * 0.6;
const night = isNight(id ?? spec?.palette);
const warm = night && src?.kind === "window" ? "#a8c0ff" : pal.light;
const layers: React.ReactNode[] = [];
const defs: React.ReactNode[] = [];
if (src?.kind === "lamp") {
const floorY = indoor || !spec?.place ? Math.max(src.y + H * 0.3, horizon + (H - horizon) * 0.55) : H * 0.84;
const sw = src.spread ?? W * 0.08;
const spread = (floorY - src.y) * 0.42 + sw;
defs.push(<linearGradient key="c" id="lgCone" gradientUnits="userSpaceOnUse" x1="0" y1={src.y} x2="0" y2={floorY}>
<stop offset="0" stopColor={warm} stopOpacity={0.42} /><stop offset="1" stopColor={warm} stopOpacity={0.06} /></linearGradient>);
defs.push(<radialGradient key="p" id="lgPool"><stop offset="0" stopColor={warm} stopOpacity={0.4} /><stop offset="1" stopColor={warm} stopOpacity={0} /></radialGradient>);
defs.push(<radialGradient key="d" id="lgDark" gradientUnits="userSpaceOnUse" cx={src.x} cy={(src.y + floorY) / 2} r={H * 0.62}>
<stop offset="0.3" stopColor={pal.shade} stopOpacity={0} /><stop offset="1" stopColor={pal.shade} stopOpacity={0.62} /></radialGradient>);
layers.push(<rect key="dark" width={W} height={H} fill="url(#lgDark)" />);
layers.push(<polygon key="cone" points={`${src.x - sw * 0.92},${src.y} ${src.x + sw * 0.92},${src.y} ${src.x + spread},${floorY} ${src.x - spread},${floorY}`} fill="url(#lgCone)" />);
layers.push(<ellipse key="pool" cx={src.x} cy={floorY} rx={spread * 1.15} ry={spread * 0.2} fill="url(#lgPool)" />);
if (src.fixture) {
layers.push(<path key="fx" d={`M${src.x - sw} ${src.y} Q${src.x - sw * 0.9} ${src.y - 60} ${src.x} ${src.y - 64} Q${src.x + sw * 0.9} ${src.y - 60} ${src.x + sw} ${src.y} Z`} fill={mix(pal.ink, "#4a5270", 0.5)} />);
layers.push(<ellipse key="fxl" cx={src.x} cy={src.y} rx={sw} ry={12} fill={warm} />);
}
} else if (src?.kind === "window") {
const ww = src.w ?? W * 0.3;
const wh = src.h ?? H * 0.18;
const x0 = src.x - ww / 2;
const y0 = src.y - wh / 2;
const dir = src.x < W / 2 ? 1 : -1;
const vx = dir * W * 0.78;
const vy = H * 0.55;
const pane = (a: number, b: number) => {
// Retângulo da vidraça arrastado na direção dos raios (contorno convexo).
const xa = x0 + ww * a;
const xb = x0 + ww * b;
const [l, r] = dir > 0 ? [xa, xb] : [xb, xa];
return `${l},${y0} ${r},${y0} ${r + vx},${y0 + vy} ${r + vx},${y0 + wh + vy} ${l + vx},${y0 + wh + vy} ${l},${y0 + wh}`;
};
defs.push(<linearGradient key="b" id="lgBeam" gradientUnits="userSpaceOnUse" x1={src.x} y1={src.y} x2={src.x + vx} y2={src.y + vy}>
<stop offset="0" stopColor={warm} stopOpacity={night ? 0.16 : 0.34} /><stop offset="1" stopColor={warm} stopOpacity={0} /></linearGradient>);
defs.push(<radialGradient key="g" id="lgGlow" gradientUnits="userSpaceOnUse" cx={src.x} cy={src.y} r={W * 0.75}>
<stop offset="0" stopColor={warm} stopOpacity={night ? 0.12 : 0.24} /><stop offset="1" stopColor={warm} stopOpacity={0} /></radialGradient>);
defs.push(<linearGradient key="k" id="lgCool" x1={dir > 0 ? 1 : 0} y1="0" x2={dir > 0 ? 0 : 1} y2="0">
<stop offset="0" stopColor={pal.shade} stopOpacity={0.4} /><stop offset="0.6" stopColor={pal.shade} stopOpacity={0} /></linearGradient>);
layers.push(<rect key="cool" width={W} height={H} fill="url(#lgCool)" />);
layers.push(<rect key="glow" width={W} height={H} fill="url(#lgGlow)" />);
layers.push(<polygon key="b1" points={pane(0, 0.47)} fill="url(#lgBeam)" />);
layers.push(<polygon key="b2" points={pane(0.53, 1)} fill="url(#lgBeam)" />);
// Manchas da janela no piso, inclinadas no sentido dos raios.
const fy = horizon + (H - horizon) * 0.3;
const fh = (H - horizon) * 0.2;
const cx = src.x + dir * W * 0.38;
const sk = dir * fh * 0.9;
for (const [a, b] of [[-0.62, -0.03], [0.03, 0.62]]) {
const xa = cx + ww * a;
const xb = cx + ww * b;
layers.push(<polygon key={`f${a}`} points={`${xa},${fy} ${xb},${fy} ${xb + sk},${fy + fh} ${xa + sk},${fy + fh}`} fill={warm} opacity={night ? 0.08 : 0.2} />);
}
} else if (src?.kind === "glow") {
const r = Math.max(W * 0.35, src.spread ?? W * 0.4);
defs.push(<radialGradient key="g" id="lgGlow" gradientUnits="userSpaceOnUse" cx={src.x} cy={src.y} r={r}>
<stop offset="0" stopColor={warm} stopOpacity={0.38} /><stop offset="1" stopColor={warm} stopOpacity={0} /></radialGradient>);
defs.push(<radialGradient key="d" id="lgDark" gradientUnits="userSpaceOnUse" cx={src.x} cy={src.y} r={H * 0.7}>
<stop offset="0.25" stopColor={pal.shade} stopOpacity={0} /><stop offset="1" stopColor={pal.shade} stopOpacity={0.6} /></radialGradient>);
layers.push(<rect key="dark" width={W} height={H} fill="url(#lgDark)" />);
layers.push(<rect key="glow" width={W} height={H} fill="url(#lgGlow)" />);
} else if (src?.kind === "sun") {
defs.push(<radialGradient key="s" id="lgSun" gradientUnits="userSpaceOnUse" cx={src.x} cy={src.y} r={W * 1.05}>
<stop offset="0" stopColor={warm} stopOpacity={0.26} /><stop offset="0.5" stopColor={warm} stopOpacity={0.06} /><stop offset="1" stopColor={warm} stopOpacity={0} /></radialGradient>);
defs.push(<linearGradient key="k" id="lgCool" x1="1" y1="1" x2="0.3" y2="0.4">
<stop offset="0" stopColor={pal.shade} stopOpacity={0.3} /><stop offset="1" stopColor={pal.shade} stopOpacity={0} /></linearGradient>);
layers.push(<rect key="cool" width={W} height={H} fill="url(#lgCool)" />);
layers.push(<rect key="sun" width={W} height={H} fill="url(#lgSun)" />);
}
if (vignette) {
defs.push(<radialGradient key="v" id="lgVig" cx="0.5" cy="0.45" r="0.75"><stop offset="0.55" stopColor="#000" stopOpacity={0} /><stop offset="1" stopColor="#000" stopOpacity={0.55} /></radialGradient>);
layers.push(<rect key="vig" width={W} height={H} fill="url(#lgVig)" />);
} }
return ( return (
<svg viewBox={`0 0 ${W} ${H}`} width="100%" height="100%" preserveAspectRatio="xMidYMid slice" style={{ position: "absolute", inset: 0 }}> <svg viewBox={`0 0 ${W} ${H}`} width="100%" height="100%" preserveAspectRatio="xMidYMid slice" style={{ position: "absolute", inset: 0 }}>
<defs> <defs>{defs}</defs>
<linearGradient id="spot" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stopColor={pal.light} stopOpacity={0.32} /><stop offset="1" stopColor={pal.light} stopOpacity={0.05} /></linearGradient> {layers}
<radialGradient id="spotDark" cx="0.5" cy="0.55" r="0.65"><stop offset="0.35" stopColor="#000" stopOpacity={0} /><stop offset="1" stopColor="#000" stopOpacity={0.6} /></radialGradient> </svg>
</defs> );
<rect width={W} height={H} fill="url(#spotDark)" /> }
<polygon points={`${W * 0.44},${H * 0.03} ${W * 0.56},${H * 0.03} ${W * 0.86},${H * 0.75} ${W * 0.14},${H * 0.75}`} fill="url(#spot)" />
<rect x={W * 0.42} y={H * 0.025} width={W * 0.16} height={14} rx={6} fill="#d9d9d9" /> /** Chuva por cima de tudo (inclusive dos personagens); tempestade escurece, chove mais e relampeja. */
<ellipse cx={W / 2} cy={H * 0.75} rx={W * 0.36} ry={34} fill={pal.light} opacity={0.12} /> export function WeatherLayer({ spec, frame }: { spec: ShotSpec; frame: number }) {
const weather = spec.place?.weather ?? "none";
if (weather === "none") return null;
const storm = weather === "storm";
const rand = rng(spec.seed + 101);
const drops = Array.from({ length: storm ? 230 : 130 }, () => ({ x: rand() * (W + 300), y: rand() * H, v: 38 + rand() * 26, l: 40 + rand() * 50 }));
// Relâmpago: um clarão curto a cada 2,5 s, com fase que depende da semente.
const cycle = 75;
const ph = (frame + (spec.seed % cycle)) % cycle;
const flash = storm && ph < 5 ? (ph < 2 ? 0.55 : 0.25) : 0;
return (
<svg viewBox={`0 0 ${W} ${H}`} width="100%" height="100%" preserveAspectRatio="xMidYMid slice" style={{ position: "absolute", inset: 0 }}>
{storm && <rect width={W} height={H} fill="#0a1020" opacity={0.22} />}
<g stroke="#d6e4f5" strokeWidth={storm ? 3.4 : 2.6} strokeLinecap="round" opacity={storm ? 0.6 : 0.5}>
{drops.map((d, i) => {
const y = ((d.y + frame * d.v) % (H + 120)) - 60;
const x = ((((d.x - frame * d.v * 0.22) % (W + 300)) + W + 300) % (W + 300)) - 150;
return <line key={i} x1={x} y1={y} x2={x - d.l * 0.22} y2={y + d.l} />;
})}
</g>
{flash > 0 && <>
<rect width={W} height={H} fill="#eaf2ff" opacity={flash} />
<path d={`M${W * 0.7} 0 L${W * 0.64} ${H * 0.14} L${W * 0.69} ${H * 0.14} L${W * 0.6} ${H * 0.3}`} stroke="#ffffff" strokeWidth={9} fill="none" strokeLinejoin="round" />
</>}
</svg>
);
}
/**
* Por cima dos personagens: a parte da frente das peças ocupadas (casco da arca, lataria do carro), na mesma
* posição da peça no fundo — quem está "dentro" aparece da cintura para cima.
*/
export function PlaceForeground({ spec, frame, progress = 0 }: { spec: ShotSpec; frame: number; progress?: number }) {
const place = spec.place;
const layout = React.useMemo(() => (place ? layoutPlace(spec) : null), [spec, place]);
if (!place || !layout || !place.elements.some((e) => e.occupied && FRONT_PART[e.kind])) return null;
const pal = palette(spec.palette);
const hazeColor = place.indoor ? pal.wall : mix(mix(pal.sky[2], pal.sky[1], 0.25), "#c8ccd6", place.fog ? 0.45 : 0);
const level = floodLevel(place, progress);
const waterY = level === null ? null : level * H;
const storm = place.weather === "storm";
const { horizon, zoom } = layout;
const zoomT = zoom === 1 ? undefined : `translate(${W / 2} ${horizon}) scale(${zoom}) translate(${-W / 2} ${-horizon})`;
return (
<svg viewBox={`0 0 ${W} ${H}`} width="100%" height="100%" preserveAspectRatio="xMidYMid slice" style={{ position: "absolute", inset: 0 }}>
<g transform={zoomT}>
{layout.items.filter((it) => it.e.occupied && FRONT_PART[it.e.kind]).map((it) => {
const floating = !!it.e.float && waterY !== null;
return <PlacedElement key={it.e.i} it={it} pal={pal} spec={spec} hazeColor={hazeColor} part="front"
y={floating ? waterY! + H * 0.035 + Math.sin(frame / 14 + it.e.i) * 9 : undefined}
rot={floating ? Math.sin(frame / 22 + it.e.i) * (storm ? 3.5 : 1.6) : 0} />;
})}
{waterY !== null && place.elements.some((e) => e.occupied && e.float) && <rect x={0} y={waterY + H * 0.03} width={W} height={H} fill={pal.ground.water} opacity={0.35} />}
</g>
</svg> </svg>
); );
} }
+7 -3
View File
@@ -116,16 +116,20 @@ export const POSE_PRESETS = {
arms_up: { arms: { raise: 158, bend: -10 } }, arms_up: { arms: { raise: 158, bend: -10 } },
celebrate: { arms: { raise: 150, bend: -30 }, headNod: -0.4 }, celebrate: { arms: { raise: 150, bend: -30 }, headNod: -0.4 },
shrug: { arms: { raise: 38, bend: 100 }, headTilt: 7 }, shrug: { arms: { raise: 38, bend: 100 }, headTilt: 7 },
think: { armR: { raise: 18, bend: 150 }, headTilt: -6 }, think: { armR: { raise: -19, bend: 141 }, headTilt: -6 },
hands_on_hips: { arms: { raise: 42, bend: 105 } }, hands_on_hips: { arms: { raise: 42, bend: 105 } },
cross_arms: { arms: { raise: 22, bend: 128 } }, cross_arms: { arms: { raise: 22, bend: 128 } },
facepalm: { armR: { raise: 26, bend: 158 }, headNod: 0.5, headTilt: 5 }, facepalm: { armR: { raise: 125, bend: -103 }, headNod: 0.5, headTilt: 8 },
cover_mouth: { armR: { raise: 16, bend: 168 } }, cover_mouth: { armR: { raise: -60, bend: 119 } },
defend: { arms: { raise: 62, bend: 118 }, lean: -4 }, defend: { arms: { raise: 62, bend: 118 }, lean: -4 },
reach: { armR: { raise: 70, bend: -10 }, lean: 6 }, reach: { armR: { raise: 70, bend: -10 }, lean: 6 },
sit: { crouch: 1, arms: { raise: 14, bend: 40 } }, sit: { crouch: 1, arms: { raise: 14, bend: 40 } },
kneel: { crouch: 0.6, arms: { raise: 10, bend: 20 } }, kneel: { crouch: 0.6, arms: { raise: 10, bend: 20 } },
lean_in: { lean: 8, headTilt: 6 }, lean_in: { lean: 8, headTilt: 6 },
// Duas mãos segurando um objeto largo (livro, tábua) pelas bordas, na frente do peito.
hold_both: { arms: { raise: 51, bend: 99 } },
// Joinha: cotovelo dobrado, mão na altura do peito/ombro (a forma da mão vem do desenho: `thumbs_up`).
thumbs_up: { armR: { raise: 17, bend: 149 } },
} satisfies Record<string, BodyPatch>; } satisfies Record<string, BodyPatch>;
export type ExpressionName = keyof typeof EXPRESSION_PRESETS; export type ExpressionName = keyof typeof EXPRESSION_PRESETS;
+1 -1
View File
@@ -152,7 +152,7 @@ function Card({ spec }: SceneProps) {
export function SceneBackground(props: SceneProps) { export function SceneBackground(props: SceneProps) {
switch (props.spec.scene.kind) { switch (props.spec.scene.kind) {
case "place": return <PlaceBackground spec={props.spec} frame={props.frame} />; case "place": return <PlaceBackground spec={props.spec} frame={props.frame} progress={props.progress} />;
case "street": return <Street {...props} />; case "street": return <Street {...props} />;
case "house": return <HouseFront {...props} />; case "house": return <HouseFront {...props} />;
case "blueprint": return <Blueprint />; case "blueprint": return <Blueprint />;
+137 -14
View File
@@ -5,7 +5,8 @@
import { EXPRESSIONS, POSES, validateLook, type CharacterLook, type Expression, type Pose } from "./character"; import { EXPRESSIONS, POSES, validateLook, type CharacterLook, type Expression, type Pose } from "./character";
import { validateTimeline, type Action } from "./motion"; import { validateTimeline, type Action } from "./motion";
import type { BodyPatch, FacePatch } from "./rig"; import type { BodyPatch, FacePatch } from "./rig";
import { ELEMENTS, GROUNDS, PALETTES, type PaletteId, type Place } from "./places"; import { ELEMENTS, GROUNDS, LIGHT_SOURCES, PALETTES, WEATHERS, type PaletteId, type Place } from "./places";
import { SPECIES, type Species } from "./animals";
/** "place" = lugar montado por peças (ver places.tsx); os demais são fundos prontos da 1ª versão. */ /** "place" = lugar montado por peças (ver places.tsx); os demais são fundos prontos da 1ª versão. */
export const SCENES = ["place", "street", "house", "plain", "blueprint", "card"] as const; export const SCENES = ["place", "street", "house", "plain", "blueprint", "card"] as const;
@@ -13,7 +14,8 @@ export const LIGHTS = ["none", "spot", "vignette"] as const;
export type SceneKind = (typeof SCENES)[number]; export type SceneKind = (typeof SCENES)[number];
export const TIMES = ["night", "dawn", "day"] as const; export const TIMES = ["night", "dawn", "day"] as const;
export type TimeOfDay = (typeof TIMES)[number]; export type TimeOfDay = (typeof TIMES)[number];
export const ICONS = ["house", "generator", "fuel", "battery", "phone", "door", "eye", "bulb", "solar", "warning", "money", "clock"] as const; export const ICONS = ["house", "generator", "fuel", "battery", "phone", "door", "eye", "bulb", "solar", "warning", "money", "clock",
"olive", "hammer", "tablet", "book", "ruler"] as const;
export type IconId = (typeof ICONS)[number]; export type IconId = (typeof ICONS)[number];
export const TONES = ["info", "danger", "ok"] as const; export const TONES = ["info", "danger", "ok"] as const;
export type Tone = (typeof TONES)[number]; export type Tone = (typeof TONES)[number];
@@ -30,7 +32,7 @@ export type Person = {
/** Olha para a esquerda (espelha o desenho). */ /** Olha para a esquerda (espelha o desenho). */
flip?: boolean; flip?: boolean;
/** Enquadramento: corpo inteiro (padrão), meio corpo ou de perto (rosto grande, como ilustração de destaque). */ /** Enquadramento: corpo inteiro (padrão), meio corpo ou de perto (rosto grande, como ilustração de destaque). */
framing?: "full" | "medium" | "close"; framing?: "full" | "medium" | "close" | "insert";
/** Ajuste fino por cima da expressão/pose (ex.: { smile: 0.3, browL: { y: -6 } } ou { armR: { raise: 60 } }). */ /** Ajuste fino por cima da expressão/pose (ex.: { smile: 0.3, browL: { y: -6 } } ou { armR: { raise: 60 } }). */
face?: FacePatch; face?: FacePatch;
body?: BodyPatch; body?: BodyPatch;
@@ -48,7 +50,22 @@ export type Person = {
enterS?: number; enterS?: number;
}; };
export type Crowd = { kind: "crowd"; count: number; y: number; enterS?: number }; export type Crowd = { kind: "crowd"; count: number; y: number; enterS?: number };
export type Actor = Person | Crowd; /**
* Animal (figura reaproveitável, animals.tsx). `count` > 1 = fila (um atrás do outro, `gap` entre eles); `pair` =
* casal lado a lado em cada lugar da fila. `walk` anda de x até `to` (aves com `fly` voam, subindo e descendo).
* Olha para a direita; anda para a esquerda = espelha sozinho. `carry: "olive"` = ramo no bico (aves).
*/
export type Animal = {
kind: "animal";
species: Species;
x: number; y: number; scale?: number; flip?: boolean; color?: string;
count?: number; gap?: number; pair?: boolean;
walk?: { to: number; startS?: number; dur?: number };
fly?: boolean;
carry?: "olive";
enterS?: number;
};
export type Actor = Person | Crowd | Animal;
export type Prop = { export type Prop = {
icon: IconId; icon: IconId;
@@ -63,16 +80,57 @@ export type Prop = {
crossed?: boolean; crossed?: boolean;
}; };
/**
* Camadas de texto/grafismo por cima da cena (overlays.tsx). `text` é o rótulo de cada uma:
* - onomatopoeia | tag | big: o texto em si; counter: rótulo pequeno + `value` grande (caixa escura arredondada);
* - namecard: nome do personagem + `lines` (função, dado) num cartão claro;
* - stat: rótulo espaçado + `value` grande colorido por `tone` (danger vermelho, info amarelo, ok verde, sem = branco);
* - checklist: `items` com `state` (empty | checked | crossed) que vão se marcando em sequência (`stepS`);
* - table: `items` ({ text, value }) com a linha `highlight` destacada; `text` = título (pode ser "");
* - progress: rótulo + barra que enche até `value` (0–100) + porcentagem;
* - grid: `value` de `total` quadradinhos preenchidos (com o número) + "N DE M".
* `panel: true` = cartela sobre fundo escuro de tela inteira; sem ele, caixa escura flutuante sobre a cena.
*/
export const TEXT_KINDS = ["onomatopoeia", "tag", "counter", "big", "namecard", "stat", "checklist", "table", "progress", "grid"] as const;
export type TextKind = (typeof TEXT_KINDS)[number];
export const CHECK_STATES = ["empty", "checked", "crossed"] as const;
export type CheckState = (typeof CHECK_STATES)[number];
export type TextRow = { text: string; value?: string; state?: CheckState };
export type TextItem = { export type TextItem = {
kind: "onomatopoeia" | "tag" | "counter" | "big"; kind: TextKind;
text: string; text: string;
/** Só no "counter": o número grande embaixo do rótulo. */ /** counter/stat: o número grande; progress: 0–100; grid: quantos quadradinhos preenchidos. */
value?: string; value?: string | number;
x: number; y: number; x: number; y: number;
atS?: number; atS?: number;
tone?: Tone; tone?: Tone;
/** Graus (onomatopeia costuma ir levemente girada). */ /** Graus (onomatopeia costuma ir levemente girada). */
rotate?: number; rotate?: number;
/** namecard: 1–2 linhas menores embaixo do nome (função, dado). */
lines?: string[];
/** checklist/table: as linhas. */
items?: TextRow[];
/** table: índice da linha destacada. */
highlight?: number;
/** grid: total de quadradinhos (1–40). */
total?: number;
/** checklist: segundos entre uma marcação e a próxima (padrão 0,5). */
stepS?: number;
/** Cartela sobre fundo escuro de tela inteira (senão, caixa flutuante sobre a cena). */
panel?: boolean;
/** Escala da cartela (padrão 1; 0,5 = lista pequena no canto). */
size?: number;
};
/**
* Painel do topo. Esquerda: `badge` (bloco amarelo, "DIA 3") + `clock` (hora, anda com `clockMinutesPerSecond`) e,
* embaixo, a faixa clara com `place` (ou `label`). Direita, opcional: `valueLabel` pequeno ("CAIXA") + `value` grande
* (`valueTone`; sem ele, zero/negativo fica vermelho) e a faixa amarela `note` ("ESTREIA EM 30 DIAS").
*/
export type Hud = {
badge: string; label: string; clock?: string; clockMinutesPerSecond?: number;
place?: string; value?: string; valueLabel?: string; valueTone?: Tone; note?: string;
}; };
export type Word = { text: string; startS: number; endS: number; tone?: "key" | "danger" }; export type Word = { text: string; startS: number; endS: number; tone?: "key" | "danger" };
@@ -91,9 +149,12 @@ export type ShotSpec = {
grain?: number; grain?: number;
/** Luz por cima: foco do teto ("spot") ou vinheta. */ /** Luz por cima: foco do teto ("spot") ou vinheta. */
light?: (typeof LIGHTS)[number]; light?: (typeof LIGHTS)[number];
/** Fonte de luz posicionada (opcional): luminária (cone + poça no chão), janela (raios em diagonal) ou sol.
* x/y em fração do quadro. Sem ela, a luz sai das peças do lugar (luminária pendente > janela > sol). */
lightSource?: { kind: (typeof LIGHT_SOURCES)[number]; x: number; y?: number };
/** push = zoom no fim do trecho (1 = parado); panX = deslocamento horizontal da câmera (fração). */ /** push = zoom no fim do trecho (1 = parado); panX = deslocamento horizontal da câmera (fração). */
camera?: { push?: number; panX?: number }; camera?: { push?: number; panX?: number };
hud?: { badge: string; label: string; clock?: string; clockMinutesPerSecond?: number }; hud?: Hud;
actors?: Actor[]; actors?: Actor[];
props?: Prop[]; props?: Prop[];
texts?: TextItem[]; texts?: TextItem[];
@@ -124,6 +185,12 @@ export function validateSpec(spec: unknown): string[] {
if (s.scene?.kind === "card" && !s.card?.title) errors.push("scene card precisa de card.title"); if (s.scene?.kind === "card" && !s.card?.title) errors.push("scene card precisa de card.title");
if (s.palette !== undefined && !PALETTES.includes(s.palette)) errors.push(`palette precisa ser um de: ${PALETTES.join(", ")}`); if (s.palette !== undefined && !PALETTES.includes(s.palette)) errors.push(`palette precisa ser um de: ${PALETTES.join(", ")}`);
if (s.light !== undefined && !LIGHTS.includes(s.light)) errors.push(`light precisa ser um de: ${LIGHTS.join(", ")}`); if (s.light !== undefined && !LIGHTS.includes(s.light)) errors.push(`light precisa ser um de: ${LIGHTS.join(", ")}`);
if (s.lightSource !== undefined) {
const ls = s.lightSource;
if (!ls || !LIGHT_SOURCES.includes(ls.kind) || !frac(ls.x) || (ls.y !== undefined && !frac(ls.y))) {
errors.push(`lightSource: { kind (${LIGHT_SOURCES.join(", ")}), x, y? } em fração do quadro`);
}
}
if (s.scene?.kind === "place") { if (s.scene?.kind === "place") {
const place = s.place; const place = s.place;
if (!place || !GROUNDS.includes(place.ground) || !Array.isArray(place.elements)) errors.push(`place precisa de ground (${GROUNDS.join(", ")}) e elements`); if (!place || !GROUNDS.includes(place.ground) || !Array.isArray(place.elements)) errors.push(`place precisa de ground (${GROUNDS.join(", ")}) e elements`);
@@ -132,7 +199,10 @@ export function validateSpec(spec: unknown): string[] {
for (const [i, e] of place.elements.entries()) { for (const [i, e] of place.elements.entries()) {
if (!ELEMENTS.includes(e.kind)) errors.push(`place.elements[${i}]: peça "${e.kind}" não existe (${ELEMENTS.join(", ")})`); if (!ELEMENTS.includes(e.kind)) errors.push(`place.elements[${i}]: peça "${e.kind}" não existe (${ELEMENTS.join(", ")})`);
if (!frac(e.x) || (e.z !== undefined && !(e.z >= 0 && e.z <= 1))) errors.push(`place.elements[${i}]: x fora do quadro ou z fora de 0–1`); if (!frac(e.x) || (e.z !== undefined && !(e.z >= 0 && e.z <= 1))) errors.push(`place.elements[${i}]: x fora do quadro ou z fora de 0–1`);
if (e.lift !== undefined && !(finite(e.lift) && e.lift >= -0.5 && e.lift <= 1)) errors.push(`place.elements[${i}]: lift entre -0,5 e 1`);
} }
if (place.weather !== undefined && !WEATHERS.includes(place.weather)) errors.push(`place.weather: ${WEATHERS.join(", ")}`);
if (place.flood !== undefined && !(place.flood && frac(place.flood.from) && frac(place.flood.to))) errors.push("place.flood: { from, to } em fração da altura");
} }
} }
for (const [i, a] of (s.actors ?? []).entries()) { for (const [i, a] of (s.actors ?? []).entries()) {
@@ -150,18 +220,22 @@ export function validateSpec(spec: unknown): string[] {
} }
} }
else if (a.kind === "crowd" && (!finite(a.count) || a.count < 1 || a.count > 40 || !frac(a.y))) errors.push(`actors[${i}]: crowd inválida`); else if (a.kind === "crowd" && (!finite(a.count) || a.count < 1 || a.count > 40 || !frac(a.y))) errors.push(`actors[${i}]: crowd inválida`);
else if ((a as { kind: string }).kind !== "crowd") errors.push(`actors[${i}]: kind inválido`); else if (a.kind === "animal") {
if (!SPECIES.includes(a.species)) errors.push(`actors[${i}]: espécie "${a.species}" não existe (${SPECIES.join(", ")})`);
if (!frac(a.x) || !frac(a.y)) errors.push(`actors[${i}]: x/y fora do quadro`);
if (a.count !== undefined && !(Number.isInteger(a.count) && a.count >= 1 && a.count <= 12)) errors.push(`actors[${i}]: count entre 1 e 12`);
if (a.walk !== undefined && !(a.walk && frac(a.walk.to))) errors.push(`actors[${i}]: walk.to fora do quadro`);
if (a.carry !== undefined && a.carry !== "olive") errors.push(`actors[${i}]: carry só "olive"`);
}
else if (!["crowd", "person", "animal"].includes((a as { kind: string }).kind)) errors.push(`actors[${i}]: kind inválido`);
} }
for (const [i, p] of (s.props ?? []).entries()) { for (const [i, p] of (s.props ?? []).entries()) {
if (!ICONS.includes(p.icon)) errors.push(`props[${i}]: ícone "${p.icon}" não existe (${ICONS.join(", ")})`); if (!ICONS.includes(p.icon)) errors.push(`props[${i}]: ícone "${p.icon}" não existe (${ICONS.join(", ")})`);
if (!frac(p.x) || !frac(p.y)) errors.push(`props[${i}]: x/y fora do quadro`); if (!frac(p.x) || !frac(p.y)) errors.push(`props[${i}]: x/y fora do quadro`);
if (p.tone !== undefined && !TONES.includes(p.tone)) errors.push(`props[${i}]: tone inválido`); if (p.tone !== undefined && !TONES.includes(p.tone)) errors.push(`props[${i}]: tone inválido`);
} }
for (const [i, t] of (s.texts ?? []).entries()) { if (s.hud !== undefined) errors.push(...validateHud(s.hud));
if (!["onomatopoeia", "tag", "counter", "big"].includes(t.kind)) errors.push(`texts[${i}]: kind inválido`); for (const [i, t] of (s.texts ?? []).entries()) errors.push(...validateText(t, i));
if (typeof t.text !== "string" || !t.text.trim()) errors.push(`texts[${i}]: texto vazio`);
if (!frac(t.x) || !frac(t.y)) errors.push(`texts[${i}]: x/y fora do quadro`);
}
if (s.audioEnv !== undefined && (!finite(s.audioEnv.fps) || !Array.isArray(s.audioEnv.values) || s.audioEnv.values.length > 36000)) errors.push("audioEnv: { fps, values[] } (até 36 mil valores)"); if (s.audioEnv !== undefined && (!finite(s.audioEnv.fps) || !Array.isArray(s.audioEnv.values) || s.audioEnv.values.length > 36000)) errors.push("audioEnv: { fps, values[] } (até 36 mil valores)");
for (const [i, w] of (s.words ?? []).entries()) { for (const [i, w] of (s.words ?? []).entries()) {
if (typeof w.text !== "string" || !finite(w.startS) || !finite(w.endS) || w.endS < w.startS) errors.push(`words[${i}]: inválida`); if (typeof w.text !== "string" || !finite(w.startS) || !finite(w.endS) || w.endS < w.startS) errors.push(`words[${i}]: inválida`);
@@ -169,5 +243,54 @@ export function validateSpec(spec: unknown): string[] {
return errors; return errors;
} }
const str = (v: unknown): v is string => typeof v === "string";
function validateHud(h: Hud): string[] {
const errors: string[] = [];
if (!h || typeof h !== "object") return ["hud precisa ser um objeto"];
if (!str(h.badge) || !str(h.label)) errors.push("hud: badge e label são texto");
for (const k of ["clock", "place", "value", "valueLabel", "note"] as const) if (h[k] !== undefined && !str(h[k])) errors.push(`hud.${k}: texto`);
if (h.clockMinutesPerSecond !== undefined && !finite(h.clockMinutesPerSecond)) errors.push("hud.clockMinutesPerSecond: número");
if (h.valueTone !== undefined && !TONES.includes(h.valueTone)) errors.push(`hud.valueTone: ${TONES.join(", ")}`);
return errors;
}
/** "97", 97 ou "97,5" → número (NaN se não for). */
export const numberOf = (v: unknown) => (typeof v === "number" ? v : typeof v === "string" && v.trim() ? Number(v.replace(/%$/, "").replace(",", ".")) : NaN);
const OPTIONAL_TEXT: TextKind[] = ["table", "stat", "checklist"];
function validateText(t: TextItem, i: number): string[] {
const errors: string[] = [];
const at = `texts[${i}]`;
if (!t || typeof t !== "object") return [`${at}: precisa ser um objeto`];
if (!TEXT_KINDS.includes(t.kind)) errors.push(`${at}: kind inválido (${TEXT_KINDS.join(", ")})`);
// Tabela e lista podem ir sem título e o stat sem rótulo (só o número); os demais precisam de texto.
if (!str(t.text) || (!t.text.trim() && !OPTIONAL_TEXT.includes(t.kind))) errors.push(`${at}: texto vazio`);
if (!frac(t.x) || !frac(t.y)) errors.push(`${at}: x/y fora do quadro`);
if (t.tone !== undefined && !TONES.includes(t.tone)) errors.push(`${at}: tone inválido`);
if (t.value !== undefined && !str(t.value) && !finite(t.value)) errors.push(`${at}: value é texto ou número`);
if (t.size !== undefined && !(finite(t.size) && t.size >= 0.3 && t.size <= 2)) errors.push(`${at}: size entre 0,3 e 2`);
if (t.lines !== undefined && !(Array.isArray(t.lines) && t.lines.length <= 3 && t.lines.every(str))) errors.push(`${at}: lines = até 3 textos`);
if (t.kind === "stat" && (t.value === undefined || !String(t.value).trim())) errors.push(`${at}: stat precisa de value`);
if (t.kind === "checklist" || t.kind === "table") {
if (!Array.isArray(t.items) || !t.items.length || t.items.length > 8) errors.push(`${at}: items com 1 a 8 linhas`);
else for (const [j, r] of t.items.entries()) {
if (!r || !str(r.text) || !r.text.trim()) errors.push(`${at}.items[${j}]: texto vazio`);
else if (r.state !== undefined && !CHECK_STATES.includes(r.state)) errors.push(`${at}.items[${j}]: state (${CHECK_STATES.join(", ")})`);
else if (r.value !== undefined && !str(r.value)) errors.push(`${at}.items[${j}]: value é texto`);
}
}
if (t.highlight !== undefined && !(Number.isInteger(t.highlight) && t.highlight >= 0 && t.highlight < (t.items?.length ?? 0))) errors.push(`${at}: highlight fora das linhas`);
if (t.stepS !== undefined && !(finite(t.stepS) && t.stepS >= 0 && t.stepS <= 5)) errors.push(`${at}: stepS entre 0 e 5`);
if (t.kind === "progress" && !(numberOf(t.value) >= 0 && numberOf(t.value) <= 100)) errors.push(`${at}: progress precisa de value entre 0 e 100`);
if (t.kind === "grid") {
const total = t.total ?? NaN;
if (!(Number.isInteger(total) && total >= 1 && total <= 40)) errors.push(`${at}: grid precisa de total inteiro entre 1 e 40`);
else if (!(Number.isInteger(numberOf(t.value)) && numberOf(t.value) >= 0 && numberOf(t.value) <= total)) errors.push(`${at}: grid precisa de value inteiro entre 0 e total`);
}
return errors;
}
/** Número de quadros do trecho (arredonda para cima: o vídeo nunca fica mais curto que o áudio). */ /** Número de quadros do trecho (arredonda para cima: o vídeo nunca fica mais curto que o áudio). */
export const frameCount = (spec: Pick<ShotSpec, "durationS" | "fps">) => Math.max(1, Math.ceil(spec.durationS * spec.fps)); export const frameCount = (spec: Pick<ShotSpec, "durationS" | "fps">) => Math.max(1, Math.ceil(spec.durationS * spec.fps));
+7
View File
@@ -4,6 +4,12 @@ import { FONT_CAPTION, FONT_LABEL } from "./colors";
export * from "./colors"; export * from "./colors";
/**
* Texto de apoio do grafismo (HUD, rótulos espaçados, listas, linhas do cartão de nome): Barlow Semi Condensed Bold
* (OFL-1.1, licença em assets/fonts/BarlowSemiCondensed-Bold.OFL.txt). Condensada e legível em tamanho pequeno.
*/
export const FONT_TEXT = "CartoonBarlow";
let loaded = false; let loaded = false;
/** Carrega as fontes de assets/fonts antes do primeiro quadro (o render espera). */ /** Carrega as fontes de assets/fonts antes do primeiro quadro (o render espera). */
export function loadFonts(): void { export function loadFonts(): void {
@@ -13,6 +19,7 @@ export function loadFonts(): void {
const faces = [ const faces = [
new FontFace(FONT_CAPTION, `url(${staticFile("fonts/Anton-Regular.ttf")})`), new FontFace(FONT_CAPTION, `url(${staticFile("fonts/Anton-Regular.ttf")})`),
new FontFace(FONT_LABEL, `url(${staticFile("fonts/BebasNeue-Regular.ttf")})`), new FontFace(FONT_LABEL, `url(${staticFile("fonts/BebasNeue-Regular.ttf")})`),
new FontFace(FONT_TEXT, `url(${staticFile("fonts/BarlowSemiCondensed-Bold.ttf")})`),
]; ];
Promise.all(faces.map((f) => f.load().then((ok) => document.fonts.add(ok)))) Promise.all(faces.map((f) => f.load().then((ok) => document.fonts.add(ok))))
.then(() => continueRender(handle)) .then(() => continueRender(handle))
+35
View File
@@ -0,0 +1,35 @@
import assert from "node:assert/strict";
import { describe, it } from "node:test";
import { GRIP, HAND_SHAPES, TWO_HANDED, handPlacement, wristForHold } from "../src/hands";
describe("biblioteca de mãos", () => {
it("o pulso acompanha o eixo do antebraço: a forma gira em torno do centro do pulso", () => {
for (const shape of HAND_SHAPES) {
for (const fore of [0, 45, 120, -60]) {
for (const s of [1, -1] as const) {
const p = handPlacement(shape, 30, 40, fore, s, 0.6);
// O centro do pulso do desenho cai exatamente no pulso da tela, em qualquer giro e espelho.
const w = p.map(p.def.wrist[0], p.def.wrist[1]);
assert.ok(Math.abs(w.x - 30) < 1e-9 && Math.abs(w.y - 40) < 1e-9, `${shape} ${fore} ${s}`);
}
}
}
});
it("formas em pé giram pela diferença entre o antebraço e o ângulo do desenho (espelhadas do outro lado)", () => {
assert.equal(handPlacement("thumbs_up", 0, 0, 135, 1, 1).rot, 0);
assert.equal(handPlacement("thumbs_up", 0, 0, -135, -1, 1).rot, 0);
assert.equal(handPlacement("grip", 0, 0, 75, 1, 1).rot, 30);
});
it("pegada de borda: o pulso calculado põe a borda do objeto no ponto pedido", () => {
const w = wristForHold("pinch_edge", 120, 80, 48, 1, 0.62);
const hold = handPlacement("pinch_edge", w.x, w.y, 48, 1, 0.62).hold!;
assert.ok(Math.abs(hold.x - 120) < 1e-9 && Math.abs(hold.y - 80) < 1e-9);
});
it("livro e tábua vão nas duas mãos; martelo, ramo e régua têm cabo em pé no punho", () => {
assert.ok(TWO_HANDED.includes("book") && TWO_HANDED.includes("tablet") && !TWO_HANDED.includes("hammer"));
for (const id of ["hammer", "olive", "ruler"] as const) assert.ok(GRIP[id], id);
});
});
+50
View File
@@ -0,0 +1,50 @@
import assert from "node:assert/strict";
import { describe, it } from "node:test";
import { armGeometry, armLayer } from "../src/limbs";
import { ACTIONS, evaluate } from "../src/motion";
import { POSE_PRESETS, bodyOf } from "../src/rig";
const layers = (pose: string, patch?: Parameters<typeof bodyOf>[1], holds = false) => {
const b = bodyOf(pose, patch);
return [armLayer(b, -1), armLayer(b, 1, { holds })];
};
describe("profundidade dos braços (personagem de frente)", () => {
it("braço ao lado do corpo, acenando ou apontando para fora fica 'side'", () => {
for (const pose of ["stand", "wave", "arms_up", "celebrate", "point", "reach", "lean_in"]) assert.deepEqual(layers(pose), ["side", "side"], pose);
});
it("antebraço na frente do peito fica 'front': cruzar os braços, segurar, mão na cintura, apontar para o outro lado", () => {
assert.deepEqual(layers("cross_arms"), ["front", "front"]);
assert.deepEqual(layers("hands_on_hips"), ["front", "front"]);
assert.equal(layers("hold")[1], "front");
assert.equal(layers("point", { armR: { raise: 40, bend: 120 } })[1], "front");
});
it("mão na altura do pescoço/rosto fica 'face' (por cima da cabeça e da barba)", () => {
// Pensar (queixo), tapar a boca e mão na testa: a mão chega ao rosto.
for (const pose of ["think", "cover_mouth", "facepalm"]) assert.equal(layers(pose)[1], "face", pose);
assert.equal(layers("stand", { armR: { raise: 10, bend: 175 } })[1], "face");
// Mesmo segurando objeto: no rosto, a mão vai por cima da cabeça.
assert.equal(layers("cover_mouth", undefined, true)[1], "face");
});
it("objeto na mão deixa o braço na frente do corpo; o lado esquerdo espelha o direito", () => {
assert.equal(layers("stand", undefined, true)[1], "front");
const b = bodyOf("cross_arms");
const [l, r] = [armGeometry(b, -1), armGeometry(b, 1)];
assert.ok(Math.abs(l.hand.x - 100 + (r.hand.x - 100)) < 1e-9 && Math.abs(l.hand.y - r.hand.y) < 1e-9);
});
it("toda pose pronta e todo quadro de toda ação têm camada válida (função pura, sem relógio)", () => {
const valid = new Set(["side", "front", "face"]);
for (const pose of Object.keys(POSE_PRESETS)) for (const s of [-1, 1] as const) assert.ok(valid.has(armLayer(bodyOf(pose), s)), pose);
for (const action of ACTIONS) {
for (let t = 0; t <= 2; t += 0.25) {
const st = evaluate({ x: 0.5, timeline: [{ do: action, at: 0, dur: 2, text: "oi" }] }, t, 2, 1);
for (const s of [-1, 1] as const) assert.ok(valid.has(armLayer(st.body, s)), `${action} ${t}`);
}
}
assert.equal(armLayer(bodyOf("wave"), 1), armLayer(bodyOf("wave"), 1));
});
});
+37
View File
@@ -0,0 +1,37 @@
import assert from "node:assert/strict";
import { describe, it } from "node:test";
import { SAMPLE } from "../src/sample";
import { layoutPlace, resolveLight } from "../src/places";
import { validateSpec, type ShotSpec } from "../src/spec";
const place = (elements: NonNullable<ShotSpec["place"]>["elements"], indoor = true): ShotSpec =>
({ ...SAMPLE, scene: { kind: "place" }, palette: "night", place: { ground: "floor", indoor, elements } }) as ShotSpec;
describe("lugar por peças: luz e regras de posição", () => {
it("lightSource é opcional e conferido; specs antigos continuam válidos", () => {
assert.deepEqual(validateSpec({ ...SAMPLE, lightSource: { kind: "window", x: 0.1, y: 0.3 } }), []);
assert.match(validateSpec({ ...SAMPLE, lightSource: { kind: "lanterna", x: 0.1 } }).join(), /lightSource/);
assert.match(validateSpec({ ...SAMPLE, lightSource: { kind: "lamp", x: 3 } }).join(), /lightSource/);
assert.deepEqual(validateSpec({ ...SAMPLE, light: "spot" }), []);
});
it("peças novas existem; janela/quadro grudam na parede e a luminária de mesa sobe na escrivaninha", () => {
const spec = place([{ kind: "window", x: 0.2, z: 0.1 }, { kind: "desk", x: 0.6, z: 0.4 }, { kind: "desklamp", x: 0.7, z: 0.4 }, { kind: "frame", x: 0.5 }]);
assert.deepEqual(validateSpec(spec), []);
const { items, horizon } = layoutPlace(spec);
const by = (k: string) => items.find((it) => it.e.kind === k)!;
assert.equal(by("window").y, horizon);
assert.equal(by("frame").zEff, 1);
assert.ok(by("desklamp").y < by("desk").y - 200, "a luminária fica em cima do tampo");
assert.ok(items.indexOf(by("desklamp")) > items.indexOf(by("desk")), "e é desenhada depois da mesa");
});
it("fonte de luz: explícita > pendente > janela; 'none' desliga", () => {
const spec = place([{ kind: "pendant", x: 0.5, z: 0.5 }, { kind: "window", x: 0.15 }]);
assert.equal(resolveLight(spec, undefined)?.kind, "lamp");
assert.equal(resolveLight(place([{ kind: "window", x: 0.15 }]), undefined)?.kind, "window");
assert.equal(resolveLight({ ...spec, lightSource: { kind: "sun", x: 0.2 } }, undefined)?.kind, "sun");
assert.equal(resolveLight(spec, "none"), null);
assert.equal(resolveLight(place([]), "spot")?.kind, "lamp");
});
});
+59 -1
View File
@@ -1,6 +1,6 @@
import assert from "node:assert/strict"; import assert from "node:assert/strict";
import { describe, it } from "node:test"; import { describe, it } from "node:test";
import { captionChunks } from "../src/overlays"; import { captionChunks, countUp, hudClock, hudValueTone } from "../src/overlays";
import { SAMPLE } from "../src/sample"; import { SAMPLE } from "../src/sample";
import { frameCount, validateSpec } from "../src/spec"; import { frameCount, validateSpec } from "../src/spec";
@@ -31,3 +31,61 @@ describe("spec do Cartoon", () => {
assert.deepEqual(chunks, ["Num apagão,", "a casa acesa", "chama atenção."]); assert.deepEqual(chunks, ["Num apagão,", "a casa acesa", "chama atenção."]);
}); });
}); });
describe("grafismo do Cartoon: cartelas, cartão de nome e HUD", () => {
const ok = (texts: unknown[], extra: Record<string, unknown> = {}) => validateSpec({ ...SAMPLE, ...extra, texts });
const base = { x: 0.5, y: 0.4, atS: 0.2 };
it("aceita os kinds novos bem formados (e o stat/lista sem título)", () => {
assert.deepEqual(ok([
{ kind: "namecard", text: "Seu Amaro", lines: ["Roupeiro há 38 anos", "7 meses sem salário"], ...base },
{ kind: "stat", text: "No caixa", value: "R$ 0", tone: "danger", panel: true, ...base },
{ kind: "stat", text: "", value: 61, ...base },
{ kind: "counter", text: "Na fila", value: "297", ...base },
{ kind: "checklist", text: "", size: 0.5, items: [{ text: "Funcionários", state: "checked" }, { text: "Elenco", state: "crossed" }, { text: "Registro" }], ...base },
{ kind: "table", text: "", highlight: 1, items: [{ text: "Atlético", value: "31" }, { text: "Vila Nova", value: "4" }], ...base },
{ kind: "progress", text: "Talento", value: 97, ...base },
{ kind: "progress", text: "Talento", value: "97%", ...base },
{ kind: "grid", text: "Com contrato", value: 4, total: 18, ...base },
]), []);
});
it("recusa kind desconhecido, lista vazia, estado, destaque, porcentagem e grade inválidos", () => {
const errors = ok([
{ kind: "slide", text: "x", ...base },
{ kind: "checklist", text: "", items: [], ...base },
{ kind: "checklist", text: "", items: [{ text: "a", state: "talvez" }], ...base },
{ kind: "table", text: "", items: [{ text: "a", value: "1" }], highlight: 3, ...base },
{ kind: "progress", text: "Talento", value: 140, ...base },
{ kind: "grid", text: "Com contrato", value: 20, total: 18, ...base },
{ kind: "stat", text: "No caixa", ...base },
{ kind: "namecard", text: "", ...base },
{ kind: "grid", text: "g", value: 1, total: 4, size: 9, ...base },
]).join(" | ");
for (const re of [/texts\[0\]: kind/, /texts\[1\]: items/, /texts\[2\]\.items\[0\]: state/, /texts\[3\]: highlight/, /texts\[4\]: progress/,
/texts\[5\]: grid/, /texts\[6\]: stat precisa de value/, /texts\[7\]: texto vazio/, /texts\[8\]: size/]) assert.match(errors, re);
});
it("HUD: campos antigos continuam valendo; novos são opcionais e conferidos", () => {
assert.deepEqual(validateSpec({ ...SAMPLE, hud: { badge: "DIA 3", label: "Vila Nova" } }), []);
assert.deepEqual(validateSpec({ ...SAMPLE, hud: { badge: "Dia 1", label: "x", clock: "10:06", clockMinutesPerSecond: 1, place: "Vila Nova (MG)",
value: "R$ 0,00", valueLabel: "Caixa", valueTone: "danger", note: "Estreia em 30 dias" } }), []);
assert.match(validateSpec({ ...SAMPLE, hud: { badge: "Dia 1", label: "x", valueTone: "roxo" } }).join(), /hud.valueTone/);
assert.match(validateSpec({ ...SAMPLE, hud: { badge: 3, label: "x" } }).join(), /hud: badge/);
});
it("número contando, hora andando e cor do valor do HUD são funções puras", () => {
assert.equal(countUp("R$ 134.273", 0.5), "R$ 67.137");
assert.equal(countUp("R$ 134.273", 1), "R$ 134.273");
assert.equal(countUp("-R$ 47.312.904", 0), "-R$ 0");
assert.equal(countUp("R$ 0", 0.3), "R$ 0");
assert.equal(countUp("Vila Nova", 0.3), "Vila Nova");
assert.equal(hudClock("10:06", 2.5, 2), "10:11");
assert.equal(hudClock("23:59", 1, 2), "00:01");
assert.equal(hudClock("10:06", 9), "10:06");
assert.equal(hudValueTone("R$ 0,00"), "danger");
assert.equal(hudValueTone("-12"), "danger");
assert.equal(hudValueTone("R$ 800"), undefined);
assert.equal(hudValueTone("R$ 800", "info"), "info");
});
});
+6 -4
View File
@@ -4,7 +4,7 @@
// escolhe daqui (montagem Cartoon). // escolhe daqui (montagem Cartoon).
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { import {
ACCESSORIES, BEARD_STYLES, BOTTOM_STYLES, BROWS, BUILDS, EXPRESSIONS, GLASSES, HAIR_STYLES, HEAD_SHAPES, NOSES, POSES, TOP_STYLES, ACCESSORIES, BEARD_STYLES, BOTTOM_STYLES, BROWS, BUILDS, EXPRESSIONS, FOOTWEAR, GLASSES, HAIR_STYLES, HEAD_SHAPES, NOSES, POSES, TOP_STYLES,
type Character, type CharacterLook, type Expression, type Pose, type Character, type CharacterLook, type Expression, type Pose,
} from "cenaforge-cartoon/character"; } from "cenaforge-cartoon/character";
import { CharacterFigure } from "cenaforge-cartoon/figure"; import { CharacterFigure } from "cenaforge-cartoon/figure";
@@ -19,7 +19,8 @@ const LABEL: Record<string, string> = {
short: "curto", side: "repartido", bun: "coque", long: "longo", curly: "cacheado", spiky: "espetado", bald: "careca", cap: "boné", short: "curto", side: "repartido", bun: "coque", long: "longo", curly: "cacheado", spiky: "espetado", bald: "careca", cap: "boné",
none: "nenhum", stubble: "por fazer", mustache: "bigode", full: "cheia", goatee: "cavanhaque", none: "nenhum", stubble: "por fazer", mustache: "bigode", full: "cheia", goatee: "cavanhaque",
round: "redondo", square: "quadrado", sun: "escuro", thin: "finas", thick: "grossas", round: "redondo", square: "quadrado", sun: "escuro", thin: "finas", thick: "grossas",
shirt: "camisa", jacket: "jaqueta", hoodie: "moletom", dress: "vestido", uniform: "uniforme", shirt: "camisa", jacket: "jaqueta", hoodie: "moletom", dress: "vestido", uniform: "uniforme", robe: "túnica",
shoes: "sapato", sandals: "sandália", bare: "descalço",
pants: "calça", shorts: "bermuda", skirt: "saia", pants: "calça", shorts: "bermuda", skirt: "saia",
neutral: "neutro", smile: "sorriso", happy: "feliz", laugh: "rindo", proud: "orgulhoso", sad: "triste", cry: "chorando", worried: "preocupado", neutral: "neutro", smile: "sorriso", happy: "feliz", laugh: "rindo", proud: "orgulhoso", sad: "triste", cry: "chorando", worried: "preocupado",
angry: "bravo", furious: "furioso", surprised: "surpreso", scared: "com medo", shocked: "chocado", suspicious: "desconfiado", smirk: "sorriso de canto", angry: "bravo", furious: "furioso", surprised: "surpreso", scared: "com medo", shocked: "chocado", suspicious: "desconfiado", smirk: "sorriso de canto",
@@ -29,7 +30,7 @@ const LABEL: Record<string, string> = {
defend: "se defendendo", reach: "alcançando", sit: "sentado", kneel: "ajoelhado", lean_in: "inclinado", defend: "se defendendo", reach: "alcançando", sit: "sentado", kneel: "ajoelhado", lean_in: "inclinado",
express: "trocar expressão", pose: "trocar pose", walk: "andar", run: "correr", enter: "entrar", exit: "sair", jump: "pular", nod: "acenar que sim", express: "trocar expressão", pose: "trocar pose", walk: "andar", run: "correr", enter: "entrar", exit: "sair", jump: "pular", nod: "acenar que sim",
shake_head: "balançar que não", tremble: "tremer", bounce: "quicar", fall: "cair", stand_up: "levantar", turn: "virar", talk: "falar", look: "olhar", shake_head: "balançar que não", tremble: "tremer", bounce: "quicar", fall: "cair", stand_up: "levantar", turn: "virar", talk: "falar", look: "olhar",
emote: "balão (!)", emote: "balão (!)", hammer: "martelar",
oval: "oval", wide: "largo", button: "botão", curve: "curvo (perfil)", towel: "toalha no ombro", whistle: "apito", tie: "gravata", oval: "oval", wide: "largo", button: "botão", curve: "curvo (perfil)", towel: "toalha no ombro", whistle: "apito", tie: "gravata",
vest: "colete refletivo", helmet: "capacete", watch: "relógio", badge: "crachá", apron: "avental", scarf: "lenço", headset: "fone", chain: "corrente", vest: "colete refletivo", helmet: "capacete", watch: "relógio", badge: "crachá", apron: "avental", scarf: "lenço", headset: "fone", chain: "corrente",
}; };
@@ -211,7 +212,8 @@ export function CharacterStudio({ initial }: { initial: Character[] }) {
onChange={(e) => setLook((l) => ({ ...l, height: Number(e.target.value) }))} /> onChange={(e) => setLook((l) => ({ ...l, height: Number(e.target.value) }))} />
</Field> </Field>
<Color name="Pele" value={look.skin} onChange={(v) => setLook((l) => ({ ...l, skin: v }))} /> <Color name="Pele" value={look.skin} onChange={(v) => setLook((l) => ({ ...l, skin: v }))} />
<Color name="Sapato" value={look.shoes} onChange={(v) => setLook((l) => ({ ...l, shoes: v }))} /> <Opt name="Calçado" list={FOOTWEAR} value={look.footwear ?? "shoes"} onChange={(v) => setLook((l) => ({ ...l, footwear: v }))} />
<Color name="Cor do calçado" value={look.shoes} onChange={(v) => setLook((l) => ({ ...l, shoes: v }))} />
<Opt name="Cabelo" list={HAIR_STYLES} value={look.hair.style} onChange={(v) => setLook((l) => ({ ...l, hair: { ...l.hair, style: v } }))} /> <Opt name="Cabelo" list={HAIR_STYLES} value={look.hair.style} onChange={(v) => setLook((l) => ({ ...l, hair: { ...l.hair, style: v } }))} />
<Color name="Cor do cabelo" value={look.hair.color} onChange={(v) => setLook((l) => ({ ...l, hair: { ...l.hair, color: v } }))} /> <Color name="Cor do cabelo" value={look.hair.color} onChange={(v) => setLook((l) => ({ ...l, hair: { ...l.hair, color: v } }))} />
<Opt name="Barba" list={BEARD_STYLES} value={look.beard.style} onChange={(v) => setLook((l) => ({ ...l, beard: { ...l.beard, style: v } }))} /> <Opt name="Barba" list={BEARD_STYLES} value={look.beard.style} onChange={(v) => setLook((l) => ({ ...l, beard: { ...l.beard, style: v } }))} />
+13 -9
View File
@@ -124,14 +124,17 @@ export function describeToLook(description: string): { look: CharacterLook; capt
: /cachead|crespo|black power/.test(t) ? "curly" : /espetad/.test(t) ? "spiky" : /cabelo (longo|comprido)|cabelos longos/.test(t) ? "long" : /cachead|crespo|black power/.test(t) ? "curly" : /espetad/.test(t) ? "spiky" : /cabelo (longo|comprido)|cabelos longos/.test(t) ? "long"
: /repartid|de lado/.test(t) ? "side" : female ? (old ? "bun" : "long") : "short"; : /repartid|de lado/.test(t) ? "side" : female ? (old ? "bun" : "long") : "short";
const beard: CharacterLook["beard"]["style"] = female ? "none" : /barba por fazer/.test(t) ? "stubble" : /cavanhaque/.test(t) ? "goatee" const beard: CharacterLook["beard"]["style"] = female ? "none" : /barba por fazer/.test(t) ? "stubble" : /cavanhaque/.test(t) ? "goatee"
: /bigode/.test(t) && !/barba/.test(t) ? "mustache" : /barb/.test(t) ? "full" : "none"; : /bigode/.test(t) && !/barba/.test(t) ? "mustache" : /barba( \w+)? (longa|comprida)|barbas? ate o peito/.test(t) ? "long" : /barb/.test(t) ? "full" : "none";
const skin = /\b(negr[oa]|pret[oa]|pele escura)\b/.test(t) ? "#8d5a3b" : /\b(moren[oa]|pard[oa])\b/.test(t) ? "#c98a5e" // Cor de cabelo, barba e roupa não diz nada da pele ("barba branca", "cabelo preto", "túnica branca").
: /\b(branc[oa]|pele clara|loir[oa]|ruiv[oa])\b/.test(t) ? "#f1c7a3" : "#e0b48f"; const ts = t.replace(/\b(cabelos?|barbas?|bigode|tunica|roupa|camisa|camiseta|vestido|jaqueta|casaco|bone|calca|sapato)\s+(\w+\s+)?(branc|pret|loir|ruiv)\w*/g, " ");
const skin = /\b(negr[oa]|pret[oa]|pele escura)\b/.test(ts) ? "#8d5a3b" : /\b(moren[oa]|pard[oa])\b/.test(ts) ? "#c98a5e"
: /\b(branc[oa]|pele clara|loir[oa]|ruiv[oa])\b/.test(ts) ? "#f1c7a3" : "#e0b48f";
const profession = PROFESSIONS.find(([re]) => re.test(t))?.[1]; const profession = PROFESSIONS.find(([re]) => re.test(t))?.[1];
const clothColor = COLORS.find(([re]) => new RegExp(`(roupa|camisa|camiseta|vestido|jaqueta|casaco|moletom|blusa)\\s+\\w*\\s*${re.source}`).test(t))?.[1]; const clothColor = COLORS.find(([re]) => new RegExp(`(roupa|camisa|camiseta|vestido|jaqueta|casaco|moletom|blusa|tunica|manto)\\s+\\w*\\s*${re.source}`).test(t))?.[1];
const topStyle: CharacterLook["top"]["style"] = /vestido/.test(t) ? "dress" : /jaqueta|casaco/.test(t) ? "jacket" : /moletom/.test(t) ? "hoodie" const topStyle: CharacterLook["top"]["style"] = /tunica|manto|roupa antiga|bata/.test(t) ? "robe" : /vestido/.test(t) ? "dress" : /jaqueta|casaco/.test(t) ? "jacket" : /moletom/.test(t) ? "hoodie"
: /uniforme|macacao/.test(t) ? "uniform" : profession?.top.style ?? (female && old ? "dress" : "shirt"); : /uniforme|macacao/.test(t) ? "uniform" : profession?.top.style ?? (female && old ? "dress" : "shirt");
const top = { ...(profession?.top ?? { style: topStyle, color: "#4f7a4a" }), style: topStyle, ...(clothColor ? { color: clothColor } : {}) }; // Túnica sem cor dita: tecido cru com faixa marrom (roupa antiga).
const top = { ...(profession?.top ?? (topStyle === "robe" ? { style: topStyle, color: female ? "#8a6f9e" : "#a8865a", accent: "#6b4a2a" } : { style: topStyle, color: "#4f7a4a" })), style: topStyle, ...(clothColor ? { color: clothColor } : {}) };
const look: CharacterLook = { const look: CharacterLook = {
build: /\b(gord[oa]|fort[e]|robust[oa]|grand[e]|gordinh[oa])\b/.test(t) ? "heavy" : /\b(magr[oa]|magrel[oa]|franzin[oa])\b/.test(t) || child ? "slim" : "average", build: /\b(gord[oa]|fort[e]|robust[oa]|grand[e]|gordinh[oa])\b/.test(t) ? "heavy" : /\b(magr[oa]|magrel[oa]|franzin[oa])\b/.test(t) || child ? "slim" : "average",
height: child ? 0.78 : /\b(alt[oa])\b/.test(t) ? 1.08 : /\b(baix[oa]|baixinh[oa])\b/.test(t) ? 0.92 : female ? 0.96 : 1, height: child ? 0.78 : /\b(alt[oa])\b/.test(t) ? 1.08 : /\b(baix[oa]|baixinh[oa])\b/.test(t) ? 0.92 : female ? 0.96 : 1,
@@ -142,12 +145,13 @@ export function describeToLook(description: string): { look: CharacterLook; capt
brows: old || /sobrancelha grossa|bravo|serio/.test(t) ? "thick" : "thin", brows: old || /sobrancelha grossa|bravo|serio/.test(t) ? "thick" : "thin",
top: top as CharacterLook["top"], top: top as CharacterLook["top"],
bottom: { style: /\b(short|bermuda)\b/.test(t) || child ? "shorts" : /\bsaia\b/.test(t) ? "skirt" : "pants", color: female && /saia/.test(t) ? top.color : "#2c3346" }, bottom: { style: /\b(short|bermuda)\b/.test(t) || child ? "shorts" : /\bsaia\b/.test(t) ? "skirt" : "pants", color: female && /saia/.test(t) ? top.color : "#2c3346" },
shoes: child ? "#f2f2f2" : "#1d1d24", shoes: /sandalia/.test(t) ? "#6b4a2a" : child ? "#f2f2f2" : "#1d1d24",
...(/sandalia/.test(t) ? { footwear: "sandals" as const } : /descalc|pe no chao/.test(t) ? { footwear: "bare" as const } : {}),
}; };
// Detalhe de ilustração: nariz, pálpebra, rugas, formato da cabeça, barriga e acessórios pela descrição. // Detalhe de ilustração: nariz, pálpebra, rugas, formato da cabeça, barriga e acessórios pela descrição.
look.nose = /narigud|nariz grande|nariz comprido/.test(t) ? "long" : /nariz largo|nariz de batata/.test(t) ? "wide" : old && !female ? "curve" : child ? "button" : female ? "button" : "round"; look.nose = /narigud|nariz grande|nariz comprido/.test(t) ? "long" : /nariz largo|nariz de batata/.test(t) ? "wide" : old && !female ? "curve" : child ? "button" : female ? "button" : "round";
look.lids = Math.min(0.6, (old ? 0.3 : 0.1) + (/cansad|sonolent|olhar caido|desconfiad/.test(t) ? 0.2 : 0)); look.lids = Math.min(0.6, (old ? 0.3 : 0.1) + (/cansad|sonolent|olhar caido|palpebras? caid|desconfiad/.test(t) ? 0.2 : 0));
look.wrinkles = age >= 60 || /idos|velh/.test(t) ? 0.7 : age >= 45 ? 0.4 : old ? 0.6 : 0; look.wrinkles = /rugas|enrugad/.test(t) ? 0.85 : age >= 60 || /idos|velh/.test(t) ? 0.7 : age >= 45 ? 0.4 : old ? 0.6 : 0;
look.head = /rosto quadrado|queixo quadrado/.test(t) ? "square" : /rosto fino|rosto comprido/.test(t) ? "oval" : look.build === "heavy" ? "wide" : "round"; look.head = /rosto quadrado|queixo quadrado/.test(t) ? "square" : /rosto fino|rosto comprido/.test(t) ? "oval" : look.build === "heavy" ? "wide" : "round";
if (/barrig|panca/.test(t) || (look.build === "heavy" && age >= 40 && !female)) look.belly = true; if (/barrig|panca/.test(t) || (look.build === "heavy" && age >= 40 && !female)) look.belly = true;
const acc = new Set<NonNullable<CharacterLook["accessories"]>[number]>(); const acc = new Set<NonNullable<CharacterLook["accessories"]>[number]>();
+89 -3
View File
@@ -1,7 +1,7 @@
import assert from "node:assert/strict"; import assert from "node:assert/strict";
import { describe, it } from "node:test"; import { describe, it } from "node:test";
import { describeToLook } from "./characters"; import { describeToLook } from "./characters";
import { cartoonKey, cartoonSpec, planCartoon, timelineFor, wordTimings } from "./montage-cartoon"; import { cartoonKey, cartoonSpec, nameCardsFor, onScreenCard, planCartoon, timelineFor, wordTimings } from "./montage-cartoon";
const shot = (narration: string, onScreen = "", index = 0) => ({ index, narration, onScreen, visualHint: "" }); const shot = (narration: string, onScreen = "", index = 0) => ({ index, narration, onScreen, visualHint: "" });
@@ -23,8 +23,8 @@ describe("estilo Cartoon: plano por regras", () => {
assert.equal(plan.props?.[0].tone, "danger"); assert.equal(plan.props?.[0].tone, "danger");
}); });
it("texto na tela numérico vira número grande; o resto vira etiqueta; multidão vira silhuetas", () => { it("texto na tela numérico vira cartela de número; o resto vira etiqueta; multidão vira silhuetas", () => {
assert.equal(planCartoon(shot("Um galão de gasolina dura pouco.", "20 L")).texts?.[0].kind, "big"); assert.deepEqual(planCartoon(shot("Um galão de gasolina dura pouco.", "20 L")).texts?.[0], { kind: "stat", text: "", value: "20 L", x: 0.5, y: 0.25, atS: 0.2, size: 0.8 });
const crowd = planCartoon(shot("Já tem dez pessoas no portão da casa acesa.", "Pessoas no portão")); const crowd = planCartoon(shot("Já tem dez pessoas no portão da casa acesa.", "Pessoas no portão"));
assert.equal(crowd.texts?.[0].kind, "tag"); assert.equal(crowd.texts?.[0].kind, "tag");
assert.ok(crowd.actors?.some((a) => a.kind === "crowd")); assert.ok(crowd.actors?.some((a) => a.kind === "crowd"));
@@ -95,3 +95,89 @@ describe("estilo Cartoon: plano por regras", () => {
assert.deepEqual([spec.schemaVersion, spec.width, spec.height, spec.fps, spec.durationS], [1, 1080, 1920, 30, 3]); assert.deepEqual([spec.schemaVersion, spec.width, spec.height, spec.fps, spec.durationS], [1, 1080, 1920, 30, 3]);
}); });
}); });
describe("estilo Cartoon: cartelas de dado e cartão de nome", () => {
it("número curto vira stat com o rótulo antes do número; negativo/perigo em vermelho; cena vazia = tela cheia", () => {
assert.deepEqual(onScreenCard("Na fila: 297", false, false), { kind: "stat", text: "Na fila", value: "297", x: 0.5, y: 0.4, atS: 0.2, panel: true });
assert.deepEqual(onScreenCard("Dívida herdada -R$ 47.312.904", false, true),
{ kind: "stat", text: "Dívida herdada", value: "-R$ 47.312.904", x: 0.5, y: 0.25, atS: 0.2, size: 0.8, tone: "danger" });
assert.equal(onScreenCard("Risco de morte 3", false, false)?.tone, "danger");
assert.equal(onScreenCard("R$ 0", false, false)?.text, "");
assert.equal(onScreenCard("No caixa R$ 0,00", false, false)?.tone, "danger");
assert.equal(onScreenCard("Folha R$ 134.273", false, false)?.tone, undefined);
assert.equal(onScreenCard("Pessoas no portão", false, false), null);
assert.equal(onScreenCard("Em 2019 o clube fechou as portas de vez", false, false), null);
});
it("porcentagem vira barra de progresso; itens com ';' viram lista que se marca", () => {
assert.deepEqual(onScreenCard("Talento 97%", false, true), { kind: "progress", text: "Talento", value: 97, x: 0.5, y: 0.25, atS: 0.2 });
const list = onScreenCard("Funcionários; ✗ Elenco; [ ] Registro; não tem estádio", false, false)!;
assert.equal(list.kind, "checklist");
assert.equal(list.panel, true);
assert.deepEqual(list.items, [{ text: "Funcionários", state: "checked" }, { text: "Elenco", state: "crossed" },
{ text: "Registro", state: "empty" }, { text: "não tem estádio", state: "crossed" }]);
const corner = onScreenCard("Gerador; Gasolina", false, true)!;
assert.ok(corner.size! < 1 && corner.x < 0.35 && corner.y < 0.3 && !corner.panel);
});
it("personagem do elenco no 1º trecho ganha cartão de nome do lado oposto ao rosto (e perde a etiqueta)", () => {
const look = describeToLook("Otávio, 58 anos, engenheiro, careca").look;
const ctx = { cast: [{ id: "otavio", name: "Otávio", caption: "Engenheiro · 58 anos", look }] };
const plan = planCartoon(shot("Otávio olhou o gerador da casa."), ctx);
const card = plan.texts?.find((t) => t.kind === "namecard");
const actor = plan.actors?.find((a) => a.kind === "person");
assert.ok(card && actor && actor.kind === "person");
assert.equal(card.text, "Otávio");
assert.deepEqual(card.lines, ["Engenheiro", "58 anos"]);
assert.ok(actor.x < 0.5 ? card.x > actor.x : card.x < actor.x);
assert.equal(actor.label, "");
// Em outro trecho sem legenda, nada de cartão.
assert.equal(planCartoon(shot("Otávio olhou o gerador da casa.", "", 4), ctx).texts?.some((t) => t.kind === "namecard"), false);
});
it("de perto, o cartão vai na altura do peito, à esquerda; com duas pessoas, acima da cabeça", () => {
const look = describeToLook("Ana, 30 anos").look;
const close = nameCardsFor([{ kind: "person", x: 0.5, y: 0.74, framing: "close", character: { name: "Ana", caption: "Vizinha", look } }], 0);
assert.deepEqual(close.map((c) => [c.x, c.y]), [[0.24, 0.585]]);
const two = nameCardsFor([{ kind: "person", x: 0.3, y: 0.74, character: { name: "Ana", look } }, { kind: "person", x: 0.7, y: 0.74, character: { name: "Bia", look } }], 0);
assert.equal(two.length, 2);
assert.ok(two.every((c) => c.y < 0.3));
});
});
describe("estilo Cartoon: assunto na cena e gestos", () => {
const look = describeToLook("Noé, idoso, barba branca longa, túnica, sandália").look;
const cast = [{ id: "noe", name: "Noé", look }];
const shot2 = (narration: string, visualHint: string, index = 3) => ({ index, narration, onScreen: "", visualHint });
it("gesto no rosto só pela direção de cena: 'imaginar' na narração não põe a mão na boca/queixo", () => {
const tl = timelineFor("Dá para imaginar Noé dizendo aos filhos que a obra ia começar.", 0.5, "Noé fala, determinado");
assert.ok(!tl.some((a) => a.do === "pose" && ["think", "cover_mouth", "facepalm"].includes(String(a.pose))));
const asked = timelineFor("A arca ficou pronta.", 0.5, "Noé pensou, sereno");
assert.ok(asked.some((a) => a.do === "pose" && a.pose === "think"));
});
it("o objeto falado vai para o centro, grande; o personagem fica ao lado", () => {
const plan = planCartoon(shot2("A arca tinha trezentos côvados de comprimento.", "Canteiro da arca em construção, dia; Noé apontou"), { cast });
const ark = plan.place?.elements.find((e) => e.kind === "ark" || e.kind === "ark_frame");
assert.ok(ark && ark.x === 0.5 && (ark.scale ?? 1) >= 1.2);
const noe = plan.actors?.find((a) => a.kind === "person");
assert.ok(noe && noe.kind === "person" && (noe.x < 0.25 || noe.x > 0.75));
assert.equal(noe && noe.kind === "person" ? noe.framing : "", "full");
});
it("dentro da arca: a peça fica ocupada (casco por cima) e o personagem no convés", () => {
const plan = planCartoon(shot2("A família ficou cerca de um ano dentro da arca.", "Arca flutuando no mar sem fim; Noé sentou, sereno"), { cast });
const ark = plan.place?.elements.find((e) => e.kind === "ark");
assert.equal(ark?.occupied, true);
const noe = plan.actors?.find((a) => a.kind === "person");
assert.ok(noe && noe.kind === "person" && Math.abs(noe.x - 0.5) < 0.2 && (noe.scale ?? 1) < 0.8);
});
it("bicho falado vai para o centro e o personagem para o canto", () => {
const plan = planCartoon(shot2("Depois vieram os animais, um casal de cada espécie.", "Arca pronta em terra firme; Noé acenou"), { cast });
assert.ok(plan.actors?.some((a) => a.kind === "animal"));
const noe = plan.actors?.find((a) => a.kind === "person");
assert.ok(noe && noe.kind === "person" && (noe.x < 0.25 || noe.x > 0.75));
});
});
+431 -70
View File
@@ -31,6 +31,11 @@ const norm = (s: string) => s.normalize("NFD").replace(/[̀-ͯ]/g, "").toLowerCa
/** Palavra do texto → objeto na cena (e etiqueta). A ordem é a prioridade. */ /** Palavra do texto → objeto na cena (e etiqueta). A ordem é a prioridade. */
const ICON_RULES: [RegExp, CartoonIcon, string][] = [ const ICON_RULES: [RegExp, CartoonIcon, string][] = [
[/ramo de oliveira|folha de oliveira|\boliveira/, "olive", "Oliveira"],
[/\bmartel/, "hammer", "Martelo"],
[/tabua de argila|tablete de argila|placa de argila/, "tablet", "Tábua de argila"],
[/biblia aberta|pergaminho|\blivro\b|escrituras/, "book", "Escritura"],
[/regua|\bcovados?\b|fita metrica|\bmedida\b/, "ruler", "Medida"],
[/\bgerador/, "generator", "Gerador"], [/\bgerador/, "generator", "Gerador"],
[/gasolina|combustivel|diesel|galao/, "fuel", "Combustível"], [/gasolina|combustivel|diesel|galao/, "fuel", "Combustível"],
[/bateria/, "battery", "Bateria"], [/bateria/, "battery", "Bateria"],
@@ -41,7 +46,7 @@ const ICON_RULES: [RegExp, CartoonIcon, string][] = [
[/lanterna|lampada|\bluz\b|acesa|aceso/, "bulb", "Luz"], [/lanterna|lampada|\bluz\b|acesa|aceso/, "bulb", "Luz"],
[/\bhoras?\b|minutos?\b|relogio/, "clock", "Tempo"], [/\bhoras?\b|minutos?\b|relogio/, "clock", "Tempo"],
[/perigo|cuidado|risco|veneno|\bmata\b|morte|morre/, "warning", "Perigo"], [/perigo|cuidado|risco|veneno|\bmata\b|morte|morre/, "warning", "Perigo"],
[/\bver\b|olho|vigia|observ|enxerg|ninguem precisa ver/, "eye", "Olho"], [/\bver\b|\bolhos?\b|vigia|observ|enxerg|ninguem precisa ver/, "eye", "Olho"],
]; ];
const DANGER = /\b(nunca|perigo|mata|morte|morre|morrer|risco|cuidado|proibido|veneno|alvo|visad\w*|ataque|roub\w*)\b/; const DANGER = /\b(nunca|perigo|mata|morte|morre|morrer|risco|cuidado|proibido|veneno|alvo|visad\w*|ataque|roub\w*)\b/;
const SOUNDS: [RegExp, string][] = [ const SOUNDS: [RegExp, string][] = [
@@ -55,33 +60,92 @@ const SOUNDS: [RegExp, string][] = [
const OUTFITS = ["#9b7be0", "#f2c230", "#4fb0e8", "#e86a5c", "#5cc48a"]; const OUTFITS = ["#9b7be0", "#f2c230", "#4fb0e8", "#e86a5c", "#5cc48a"];
type El = Place["elements"][number]; type El = Place["elements"][number];
/** Lugares reconhecidos pelo texto → chão, interno?, névoa, paleta sugerida e peças (posições variam pela semente). */ /** Peça do lugar: só o tipo (posição pela semente, longe do centro) ou já posicionada (arca, arco-íris…). */
const LOCATIONS: { re: RegExp; ground: Place["ground"]; indoor?: boolean; fog?: boolean; palette?: PaletteId; light?: ShotSpec["light"]; pieces: El["kind"][] }[] = [ type Piece = El["kind"] | El;
type Location = {
re: RegExp; ground: Place["ground"]; indoor?: boolean; fog?: boolean; horizon?: number;
palette?: PaletteId;
/** A paleta do lugar vence a paleta da série (tempestade é cinza, arco-íris no entardecer). */
override?: boolean;
light?: ShotSpec["light"];
weather?: Place["weather"];
flood?: Place["flood"];
pieces: Piece[];
/** Ajuste pelo texto (ex.: "tempestade" troca chuva por tempestade; "noite" escurece). */
adjust?: (text: string) => Partial<Pick<Location, "weather" | "palette" | "flood">> & { extra?: Piece[] };
};
const ARK_X = 0.6;
/** Lugares reconhecidos pelo texto (a ordem é a prioridade) → chão, clima, água, paleta e peças. */
const LOCATIONS: Location[] = [
{ re: /\bmuseu|exposicao|vitrine/, ground: "floor", indoor: true, palette: "sepia", override: true, light: "spot", pieces: ["shelf", "window", "shelf", "frame", "frame", { kind: "pendant", x: 0.5, z: 0.45 }] },
// Dilúvio: chove forte e a água sobe; a arca boia e balança; casa e árvore ficam embaixo d'água.
{ re: /diluvio|aguas? subi|enchente|inunda/, ground: "water", palette: "gray", override: true, weather: "storm", flood: { from: 0.8, to: 0.5 },
pieces: [{ kind: "ark", x: 0.5, z: 0.4, float: true }, { kind: "house", x: 0.14, z: 0.3 }, { kind: "tree", x: 0.86, z: 0.3 }, { kind: "mountain", x: 0.62, z: 0.96 }],
adjust: (t) => (/\bnoite\b/.test(t) ? { palette: "night" } : {}) },
{ re: /\bchuva|\bchov|tempestade|temporal|trovoad/, ground: "grass", palette: "gray", override: true, weather: "rain",
pieces: [{ kind: "ark", x: ARK_X, z: 0.55, scale: 1.1 }, "cloud", "palm", "cloud", "bush"],
adjust: (t) => ({ ...(/tempestade|temporal|trovoad|\braio/.test(t) ? { weather: "storm" as const } : {}), ...(/\bnoite\b/.test(t) ? { palette: "night" as const } : {}) }) },
// Mar sem fim: a água fica parada na linha do horizonte e o barco boia nela.
{ re: /mar sem fim|alto mar|\bflutua|boiando|navega|a deriva|no mar\b/, ground: "water", horizon: 0.5, flood: { from: 0.55, to: 0.55 },
pieces: [{ kind: "ark", x: 0.5, z: 0.4, float: true, scale: 1.05 }, { kind: "waves", x: 0.2, z: 0.08 }, { kind: "waves", x: 0.85, z: 0.12, flip: true }, "cloud", "cloud"] },
// Barco pousado no monte: a água ainda em volta, baixando.
{ re: /pousad\w* no monte|pousou|montes? de ararat|encalh/, ground: "dirt", flood: { from: 0.66, to: 0.72 },
pieces: [{ kind: "mountain", x: 0.5, z: 0.82, scale: 1.35 }, { kind: "mountain", x: 0.1, z: 0.96 }, { kind: "mountain", x: 0.92, z: 0.95 },
{ kind: "ark", x: 0.46, z: 0.82, scale: 0.8, lift: 0.1 }, "cloud"] },
{ re: /montanha na turquia|monte ararat|\bexpedic|cordilheira/, ground: "dirt",
pieces: [{ kind: "mountain", x: 0.5, z: 0.9, scale: 1.4 }, { kind: "mountain", x: 0.12, z: 0.96 }, "rock", "rock", "cloud"],
adjust: (t) => (/forma de barco|formacao (de )?roch|afloramento/.test(t) ? { extra: [{ kind: "outcrop", x: 0.5, z: 0.35, scale: 1.2 }] } : {}) },
{ re: /arco-?\s?iris/, ground: "grass", palette: "dusk", override: true,
pieces: [{ kind: "rainbow", x: 0.5, z: 0.97, scale: 2.3 }, { kind: "mountain", x: 0.2, z: 0.95 }, { kind: "mountain", x: 0.85, z: 0.94 },
{ kind: "ark", x: 0.78, z: 0.8, scale: 0.6 }, "palm", "bush"] },
// Canteiro de obra de um barco: casco em construção (costelas), andaime e tábuas empilhadas.
{ re: /em construcao|canteiro|construindo|andaime|estaleiro/, ground: "dirt",
pieces: [{ kind: "ark_frame", x: 0.55, z: 0.62, scale: 1.2 }, { kind: "scaffold", x: 0.16, z: 0.5 }, { kind: "planks", x: 0.84, z: 0.22 },
{ kind: "palm", x: 0.94, z: 0.75 }, { kind: "mountain", x: 0.3, z: 0.97 }, "cloud"] },
{ re: /arca pronta|arca em terra|barco em terra|entrando na arca|entram na arca|entraram na arca|\barca\b|\bbarco grande/, ground: "grass",
pieces: [{ kind: "ark", x: ARK_X, z: 0.55, scale: 1.2 }, { kind: "palm", x: 0.07, z: 0.6 }, { kind: "palm", x: 0.95, z: 0.78 }, { kind: "mountain", x: 0.3, z: 0.97 }, "cloud"] },
// Lugar antigo: casas de barro, palmeiras e tendas (sem poste, carro nem prédio).
{ re: /vilarejo|aldeia|povoado|cidade antiga|casas simples|tempos antigos/, ground: "dirt",
pieces: [{ kind: "house", x: 0.12, z: 0.45, color: "#d8b88a" }, { kind: "house", x: 0.86, z: 0.6, color: "#c9a576", flip: true }, "palm", "tent", "palm", "mountain", { kind: "wall", x: 0.5, z: 0.8, color: "#d8b88a" }] },
{ re: /campo aberto|planicie|pasto|campina/, ground: "grass", pieces: ["palm", "bush", "mountain", "cloud", "tree", "rock"] },
{ re: /cemiterio|tumulo|enterr|velorio/, ground: "dirt", fog: true, palette: "dusk", light: "vignette", pieces: ["gravestone", "gravestone", "cross", "deadtree", "fence", "gravestone"] }, { re: /cemiterio|tumulo|enterr|velorio/, ground: "dirt", fog: true, palette: "dusk", light: "vignette", pieces: ["gravestone", "gravestone", "cross", "deadtree", "fence", "gravestone"] },
{ re: /bunker|porao|abrigo|subsolo|esconderijo/, ground: "floor", indoor: true, palette: "sepia", light: "spot", pieces: ["shelf", "crate", "crate", "door"] }, { re: /bunker|porao|abrigo|subsolo|esconderijo/, ground: "floor", indoor: true, palette: "sepia", light: "spot", pieces: ["shelf", "crate", "crate", "door", "cabinet", { kind: "pendant", x: 0.5, z: 0.45 }] },
{ re: /hospital|consultorio|escritorio|delegacia|escola|sala de aula/, ground: "floor", indoor: true, pieces: ["window", "table", "door", "shelf"] }, { re: /hospital|consultorio|escritorio|delegacia|escola|sala de aula/, ground: "floor", indoor: true, pieces: ["window", "table", "door", "shelf", "cabinet", "frame"] },
{ re: /\b(casa|sala|quarto|cozinha|apartamento)\b/, ground: "floor", indoor: true, pieces: ["window", "table", "shelf", "door", "bed"] }, { re: /\b(casa|sala|quarto|cozinha|apartamento)\b/, ground: "floor", indoor: true, pieces: ["window", "table", "shelf", "door", "bed", "frame", { kind: "pendant", x: 0.5, z: 0.45 }] },
{ re: /parque|praca|jardim/, ground: "grass", pieces: ["tree", "tree", "bench", "lamp", "bush", "cloud", "building", "pine"] }, { re: /parque|praca|jardim/, ground: "grass", pieces: ["tree", "tree", "bench", "lamp", "bush", "cloud", "building", "pine"] },
{ re: /floresta|mata\b|trilha|bosque|selva/, ground: "grass", pieces: ["pine", "pine", "tree", "rock", "bush", "pine", "mountain"] }, { re: /floresta|mata\b|trilha|bosque|selva/, ground: "grass", pieces: ["pine", "pine", "tree", "rock", "bush", "pine", "mountain"] },
{ re: /acampamento|fogueira|barraca/, ground: "grass", pieces: ["tent", "fire", "pine", "pine", "rock"] }, { re: /acampamento|fogueira|barraca/, ground: "grass", pieces: ["tent", "fire", "pine", "pine", "rock"] },
{ re: /praia|litoral|areia|\bmar\b/, ground: "sand", pieces: ["rock", "cloud", "cloud", "rock"] }, { re: /praia|litoral|areia|\bmar\b/, ground: "sand", pieces: ["rock", "cloud", "cloud", "rock"] },
{ re: /sitio|fazenda|roca|campo\b|interior/, ground: "grass", pieces: ["house", "fence", "tree", "mountain", "bush", "cloud"] }, { re: /sitio|fazenda|roca|campo\b|interior/, ground: "grass", pieces: ["house", "fence", "tree", "mountain", "bush", "cloud", "clothesline"] },
{ re: /\b(rua|cidade|bairro|avenida|estrada|transito|vizinh)\w*/, ground: "street", pieces: ["building", "building", "lamp", "house", "car", "sign"] }, { re: /\b(rua|cidade|bairro|avenida|estrada|transito|vizinh)\w*/, ground: "street", pieces: ["building", "building", "lamp", "house", "car", "sign", "shopfront"] },
]; ];
/** Monta o lugar: peças espalhadas pela semente, longe do centro (onde fica o personagem). */ type Built = { place: Place; palette?: PaletteId; override?: boolean; light?: ShotSpec["light"] };
function placeFor(text: string, seed: number, variant: number): { place: Place; palette?: PaletteId; light?: ShotSpec["light"] } | null { /** Monta o lugar: peças soltas espalhadas pela semente, longe do centro (onde fica o personagem); peças já
* posicionadas ficam onde a regra mandou. */
function placeFor(text: string, seed: number, variant: number): Built | null {
const loc = LOCATIONS.find((l) => l.re.test(text)); const loc = LOCATIONS.find((l) => l.re.test(text));
if (!loc) return null; if (!loc) return null;
const tuned = loc.adjust?.(text) ?? {};
let a = (seed * 9301 + 49297 + variant * 233) % 233280; let a = (seed * 9301 + 49297 + variant * 233) % 233280;
const rand = () => (a = (a * 9301 + 49297) % 233280) / 233280; const rand = () => (a = (a * 9301 + 49297) % 233280) / 233280;
const slots = [0.12, 0.88, 0.25, 0.75, 0.06, 0.94, 0.4, 0.62]; const slots = [0.12, 0.88, 0.25, 0.75, 0.06, 0.94, 0.4, 0.62];
const elements: El[] = loc.pieces.map((kind, i) => ({ let n = 0;
kind, x: slots[(i + variant) % slots.length] + (rand() - 0.5) * 0.06, const elements: El[] = [...loc.pieces, ...(tuned.extra ?? [])].map((p) => {
z: kind === "mountain" || kind === "building" ? 0.95 : kind === "cloud" ? 0.3 + rand() * 0.4 : 0.25 + rand() * 0.6, if (typeof p !== "string") return { ...p, x: p.x + (variant % 2 ? 0.03 : 0) };
flip: rand() > 0.5, const kind = p;
})); return {
return { place: { ground: loc.ground, indoor: loc.indoor, fog: loc.fog, elements }, palette: loc.palette, light: loc.light }; kind, x: slots[(n++ + variant) % slots.length] + (rand() - 0.5) * 0.06,
z: kind === "mountain" || kind === "building" ? 0.95 : kind === "cloud" ? 0.3 + rand() * 0.4 : 0.25 + rand() * 0.6,
flip: rand() > 0.5,
};
});
const weather = tuned.weather ?? loc.weather;
const flood = tuned.flood ?? loc.flood;
return {
place: { ground: loc.ground, indoor: loc.indoor, fog: loc.fog, ...(loc.horizon ? { horizon: loc.horizon } : {}), ...(weather ? { weather } : {}), ...(flood ? { flood } : {}), elements },
palette: tuned.palette ?? loc.palette, override: loc.override || !!tuned.palette, light: loc.light,
};
} }
function expressionOf(text: string): Expression { function expressionOf(text: string): Expression {
@@ -91,6 +155,8 @@ function expressionOf(text: string): Expression {
if (/\b(trist|chor|perdeu|saudade|sozinh)\w*/.test(text)) return "sad"; if (/\b(trist|chor|perdeu|saudade|sozinh)\w*/.test(text)) return "sad";
if (DANGER.test(text) || /\b(preocup|problema|nervos|ansios)\w*/.test(text)) return "worried"; if (DANGER.test(text) || /\b(preocup|problema|nervos|ansios)\w*/.test(text)) return "worried";
if (/\b(feliz|alegr|comemor|sorri|riu|rindo|venceu|conseguiu)\w*/.test(text)) return "happy"; if (/\b(feliz|alegr|comemor|sorri|riu|rindo|venceu|conseguiu)\w*/.test(text)) return "happy";
if (/\b(determinad|decidid|firme)\w*/.test(text)) return "determined";
if (/\b(seren|calm|aliviad|em paz)\w*/.test(text)) return "smile";
return "neutral"; return "neutral";
} }
@@ -102,27 +168,35 @@ function cueOf(text: string, re: RegExp): string | null {
} }
/** Verbos e emoções do texto → linha do tempo do personagem (cada ação começa na palavra que a provocou). */ /** Verbos e emoções do texto → linha do tempo do personagem (cada ação começa na palavra que a provocou). */
const MOVES: { re: RegExp; act: (cue: string, x: number) => Action[] }[] = [ // `face: true` = gesto com a mão no rosto (pensar, tapar a boca, mão na testa). REGRA: só entra quando a direção
{ re: /\b(andou|caminhou|foi ate|se aproximou|chegou perto)\b/, act: (cue, x) => [{ do: "walk", cue, to: x < 0.5 ? x + 0.2 : x - 0.2 }] }, // de cena (coluna Imagem) pede com todas as letras — palavra solta da narração ("imaginar", "lembrar", "riu")
// não põe a mão no rosto. Riso é expressão + corpo quicando, nunca mão na boca.
const MOVES: { re: RegExp; act: (cue: string, x: number) => Action[]; face?: boolean }[] = [
{ re: /\b(andou|caminhou|caminharam|foi ate|se aproximou|chegou perto)\b/, act: (cue, x) => [{ do: "walk", cue, to: x < 0.5 ? x + 0.2 : x - 0.2 }] },
{ re: /\b(entra|entram|entrou|entraram) na (arca|casa|barca|caverna)\b/, act: (cue, x) => [{ do: "walk", cue, to: Math.min(0.92, x + 0.14), dur: 2.4 }] },
{ re: /\b(correu|fugiu|disparou|saiu correndo)\b/, act: (cue, x) => [{ do: "run", cue, to: x < 0.5 ? x + 0.3 : x - 0.3 }] }, { re: /\b(correu|fugiu|disparou|saiu correndo)\b/, act: (cue, x) => [{ do: "run", cue, to: x < 0.5 ? x + 0.3 : x - 0.3 }] },
{ re: /\b(pulou|saltou)\b/, act: (cue) => [{ do: "jump", cue }] }, { re: /\b(pulou|saltou)\b/, act: (cue) => [{ do: "jump", cue }] },
{ re: /\b(caiu|desmaiou|tropecou|despencou)\b/, act: (cue) => [{ do: "fall", cue }] }, { re: /\b(caiu|desmaiou|tropecou|despencou)\b/, act: (cue) => [{ do: "fall", cue }] },
{ re: /\b(sentou|se sentou)\b/, act: (cue) => [{ do: "sit", cue }] }, { re: /\b(sentou|se sentou|sentaram)\b/, act: (cue) => [{ do: "sit", cue }] },
{ re: /\b(levantou|se levantou|ficou de pe)\b/, act: (cue) => [{ do: "stand_up", cue }] }, { re: /\b(levantou|se levantou|ficou de pe)\b/, act: (cue) => [{ do: "stand_up", cue }] },
{ re: /\b(ajoelhou|ajoelharam|orou|oraram|rezou|rezando|orando)\b/, act: (cue) => [{ do: "pose", cue, pose: "kneel" }, { do: "look", cue, dir: "up" }] },
{ re: /\b(martelando|martelou|martelava|pregando)\b/, act: (cue) => [{ do: "hammer", cue, dur: 2.6 }] },
{ re: /\b(balancou a cabeca|negou|disse que nao)\b/, act: (cue) => [{ do: "shake_head", cue }] }, { re: /\b(balancou a cabeca|negou|disse que nao)\b/, act: (cue) => [{ do: "shake_head", cue }] },
{ re: /\b(concordou|assentiu|acenou com a cabeca)\b/, act: (cue) => [{ do: "nod", cue }] }, { re: /\b(concordou|assentiu|acenou com a cabeca)\b/, act: (cue) => [{ do: "nod", cue }] },
{ re: /\b(tremia|tremeu|tremendo|arrepiou|arrepio)\b/, act: (cue) => [{ do: "tremble", cue, dur: 1.4 }] }, { re: /\b(tremia|tremeu|tremendo|arrepiou|arrepio)\b/, act: (cue) => [{ do: "tremble", cue, dur: 1.4 }] },
{ re: /\b(riu|gargalhou|caiu na risada|rindo)\b/, act: (cue) => [{ do: "express", cue, expression: "laugh" }, { do: "bounce", cue, times: 3 }] }, { re: /\b(riu|gargalhou|caiu na risada|rindo)\b/, act: (cue) => [{ do: "express", cue, expression: "laugh" }, { do: "bounce", cue, times: 3 }] },
{ re: /\b(chorou|chorando|lagrimas)\b/, act: (cue) => [{ do: "express", cue, expression: "cry" }] }, { re: /\b(chorou|chorando|lagrimas)\b/, act: (cue) => [{ do: "express", cue, expression: "cry" }] },
{ re: /\b(olhou para os lados|olhou em volta|procurou)\b/, act: (cue) => [{ do: "look", cue, dir: "left" }, { do: "shake_head", cue, times: 1, dur: 1.2 }] }, { re: /\b(olhou para os lados|olhou em volta|olharam em volta|procurou)\b/, act: (cue) => [{ do: "look", cue, dir: "left" }, { do: "shake_head", cue, times: 1, dur: 1.2 }] },
{ re: /\b(olhou para cima|olhou pro ceu)\b/, act: (cue) => [{ do: "look", cue, dir: "up" }] }, { re: /\b(olhou para cima|olhou pro ceu|olhou para o ceu|olharam para o ceu)\b/, act: (cue) => [{ do: "look", cue, dir: "up" }] },
{ re: /\b(virou|deu as costas)\b/, act: (cue) => [{ do: "turn", cue }] }, { re: /\b(virou|deu as costas)\b/, act: (cue) => [{ do: "turn", cue }] },
{ re: /\b(pensou|lembrou|imaginou|calculou|planejou)\b/, act: (cue) => [{ do: "pose", cue, pose: "think" }] }, { re: /\b(pensou|pensaram|pensativo|pensativa|mao no queixo)\b/, act: (cue) => [{ do: "pose", cue, pose: "think" }], face: true },
{ re: /\b(acenou|tchau|chamou)\b/, act: (cue) => [{ do: "wave", cue }] }, { re: /\b(tapou a boca|mao na boca|cobriu a boca|tapando a boca)\b/, act: (cue) => [{ do: "pose", cue, pose: "cover_mouth" }], face: true },
{ re: /\b(acenou|acenaram|tchau|chamou)\b/, act: (cue) => [{ do: "wave", cue }] },
{ re: /\b(apontou|mostrou)\b/, act: (cue) => [{ do: "pose", cue, pose: "point" }] }, { re: /\b(apontou|mostrou)\b/, act: (cue) => [{ do: "pose", cue, pose: "point" }] },
{ re: /\b(segurou|segurava|ergueu)\b/, act: (cue) => [{ do: "pose", cue, pose: "hold" }] },
{ re: /\b(cruzou os bracos)\b/, act: (cue) => [{ do: "pose", cue, pose: "cross_arms" }] }, { re: /\b(cruzou os bracos)\b/, act: (cue) => [{ do: "pose", cue, pose: "cross_arms" }] },
{ re: /\b(desesper|mao na cabeca|nao acreditou)\w*/, act: (cue) => [{ do: "pose", cue, pose: "facepalm" }] }, { re: /\b(mao na testa|mao na cabeca|desesperou|desesperado|desesperada)\b/, act: (cue) => [{ do: "pose", cue, pose: "facepalm" }], face: true },
{ re: /\b(comemorou|vibrou|venceu|conseguiu)\b/, act: (cue) => [{ do: "pose", cue, pose: "celebrate" }, { do: "bounce", cue, times: 2 }] }, { re: /\b(comemor\w*|vibrou|vibraram|venceu|conseguiu)\b/, act: (cue) => [{ do: "pose", cue, pose: "celebrate" }, { do: "bounce", cue, times: 2 }] },
{ re: /\b(de repente|susto|assustou)\b/, act: (cue) => [{ do: "emote", cue, text: "!" }] }, { re: /\b(de repente|susto|assustou)\b/, act: (cue) => [{ do: "emote", cue, text: "!" }] },
{ re: /\b(por que|sera que|duvida|estranh)\w*/, act: (cue) => [{ do: "emote", cue, text: "?" }] }, { re: /\b(por que|sera que|duvida|estranh)\w*/, act: (cue) => [{ do: "emote", cue, text: "?" }] },
]; ];
@@ -134,7 +208,9 @@ const EMOTIONS: { re: RegExp; expression: Expression }[] = [
{ re: /\b(trist|perdeu|saudade|sozinh)\w*/, expression: "sad" }, { re: /\b(trist|perdeu|saudade|sozinh)\w*/, expression: "sad" },
{ re: /\b(preocup|problema|nervos|ansios)\w*/, expression: "worried" }, { re: /\b(preocup|problema|nervos|ansios)\w*/, expression: "worried" },
{ re: /\b(desconfi|suspeit)\w*/, expression: "suspicious" }, { re: /\b(desconfi|suspeit)\w*/, expression: "suspicious" },
{ re: /\b(feliz|alegr|sorri)\w*/, expression: "happy" }, { re: /\b(feliz|felizes|alegr|sorri)\w*/, expression: "happy" },
{ re: /\b(determinad|decidid)\w*/, expression: "determined" },
{ re: /\b(aliviad|seren|calm)\w*/, expression: "smile" },
]; ];
/** Fala entre aspas ou depois de travessão: [1ª palavra, última palavra, texto] (normalizados). */ /** Fala entre aspas ou depois de travessão: [1ª palavra, última palavra, texto] (normalizados). */
@@ -146,17 +222,27 @@ function quoteOf(original: string): { first: string; last: string; text: string
return ws.length ? { first: ws[0], last: ws[ws.length - 1], text: said } : null; return ws.length ? { first: ws[0], last: ws[ws.length - 1], text: said } : null;
} }
/** Linha do tempo do personagem principal do trecho: emoção na palavra, verbos viram movimento, fala na boca. */ /**
export function timelineFor(original: string, x: number): Action[] { * Linha do tempo do personagem principal do trecho: emoção na palavra, verbos viram movimento, fala na boca.
* `hint` = coluna Imagem (direção de cena): o que ela pede e a narração não diz entra em ORDEM ao longo do
* trecho (posição no texto → fração do trecho), já que essas palavras não são faladas.
*/
export function timelineFor(original: string, x: number, hint = ""): Action[] {
const text = norm(original); const text = norm(original);
const h = norm(hint);
const at = (re: RegExp) => { const i = h.search(re); return Math.round((0.06 + 0.7 * (i / Math.max(1, h.length))) * 100) / 100; };
const out: Action[] = []; const out: Action[] = [];
for (const e of EMOTIONS) { const emotion = EMOTIONS.find((e) => cueOf(text, e.re));
const cue = cueOf(text, e.re); if (emotion) out.push({ do: "express", cue: cueOf(text, emotion.re)!, expression: emotion.expression });
if (cue) { out.push({ do: "express", cue, expression: e.expression }); break; } else {
const first = EMOTIONS.map((e) => ({ e, i: h.search(e.re) })).filter((p) => p.i >= 0).sort((p, q) => p.i - q.i)[0];
if (first) out.push({ do: "express", atP: Math.max(0.04, at(first.e.re) - 0.04), expression: first.e.expression });
} }
for (const m of MOVES) { for (const m of MOVES) {
const cue = cueOf(text, m.re); // Gesto no rosto: nunca pela narração, só pela direção de cena (hint).
const cue = m.face ? null : cueOf(text, m.re);
if (cue) out.push(...m.act(cue, x)); if (cue) out.push(...m.act(cue, x));
else if (h && m.re.test(h)) out.push(...m.act("", x).map((a) => ({ ...a, cue: undefined, atP: at(m.re) })));
} }
const quote = quoteOf(original); const quote = quoteOf(original);
if (quote) out.push({ do: "talk", cue: quote.first, cueEnd: quote.last, text: quote.text }); if (quote) out.push({ do: "talk", cue: quote.first, cueEnd: quote.last, text: quote.text });
@@ -166,25 +252,146 @@ export function timelineFor(original: string, x: number): Action[] {
function poseOf(text: string, hasProp: boolean): Pose { function poseOf(text: string, hasProp: boolean): Pose {
if (/acen|tchau|chamou/.test(text)) return "wave"; if (/acen|tchau|chamou/.test(text)) return "wave";
if (/comemor|venceu|gritou de alegria/.test(text)) return "arms_up"; if (/comemor|venceu|gritou de alegria/.test(text)) return "arms_up";
if (/pens|lembr|imagin|calcul|planej/.test(text)) return "think"; // Mão no queixo só com pedido explícito (ver a regra dos gestos no rosto em MOVES).
if (/\b(pensou|pensaram|pensativo|pensativa|mao no queixo)\b/.test(text)) return "think";
if (/nao sabe|sem saber|nao entend/.test(text)) return "shrug"; if (/nao sabe|sem saber|nao entend/.test(text)) return "shrug";
return hasProp ? "point" : "stand"; return hasProp ? "point" : "stand";
} }
type AnimalActor = Extract<NonNullable<ShotSpec["actors"]>[number], { kind: "animal" }>;
type Species = AnimalActor["species"];
/** Bichos citados (palavra → espécie); "animais/bichos" sem espécie vira um grupo variado. Grandes primeiro (vão atrás). */
const SPECIES_WORDS: [RegExp, Species][] = [
[/\belefantes?\b/, "elephant"], [/\bgirafas?\b/, "giraffe"], [/\bcamelos?\b/, "camel"], [/\bcavalos?\b|\begu[ao]s?\b/, "horse"],
[/\bleao\b|\bleoes\b|\bleoa/, "lion"], [/\bovelhas?\b|\bcarneir\w*|\bcordeir\w*/, "sheep"],
[/\bpombas?\b/, "dove"], [/\bcorvos?\b/, "raven"],
];
const FLYERS: Species[] = ["dove", "raven"];
/** Animais do trecho: aves voando pelo céu (pomba com ramo, se o texto falar de oliveira); bichos de chão em
* casal, parados ou em fila andando até o barco ("fila", "entrando"). */
function animalsFor(text: string, arkX: number | null): AnimalActor[] {
let species = SPECIES_WORDS.filter(([re]) => re.test(text)).map(([, s]) => s);
if (!species.some((s) => !FLYERS.includes(s)) && /\b(animais|bichos|casal de cada|bicharada)\b/.test(text)) {
species = [...new Set<Species>(["elephant", "giraffe", "lion", "sheep", ...species])];
}
const out: AnimalActor[] = [];
const birds = species.filter((s) => FLYERS.includes(s)).slice(0, 2);
birds.forEach((s, i) => {
const toRight = i === 0;
out.push({ kind: "animal", species: s, x: toRight ? 0.06 : 0.94, y: 0.3 + i * 0.08, scale: 2.4, fly: true,
walk: { to: toRight ? 0.82 : 0.32 }, ...(s === "dove" && /oliveira|\bramo\b|\bfolha/.test(text) ? { carry: "olive" as const } : {}) });
});
const ground = species.filter((s) => !FLYERS.includes(s)).slice(0, 4);
const pair = /\b(casal|casais|pares|par|dois de cada|macho e femea)\b/.test(text) || /\b(animais|fila)\b/.test(text);
const line = /\b(fila|entrando|entram|entraram|marchando|em direcao)\b/.test(text);
ground.forEach((s, i) => {
if (line) {
const target = (arkX ?? 0.6) - 0.06 - i * 0.1;
out.push({ kind: "animal", species: s, x: target - 0.42, y: Math.min(0.97, 0.76 + i * 0.06), pair, walk: { to: target, startS: i * 0.25 } });
} else {
const slots = [[0.26, 0.82], [0.74, 0.86], [0.5, 0.95], [0.18, 0.97]];
out.push({ kind: "animal", species: s, x: slots[i][0], y: slots[i][1], pair, flip: slots[i][0] > 0.5 });
}
});
return out;
}
/** Peças que podem ser o ASSUNTO falado (palavra → peça). A arca aceita a versão em construção como ela mesma. */
const FOCUS_ELEMENTS: [RegExp, El["kind"]][] = [
[/\b(arca|barco|barca|navio|embarcacao|bote)\b/, "ark"],
[/\b(carro|caminhao|onibus|automovel|caminhonete|carroca)\b/, "car"],
[/\barco-?\s?iris\b/, "rainbow"],
[/\b(arvore|arvores)\b/, "tree"],
[/\b(fogueira)\b/, "fire"],
[/\b(barraca|tenda)\b/, "tent"],
];
const FOCUS_ANIMALS = /\b(animais|bichos|aves|pombas?|corvos?|elefantes?|girafas?|leao|leoes|ovelhas?|cavalos?|camelos?)\b/;
type Focus = { kind: "element"; element: El["kind"] } | { kind: "animal" };
/** O assunto do trecho: o 1º objeto ou bicho citado na NARRAÇÃO (é do que o vídeo está falando naquele momento);
* sem nenhum, uma peça citada na coluna Imagem. */
function focusOf(narration: string, direction: string): Focus | null {
const hits: { at: number; f: Focus }[] = [];
for (const [re, element] of FOCUS_ELEMENTS) { const at = narration.search(re); if (at >= 0) hits.push({ at, f: { kind: "element", element } }); }
const a = narration.search(FOCUS_ANIMALS);
if (a >= 0) hits.push({ at: a, f: { kind: "animal" } });
if (hits.length) return hits.sort((p, q) => p.at - q.at)[0].f;
for (const [re, element] of FOCUS_ELEMENTS) if (re.test(direction)) return { kind: "element", element };
return null;
}
const INSIDE = /\b(dentro d[aoe]|a bordo|embarc\w*|entr(a|am|ou|aram) n[ao] (arca|barco|barca|navio|carro|onibus)|n[ao] (arca|barco|carro) (com|por|durante))\b/;
/**
* Põe o assunto no centro, grande, e devolve onde ficam os `n` personagens: ao lado (cantos) ou DENTRO da peça
* (no convés da arca / atrás da lataria do carro, com a parte da frente desenhada por cima — `occupied`).
* Medidas iguais às do layout do cartoon (horizonte 0,56; frente 0,72; escala = scale × (1 − z·0,62) × 1,15).
*/
function stageFocus(place: Place, focus: Focus, text: string, n: number): { xs: number[]; ys: number[]; scale: number } | null {
const side = (count: number) => ({ xs: Array.from({ length: count }, (_, i) => (i % 2 === 0 ? 0.15 : 0.85) + (i > 1 ? (i % 2 === 0 ? 0.1 : -0.1) : 0)), ys: Array.from({ length: count }, (_, i) => 0.8 + (i > 1 ? 0.03 : 0)), scale: count > 2 ? 0.6 : 0.72 });
if (focus.kind === "animal") return n ? side(n) : null;
const family: El["kind"][] = focus.element === "ark" ? ["ark", "ark_frame"] : [focus.element];
let el = place.elements.find((e) => family.includes(e.kind));
if (!el) {
if (place.indoor) return null;
el = { kind: focus.element === "ark" && /constru/.test(text) && !/pronta/.test(text) ? "ark_frame" : focus.element, x: 0.5, z: 0.4 };
place.elements.push(el);
}
if (el.kind === "rainbow") return n ? side(n) : null;
el.x = 0.5;
const occupiable = el.kind === "ark" || el.kind === "car";
const inside = occupiable && n > 0 && (INSIDE.test(text) || (el.kind === "ark" && place.ground === "water"));
if (!inside) {
if (!el.lift) el.z = Math.min(el.z ?? 0.4, 0.42);
el.scale = Math.max(el.scale ?? 1, el.kind === "ark" || el.kind === "ark_frame" ? 1.2 : 1.3);
return n ? side(n) : null;
}
// Dentro: a peça vem para a frente e os personagens ficam no convés, da cintura para cima.
el.occupied = true;
el.z = el.lift ? el.z : 0.12;
el.scale = el.kind === "car" ? 0.95 : 1.05;
const H = 1920;
const horizon = (place.horizon ?? 0.56) * H;
const s = el.scale * (1 - (el.z ?? 0.3) * 0.62) * 1.15;
let baseY = horizon + (1 - (el.z ?? 0.3)) * (H * 0.72 - horizon) - (el.lift ?? 0) * H;
if (el.float && place.flood) {
// Com gente dentro, a água fica parada no nível final (o convés não pode fugir de quem está nele).
place.flood = { from: place.flood.to, to: place.flood.to };
baseY = place.flood.to * H + H * 0.035;
}
const deck = baseY - (el.kind === "car" ? 112 * 2.5 : 150) * s;
const scale = n >= 4 ? 0.5 : n === 3 ? 0.56 : 0.66;
// Pés escondidos atrás do casco: o quadril fica na linha do convés.
const feet = (deck + 0.3 * 0.52 * scale * H) / H;
const half = ((el.kind === "car" ? 300 : 330) * s) / 1080;
const xs = Array.from({ length: n }, (_, i) => (n === 1 ? 0.5 - half * 0.25 : 0.5 - half * 0.7 + (1.4 * half * i) / (n - 1)));
return { xs, ys: xs.map(() => feet), scale };
}
/** Objetos que o personagem pode ter na mão (os outros ficam soltos na cena). */
const HANDHELD: CartoonIcon[] = ["phone", "fuel", "battery", "money", "bulb", "olive", "hammer", "ruler"];
const GROUP_VERB = /\b(olharam|comemoraram|sentaram|pensaram|entram|entraram|caminharam|acenaram|oraram|ajoelharam|felizes|serenos)\b/;
/** Plano do trecho por regras do texto (narração + texto na tela + coluna Imagem). `variant` troca o arranjo. */ /** Plano do trecho por regras do texto (narração + texto na tela + coluna Imagem). `variant` troca o arranjo. */
export function planCartoon(shot: ShotText, ctx: PlanContext = {}, variant = 0): CartoonScene { export function planCartoon(shot: ShotText, ctx: PlanContext = {}, variant = 0): CartoonScene {
const original = `${shot.narration} ${shot.onScreen} ${shot.visualHint}`; const original = `${shot.narration} ${shot.onScreen} ${shot.visualHint}`;
const text = norm(original); const text = norm(original);
const time = /noite|madrugada|escuro|meia-noite/.test(text) ? "night" // A coluna Imagem é a direção de cena: quando existe, lugar, quem aparece, objetos e ações saem dela (e do
: /amanhecer|sol nasce|amanhece|de madrugada/.test(text) ? "dawn" // texto na tela); a narração continua dando os tempos (cue) e a fala. Sem ela, vale o texto todo.
: /\btarde\b|meio-dia|de dia\b|\bsol\b|ensolarad|\bmanha\b|domingo|claro\b/.test(text) ? "day" : "night"; const hint = shot.visualHint.trim();
const subject = hint ? norm(`${shot.visualHint} ${shot.onScreen}`) : text;
const spoken = `${shot.narration} ${shot.onScreen}`;
const explicitTime = /\bnoite|madrugada|escuro|meia-noite/.test(subject) ? "night" : /amanhecer|sol nasce|amanhece|entardecer|por do sol/.test(subject) ? "dawn" : null;
const dayRe = hint ? /\btarde\b|meio-dia|\bdia\b|\bsol\b|ensolarad|\bmanha\b|domingo|claro\b/ : /\btarde\b|meio-dia|de dia\b|\bsol\b|ensolarad|\bmanha\b|domingo|claro\b/;
const time = explicitTime ?? (dayRe.test(subject) ? "day" : "night");
const named = /\b(Dona|Seu|Tio|Tia|Doutor|Doutora)\s+([A-ZÁ-Ú][a-zá-ú]+)/.exec(original); const named = /\b(Dona|Seu|Tio|Tia|Doutor|Doutora)\s+([A-ZÁ-Ú][a-zá-ú]+)/.exec(original);
const crowd = /\b(pessoas|gente|multidao|vizinhos|fila|moradores|todo mundo)\b/.test(text); let crowd = /\b(pessoas|gente|multidao|vizinhos|moradores|todo mundo)\b|\bfila\b(?! de (animais|bichos))/.test(subject);
const sound = SOUNDS.find(([re]) => re.test(text)); const sound = SOUNDS.find(([re]) => re.test(subject));
const icons = ICON_RULES.filter(([re]) => re.test(text)).slice(0, named ? 1 : 2); const icons = ICON_RULES.filter(([re]) => re.test(subject)).slice(0, named ? 1 : 2);
const danger = DANGER.test(text); const danger = DANGER.test(subject);
const negated = danger && /\b(nunca|nao)\b/.test(text); const negated = danger && /\b(nunca|nao)\b/.test(subject);
const props: NonNullable<CartoonScene["props"]> = icons.map(([, icon, label], i) => { const props: NonNullable<CartoonScene["props"]> = icons.map(([, icon, label], i) => {
const x = named ? 0.7 : icons.length === 1 ? 0.5 : i === 0 ? 0.3 : 0.72; const x = named ? 0.7 : icons.length === 1 ? 0.5 : i === 0 ? 0.3 : 0.72;
@@ -192,38 +399,96 @@ export function planCartoon(shot: ShotText, ctx: PlanContext = {}, variant = 0):
icon, x, y: 0.46, size: icons.length === 1 && !named ? 0.17 : 0.13, label, enterS: 0.3 + i * 0.5, icon, x, y: 0.46, size: icons.length === 1 && !named ? 0.17 : 0.13, label, enterS: 0.3 + i * 0.5,
tone: danger && i === 0 ? "danger" : "info", tone: danger && i === 0 ? "danger" : "info",
shake: !!sound && i === 0 && (icon === "generator" || icon === "door"), shake: !!sound && i === 0 && (icon === "generator" || icon === "door"),
rings: (!!sound && i === 0) || /chama atencao|da pra ouvir|de longe/.test(text), rings: (!!sound && i === 0) || /chama atencao|da pra ouvir|de longe/.test(subject),
crossed: negated && i === 0, crossed: negated && i === 0,
}; };
}); });
// Lugar montado por peças quando o texto diz onde é (ou quando a história tem elenco/paleta: tudo vira lugar).
const technical = /funciona|liga\b|desliga|inversor|rede eletrica|circuito|sistema|corrente/.test(subject);
const built = technical ? null : placeFor(subject, shot.index * 7 + 1, variant)
?? (cast(ctx).length || ctx.palette ? placeFor("rua", shot.index * 7 + 1, variant) : null);
const arkX = built?.place.elements.find((e) => e.kind === "ark" || e.kind === "ark_frame")?.x ?? null;
const animals = animalsFor(subject, arkX);
const actors: NonNullable<CartoonScene["actors"]> = []; const actors: NonNullable<CartoonScene["actors"]> = [];
// Elenco da história: quem é citado pelo nome; sem citação e com um protagonista só, ele aparece nos trechos // Elenco da história: quem é citado pelo nome (na ordem do texto); sem citação e com um protagonista só, ele
// pares ou quando o texto fala "ele/ela" (fio condutor, como o Otávio da referência). // aparece nos trechos pares ou quando o texto fala "ele/ela" (fio condutor, como o Otávio da referência).
const cast = ctx.cast ?? []; const all = cast(ctx);
const firstName = (n: string) => norm(n.split(/\s+/)[0]); const firstName = (n: string) => norm(n.split(/\s+/)[0]);
let castIn = cast.filter((c) => new RegExp(`\\b${firstName(c.name)}\\b`).test(text)); // Nome de uma palavra só casa com MAIÚSCULA (o filho "Sem" ≠ a palavra "sem"); nome composto ("Esposa de Noé")
if (!castIn.length && cast.length === 1 && !crowd && (shot.index % 2 === 0 || /\b(ele|ela)\b/.test(text))) castIn = [cast[0]]; // casa inteiro, sem olhar maiúscula.
castIn.slice(0, 2).forEach((c, i) => { const cased = (hint ? `${shot.visualHint} ${shot.onScreen}` : original).normalize("NFD").replace(/[̀-ͯ]/g, "");
const findName = (name: string) => {
const plain = name.normalize("NFD").replace(/[̀-ͯ]/g, "").trim();
if (/\s/.test(plain)) return subject.search(new RegExp(`\\b${norm(plain).replace(/\s+/g, "\\s+")}\\b`));
const m = new RegExp(`(^|[^\\p{L}])${plain.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(?![\\p{L}])`, "u").exec(cased);
return m ? m.index : -1;
};
let castIn = all.map((c) => ({ c, i: findName(c.name) })).filter((p) => p.i >= 0).sort((p, q) => p.i - q.i).map((p) => p.c);
if (!castIn.length && all.length === 1 && !crowd && (shot.index % 2 === 0 || /\b(ele|ela)\b/.test(text))) castIn = [all[0]];
// Família/grupo do elenco já em cena: "8 pessoas" não vira multidão atrás deles.
if (castIn.length >= 3) crowd = false;
const tl0 = timelineFor(spoken, 0.5, hint);
const talking = tl0.some((a) => a.do === "talk");
// Quem fala sozinho vai de perto (close) e a cena fica só com ele.
const close = talking && castIn.length > 0 && (castIn.length === 1 || /\bfala\b|\bclose\b|de perto/.test(subject));
if (close) castIn = castIn.slice(0, 1);
castIn = castIn.slice(0, 5);
const n = castIn.length;
const group = n > 2;
const xs = n === 1 ? [props.length || animals.some((a) => !a.fly) ? 0.34 : 0.5] : n === 2 ? [0.3, 0.7] : castIn.map((_, i) => 0.14 + (0.72 * i) / (n - 1));
if (n === 1 && animals.some((a) => !a.fly) && arkX !== null) xs[0] = 0.8;
let ys: number[] = castIn.map((_, i) => (group ? 0.8 + (i % 2) * 0.03 : n === 2 ? 0.8 : 0.78));
let scales: (number | undefined)[] = castIn.map(() => (n >= 4 ? 0.6 : group ? 0.72 : n === 2 ? 0.9 : undefined));
// Assunto do trecho: o objeto ou bicho de que a NARRAÇÃO fala vai para o centro, grande; o personagem fica ao
// lado dele, ou DENTRO (arca, carro) quando o texto diz — nunca o personagem sozinho tomando a cena.
const focus = built ? focusOf(norm(spoken), subject) : null;
if (focus && built && !close) {
const placed = stageFocus(built.place, focus, `${norm(spoken)} ${subject}`, n);
if (focus.kind === "animal" && !animals.some((a) => !a.fly)) animals.push(...animalsFor(norm(spoken), null));
if (focus.kind === "animal") for (const a of animals) if (!a.fly) { a.scale = (a.scale ?? 1) * 1.35; a.x = 0.18 + (a.x - 0.18) * 0.7; }
if (placed) {
for (let i = 0; i < n; i++) { xs[i] = placed.xs[i]; ys[i] = placed.ys[i]; }
ys = ys.slice(0, n);
scales = castIn.map(() => placed.scale);
}
}
// Martelar: vai para quem é citado logo antes de "martel…" (os outros só seguram o martelo).
const hammerAt = subject.search(/martel(ando|ou|ava)/);
let hammerer = -1;
if (hammerAt >= 0) {
let bestPos = -1;
castIn.forEach((c, i) => { const p = subject.lastIndexOf(firstName(c.name), hammerAt); if (p > bestPos) { bestPos = p; hammerer = i; } });
}
const everyone = GROUP_VERB.test(subject);
// Close das mãos (vista "insert"): só as mãos de quem é citado primeiro, segurando o objeto.
const insert = n >= 1 && /close (das|nas) maos|maos segurando|maos de \w+ segurando|insert/.test(subject);
castIn.forEach((c, i) => {
const x = xs[i];
const own = timelineFor(spoken, x, hint).filter((a) => a.do !== "hammer");
const timeline = i === 0 ? own : everyone ? own.filter((a) => a.do !== "talk") : [];
if (i === hammerer) timeline.push({ do: "hammer", atP: 0.1, dur: 3 });
const holds = props.find((p) => HANDHELD.includes(p.icon))?.icon ?? (hammerer === i || (i === 0 && /\bmartelo\b/.test(subject)) ? "hammer" : undefined);
actors.push({ actors.push({
kind: "person", x: castIn.length > 1 ? (i === 0 ? 0.3 : 0.7) : props.length ? 0.34 : 0.5, y: 0.74, enterS: 0.15 + i * 0.3, kind: "person", x, y: ys[i], scale: scales[i], enterS: 0.15 + i * 0.2,
character: { name: c.name, caption: i === 0 && shot.index === 0 ? c.caption : undefined, look: c.look }, character: { name: c.name, caption: i === 0 && shot.index === 0 ? c.caption : undefined, look: c.look },
// Começa neutro e a emoção/movimento entram na palavra (linha do tempo); sem gatilho no texto, fica a // Começa neutro e a emoção/movimento entram na palavra (linha do tempo); sem gatilho no texto, fica a
// expressão geral do trecho desde o início. // expressão geral do trecho desde o início.
expression: timelineFor(original, 0.5).some((a) => a.do === "express") ? "neutral" : expressionOf(text), expression: timeline.some((a) => a.do === "express") ? "neutral" : expressionOf(subject),
pose: i === 0 ? poseOf(text, props.length > 0) : "stand", pose: i === 0 || everyone ? poseOf(subject, props.length > 0) : "stand",
...(i === 0 ? { timeline: timelineFor(original, castIn.length > 1 ? 0.3 : props.length ? 0.34 : 0.5) } : {}), ...(timeline.length ? { timeline } : {}),
// Enquadramento: de perto quando fala; meio corpo sozinho em cena; corpo inteiro com mais gente/objetos. // Enquadramento: de perto quando fala; meio corpo sozinho em cena; corpo inteiro com mais gente/objetos/bichos.
framing: i === 0 && timelineFor(original, 0.5).some((a) => a.do === "talk") && castIn.length === 1 ? "close" framing: insert && i === 0 ? "insert" : close && i === 0 ? "close" : n === 1 && !focus && !crowd && props.length === 0 && !animals.length ? "medium" : "full",
: castIn.length === 1 && !crowd && props.length === 0 ? "medium" : "full", item: i === 0 || i === hammerer ? holds : undefined,
item: i === 0 && props.length === 1 && ["phone", "fuel", "battery", "money", "bulb"].includes(props[0].icon) ? props[0].icon : undefined, flip: n === 2 ? i === 1 : group ? x > 0.5 : false,
flip: i === 1,
}); });
}); });
// Objeto que o personagem segura sai do chão; os outros vão para o lado oposto ao personagem. // Objeto que o personagem segura sai do chão; os outros vão para o lado oposto ao personagem.
if (castIn.length) { if (castIn.length) {
const held = actors[0] && "item" in actors[0] ? actors[0].item : undefined; const held = actors[0] && "item" in actors[0] ? actors[0].item : undefined;
for (let i = props.length - 1; i >= 0; i--) if (props[i].icon === held) props.splice(i, 1); for (let i = props.length - 1; i >= 0; i--) if (props[i].icon === held) props.splice(i, 1);
props.forEach((p) => { p.x = 0.74; p.y = 0.5; }); props.forEach((p) => { p.x = actors[0] && "x" in actors[0] && actors[0].x > 0.5 ? 0.26 : 0.74; p.y = 0.5; });
} }
if (named && !castIn.length) { if (named && !castIn.length) {
const older = /^(Dona|Tia)$/.test(named[1]); const older = /^(Dona|Tia)$/.test(named[1]);
@@ -231,41 +496,137 @@ export function planCartoon(shot: ShotText, ctx: PlanContext = {}, variant = 0):
outfit: OUTFITS[(shot.index + variant) % OUTFITS.length], hair: older ? "bun" : "short", outfit: OUTFITS[(shot.index + variant) % OUTFITS.length], hair: older ? "bun" : "short",
hairColor: older ? "#e8e8ee" : "#3a2a1e", glasses: older, pointing: props.length > 0 }); hairColor: older ? "#e8e8ee" : "#3a2a1e", glasses: older, pointing: props.length > 0 });
} }
// Multidão atrás do personagem: entra primeiro (desenhada antes) e com os pés acima dos dele. // Bichos e pessoas desenhados de trás para a frente (quem tem o pé mais alto na tela fica atrás); o close vai
// por cima de tudo. Multidão atrás do personagem: entra primeiro e com os pés acima dos dele.
const depth = (a: (typeof actors)[number]) => (a.kind === "person" && a.framing && a.framing !== "full" ? 2 : a.kind === "animal" && a.fly ? 3 : "y" in a ? a.y : 0);
actors.push(...animals);
actors.sort((a, b) => depth(a) - depth(b));
if (crowd) actors.unshift({ kind: "crowd", count: 9 + (shot.index % 4), y: actors.some((a) => a.kind === "person") ? 0.6 : 0.66, enterS: 0.4 }); if (crowd) actors.unshift({ kind: "crowd", count: 9 + (shot.index % 4), y: actors.some((a) => a.kind === "person") ? 0.6 : 0.66, enterS: 0.4 });
const technical = /funciona|liga\b|desliga|inversor|rede eletrica|circuito|sistema|corrente/.test(text);
const kinds: CartoonScene["scene"]["kind"][] = technical ? ["blueprint", "plain"] const kinds: CartoonScene["scene"]["kind"][] = technical ? ["blueprint", "plain"]
: named || crowd ? (/portao|porta|frente|calcada/.test(text) ? ["house", "street"] : ["street", "house"]) : named || crowd ? (/portao|porta|frente|calcada/.test(subject) ? ["house", "street"] : ["street", "house"])
: props.length ? ["plain", "street"] : ["street", "plain"]; : props.length ? ["plain", "street"] : ["street", "plain"];
let kind: CartoonScene["scene"]["kind"] = kinds[variant % kinds.length]; let kind: CartoonScene["scene"]["kind"] = kinds[variant % kinds.length];
// Lugar montado por peças quando o texto diz onde é (ou quando a história tem elenco/paleta: tudo vira lugar).
const built = technical ? null : placeFor(text, shot.index * 7 + 1, variant)
?? (cast.length || ctx.palette ? placeFor("rua", shot.index * 7 + 1, variant) : null);
if (built) kind = "place"; if (built) kind = "place";
const texts: NonNullable<CartoonScene["texts"]> = []; const texts: NonNullable<CartoonScene["texts"]> = [];
const onScreen = shot.onScreen.trim(); const onScreen = shot.onScreen.trim();
// Cena "ocupada" (pessoa ou objeto): a cartela flutua; vazia, vai em tela cheia.
const busy = actors.some((a) => a.kind === "person") || props.length > 0;
// Texto na tela vira cartela: número (stat), porcentagem (barra), itens com ";" (lista); o resto, etiqueta.
if (onScreen) { if (onScreen) {
const numeric = /^\W*[\d.,]+\s*\S{0,8}\W*$/.test(onScreen); texts.push(onScreenCard(onScreen, danger, busy)
texts.push(numeric ?? { kind: "tag", text: onScreen.slice(0, 40), x: 0.5, y: close ? 0.12 : 0.17, atS: 0.1, tone: danger ? "danger" : "info" });
? { kind: "big", text: onScreen, x: 0.5, y: 0.27, atS: 0.2, tone: danger ? "danger" : "info" }
: { kind: "tag", text: onScreen.slice(0, 40), x: 0.5, y: 0.17, atS: 0.1, tone: danger ? "danger" : "info" });
} }
texts.push(...nameCardsFor(actors, shot.index));
// Onomatopeia longe da etiqueta do personagem (que fica acima da cabeça, perto do centro). // Onomatopeia longe da etiqueta do personagem (que fica acima da cabeça, perto do centro).
if (sound) texts.push({ kind: "onomatopoeia", text: sound[1], x: props[0]?.x ?? (actors.some((a) => a.kind === "person") ? 0.76 : 0.62), y: props.length ? 0.33 : 0.24, atS: 0.7, rotate: -6 }); if (sound) texts.push({ kind: "onomatopoeia", text: sound[1], x: props[0]?.x ?? (actors.some((a) => a.kind === "person") ? 0.76 : 0.62), y: props.length ? 0.33 : 0.24, atS: 0.7, rotate: -6 });
// Paleta: a do lugar quando ele manda (tempestade, arco-íris, museu) > hora dita na coluna Imagem (noite,
// amanhecer) > a da série > a do lugar > a da hora.
const timePalette: PaletteId = time === "day" ? "day" : time === "dawn" ? "dusk" : "night"; const timePalette: PaletteId = time === "day" ? "day" : time === "dawn" ? "dusk" : "night";
const explicitPalette: PaletteId | undefined = explicitTime === "night" ? "night" : explicitTime === "dawn" ? "dusk" : undefined;
const palette = built ? (built.override ? built.palette : undefined) ?? (hint ? explicitPalette : undefined) ?? ctx.palette ?? built.palette ?? timePalette : undefined;
return { return {
seed: shot.index * 7 + variant * 101 + 1, seed: shot.index * 7 + variant * 101 + 1,
scene: { kind, time, litHouse: kind === "street" && /acesa|aceso|luz|iluminad|gerador/.test(text) }, scene: { kind, time, litHouse: kind === "street" && /acesa|aceso|luz|iluminad|gerador/.test(subject) },
...(built ? { place: built.place, palette: ctx.palette ?? built.palette ?? timePalette, ...(built.light ? { light: built.light } : {}) } : ctx.palette ? { palette: ctx.palette } : {}), ...(built ? { place: built.place, palette, ...(built.light ? { light: built.light } : {}) } : ctx.palette ? { palette: ctx.palette } : {}),
camera: { push: 1.05 + ((shot.index + variant) % 3) * 0.02, panX: kind === "street" ? (shot.index % 2 ? 0.05 : -0.05) : 0 }, camera: { push: 1.05 + ((shot.index + variant) % 3) * 0.02, panX: kind === "street" ? (shot.index % 2 ? 0.05 : -0.05) : 0 },
...(ctx.hud ? { hud: ctx.hud } : {}), ...(ctx.hud ? { hud: ctx.hud } : {}),
actors, props, texts, actors, props, texts,
}; };
} }
const cast = (ctx: PlanContext) => ctx.cast ?? [];
type TextItem = NonNullable<CartoonScene["texts"]>[number];
type CheckState = NonNullable<NonNullable<TextItem["items"]>[number]["state"]>;
/**
* Texto na tela curto com número → cartela. "Na fila: 297" → stat (rótulo = palavras antes do número; vermelho com
* palavra de perigo ou número negativo); "Talento 97%" → barra de progresso; "Gerador; Gasolina; Lanterna" → lista
* que se marca em sequência. Cena vazia (sem pessoa nem objeto): cartela em tela cheia (fundo escuro); senão, flutua no
* alto, longe do rosto. Nada reconhecido → null (vira etiqueta).
*/
export function onScreenCard(onScreen: string, danger: boolean, busy: boolean): TextItem | null {
const text = onScreen.trim();
if (text.includes(";")) {
const items = text.split(";").map(checkItem).filter((i): i is NonNullable<ReturnType<typeof checkItem>> => !!i).slice(0, 8);
if (items.length >= 2) return checklistCard(items, busy);
}
if (text.length > 34) return null;
// Rótulo (sem dígitos) + número no fim: "-R$ 47.312.904", "R$ 0", "297", "20 L", "97%".
const m = /^([^\d]*?)[\s:–—]*((?:-(?=R|\d))?(?:R\$\s?)?\d[\d.,]*\s?(?:%|[\p{L}$]{1,8}\.?)?)$/u.exec(text);
if (!m) return null;
const label = m[1].replace(/[\s:–—-]+$/, "").trim();
const value = m[2].trim();
if (/\d/.test(label)) return null;
const pct = /^(\d{1,3}(?:[.,]\d+)?)\s?%$/.exec(value);
if (pct && label && Number(pct[1].replace(",", ".")) <= 100) {
return { kind: "progress", text: label, value: Number(pct[1].replace(",", ".")), x: 0.5, y: 0.25, atS: 0.2, ...(danger ? { tone: "danger" as const } : {}) };
}
// Vermelho: palavra de perigo, número negativo ou zerado ("R$ 0", como o caixa vazio da referência).
const tone = danger || /^-/.test(value) || /^\D*0+(?:[.,]0+)?\D*$/.test(value) || DANGER.test(norm(label)) ? { tone: "danger" as const } : {};
return busy
? { kind: "stat", text: label, value, x: 0.5, y: 0.25, atS: 0.2, size: 0.8, ...tone }
: { kind: "stat", text: label, value, x: 0.5, y: 0.4, atS: 0.2, panel: true, ...tone };
}
/** Item da lista: "✓ x"/"[x] x" marcado, "✗ x"/"não x"/"sem x" riscado, "[ ] x" vazio; sem marca, marcado. */
function checkItem(raw: string): { text: string; state: CheckState } | null {
let t = raw.trim();
let state: CheckState = "checked";
const mark = /^(\[x\]|✓|✔|☑)\s*|^(\[ \]|☐)\s*|^(✗|✘|❌|\[-\])\s*/i.exec(t);
if (mark) { state = mark[1] ? "checked" : mark[2] ? "empty" : "crossed"; t = t.slice(mark[0].length).trim(); }
else if (/^(nao|sem|nunca)\b/.test(norm(t))) state = "crossed";
return t ? { text: t.slice(0, 28), state } : null;
}
function checklistCard(items: { text: string; state: CheckState }[], busy: boolean): TextItem {
// Largura/altura aproximadas em unidades de u() (% da largura de um vertical), para caber no quadro.
const longest = Math.max(...items.map((i) => i.text.length));
const width = 25.6 + longest * 6.1 * 0.58;
if (!busy) {
const size = Math.min(1, 84 / width);
return { kind: "checklist", text: "", items, x: 0.5, y: 0.42, atS: 0.1, panel: true, ...(size < 1 ? { size: Number(size.toFixed(2)) } : {}) };
}
// Cena ocupada: lista pequena no canto de cima, logo abaixo do painel do topo (como a referência).
const size = 0.52;
const height = size * (10 + items.length * 8.2 + (items.length - 1) * 3.3);
return { kind: "checklist", text: "", items, size, atS: 0.2,
x: Number(((4 + (size * width) / 2) / 100).toFixed(3)), y: Number((0.124 + (height * 0.005625) / 2).toFixed(3)) };
}
/**
* Cartão de nome de quem aparece pela 1ª vez (1º trecho ou com `caption`): nome + função. Sozinho em cena, o cartão
* vai para o lado com mais espaço (oposto ao rosto) na altura do peito/cabeça; com mais gente, acima da cabeça. Quem
* ganha cartão perde a etiqueta amarela (label vazio), para o nome não aparecer duas vezes.
*/
export function nameCardsFor(actors: NonNullable<CartoonScene["actors"]>, shotIndex: number): TextItem[] {
const people = actors.filter((a) => a.kind === "person");
const cards: TextItem[] = [];
for (const a of people) {
if (a.kind !== "person" || !a.character || cards.length >= 2) continue;
const caption = a.character.caption?.trim();
if (!caption && shotIndex !== 0) continue;
const lines = caption ? caption.split(/\s*[;·|]\s*/).filter(Boolean).slice(0, 2) : [];
const clamp = (v: number) => Math.max(0.24, Math.min(0.76, v));
const scale = a.scale ?? 1;
let x: number; let y: number;
if (people.length === 1) {
x = clamp(a.x >= 0.5 ? a.x - 0.3 : a.x + 0.3);
y = a.framing === "close" ? 0.585 : a.framing === "medium" ? 0.62 : a.y - 0.27 * scale;
} else {
x = clamp(a.x);
y = a.y - 0.42 * scale - 0.05;
}
cards.push({ kind: "namecard", text: a.character.name, ...(lines.length ? { lines } : {}), x: Number(x.toFixed(3)), y: Number(Math.max(0.2, y).toFixed(3)),
atS: (a.enterS ?? 0) + 0.35 });
a.label = "";
}
return cards;
}
/** Chave da versão renderizada: muda se a cena, a duração ou o áudio (texto falado, voz, velocidade) mudarem. */ /** Chave da versão renderizada: muda se a cena, a duração ou o áudio (texto falado, voz, velocidade) mudarem. */
export function cartoonKey(scene: CartoonScene, durationS: number, audioKey: string): string { export function cartoonKey(scene: CartoonScene, durationS: number, audioKey: string): string {
let h = 0; let h = 0;
+19 -1
View File
@@ -14,7 +14,7 @@ export const W = 1080;
export const H = 1920; export const H = 1920;
export const FPS = 30; export const FPS = 30;
/** Respiro depois da fala de cada trecho; o último ganha mais, para o fecho não cortar seco. */ /** Respiro depois da fala de cada trecho; o último ganha mais, para o fecho não cortar seco. */
export const PAD_S = 0.35; export const PAD_S = 0.2;
export const LAST_PAD_S = 0.9; export const LAST_PAD_S = 0.9;
export const CREDITS_S = 3.5; export const CREDITS_S = 3.5;
@@ -51,6 +51,24 @@ export async function probeDuration(file: string): Promise<number> {
return seconds; return seconds;
} }
/**
* Narração corrida: tira o silêncio do começo/fim do áudio do trecho e encurta as pausas internas longas (a voz
* sintética para quase 1 s em cada ponto final, o que soa como "lendo e editando"). Pausa interna maior que
* `maxPauseS` vira `keepS`. Grava `out` em Opus; devolve a duração nova (s).
*/
export async function tightenSpeech(input: string, out: string, opts: { maxPauseS?: number; keepS?: number } = {}): Promise<number> {
const maxPause = opts.maxPauseS ?? 0.28;
const keep = opts.keepS ?? 0.2;
const filter = [
`silenceremove=start_periods=1:start_threshold=-45dB:start_silence=0.04`,
`silenceremove=stop_periods=-1:stop_duration=${maxPause}:stop_threshold=-45dB:stop_silence=${keep}`,
// Fim: tira o silêncio que sobrou (invertendo, cortando o começo e desinvertendo).
`areverse`, `silenceremove=start_periods=1:start_threshold=-45dB:start_silence=0.08`, `areverse`,
].join(",");
await exec(ffmpegBin("ffmpeg"), ["-v", "error", "-y", "-i", input, "-af", filter, "-c:a", "libopus", "-b:a", "96k", out], path.dirname(out));
return probeDuration(out);
}
export function exec(bin: string, args: string[], cwd: string, hook?: JobHook): Promise<string> { export function exec(bin: string, args: string[], cwd: string, hook?: JobHook): Promise<string> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const child = spawn(bin, args, { cwd, shell: false, windowsHide: true, stdio: ["ignore", "pipe", "pipe"] }); const child = spawn(bin, args, { cwd, shell: false, windowsHide: true, stdio: ["ignore", "pipe", "pipe"] });
+19 -6
View File
@@ -12,7 +12,7 @@ import path from "node:path";
import { createAsset } from "./assets"; import { createAsset } from "./assets";
import { all, get, now, run } from "./db"; import { all, get, now, run } from "./db";
import { DATA_DIR, OUTPUT_DIR, REPO_ROOT, STORIES_DIR, readTextIfExists, rel, resolveInside, storyDir } from "./paths"; import { DATA_DIR, OUTPUT_DIR, REPO_ROOT, STORIES_DIR, readTextIfExists, rel, resolveInside, storyDir } from "./paths";
import { LAST_PAD_S, PAD_S, buildCredits, buildSegment, concatSegments, ffmpegBin, fontFile, probeDuration, type JobHook } from "./montage-ffmpeg"; import { LAST_PAD_S, PAD_S, buildCredits, buildSegment, concatSegments, ffmpegBin, fontFile, probeDuration, tightenSpeech, type JobHook } from "./montage-ffmpeg";
import { downloadImage, searchFirst } from "./image-search"; import { downloadImage, searchFirst } from "./image-search";
import { DOC2D_TEMPLATES, planScene, planShot, planShot3d, renderGodotScene, sceneKey, scriptEntities, type Doc2DScene } from "./montage-godot"; import { DOC2D_TEMPLATES, planScene, planShot, planShot3d, renderGodotScene, sceneKey, scriptEntities, type Doc2DScene } from "./montage-godot";
import { getCast } from "./characters"; import { getCast } from "./characters";
@@ -251,11 +251,14 @@ function shotDuration(montage: Montage, shot: MontageShot): number {
return shot.audio!.durationMs / 1000 + (last ? LAST_PAD_S : PAD_S); return shot.audio!.durationMs / 1000 + (last ? LAST_PAD_S : PAD_S);
} }
/** Painel do topo das cenas Cartoon: nome da história e o número do vídeo. */ /**
* Painel do topo das cenas Cartoon: bloco amarelo com o número do vídeo ("EP. 3") e, na faixa clara embaixo, o nome
* da história (`label`). Hora, caixa e nota não existem no roteiro: ficam de fora (não inventar dado).
*/
function hudFor(ep: EpisodeView): CartoonScene["hud"] { function hudFor(ep: EpisodeView): CartoonScene["hud"] {
const story = getStory(ep.story_id); const story = getStory(ep.story_id);
const badge = (story?.title ?? ep.story_id).replace(/[^\p{L}\p{N} ]/gu, "").trim().split(/\s+/).slice(0, 2).join(" ").slice(0, 18); const title = (story?.title ?? ep.story_id).replace(/[^\p{L}\p{N} ()-]/gu, "").replace(/\s+/g, " ").trim().slice(0, 30) || "História";
return { badge: badge || "História", label: `Ep. ${ep.number}` }; return { badge: `Ep. ${ep.number}`, label: title };
} }
/** Paletas do estilo Cartoon (a mesma em todos os trechos dá a "cara" da série). Vazio = pela hora do trecho. */ /** Paletas do estilo Cartoon (a mesma em todos os trechos dá a "cara" da série). Vazio = pela hora do trecho. */
@@ -352,8 +355,18 @@ export async function generateShotAudio(episodeId: number, index: number): Promi
if (bytes.length < 100) throw new UserError("O serviço de voz devolveu um áudio vazio."); if (bytes.length < 100) throw new UserError("O serviço de voz devolveu um áudio vazio.");
fs.mkdirSync(audioDir(ep), { recursive: true }); fs.mkdirSync(audioDir(ep), { recursive: true });
const file = path.join(audioDir(ep), `${ep.file_key}-${String(index + 1).padStart(2, "0")}.ogg`); const file = path.join(audioDir(ep), `${ep.file_key}-${String(index + 1).padStart(2, "0")}.ogg`);
fs.writeFileSync(file, bytes); // Áudio cru da voz → narração corrida (sem silêncio nas pontas, pausas longas encurtadas). Se o FFmpeg falhar,
const durationMs = Number(response.headers.get("X-Audio-Duration-Ms")) || (await probeDuration(file)) * 1000; // fica o áudio cru.
const raw = `${file}.raw`;
fs.writeFileSync(raw, bytes);
let durationMs: number;
try {
durationMs = (await tightenSpeech(raw, file)) * 1000;
fs.rmSync(raw, { force: true });
} catch {
fs.renameSync(raw, file);
durationMs = Number(response.headers.get("X-Audio-Duration-Ms")) || (await probeDuration(file)) * 1000;
}
const saved = readSaved(ep); const saved = readSaved(ep);
(saved.shots[String(index)] ??= {}).audio = { file: rel(file), durationMs: Math.round(durationMs), key: audioKey(montage.voiceId, montage.speed, shot.spoken) }; (saved.shots[String(index)] ??= {}).audio = { file: rel(file), durationMs: Math.round(durationMs), key: audioKey(montage.voiceId, montage.speed, shot.spoken) };
writeSaved(ep, saved); writeSaved(ep, saved);
+67
View File
@@ -0,0 +1,67 @@
Formato: documental
# Noé e a Arca: a história resumida e as curiosidades que pouca gente conhece
## Ângulo (a pergunta que o vídeo responde)
O que o Gênesis conta de fato sobre Noé e a arca, e quais detalhes pouca gente conhece (sete pares de animais puros, cerca de um ano a bordo, "Ararate" como região) e o que se sabe sobre a busca pela arca?
Premissa: é narrativa religiosa. O vídeo conta como "segundo o Gênesis" / "a Bíblia conta" / "o texto diz", sem zombar e sem afirmar como fato científico o que é relato de fé. Ao falar de buscas e de achados, usa só o que as fontes dizem.
## Público e tom
Público amplo, curioso, incluindo quem conhece a história só pela versão infantil. Tom curioso e respeitoso. Vídeo único vertical, 180 s, sem votação. Estilo Cartoon.
Gancho: "Um barco da altura de um prédio de quatro andares, feito à mão." Pagamento: os detalhes pouco conhecidos e a conclusão de que não há comprovação aceita do achado da arca. Motivo para compartilhar: curiosidades que contrariam a imagem de livro infantil.
## Fatos confirmados
Versão bíblica: Almeida Revista e Atualizada (ARA).
| Fato | Fonte (instituição) | Link |
|---|---|---|
| Noé era "homem justo e íntegro" (Gn 6:9); a terra estava cheia de maldade e violência (Gn 6:5-13). | Gênesis 6 (ARA), Bíblia Online | https://www.bibliaonline.com.br/ara/gn/6 |
| Madeira de gofer, betume por dentro e por fora; 300 × 50 × 30 côvados; três andares, uma porta lateral, uma janela (Gn 6:14-16). A espécie do gofer não é identificada com certeza. | Gênesis 6 (ARA) | https://www.bibliaonline.com.br/ara/gn/6 |
| Um casal de cada espécie (Gn 6:19-20); sete pares dos animais puros e das aves (Gn 7:2-3). | Gênesis 6 e 7 (ARA) | https://www.bibliaonline.com.br/ara/gn/7 |
| Noé tinha 600 anos no dilúvio (Gn 7:6). Entraram oito pessoas: Noé, a esposa, Sem, Cam, Jafé e as três noras (Gn 7:13). | Gênesis 7 (ARA) | https://www.bibliaonline.com.br/ara/gn/7 |
| Chuva por quarenta dias e quarenta noites (Gn 7:12); águas prevalecem 150 dias (Gn 7:24). | Gênesis 7 (ARA) | https://www.bibliaonline.com.br/ara/gn/7 |
| Entrada no ano 600, mês 2, dia 17 (Gn 7:11); terra seca no ano 601, mês 2, dia 27 (Gn 8:14): cerca de um ano a bordo. | Gênesis 7 e 8 (ARA) | https://www.bibliaonline.com.br/ara/gn/8 |
| Corvo que saía e voltava (Gn 8:7); pomba: volta sem pousar, volta com folha de oliveira, não volta (Gn 8:8-12). | Gênesis 8 (ARA) | https://www.bibliaonline.com.br/ara/gn/8 |
| A arca pousa "sobre os montes de Ararate" (Gn 8:4). O nome designa uma região (ligada a Urartu), não necessariamente o pico hoje chamado Monte Ararat, na Turquia. | Gênesis 8 (ARA); Encyclopaedia Britannica, "Mount Ararat" | https://www.britannica.com/place/Mount-Ararat |
| Arco-íris como sinal da aliança (Gn 9:12-17); Noé morre aos 950 anos (Gn 9:29). | Gênesis 9 (ARA) | https://www.bibliaonline.com.br/ara/gn/9 |
| A Epopeia de Gilgamesh traz um dilúvio com Utnapishtim, um barco e aves soltas. | Encyclopaedia Britannica, "Epic of Gilgamesh" | https://www.britannica.com/topic/Epic-of-Gilgamesh |
| Tábua do Dilúvio, século VII a.C., achada em Nínive, identificada por George Smith em 1872; no British Museum (K.3375). | British Museum | https://www.britishmuseum.org/collection/object/W_K-3375 |
| Expedições do século XX procuraram a arca no Monte Ararat sem sucesso. | Encyclopaedia Britannica, "Mount Ararat" | https://www.britannica.com/place/Mount-Ararat |
| Durupınar: formação em forma de barco perto do Ararat, descrita por geólogos como estrutura rochosa natural (1996). | Collins & Fasold, Journal of Geoscience Education 44(4), 1996 | (periódico; sem link informado) |
## Mitos a desmentir (o que se diz × o que as fontes dizem)
- **"Um casal de cada animal, só isso":** o Gênesis fala em um casal de cada espécie (6:19-20) e também em sete pares dos animais puros e das aves (7:2-3). O vídeo mostra as duas passagens.
- **"A arca pousou no Monte Ararat":** o texto diz "montes de Ararate", uma região; o pico atual leva o nome depois. Segundo a Britannica, as buscas no século XX não acharam a arca.
- **"Acharam a arca na Turquia (Durupınar)":** a formação em forma de barco foi descrita como rocha natural (Collins & Fasold, 1996). Grupos ainda pesquisam, sem comprovação aceita.
- **Gilgamesh x Gênesis:** o vídeo só diz que a Epopeia traz um dilúvio parecido; não afirma qual relato veio antes nem que um copiou o outro.
## Divergências e decisões editoriais
- **Medidas:** o côvado de cerca de 45 cm veio do pedido, sem fonte entre as listadas. Por isso a narração usa "cerca de" e "estima-se". A equivalência "prédio de quatro andares" é aproximação do roteiro.
- **"Animais puros":** a ARA usa "limpos"; a narração usa "puros".
- **"Feito à mão":** interpretação do roteiro, sem fonte direta; fica só no gancho.
- **Deus:** não é representado em imagem (só céu, luz e nuvens) e não tem falas. A única fala entre aspas (trecho 7) é dramatização anunciada, feita por Noé.
- **Fora do roteiro:** "andava com Deus" (Gn 6:9, parte final), a vinha de Noé (Gn 9:20) e as datas exatas por mês e dia (só o resumo "cerca de um ano").
- **Papel de Fasold:** o roteiro cita só "um estudo de 1996"; não afirma o que cada autor defendia antes.
## Referências visuais (lugares, mapas, espécies, imagens de arquivo)
Estilo Cartoon: vilarejo antigo, canteiro da arca em construção, arca pronta, chuva e dilúvio, arca flutuando, montes de Ararat, arco-íris, museu com tábua de argila, montanha na Turquia. Elenco: Noé (túnica, barba longa, sandália), a esposa de Noé, Sem, Cam e Jafé. Animais: elefante, girafa, leão, ovelha, cavalo, camelo, pomba, corvo. Objetos: martelo, tábuas, régua de medida (côvado), ramo de oliveira, Bíblia aberta / pergaminho, tábua de argila. Sem rosto de Deus nem fotos reais. O cartão do Museu Britânico não usa imagem do objeto.
## Estado de produção
| Etapa | Estado |
|---|---|
| Pauta | Escrita em `pauta.md`. |
| Roteiro | Escrito: 435 palavras, 22 trechos, cerca de 181 s. |
| Narração | Pendente: gerar áudio e medir. |
| Cenas | Pendente (peças Cartoon em produção). |
| Montagem | Pendente. |
| Shorts | Pendente. |
| Thumbnail | Texto definido: "Noé e a Arca: curiosidades". |
| Agenda | Pendente: conta de destino não informada. |
+90
View File
@@ -0,0 +1,90 @@
[
{
"spec": "stories/noe-e-a-arca/cartoon/ep01-t01.json",
"out": "output/cartoon/noe-e-a-arca-ep01/ep01-t01.mp4"
},
{
"spec": "stories/noe-e-a-arca/cartoon/ep01-t02.json",
"out": "output/cartoon/noe-e-a-arca-ep01/ep01-t02.mp4"
},
{
"spec": "stories/noe-e-a-arca/cartoon/ep01-t03.json",
"out": "output/cartoon/noe-e-a-arca-ep01/ep01-t03.mp4"
},
{
"spec": "stories/noe-e-a-arca/cartoon/ep01-t04.json",
"out": "output/cartoon/noe-e-a-arca-ep01/ep01-t04.mp4"
},
{
"spec": "stories/noe-e-a-arca/cartoon/ep01-t05.json",
"out": "output/cartoon/noe-e-a-arca-ep01/ep01-t05.mp4"
},
{
"spec": "stories/noe-e-a-arca/cartoon/ep01-t06.json",
"out": "output/cartoon/noe-e-a-arca-ep01/ep01-t06.mp4"
},
{
"spec": "stories/noe-e-a-arca/cartoon/ep01-t07.json",
"out": "output/cartoon/noe-e-a-arca-ep01/ep01-t07.mp4"
},
{
"spec": "stories/noe-e-a-arca/cartoon/ep01-t08.json",
"out": "output/cartoon/noe-e-a-arca-ep01/ep01-t08.mp4"
},
{
"spec": "stories/noe-e-a-arca/cartoon/ep01-t09.json",
"out": "output/cartoon/noe-e-a-arca-ep01/ep01-t09.mp4"
},
{
"spec": "stories/noe-e-a-arca/cartoon/ep01-t10.json",
"out": "output/cartoon/noe-e-a-arca-ep01/ep01-t10.mp4"
},
{
"spec": "stories/noe-e-a-arca/cartoon/ep01-t11.json",
"out": "output/cartoon/noe-e-a-arca-ep01/ep01-t11.mp4"
},
{
"spec": "stories/noe-e-a-arca/cartoon/ep01-t12.json",
"out": "output/cartoon/noe-e-a-arca-ep01/ep01-t12.mp4"
},
{
"spec": "stories/noe-e-a-arca/cartoon/ep01-t13.json",
"out": "output/cartoon/noe-e-a-arca-ep01/ep01-t13.mp4"
},
{
"spec": "stories/noe-e-a-arca/cartoon/ep01-t14.json",
"out": "output/cartoon/noe-e-a-arca-ep01/ep01-t14.mp4"
},
{
"spec": "stories/noe-e-a-arca/cartoon/ep01-t15.json",
"out": "output/cartoon/noe-e-a-arca-ep01/ep01-t15.mp4"
},
{
"spec": "stories/noe-e-a-arca/cartoon/ep01-t16.json",
"out": "output/cartoon/noe-e-a-arca-ep01/ep01-t16.mp4"
},
{
"spec": "stories/noe-e-a-arca/cartoon/ep01-t17.json",
"out": "output/cartoon/noe-e-a-arca-ep01/ep01-t17.mp4"
},
{
"spec": "stories/noe-e-a-arca/cartoon/ep01-t18.json",
"out": "output/cartoon/noe-e-a-arca-ep01/ep01-t18.mp4"
},
{
"spec": "stories/noe-e-a-arca/cartoon/ep01-t19.json",
"out": "output/cartoon/noe-e-a-arca-ep01/ep01-t19.mp4"
},
{
"spec": "stories/noe-e-a-arca/cartoon/ep01-t20.json",
"out": "output/cartoon/noe-e-a-arca-ep01/ep01-t20.mp4"
},
{
"spec": "stories/noe-e-a-arca/cartoon/ep01-t21.json",
"out": "output/cartoon/noe-e-a-arca-ep01/ep01-t21.mp4"
},
{
"spec": "stories/noe-e-a-arca/cartoon/ep01-t22.json",
"out": "output/cartoon/noe-e-a-arca-ep01/ep01-t22.mp4"
}
]
+453
View File
@@ -0,0 +1,453 @@
{
"schemaVersion": 1,
"width": 1080,
"height": 1920,
"fps": 30,
"durationS": 7.478,
"seed": 1,
"scene": {
"kind": "place",
"time": "day",
"litHouse": false
},
"place": {
"ground": "grass",
"elements": [
{
"kind": "ark",
"x": 0.6,
"z": 0.55,
"scale": 1.2
},
{
"kind": "palm",
"x": 0.07,
"z": 0.6
},
{
"kind": "palm",
"x": 0.95,
"z": 0.78
},
{
"kind": "mountain",
"x": 0.3,
"z": 0.97
},
{
"kind": "cloud",
"x": 0.1227199074074074,
"z": 0.436920438957476,
"flip": true
}
]
},
"palette": "day",
"camera": {
"push": 1.05,
"panX": 0
},
"hud": {
"badge": "Ep. 1",
"label": "Noé e a Arca a história e as c"
},
"actors": [
{
"kind": "person",
"x": 0.34,
"y": 0.78,
"enterS": 0.15,
"character": {
"name": "Noé",
"caption": "Construtor da arca",
"look": {
"build": "slim",
"height": 0.96,
"skin": "#c98a5e",
"hair": {
"style": "long",
"color": "#e2e2e8"
},
"beard": {
"style": "long",
"color": "#eeeef2"
},
"glasses": "none",
"brows": "thick",
"top": {
"style": "robe",
"color": "#a8865a",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "long",
"lids": 0.5,
"wrinkles": 0.85,
"head": "oval"
}
},
"expression": "neutral",
"pose": "point",
"timeline": [
{
"do": "express",
"atP": 0.47000000000000003,
"expression": "surprised"
},
{
"do": "look",
"dir": "up",
"atP": 0.28
}
],
"framing": "full",
"item": "ruler",
"flip": false,
"label": ""
}
],
"props": [],
"texts": [
{
"kind": "stat",
"text": "Altura de",
"value": "4 andares",
"x": 0.5,
"y": 0.25,
"atS": 0.2,
"size": 0.8
},
{
"kind": "namecard",
"text": "Noé",
"lines": [
"Construtor da arca"
],
"x": 0.64,
"y": 0.51,
"atS": 0.5
}
],
"words": [
{
"text": "Um",
"startS": 0,
"endS": 0.3
},
{
"text": "barco",
"startS": 0.3,
"endS": 0.72
},
{
"text": "da",
"startS": 0.72,
"endS": 0.84
},
{
"text": "altura",
"startS": 0.84,
"endS": 1.18,
"tone": "key"
},
{
"text": "de",
"startS": 1.18,
"endS": 1.34
},
{
"text": "um",
"startS": 1.34,
"endS": 1.44
},
{
"text": "prédio",
"startS": 1.44,
"endS": 1.78
},
{
"text": "de",
"startS": 1.78,
"endS": 1.92
},
{
"text": "quatro",
"startS": 1.92,
"endS": 2.26
},
{
"text": "andares,",
"startS": 2.26,
"endS": 2.78
},
{
"text": "feito",
"startS": 3.02,
"endS": 3.36
},
{
"text": "à",
"startS": 3.36,
"endS": 3.48
},
{
"text": "mão,",
"startS": 3.48,
"endS": 3.68
},
{
"text": "a",
"startS": 3.92,
"endS": 4.14
},
{
"text": "Arca",
"startS": 4.14,
"endS": 4.48
},
{
"text": "de",
"startS": 4.48,
"endS": 4.6
},
{
"text": "Noé,",
"startS": 4.6,
"endS": 4.9
},
{
"text": "segundo",
"startS": 5.24,
"endS": 5.58
},
{
"text": "Gênesis.",
"startS": 5.58,
"endS": 6.24
}
],
"audioEnv": {
"fps": 30,
"values": [
0,
0,
0,
0,
0.16,
0.62,
0.67,
0.62,
0.62,
0.59,
0.46,
0.17,
0.83,
1,
1,
1,
0.71,
0.26,
0.12,
0.02,
0.06,
0.76,
0.34,
0.45,
1,
0.96,
1,
0.48,
0.16,
0.01,
0,
0.13,
0.57,
0.78,
0.79,
0.75,
1,
0.88,
0.14,
0.18,
0.5,
0.63,
0.4,
0.05,
0.06,
0.76,
0.77,
1,
0.91,
0.95,
0.64,
0.16,
0.37,
0.42,
0.08,
0.19,
0.54,
0.15,
0.01,
0.09,
0.21,
1,
1,
1,
0.84,
0.06,
0.04,
0.33,
0.5,
0.71,
0.65,
0.41,
0.43,
0.25,
0.78,
0.73,
0.73,
0.73,
0.61,
0.18,
0.24,
0.17,
0.04,
0.05,
0.03,
0.03,
0,
0,
0,
0.01,
0.01,
0,
0,
0,
0.01,
0.36,
1,
0.72,
0.24,
0.01,
0.39,
0.89,
0.86,
0.43,
0.4,
0.44,
0.74,
0.67,
0.42,
0.4,
0.24,
0.06,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0.71,
0.92,
0.71,
0.93,
0.95,
0.87,
0.88,
0.83,
0.34,
0.19,
0.07,
0.01,
0.45,
0.8,
0.22,
0.15,
0.5,
0.46,
0.64,
0.78,
0.72,
0.84,
0.71,
0.54,
0.28,
0.07,
0.03,
0,
0,
0,
0,
0,
0,
0,
0.01,
0.01,
0.01,
0.05,
0.66,
0.56,
0.21,
0.14,
0.53,
0.67,
0.52,
0.54,
0.43,
0.49,
0.82,
0.81,
0.32,
0.14,
0.44,
0.83,
0.61,
0.43,
0.28,
0.31,
0.17,
0.02,
0.09,
0.16,
0.08,
0.03,
0.03,
0.02,
0.01,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
}
+449
View File
@@ -0,0 +1,449 @@
{
"schemaVersion": 1,
"width": 1080,
"height": 1920,
"fps": 30,
"durationS": 6.974,
"seed": 8,
"scene": {
"kind": "place",
"time": "day",
"litHouse": false
},
"place": {
"ground": "dirt",
"elements": [
{
"kind": "house",
"x": 0.12,
"z": 0.45,
"color": "#d8b88a"
},
{
"kind": "house",
"x": 0.86,
"z": 0.6,
"color": "#c9a576",
"flip": true
},
{
"kind": "palm",
"x": 0.11380195473251029,
"z": 0.796602366255144,
"flip": false
},
{
"kind": "tent",
"x": 0.8733675411522633,
"z": 0.591795267489712,
"flip": true
},
{
"kind": "palm",
"x": 0.2644609053497942,
"z": 0.485599279835391,
"flip": false
},
{
"kind": "mountain",
"x": 0.7720820473251029,
"z": 0.95,
"flip": true
},
{
"kind": "wall",
"x": 0.5,
"z": 0.8,
"color": "#d8b88a"
}
]
},
"palette": "day",
"camera": {
"push": 1.07,
"panX": 0
},
"hud": {
"badge": "Ep. 1",
"label": "Noé e a Arca a história e as c"
},
"actors": [
{
"kind": "person",
"x": 0.34,
"y": 0.78,
"enterS": 0.15,
"character": {
"name": "Noé",
"look": {
"build": "slim",
"height": 0.96,
"skin": "#c98a5e",
"hair": {
"style": "long",
"color": "#e2e2e8"
},
"beard": {
"style": "long",
"color": "#eeeef2"
},
"glasses": "none",
"brows": "thick",
"top": {
"style": "robe",
"color": "#a8865a",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "long",
"lids": 0.5,
"wrinkles": 0.85,
"head": "oval"
}
},
"expression": "neutral",
"pose": "point",
"timeline": [
{
"do": "express",
"atP": 0.41000000000000003,
"expression": "smile"
},
{
"do": "walk",
"to": 0.54,
"atP": 0.23
}
],
"framing": "full",
"flip": false
}
],
"props": [
{
"icon": "book",
"x": 0.74,
"y": 0.5,
"size": 0.17,
"label": "Escritura",
"enterS": 0.3,
"tone": "info",
"shake": false,
"rings": false,
"crossed": false
}
],
"texts": [
{
"kind": "tag",
"text": "Noé: homem justo (Gn 6:9)",
"x": 0.5,
"y": 0.17,
"atS": 0.1,
"tone": "info"
}
],
"words": [
{
"text": "Quem",
"startS": 0,
"endS": 0.36
},
{
"text": "era",
"startS": 0.36,
"endS": 0.64
},
{
"text": "Noé?",
"startS": 0.64,
"endS": 0.94
},
{
"text": "A",
"startS": 1.44,
"endS": 1.96
},
{
"text": "Bíblia",
"startS": 1.96,
"endS": 2.32
},
{
"text": "conta",
"startS": 2.32,
"endS": 2.66
},
{
"text": "que",
"startS": 2.66,
"endS": 2.84
},
{
"text": "ele",
"startS": 2.84,
"endS": 2.96
},
{
"text": "era",
"startS": 2.96,
"endS": 3.08
},
{
"text": "um",
"startS": 3.08,
"endS": 3.18
},
{
"text": "homem",
"startS": 3.18,
"endS": 3.42,
"tone": "key"
},
{
"text": "justo",
"startS": 3.42,
"endS": 3.82,
"tone": "key"
},
{
"text": "e",
"startS": 3.82,
"endS": 3.98
},
{
"text": "íntegro",
"startS": 3.98,
"endS": 4.32
},
{
"text": "entre",
"startS": 4.32,
"endS": 4.52
},
{
"text": "os",
"startS": 4.52,
"endS": 4.7
},
{
"text": "seus",
"startS": 4.7,
"endS": 4.84
},
{
"text": "contemporâneos.",
"startS": 4.84,
"endS": 5.72
}
],
"audioEnv": {
"fps": 30,
"values": [
0,
0,
0,
0,
0,
0.04,
0.05,
0.66,
0.67,
0.64,
0.6,
0.64,
0.7,
0.87,
0.74,
0.9,
1,
1,
1,
0.87,
0.51,
0.64,
0.84,
0.86,
0.89,
0.66,
0.49,
0.16,
0.04,
0.01,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0.84,
1,
0.7,
0.21,
0.14,
0.23,
0.45,
0.53,
0.53,
0.24,
0.3,
0.89,
1,
0.85,
0.12,
0.01,
0.07,
0.51,
0.81,
0.74,
0.73,
0.37,
0.16,
0.14,
0.49,
0.27,
0.01,
0.02,
0.18,
0.81,
1,
0.57,
1,
0.99,
1,
0.46,
0.62,
0.49,
0.46,
0.58,
0.62,
0.67,
0.9,
0.49,
0.55,
0.51,
0.49,
0.58,
0.3,
0.13,
0.15,
0.42,
0.89,
1,
0.65,
0.47,
0.12,
0.09,
0.02,
0.12,
0.9,
0.71,
0.47,
0.52,
0.59,
0.64,
0.16,
0.19,
1,
0.7,
0.16,
0.57,
0.57,
0.76,
0.68,
0.48,
0.5,
0.31,
0.05,
0.29,
0.54,
0.65,
0.17,
0.04,
0.03,
0.73,
0.88,
0.58,
0.1,
0.08,
0.04,
0.05,
0.54,
0.61,
0.42,
0.03,
0.47,
0.48,
0.42,
0.24,
0.03,
0.67,
1,
1,
0.49,
0.78,
0.69,
0.48,
0.39,
0.27,
0.26,
0.23,
0.1,
0.04,
0.06,
0.05,
0.03,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
}
+555
View File
@@ -0,0 +1,555 @@
{
"schemaVersion": 1,
"width": 1080,
"height": 1920,
"fps": 30,
"durationS": 9.47,
"seed": 15,
"scene": {
"kind": "place",
"time": "night",
"litHouse": false
},
"place": {
"ground": "dirt",
"elements": [
{
"kind": "house",
"x": 0.12,
"z": 0.45,
"color": "#d8b88a"
},
{
"kind": "house",
"x": 0.86,
"z": 0.6,
"color": "#c9a576",
"flip": true
},
{
"kind": "palm",
"x": 0.10488400205761317,
"z": 0.5378240740740741,
"flip": true
},
{
"kind": "tent",
"x": 0.8507921810699588,
"z": 0.257554012345679,
"flip": false
},
{
"kind": "palm",
"x": 0.26656147119341567,
"z": 0.2592283950617284,
"flip": false
},
{
"kind": "mountain",
"x": 0.7771918724279835,
"z": 0.95,
"flip": true
},
{
"kind": "wall",
"x": 0.5,
"z": 0.8,
"color": "#d8b88a"
}
]
},
"palette": "night",
"camera": {
"push": 1.09,
"panX": 0
},
"hud": {
"badge": "Ep. 1",
"label": "Noé e a Arca a história e as c"
},
"actors": [
{
"kind": "person",
"x": 0.5,
"y": 0.78,
"enterS": 0.15,
"character": {
"name": "Noé",
"look": {
"build": "slim",
"height": 0.96,
"skin": "#c98a5e",
"hair": {
"style": "long",
"color": "#e2e2e8"
},
"beard": {
"style": "long",
"color": "#eeeef2"
},
"glasses": "none",
"brows": "thick",
"top": {
"style": "robe",
"color": "#a8865a",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "long",
"lids": 0.5,
"wrinkles": 0.85,
"head": "oval"
}
},
"expression": "neutral",
"pose": "stand",
"timeline": [
{
"do": "express",
"atP": 0.38,
"expression": "worried"
},
{
"do": "pose",
"pose": "kneel",
"atP": 0.55
},
{
"do": "look",
"dir": "up",
"atP": 0.55
},
{
"do": "look",
"dir": "left",
"atP": 0.32
},
{
"do": "shake_head",
"times": 1,
"dur": 1.2,
"atP": 0.32
}
],
"framing": "medium",
"flip": false
}
],
"props": [],
"texts": [
{
"kind": "tag",
"text": "Gn 6:5-13",
"x": 0.5,
"y": 0.17,
"atS": 0.1,
"tone": "info"
}
],
"words": [
{
"text": "Segundo",
"startS": 0,
"endS": 0.62
},
{
"text": "o",
"startS": 0.62,
"endS": 0.76
},
{
"text": "relato,",
"startS": 0.76,
"endS": 1.12
},
{
"text": "a",
"startS": 1.4,
"endS": 1.62
},
{
"text": "terra",
"startS": 1.62,
"endS": 1.78
},
{
"text": "estava",
"startS": 1.78,
"endS": 2.12
},
{
"text": "cheia",
"startS": 2.12,
"endS": 2.46
},
{
"text": "de",
"startS": 2.46,
"endS": 2.58
},
{
"text": "maldade.",
"startS": 2.58,
"endS": 3.08
},
{
"text": "Noé",
"startS": 3.76,
"endS": 4.36
},
{
"text": "recebeu",
"startS": 4.36,
"endS": 4.8
},
{
"text": "a",
"startS": 4.8,
"endS": 4.88
},
{
"text": "ordem",
"startS": 4.88,
"endS": 5.24
},
{
"text": "de",
"startS": 5.24,
"endS": 5.36
},
{
"text": "construir",
"startS": 5.36,
"endS": 5.76
},
{
"text": "uma",
"startS": 5.76,
"endS": 6
},
{
"text": "arca",
"startS": 6,
"endS": 6.3
},
{
"text": "para",
"startS": 6.3,
"endS": 6.48
},
{
"text": "salvar",
"startS": 6.48,
"endS": 6.8
},
{
"text": "a",
"startS": 6.8,
"endS": 6.96
},
{
"text": "família",
"startS": 6.96,
"endS": 7.34
},
{
"text": "e",
"startS": 7.34,
"endS": 7.54
},
{
"text": "os",
"startS": 7.54,
"endS": 7.72
},
{
"text": "animais.",
"startS": 7.72,
"endS": 8.18
}
],
"audioEnv": {
"fps": 30,
"values": [
0,
0,
0,
0,
0,
0,
0.01,
0.02,
0.03,
0.46,
0.69,
0.48,
0.2,
0.29,
0.81,
0.93,
0.86,
0.46,
0.58,
0.98,
0.72,
0.62,
0.82,
0.95,
0.66,
0.65,
0.77,
0.79,
0.75,
0.59,
0.25,
0.01,
0.03,
0.15,
0.01,
0.01,
0,
0,
0,
0,
0,
0,
0.23,
1,
0.94,
0.39,
0.02,
0,
0.26,
1,
0.94,
0.9,
0.99,
0.53,
0.51,
0.54,
0.13,
0.03,
0.03,
0.87,
1,
0.59,
0.17,
0.75,
0.52,
0.19,
0.14,
0.17,
0.14,
0.46,
1,
0.66,
0.75,
1,
0.91,
0.13,
0.25,
0.64,
0.5,
0.78,
0.89,
0.78,
0.43,
0.12,
0.76,
0.82,
0.73,
0.62,
0.5,
0.27,
0.03,
0.08,
0.08,
0.04,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0.39,
0.59,
0.8,
0.9,
0.99,
0.97,
0.77,
0.71,
0.68,
0.64,
0.64,
0.7,
0.42,
0.04,
0.03,
0.54,
0.62,
0.21,
0.23,
0.87,
1,
1,
1,
1,
1,
0.81,
0.75,
0.94,
1,
0.99,
0.48,
0.4,
0.23,
0.11,
0.53,
0.46,
0.35,
0.11,
0.4,
0.33,
0.01,
0.05,
0.57,
0.7,
0.49,
0.13,
0.05,
0.05,
0.47,
0.51,
0.83,
1,
1,
0.48,
0.63,
0.46,
0.59,
0.81,
0.65,
0.63,
0.65,
0.69,
0.78,
0.42,
0.21,
0.04,
0.05,
0.48,
0.34,
0.02,
0.33,
0.58,
0.5,
0.55,
0.13,
0.01,
0.12,
0.86,
0.75,
0.5,
0.15,
0.17,
0.92,
1,
0.62,
0.79,
0.31,
0.02,
0.05,
0.61,
0.55,
0.34,
0.36,
0.43,
0.56,
0.6,
0.78,
0.47,
0.44,
0.92,
0.43,
0.03,
0.01,
0.28,
0.5,
0.79,
0.9,
0.62,
0.19,
0.18,
0.94,
0.76,
0.55,
0.63,
0.84,
0.5,
0.48,
0.58,
0.53,
0.41,
0.29,
0.17,
0.05,
0.03,
0.03,
0.03,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
}
+449
View File
@@ -0,0 +1,449 @@
{
"schemaVersion": 1,
"width": 1080,
"height": 1920,
"fps": 30,
"durationS": 7.382,
"seed": 22,
"scene": {
"kind": "place",
"time": "day",
"litHouse": false
},
"place": {
"ground": "dirt",
"elements": [
{
"kind": "ark_frame",
"x": 0.55,
"z": 0.62,
"scale": 1.2
},
{
"kind": "scaffold",
"x": 0.16,
"z": 0.5
},
{
"kind": "planks",
"x": 0.84,
"z": 0.22
},
{
"kind": "palm",
"x": 0.94,
"z": 0.75
},
{
"kind": "mountain",
"x": 0.3,
"z": 0.97
},
{
"kind": "cloud",
"x": 0.09596604938271605,
"z": 0.31936385459533606,
"flip": false
}
]
},
"palette": "day",
"camera": {
"push": 1.05,
"panX": 0
},
"hud": {
"badge": "Ep. 1",
"label": "Noé e a Arca a história e as c"
},
"actors": [
{
"kind": "person",
"x": 0.34,
"y": 0.78,
"enterS": 0.15,
"character": {
"name": "Noé",
"look": {
"build": "slim",
"height": 0.96,
"skin": "#c98a5e",
"hair": {
"style": "long",
"color": "#e2e2e8"
},
"beard": {
"style": "long",
"color": "#eeeef2"
},
"glasses": "none",
"brows": "thick",
"top": {
"style": "robe",
"color": "#a8865a",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "long",
"lids": 0.5,
"wrinkles": 0.85,
"head": "oval"
}
},
"expression": "neutral",
"pose": "think",
"timeline": [
{
"do": "express",
"atP": 0.47000000000000003,
"expression": "determined"
},
{
"do": "pose",
"pose": "think",
"atP": 0.46
},
{
"do": "pose",
"pose": "hold",
"atP": 0.33
}
],
"framing": "full",
"item": "hammer",
"flip": false
}
],
"props": [],
"texts": [
{
"kind": "tag",
"text": "Gofer: espécie incerta",
"x": 0.5,
"y": 0.17,
"atS": 0.1,
"tone": "info"
}
],
"words": [
{
"text": "Ela",
"startS": 0,
"endS": 0.36
},
{
"text": "seria",
"startS": 0.36,
"endS": 0.68
},
{
"text": "de",
"startS": 0.68,
"endS": 0.84
},
{
"text": "madeira",
"startS": 0.84,
"endS": 1.24
},
{
"text": "de",
"startS": 1.24,
"endS": 1.36
},
{
"text": "gofer,",
"startS": 1.36,
"endS": 1.72,
"tone": "key"
},
{
"text": "cuja",
"startS": 2,
"endS": 2.4
},
{
"text": "espécie",
"startS": 2.4,
"endS": 2.82,
"tone": "key"
},
{
"text": "é",
"startS": 2.82,
"endS": 2.92
},
{
"text": "incerta,",
"startS": 2.92,
"endS": 3.44,
"tone": "key"
},
{
"text": "e",
"startS": 3.62,
"endS": 3.88
},
{
"text": "coberta",
"startS": 3.88,
"endS": 4.4
},
{
"text": "de",
"startS": 4.4,
"endS": 4.5
},
{
"text": "betume",
"startS": 4.5,
"endS": 4.9
},
{
"text": "por",
"startS": 4.9,
"endS": 5.16
},
{
"text": "dentro",
"startS": 5.16,
"endS": 5.48
},
{
"text": "e",
"startS": 5.48,
"endS": 5.64
},
{
"text": "por",
"startS": 5.64,
"endS": 5.82
},
{
"text": "fora.",
"startS": 5.82,
"endS": 6.14
}
],
"audioEnv": {
"fps": 30,
"values": [
0,
0,
0,
0,
0,
0.42,
0.89,
0.92,
0.7,
0.61,
0.91,
0.62,
0.09,
0.02,
0.04,
0.78,
0.82,
0.36,
0.49,
0.81,
1,
1,
0.35,
0.12,
0.36,
0.45,
0.47,
0.74,
0.82,
0.53,
0.13,
0.1,
0.75,
0.85,
0.85,
0.42,
0.77,
0.66,
0.12,
0.14,
0.62,
0.25,
0.32,
1,
0.78,
0.19,
0.03,
0.01,
0.05,
0.59,
0.83,
0.72,
0.27,
0.08,
0.03,
0.01,
0,
0,
0,
0.01,
0.01,
0.01,
0,
0,
0,
0.04,
0.29,
0.66,
0.7,
0.41,
0.17,
0.49,
0.48,
0.12,
0.09,
0.02,
0.14,
0.9,
0.64,
0.67,
0.38,
0.04,
0.02,
0.09,
0.65,
0.48,
0.4,
0.42,
0.39,
0.17,
0.03,
0.01,
0.02,
0.45,
0.99,
0.97,
1,
0.43,
0.13,
0.06,
0.01,
0.03,
0.15,
0.09,
0.01,
0,
0,
0,
0.01,
0,
0,
0,
0,
0.03,
0.41,
0.42,
0.02,
0.09,
0.67,
1,
0.9,
0.17,
0.24,
1,
0.85,
1,
0.79,
0.27,
0.1,
0.02,
0.05,
0.62,
0.34,
0.09,
0.31,
0.21,
0.15,
0.85,
1,
0.17,
0.02,
0,
0.51,
0.68,
0.59,
0.56,
0.85,
1,
0.27,
0.02,
0.16,
0.88,
0.54,
0.33,
0.22,
0.06,
0.19,
0.72,
0.72,
0.61,
0.64,
0.55,
0.38,
0.05,
0.36,
0.29,
0.35,
0.4,
0.32,
0.04,
0.01,
0.46,
0.65,
0.11,
0.06,
0.04,
0.02,
0.26,
1,
1,
0.87,
0.59,
0.31,
0.2,
0.09,
0.02,
0.01,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
}
+480
View File
@@ -0,0 +1,480 @@
{
"schemaVersion": 1,
"width": 1080,
"height": 1920,
"fps": 30,
"durationS": 7.382,
"seed": 29,
"scene": {
"kind": "place",
"time": "day",
"litHouse": false
},
"place": {
"ground": "dirt",
"elements": [
{
"kind": "ark_frame",
"x": 0.55,
"z": 0.62,
"scale": 1.2
},
{
"kind": "scaffold",
"x": 0.16,
"z": 0.5
},
{
"kind": "planks",
"x": 0.84,
"z": 0.22
},
{
"kind": "palm",
"x": 0.94,
"z": 0.75
},
{
"kind": "mountain",
"x": 0.3,
"z": 0.97
},
{
"kind": "cloud",
"x": 0.14704809670781893,
"z": 0.5468449931412894,
"flip": true
}
]
},
"palette": "day",
"camera": {
"push": 1.07,
"panX": 0
},
"hud": {
"badge": "Ep. 1",
"label": "Noé e a Arca a história e as c"
},
"actors": [
{
"kind": "person",
"x": 0.3,
"y": 0.8,
"scale": 0.9,
"enterS": 0.15,
"character": {
"name": "Noé",
"look": {
"build": "slim",
"height": 0.96,
"skin": "#c98a5e",
"hair": {
"style": "long",
"color": "#e2e2e8"
},
"beard": {
"style": "long",
"color": "#eeeef2"
},
"glasses": "none",
"brows": "thick",
"top": {
"style": "robe",
"color": "#a8865a",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "long",
"lids": 0.5,
"wrinkles": 0.85,
"head": "oval"
}
},
"expression": "neutral",
"pose": "point",
"timeline": [
{
"do": "pose",
"pose": "point",
"atP": 0.34
},
{
"do": "pose",
"pose": "hold",
"atP": 0.52
}
],
"framing": "full",
"item": "ruler",
"flip": false
},
{
"kind": "person",
"x": 0.7,
"y": 0.8,
"scale": 0.9,
"enterS": 0.35,
"character": {
"name": "Jafé",
"look": {
"build": "slim",
"height": 1.08,
"skin": "#d4a074",
"hair": {
"style": "side",
"color": "#6b4226"
},
"beard": {
"style": "goatee",
"color": "#6b4226"
},
"glasses": "none",
"brows": "thin",
"top": {
"style": "robe",
"color": "#c8443a",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "round",
"lids": 0.1,
"wrinkles": 0,
"head": "round"
}
},
"expression": "neutral",
"pose": "stand",
"framing": "full",
"flip": true
}
],
"props": [],
"texts": [
{
"kind": "tag",
"text": "300 × 50 × 30 côvados",
"x": 0.5,
"y": 0.17,
"atS": 0.1,
"tone": "info"
}
],
"words": [
{
"text": "A",
"startS": 0,
"endS": 0.3
},
{
"text": "arca",
"startS": 0.3,
"endS": 0.68
},
{
"text": "tinha",
"startS": 0.68,
"endS": 0.9
},
{
"text": "300",
"startS": 0.9,
"endS": 1.28,
"tone": "key"
},
{
"text": "covados",
"startS": 1.28,
"endS": 1.92,
"tone": "key"
},
{
"text": "de",
"startS": 1.92,
"endS": 2.08
},
{
"text": "comprimento,",
"startS": 2.08,
"endS": 2.64
},
{
"text": "50",
"startS": 2.96,
"endS": 3.38,
"tone": "key"
},
{
"text": "de",
"startS": 3.38,
"endS": 3.6
},
{
"text": "largura",
"startS": 3.6,
"endS": 4.02
},
{
"text": "e",
"startS": 4.02,
"endS": 4.1
},
{
"text": "30",
"startS": 4.1,
"endS": 4.34,
"tone": "key"
},
{
"text": "de",
"startS": 4.34,
"endS": 4.5
},
{
"text": "altura,",
"startS": 4.5,
"endS": 4.88
},
{
"text": "diz",
"startS": 5.14,
"endS": 5.46
},
{
"text": "o",
"startS": 5.46,
"endS": 5.62
},
{
"text": "Gênesis.",
"startS": 5.62,
"endS": 6.12
}
],
"audioEnv": {
"fps": 30,
"values": [
0,
0,
0,
0,
0,
0.03,
0.99,
1,
1,
0.97,
0.94,
0.87,
0.96,
0.91,
0.63,
0.29,
0.12,
0.05,
0.09,
0.77,
0.81,
0.31,
0.07,
0.18,
0.26,
0.61,
0.57,
0.41,
0.04,
0.36,
0.46,
1,
1,
0.34,
0.06,
0.46,
0.78,
0.75,
0.5,
0.06,
0.38,
0.41,
0.08,
0.06,
0.06,
0.54,
1,
0.83,
0.15,
0.1,
0.84,
1,
1,
0.92,
0.56,
0.15,
0.44,
0.54,
0.29,
0.09,
0.13,
0.56,
0.22,
0.09,
0.44,
0.58,
0.31,
0.13,
0.33,
0.64,
0.39,
0.49,
0.63,
0.66,
0.59,
0.53,
0.31,
0.08,
0.04,
0.11,
0.03,
0.01,
0,
0.01,
0.01,
0.01,
0,
0,
0.01,
0.01,
0.04,
0.51,
0.62,
0.6,
0.45,
0.04,
0.1,
0.59,
0.74,
0.99,
0.89,
0.54,
0.22,
0.38,
0.81,
0.28,
0.15,
0.6,
0.5,
0.73,
1,
0.32,
0.41,
0.28,
0.08,
0.25,
0.79,
1,
1,
0.59,
0.8,
0.88,
0.35,
0.01,
0.23,
0.72,
0.6,
0.65,
0.53,
0.12,
0.55,
0.85,
0.52,
0.1,
0.68,
1,
0.83,
0.47,
0.11,
0.01,
0,
0.26,
0.71,
0.9,
0.99,
0.62,
0.44,
0.27,
0.03,
0.01,
0,
0.01,
0,
0,
0,
0.12,
0.11,
0.16,
0.38,
0.63,
0.59,
0.55,
0.24,
0.1,
0.48,
0.74,
0.55,
0.23,
0.16,
0.56,
0.89,
0.7,
0.43,
0.27,
0.32,
0.29,
0.1,
0.02,
0.09,
0.15,
0.06,
0.03,
0.02,
0.02,
0.01,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
}
+567
View File
@@ -0,0 +1,567 @@
{
"schemaVersion": 1,
"width": 1080,
"height": 1920,
"fps": 30,
"durationS": 9.23,
"seed": 36,
"scene": {
"kind": "place",
"time": "day",
"litHouse": false
},
"place": {
"ground": "grass",
"elements": [
{
"kind": "ark",
"x": 0.6,
"z": 0.55,
"scale": 1.2
},
{
"kind": "palm",
"x": 0.07,
"z": 0.6
},
{
"kind": "palm",
"x": 0.95,
"z": 0.78
},
{
"kind": "mountain",
"x": 0.3,
"z": 0.97
},
{
"kind": "cloud",
"x": 0.13813014403292181,
"z": 0.3743261316872428,
"flip": false
}
]
},
"palette": "day",
"camera": {
"push": 1.09,
"panX": 0
},
"hud": {
"badge": "Ep. 1",
"label": "Noé e a Arca a história e as c"
},
"actors": [
{
"kind": "person",
"x": 0.3,
"y": 0.8,
"scale": 0.9,
"enterS": 0.15,
"character": {
"name": "Noé",
"look": {
"build": "slim",
"height": 0.96,
"skin": "#c98a5e",
"hair": {
"style": "long",
"color": "#e2e2e8"
},
"beard": {
"style": "long",
"color": "#eeeef2"
},
"glasses": "none",
"brows": "thick",
"top": {
"style": "robe",
"color": "#a8865a",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "long",
"lids": 0.5,
"wrinkles": 0.85,
"head": "oval"
}
},
"expression": "neutral",
"pose": "point",
"timeline": [
{
"do": "express",
"atP": 0.6599999999999999,
"expression": "surprised"
},
{
"do": "look",
"dir": "left",
"atP": 0.59
},
{
"do": "shake_head",
"times": 1,
"dur": 1.2,
"atP": 0.59
}
],
"framing": "full",
"item": "ruler",
"flip": false
},
{
"kind": "person",
"x": 0.7,
"y": 0.8,
"scale": 0.9,
"enterS": 0.35,
"character": {
"name": "Sem",
"look": {
"build": "average",
"height": 1.02,
"skin": "#c08055",
"hair": {
"style": "short",
"color": "#6b4226"
},
"beard": {
"style": "full",
"color": "#6b4226"
},
"glasses": "none",
"brows": "thin",
"top": {
"style": "robe",
"color": "#2f6db3",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "round",
"lids": 0.1,
"wrinkles": 0.4,
"head": "round"
}
},
"expression": "surprised",
"pose": "stand",
"framing": "full",
"flip": true
}
],
"props": [],
"texts": [
{
"kind": "checklist",
"text": "",
"items": [
{
"text": "1 côvado ≈ 45 cm",
"state": "checked"
},
{
"text": "≈ 135 × 22 × 13 m",
"state": "checked"
}
],
"size": 0.52,
"atS": 0.2,
"x": 0.263,
"y": 0.167
}
],
"words": [
{
"text": "Com",
"startS": 0,
"endS": 0.3
},
{
"text": "o",
"startS": 0.3,
"endS": 0.44
},
{
"text": "côvado",
"startS": 0.44,
"endS": 0.72
},
{
"text": "valendo",
"startS": 0.72,
"endS": 1.1
},
{
"text": "cerca",
"startS": 1.1,
"endS": 1.42
},
{
"text": "de",
"startS": 1.42,
"endS": 1.58
},
{
"text": "45",
"startS": 1.58,
"endS": 2.12,
"tone": "key"
},
{
"text": "cm,",
"startS": 2.12,
"endS": 2.68
},
{
"text": "estima",
"startS": 3.26,
"endS": 3.5
},
{
"text": "-se",
"startS": 3.5,
"endS": 3.68
},
{
"text": "135",
"startS": 3.68,
"endS": 4.2,
"tone": "key"
},
{
"text": "m",
"startS": 4.2,
"endS": 4.82
},
{
"text": "de",
"startS": 4.82,
"endS": 5.12
},
{
"text": "comprimento,",
"startS": 5.12,
"endS": 5.68
},
{
"text": "22",
"startS": 5.94,
"endS": 6.34,
"tone": "key"
},
{
"text": "de",
"startS": 6.34,
"endS": 6.64
},
{
"text": "largura",
"startS": 6.64,
"endS": 7.06
},
{
"text": "e",
"startS": 7.06,
"endS": 7.2
},
{
"text": "13",
"startS": 7.2,
"endS": 7.48,
"tone": "key"
},
{
"text": "de",
"startS": 7.48,
"endS": 7.62
},
{
"text": "altura.",
"startS": 7.62,
"endS": 7.9
}
],
"audioEnv": {
"fps": 30,
"values": [
0,
0,
0,
0,
0,
0.06,
0.57,
0.89,
0.7,
0.63,
0.73,
0.14,
0.01,
0.09,
1,
1,
1,
0.36,
0.27,
0.78,
0.42,
0.26,
0.7,
0.28,
0.14,
0.84,
1,
0.59,
0.48,
0.63,
0.57,
0.47,
0.41,
0.64,
0.16,
0.04,
0.03,
0.04,
0.69,
0.62,
0.29,
0.04,
0.09,
0.65,
0.45,
0.12,
0.36,
0.06,
0.06,
0.72,
0.98,
0.68,
0.53,
0.58,
0.47,
0.2,
0.14,
0.64,
0.33,
0.03,
0.03,
0.36,
0.39,
0.22,
0.13,
0.31,
0.07,
0.02,
0.4,
0.51,
0.42,
0.23,
0.05,
0.15,
0.16,
0.32,
0.58,
0.57,
0.53,
0.41,
0.27,
0.02,
0.05,
0.11,
0.05,
0.04,
0.06,
0.04,
0.01,
0,
0.01,
0.01,
0,
0,
0,
0.29,
0.4,
0.07,
0.07,
0.11,
0.16,
0.62,
0.5,
0.43,
0.87,
0.58,
0.12,
0.02,
0.14,
0.6,
0.19,
0.02,
0.02,
0.01,
0.02,
0.37,
0.54,
0.59,
0.55,
0.31,
0.05,
0.46,
0.26,
0.04,
0.56,
0.43,
0.56,
0.26,
0.29,
0.7,
0.37,
0.03,
0.01,
0.26,
0.74,
0.46,
0.09,
0.5,
0.73,
0.45,
0.46,
0.65,
0.67,
0.6,
0.72,
0.4,
0.02,
0.21,
0.29,
0.38,
0.14,
0.13,
0.5,
0.23,
0.04,
0.45,
0.76,
0.41,
0.06,
0.24,
0.71,
0.4,
0.41,
0.54,
0.54,
0.45,
0.39,
0.26,
0.11,
0.01,
0.1,
0.05,
0.01,
0,
0,
0.01,
0.01,
0,
0,
0,
0.13,
0.09,
0.36,
0.57,
0.63,
0.53,
0.09,
0.14,
0.49,
0.26,
0.21,
0.79,
0.82,
0.9,
1,
0.98,
0.22,
0.14,
0.57,
0.59,
0.68,
0.8,
0.43,
0.35,
0.22,
0.08,
0.18,
0.67,
1,
1,
1,
1,
1,
0.69,
0.16,
0.01,
0,
0.56,
0.36,
1,
1,
1,
0.77,
0.15,
0.15,
0.34,
0.12,
0.17,
1,
0.72,
0.42,
0.08,
0,
0.05,
0.32,
0.49,
0.58,
0.32,
0.32,
0.1,
0.02,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
}
+540
View File
@@ -0,0 +1,540 @@
{
"schemaVersion": 1,
"width": 1080,
"height": 1920,
"fps": 30,
"durationS": 9.614,
"seed": 43,
"scene": {
"kind": "place",
"time": "day",
"litHouse": false
},
"place": {
"ground": "dirt",
"elements": [
{
"kind": "ark_frame",
"x": 0.55,
"z": 0.62,
"scale": 1.2
},
{
"kind": "scaffold",
"x": 0.16,
"z": 0.5
},
{
"kind": "planks",
"x": 0.84,
"z": 0.22
},
{
"kind": "palm",
"x": 0.94,
"z": 0.75
},
{
"kind": "mountain",
"x": 0.3,
"z": 0.97
},
{
"kind": "cloud",
"x": 0.1292121913580247,
"z": 0.6018072702331962,
"flip": true
}
]
},
"palette": "day",
"camera": {
"push": 1.05,
"panX": 0
},
"hud": {
"badge": "Ep. 1",
"label": "Noé e a Arca a história e as c"
},
"actors": [
{
"kind": "person",
"x": 0.34,
"y": 0.78,
"enterS": 0.15,
"character": {
"name": "Noé",
"look": {
"build": "slim",
"height": 0.96,
"skin": "#c98a5e",
"hair": {
"style": "long",
"color": "#e2e2e8"
},
"beard": {
"style": "long",
"color": "#eeeef2"
},
"glasses": "none",
"brows": "thick",
"top": {
"style": "robe",
"color": "#a8865a",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "long",
"lids": 0.5,
"wrinkles": 0.85,
"head": "oval"
}
},
"expression": "neutral",
"pose": "point",
"timeline": [
{
"do": "express",
"atP": 0.39,
"expression": "determined"
},
{
"do": "talk",
"cue": "vamos",
"cueEnd": "tabua",
"text": "Vamos, tábua por tábua."
},
{
"do": "hammer",
"atP": 0.1,
"dur": 3
}
],
"framing": "close",
"item": "hammer",
"flip": false
}
],
"props": [
{
"icon": "door",
"x": 0.74,
"y": 0.5,
"size": 0.13,
"label": "Porta",
"enterS": 0.8,
"tone": "info",
"shake": false,
"rings": false,
"crossed": false
}
],
"texts": [
{
"kind": "tag",
"text": "3 andares + porta + janela",
"x": 0.5,
"y": 0.12,
"atS": 0.1,
"tone": "info"
}
],
"words": [
{
"text": "Eram",
"startS": 0,
"endS": 0.42
},
{
"text": "três",
"startS": 0.42,
"endS": 0.72
},
{
"text": "andares,",
"startS": 0.72,
"endS": 1.26,
"tone": "key"
},
{
"text": "uma",
"startS": 1.52,
"endS": 1.82
},
{
"text": "porta",
"startS": 1.82,
"endS": 2.2,
"tone": "key"
},
{
"text": "na",
"startS": 2.2,
"endS": 2.32
},
{
"text": "lateral",
"startS": 2.32,
"endS": 2.66
},
{
"text": "e",
"startS": 2.66,
"endS": 2.9
},
{
"text": "uma",
"startS": 2.9,
"endS": 3.06
},
{
"text": "janela.",
"startS": 3.06,
"endS": 3.54,
"tone": "key"
},
{
"text": "Dá",
"startS": 4.04,
"endS": 4.62
},
{
"text": "para",
"startS": 4.62,
"endS": 4.82
},
{
"text": "imaginar",
"startS": 4.82,
"endS": 5.22
},
{
"text": "Noé",
"startS": 5.22,
"endS": 5.58
},
{
"text": "dizendo",
"startS": 5.58,
"endS": 5.86
},
{
"text": "aos",
"startS": 5.86,
"endS": 6.06
},
{
"text": "filhos,",
"startS": 6.06,
"endS": 6.48
},
{
"text": "vamos,",
"startS": 6.62,
"endS": 7.1
},
{
"text": "tábua",
"startS": 7.48,
"endS": 7.78
},
{
"text": "por",
"startS": 7.78,
"endS": 8.02
},
{
"text": "tábua.",
"startS": 8.02,
"endS": 8.4
}
],
"audioEnv": {
"fps": 30,
"values": [
0,
0,
0,
0,
0,
0.51,
0.84,
1,
1,
0.48,
0.7,
0.45,
0.4,
0.36,
0.09,
0.01,
0.69,
0.56,
1,
1,
0.56,
0.38,
0.06,
0.69,
0.84,
0.58,
0.49,
0.33,
0.72,
0.81,
0.75,
0.68,
0.7,
0.48,
0.21,
0.24,
0.12,
0.04,
0.04,
0.04,
0.02,
0,
0,
0,
0,
0,
0,
0,
0,
0.03,
0.29,
0.48,
0.63,
1,
0.88,
0.19,
0.01,
0,
0.47,
1,
1,
0.82,
0.26,
0.15,
0.04,
0.29,
0.73,
0.36,
0.68,
0.77,
0.47,
1,
0.81,
0.06,
0.03,
0.58,
0.89,
0.92,
0.82,
1,
1,
1,
0.92,
0.75,
0.78,
0.79,
0.69,
0.94,
0.58,
0.43,
0.7,
0.87,
0.83,
0.23,
0.29,
0.82,
0.75,
0.35,
0.41,
0.55,
0.48,
0.45,
0.41,
0.35,
0.26,
0.15,
0.06,
0.01,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0.21,
0.21,
0.56,
1,
0.79,
0.58,
0.05,
0.07,
0.76,
0.9,
0.56,
0.71,
0.45,
0.56,
0.68,
0.77,
0.4,
0.16,
0.48,
0.4,
0.49,
0.65,
0.75,
0.71,
0.47,
0.36,
0.42,
0.55,
0.67,
0.75,
0.86,
0.88,
0.71,
0.15,
0.16,
0.51,
0.42,
0.08,
0.29,
0.72,
0.64,
0.46,
0.45,
0.82,
0.81,
0.55,
0.09,
0.1,
0.08,
0.03,
0.08,
0.75,
0.91,
0.75,
0.35,
0.21,
0.28,
0.11,
0.05,
0.05,
0.04,
0.01,
0,
0,
0,
0,
0,
0,
0.17,
0.13,
0.54,
1,
0.83,
0.92,
0.53,
0.37,
0.35,
0.34,
0.11,
0.09,
0.08,
0.05,
0.01,
0,
0,
0,
0,
0,
0,
0,
0.88,
0.85,
0.77,
0.8,
0.94,
0.24,
0.15,
1,
0.88,
0.51,
0.05,
0,
0.45,
0.86,
0.11,
0.09,
0.03,
0.01,
0.85,
1,
0.81,
0.78,
0.31,
0.06,
0.14,
0.38,
0.16,
0.03,
0.01,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
}
+449
View File
@@ -0,0 +1,449 @@
{
"schemaVersion": 1,
"width": 1080,
"height": 1920,
"fps": 30,
"durationS": 7.166,
"seed": 50,
"scene": {
"kind": "place",
"time": "day",
"litHouse": false
},
"place": {
"ground": "grass",
"elements": [
{
"kind": "ark",
"x": 0.6,
"z": 0.55,
"scale": 1.2
},
{
"kind": "palm",
"x": 0.07,
"z": 0.6
},
{
"kind": "palm",
"x": 0.95,
"z": 0.78
},
{
"kind": "mountain",
"x": 0.3,
"z": 0.97
},
{
"kind": "cloud",
"x": 0.12029423868312757,
"z": 0.42928840877914953,
"flip": false
}
]
},
"palette": "day",
"camera": {
"push": 1.07,
"panX": 0
},
"hud": {
"badge": "Ep. 1",
"label": "Noé e a Arca a história e as c"
},
"actors": [
{
"kind": "animal",
"species": "elephant",
"x": 0.12000000000000005,
"y": 0.76,
"pair": true,
"walk": {
"to": 0.54,
"startS": 0
}
},
{
"kind": "person",
"x": 0.8,
"y": 0.78,
"enterS": 0.15,
"character": {
"name": "Noé",
"look": {
"build": "slim",
"height": 0.96,
"skin": "#c98a5e",
"hair": {
"style": "long",
"color": "#e2e2e8"
},
"beard": {
"style": "long",
"color": "#eeeef2"
},
"glasses": "none",
"brows": "thick",
"top": {
"style": "robe",
"color": "#a8865a",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "long",
"lids": 0.5,
"wrinkles": 0.85,
"head": "oval"
}
},
"expression": "neutral",
"pose": "wave",
"timeline": [
{
"do": "express",
"atP": 0.69,
"expression": "happy"
},
{
"do": "wave",
"atP": 0.68
}
],
"framing": "full",
"flip": false
},
{
"kind": "animal",
"species": "giraffe",
"x": 0.020000000000000073,
"y": 0.8200000000000001,
"pair": true,
"walk": {
"to": 0.44000000000000006,
"startS": 0.25
}
},
{
"kind": "animal",
"species": "lion",
"x": -0.07999999999999996,
"y": 0.88,
"pair": true,
"walk": {
"to": 0.34,
"startS": 0.5
}
}
],
"props": [],
"texts": [
{
"kind": "tag",
"text": "1 casal de cada espécie",
"x": 0.5,
"y": 0.17,
"atS": 0.1,
"tone": "info"
}
],
"words": [
{
"text": "Depois",
"startS": 0,
"endS": 0.58
},
{
"text": "vieram",
"startS": 0.58,
"endS": 1.08
},
{
"text": "os",
"startS": 1.08,
"endS": 1.24
},
{
"text": "animais.",
"startS": 1.24,
"endS": 1.74
},
{
"text": "O",
"startS": 2.22,
"endS": 2.82
},
{
"text": "Gênesis",
"startS": 2.82,
"endS": 3.22
},
{
"text": "fala",
"startS": 3.22,
"endS": 3.46
},
{
"text": "em",
"startS": 3.46,
"endS": 3.56
},
{
"text": "um",
"startS": 3.56,
"endS": 3.66
},
{
"text": "casal",
"startS": 3.66,
"endS": 3.98,
"tone": "key"
},
{
"text": "de",
"startS": 3.98,
"endS": 4.1
},
{
"text": "cada",
"startS": 4.1,
"endS": 4.32,
"tone": "key"
},
{
"text": "espécie,",
"startS": 4.32,
"endS": 4.86,
"tone": "key"
},
{
"text": "macho",
"startS": 5.1,
"endS": 5.48
},
{
"text": "e",
"startS": 5.48,
"endS": 5.56
},
{
"text": "fêmea.",
"startS": 5.56,
"endS": 5.98
}
],
"audioEnv": {
"fps": 30,
"values": [
0,
0,
0,
0,
0,
0.19,
0.16,
0.97,
1,
0.56,
0.04,
0,
0.03,
0.74,
1,
1,
1,
1,
0.36,
0.13,
0.09,
0.09,
0.46,
0.8,
0.84,
1,
1,
0.87,
0.82,
0.54,
0.74,
0.45,
0.33,
0.5,
0.53,
0.24,
0.07,
0.79,
0.75,
0.46,
0.79,
0.57,
0.47,
0.55,
0.74,
0.58,
0.46,
0.36,
0.27,
0.08,
0.04,
0.03,
0.02,
0.01,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0.77,
1,
0.56,
0.22,
0.19,
0.43,
1,
0.69,
0.48,
0.54,
0.4,
0.12,
0.18,
0.51,
0.19,
0.12,
0.06,
0.02,
0.74,
1,
1,
0.81,
0.6,
0.48,
0.46,
0.4,
0.4,
0.34,
0.07,
0.39,
0.88,
0.71,
0.25,
0.05,
0.39,
0.94,
0.94,
0.74,
0.4,
0.09,
0.18,
0.42,
0.06,
0.08,
0.48,
0.84,
0.76,
0.21,
0.44,
0.43,
0.08,
0.04,
0.07,
0.01,
0.32,
0.91,
0.94,
0.68,
0.51,
0.18,
0.02,
0.01,
0.02,
0.15,
0.08,
0.01,
0,
0,
0,
0,
0,
0.06,
0.19,
0.32,
0.8,
0.78,
0.66,
0.55,
0.29,
0.13,
0.11,
0.06,
0.44,
0.47,
0.3,
0.04,
0.02,
0.02,
0.44,
0.61,
0.54,
0.42,
0.26,
0.24,
0.18,
0.12,
0.07,
0.02,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
}
+541
View File
@@ -0,0 +1,541 @@
{
"schemaVersion": 1,
"width": 1080,
"height": 1920,
"fps": 30,
"durationS": 7.286,
"seed": 57,
"scene": {
"kind": "place",
"time": "day",
"litHouse": false
},
"place": {
"ground": "grass",
"elements": [
{
"kind": "palm",
"x": 0.11137628600823045,
"z": 0.7851543209876543,
"flip": true
},
{
"kind": "bush",
"x": 0.8953400205761317,
"z": 0.6521064814814814,
"flip": true
},
{
"kind": "mountain",
"x": 0.27916486625514403,
"z": 0.95,
"flip": true
},
{
"kind": "cloud",
"x": 0.7506499485596708,
"z": 0.4856721536351166,
"flip": true
},
{
"kind": "tree",
"x": 0.05090997942386831,
"z": 0.6139789094650205,
"flip": false
},
{
"kind": "rock",
"x": 0.9376977880658436,
"z": 0.7480606995884773,
"flip": true
}
]
},
"palette": "day",
"camera": {
"push": 1.09,
"panX": 0
},
"hud": {
"badge": "Ep. 1",
"label": "Noé e a Arca a história e as c"
},
"actors": [
{
"kind": "person",
"x": 0.3,
"y": 0.8,
"scale": 0.9,
"enterS": 0.15,
"character": {
"name": "Noé",
"look": {
"build": "slim",
"height": 0.96,
"skin": "#c98a5e",
"hair": {
"style": "long",
"color": "#e2e2e8"
},
"beard": {
"style": "long",
"color": "#eeeef2"
},
"glasses": "none",
"brows": "thick",
"top": {
"style": "robe",
"color": "#a8865a",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "long",
"lids": 0.5,
"wrinkles": 0.85,
"head": "oval"
}
},
"expression": "neutral",
"pose": "think",
"timeline": [
{
"do": "look",
"dir": "left",
"atP": 0.68
},
{
"do": "shake_head",
"times": 1,
"dur": 1.2,
"atP": 0.68
},
{
"do": "pose",
"pose": "think",
"atP": 0.61
},
{
"do": "pose",
"pose": "point",
"atP": 0.46
}
],
"framing": "full",
"flip": false
},
{
"kind": "person",
"x": 0.7,
"y": 0.8,
"scale": 0.9,
"enterS": 0.35,
"character": {
"name": "Cam",
"look": {
"build": "heavy",
"height": 1,
"skin": "#9a6440",
"hair": {
"style": "curly",
"color": "#3a2a1e"
},
"beard": {
"style": "stubble",
"color": "#3a2a1e"
},
"glasses": "none",
"brows": "thin",
"top": {
"style": "robe",
"color": "#56704a",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "round",
"lids": 0.1,
"wrinkles": 0,
"head": "wide",
"belly": true
}
},
"expression": "neutral",
"pose": "stand",
"framing": "full",
"flip": true
},
{
"kind": "animal",
"species": "camel",
"x": 0.26,
"y": 0.82,
"pair": true,
"flip": false
},
{
"kind": "animal",
"species": "horse",
"x": 0.74,
"y": 0.86,
"pair": true,
"flip": true
},
{
"kind": "animal",
"species": "sheep",
"x": 0.5,
"y": 0.95,
"pair": true,
"flip": false
},
{
"kind": "animal",
"species": "dove",
"x": 0.06,
"y": 0.3,
"scale": 2.4,
"fly": true,
"walk": {
"to": 0.82
}
}
],
"props": [],
"texts": [
{
"kind": "stat",
"text": "Puros e aves",
"value": "7 pares",
"x": 0.5,
"y": 0.25,
"atS": 0.2,
"size": 0.8
}
],
"words": [
{
"text": "Mas",
"startS": 0,
"endS": 0.38
},
{
"text": "há",
"startS": 0.38,
"endS": 0.52
},
{
"text": "um",
"startS": 0.52,
"endS": 0.62
},
{
"text": "detalhe,",
"startS": 0.62,
"endS": 1.12
},
{
"text": "dos",
"startS": 1.28,
"endS": 1.54
},
{
"text": "animais",
"startS": 1.54,
"endS": 2
},
{
"text": "puros",
"startS": 2,
"endS": 2.36,
"tone": "key"
},
{
"text": "e",
"startS": 2.36,
"endS": 2.44
},
{
"text": "das",
"startS": 2.44,
"endS": 2.6
},
{
"text": "aves,",
"startS": 2.6,
"endS": 2.96,
"tone": "key"
},
{
"text": "o",
"startS": 3.14,
"endS": 3.4
},
{
"text": "texto",
"startS": 3.4,
"endS": 3.76
},
{
"text": "fala",
"startS": 3.76,
"endS": 4.1
},
{
"text": "em",
"startS": 4.1,
"endS": 4.3
},
{
"text": "sete",
"startS": 4.3,
"endS": 4.66
},
{
"text": "pares,",
"startS": 4.66,
"endS": 4.98
},
{
"text": "não",
"startS": 5.22,
"endS": 5.48
},
{
"text": "em",
"startS": 5.48,
"endS": 5.66
},
{
"text": "um",
"startS": 5.66,
"endS": 5.78
},
{
"text": "só.",
"startS": 5.78,
"endS": 6.04
}
],
"audioEnv": {
"fps": 30,
"values": [
0,
0,
0,
0,
0,
0.35,
0.53,
0.99,
0.83,
0.74,
0.55,
0.13,
0.11,
0.76,
0.73,
0.58,
0.6,
0.5,
0.31,
1,
1,
0.4,
0.03,
0.01,
0.53,
1,
0.85,
0.81,
0.65,
0.37,
0.18,
0.22,
0.07,
0.01,
0,
0,
0,
0,
0,
0.01,
0.17,
0.12,
0.68,
1,
0.6,
0.57,
0.52,
0.15,
0.11,
0.88,
0.65,
0.41,
0.59,
0.42,
0.5,
0.64,
0.74,
0.56,
0.35,
0.1,
0.11,
0.02,
0,
0.1,
0.85,
1,
1,
0.35,
0.69,
0.37,
0.11,
0.47,
0.32,
0.66,
0.99,
0.86,
0.36,
0.09,
0.31,
0.83,
0.83,
0.74,
0.67,
0.38,
0.07,
0.16,
0.18,
0.04,
0.04,
0.05,
0.02,
0,
0,
0,
0,
0,
0,
0,
0.04,
0.46,
0.62,
0.26,
0.01,
0,
0.08,
0.63,
0.53,
0.6,
0.58,
0.33,
0.09,
0.04,
0.03,
0.59,
0.62,
0.08,
0.02,
0.02,
0.78,
1,
1,
0.69,
0.39,
0.42,
0.47,
0.38,
0.12,
0.02,
0.01,
0.01,
0.61,
1,
1,
0.66,
0.05,
0.08,
0.13,
0.35,
0.02,
0.17,
0.86,
0.84,
0.78,
0.65,
0.18,
0.23,
0.12,
0.03,
0.04,
0.03,
0.02,
0,
0,
0,
0,
0,
0,
0,
0.33,
0.62,
0.64,
0.67,
0.71,
0.72,
0.47,
0.45,
0.43,
0.42,
0.4,
0.41,
0.4,
0.41,
0.47,
0.35,
0.06,
0.06,
0.08,
0.34,
1,
0.83,
0.43,
0.08,
0.02,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
}
+675
View File
@@ -0,0 +1,675 @@
{
"schemaVersion": 1,
"width": 1080,
"height": 1920,
"fps": 30,
"durationS": 7.982,
"seed": 64,
"scene": {
"kind": "place",
"time": "dawn",
"litHouse": false
},
"place": {
"ground": "grass",
"elements": [
{
"kind": "ark",
"x": 0.6,
"z": 0.55,
"scale": 1.2
},
{
"kind": "palm",
"x": 0.07,
"z": 0.6
},
{
"kind": "palm",
"x": 0.95,
"z": 0.78
},
{
"kind": "mountain",
"x": 0.3,
"z": 0.97
},
{
"kind": "cloud",
"x": 0.10245833333333333,
"z": 0.48425068587105624,
"flip": true
}
]
},
"palette": "dusk",
"camera": {
"push": 1.05,
"panX": 0
},
"hud": {
"badge": "Ep. 1",
"label": "Noé e a Arca a história e as c"
},
"actors": [
{
"kind": "person",
"x": 0.14,
"y": 0.8,
"scale": 0.6,
"enterS": 0.15,
"character": {
"name": "Noé",
"look": {
"build": "slim",
"height": 0.96,
"skin": "#c98a5e",
"hair": {
"style": "long",
"color": "#e2e2e8"
},
"beard": {
"style": "long",
"color": "#eeeef2"
},
"glasses": "none",
"brows": "thick",
"top": {
"style": "robe",
"color": "#a8865a",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "long",
"lids": 0.5,
"wrinkles": 0.85,
"head": "oval"
}
},
"expression": "neutral",
"pose": "stand",
"timeline": [
{
"do": "express",
"atP": 0.6799999999999999,
"expression": "smile"
},
{
"do": "walk",
"to": 0.28,
"dur": 2.4,
"atP": 0.6
}
],
"framing": "full",
"flip": false
},
{
"kind": "person",
"x": 0.5,
"y": 0.8,
"scale": 0.6,
"enterS": 0.55,
"character": {
"name": "Sem",
"look": {
"build": "average",
"height": 1.02,
"skin": "#c08055",
"hair": {
"style": "short",
"color": "#6b4226"
},
"beard": {
"style": "full",
"color": "#6b4226"
},
"glasses": "none",
"brows": "thin",
"top": {
"style": "robe",
"color": "#2f6db3",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "round",
"lids": 0.1,
"wrinkles": 0.4,
"head": "round"
}
},
"expression": "neutral",
"pose": "stand",
"timeline": [
{
"do": "express",
"atP": 0.6799999999999999,
"expression": "smile"
},
{
"do": "walk",
"to": 0.64,
"dur": 2.4,
"atP": 0.6
}
],
"framing": "full",
"flip": false
},
{
"kind": "person",
"x": 0.86,
"y": 0.8,
"scale": 0.6,
"enterS": 0.9500000000000001,
"character": {
"name": "Jafé",
"look": {
"build": "slim",
"height": 1.08,
"skin": "#d4a074",
"hair": {
"style": "side",
"color": "#6b4226"
},
"beard": {
"style": "goatee",
"color": "#6b4226"
},
"glasses": "none",
"brows": "thin",
"top": {
"style": "robe",
"color": "#c8443a",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "round",
"lids": 0.1,
"wrinkles": 0,
"head": "round"
}
},
"expression": "neutral",
"pose": "stand",
"timeline": [
{
"do": "express",
"atP": 0.6799999999999999,
"expression": "smile"
},
{
"do": "walk",
"to": 0.92,
"dur": 2.4,
"atP": 0.6
}
],
"framing": "full",
"flip": true
},
{
"kind": "person",
"x": 0.32,
"y": 0.8300000000000001,
"scale": 0.6,
"enterS": 0.35,
"character": {
"name": "Esposa de Noé",
"look": {
"build": "average",
"height": 0.92,
"skin": "#d09a70",
"hair": {
"style": "long",
"color": "#c9c9cf"
},
"beard": {
"style": "none",
"color": "#a9a9b0"
},
"glasses": "none",
"brows": "thick",
"top": {
"style": "robe",
"color": "#8a6f9e",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "button",
"lids": 0.3,
"wrinkles": 0.7,
"head": "round"
}
},
"expression": "neutral",
"pose": "stand",
"timeline": [
{
"do": "express",
"atP": 0.6799999999999999,
"expression": "smile"
},
{
"do": "walk",
"to": 0.46,
"dur": 2.4,
"atP": 0.6
}
],
"framing": "full",
"flip": false
},
{
"kind": "person",
"x": 0.68,
"y": 0.8300000000000001,
"scale": 0.6,
"enterS": 0.7500000000000001,
"character": {
"name": "Cam",
"look": {
"build": "heavy",
"height": 1,
"skin": "#9a6440",
"hair": {
"style": "curly",
"color": "#3a2a1e"
},
"beard": {
"style": "stubble",
"color": "#3a2a1e"
},
"glasses": "none",
"brows": "thin",
"top": {
"style": "robe",
"color": "#56704a",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "round",
"lids": 0.1,
"wrinkles": 0,
"head": "wide",
"belly": true
}
},
"expression": "neutral",
"pose": "stand",
"timeline": [
{
"do": "express",
"atP": 0.6799999999999999,
"expression": "smile"
},
{
"do": "walk",
"to": 0.8200000000000001,
"dur": 2.4,
"atP": 0.6
}
],
"framing": "full",
"flip": true
}
],
"props": [],
"texts": [
{
"kind": "tag",
"text": "8 pessoas na arca",
"x": 0.5,
"y": 0.17,
"atS": 0.1,
"tone": "info"
}
],
"words": [
{
"text": "Entraram",
"startS": 0,
"endS": 0.64
},
{
"text": "também",
"startS": 0.64,
"endS": 0.88
},
{
"text": "oito",
"startS": 0.88,
"endS": 1.2
},
{
"text": "pessoas,",
"startS": 1.2,
"endS": 1.78,
"tone": "key"
},
{
"text": "Noé,",
"startS": 2,
"endS": 2.44
},
{
"text": "a",
"startS": 2.66,
"endS": 2.88
},
{
"text": "esposa,",
"startS": 2.88,
"endS": 3.38
},
{
"text": "os",
"startS": 3.58,
"endS": 3.84
},
{
"text": "filhos",
"startS": 3.84,
"endS": 4.2
},
{
"text": "sem,",
"startS": 4.2,
"endS": 4.4
},
{
"text": "Cães",
"startS": 4.66,
"endS": 5
},
{
"text": "de",
"startS": 5,
"endS": 5.06
},
{
"text": "Afé,",
"startS": 5.06,
"endS": 5.36
},
{
"text": "e",
"startS": 5.54,
"endS": 5.8
},
{
"text": "as",
"startS": 5.8,
"endS": 6.02
},
{
"text": "três",
"startS": 6.02,
"endS": 6.2
},
{
"text": "noras.",
"startS": 6.2,
"endS": 6.72
}
],
"audioEnv": {
"fps": 30,
"values": [
0,
0,
0,
0,
0,
0.55,
0.67,
0.64,
0.65,
0.39,
0.03,
0.62,
0.68,
0.97,
0.97,
0.79,
0.63,
0.52,
0.29,
0.03,
0.68,
0.65,
0.55,
0.54,
0.27,
0.88,
0.68,
0.51,
0.51,
0.58,
0.82,
0.89,
1,
1,
0.19,
0.05,
0.51,
0.11,
0.01,
0.67,
0.76,
0.45,
0.1,
0.13,
0.11,
0.23,
0.93,
1,
0.64,
0.54,
0.44,
0.18,
0.06,
0.06,
0.04,
0.03,
0,
0,
0,
0,
0,
0.08,
0.41,
0.62,
0.69,
0.57,
0.63,
0.82,
0.83,
0.68,
0.67,
0.52,
0.18,
0.05,
0.01,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0.61,
0.96,
0.74,
0.52,
0.12,
0.06,
0.08,
0.01,
0,
0.7,
1,
1,
1,
0.99,
0.65,
0.13,
0.17,
0.19,
0.07,
0.01,
0,
0,
0,
0,
0,
0.24,
0.77,
0.56,
0.12,
0.07,
0.1,
0.08,
0.02,
0.39,
0.65,
0.66,
0.48,
0.33,
0.43,
0.47,
0.31,
0.03,
0.02,
0.04,
0.54,
0.67,
0.39,
0.21,
0.14,
0.03,
0,
0,
0,
0,
0,
0,
0.05,
0.2,
0.87,
0.59,
0.76,
0.69,
0.6,
0.51,
0.24,
0.16,
0.8,
1,
0.72,
0.1,
0.03,
0.02,
0.4,
1,
1,
0.76,
0.24,
0.04,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0.31,
0.61,
1,
1,
1,
0.52,
0.11,
0.04,
0.01,
0,
0.74,
0.79,
0.95,
0.38,
0.43,
0.44,
0.31,
0.12,
0.18,
0.54,
0.76,
0.84,
0.83,
0.68,
0.46,
0.29,
0.28,
0.13,
0.02,
0.02,
0.02,
0.01,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
}
+460
View File
@@ -0,0 +1,460 @@
{
"schemaVersion": 1,
"width": 1080,
"height": 1920,
"fps": 30,
"durationS": 8.246,
"seed": 71,
"scene": {
"kind": "place",
"time": "night",
"litHouse": false
},
"place": {
"ground": "water",
"weather": "storm",
"flood": {
"from": 0.8,
"to": 0.5
},
"elements": [
{
"kind": "ark",
"x": 0.5,
"z": 0.4,
"float": true
},
{
"kind": "house",
"x": 0.14,
"z": 0.3
},
{
"kind": "tree",
"x": 0.86,
"z": 0.3
},
{
"kind": "mountain",
"x": 0.62,
"z": 0.96
}
]
},
"palette": "gray",
"camera": {
"push": 1.07,
"panX": 0
},
"hud": {
"badge": "Ep. 1",
"label": "Noé e a Arca a história e as c"
},
"actors": [
{
"kind": "person",
"x": 0.5,
"y": 0.78,
"enterS": 0.15,
"character": {
"name": "Noé",
"look": {
"build": "slim",
"height": 0.96,
"skin": "#c98a5e",
"hair": {
"style": "long",
"color": "#e2e2e8"
},
"beard": {
"style": "long",
"color": "#eeeef2"
},
"glasses": "none",
"brows": "thick",
"top": {
"style": "robe",
"color": "#a8865a",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "long",
"lids": 0.5,
"wrinkles": 0.85,
"head": "oval"
}
},
"expression": "neutral",
"pose": "stand",
"timeline": [
{
"do": "express",
"atP": 0.7,
"expression": "scared"
},
{
"do": "look",
"dir": "up",
"atP": 0.6
}
],
"framing": "medium",
"flip": false
}
],
"props": [],
"texts": [
{
"kind": "tag",
"text": "40 dias • 150 dias de água",
"x": 0.5,
"y": 0.17,
"atS": 0.1,
"tone": "info"
}
],
"words": [
{
"text": "A",
"startS": 0,
"endS": 0.32
},
{
"text": "chuva,",
"startS": 0.32,
"endS": 0.7
},
{
"text": "diz",
"startS": 0.88,
"endS": 1.16
},
{
"text": "o",
"startS": 1.16,
"endS": 1.34
},
{
"text": "texto,",
"startS": 1.34,
"endS": 1.66
},
{
"text": "durou",
"startS": 2.02,
"endS": 2.32
},
{
"text": "40",
"startS": 2.32,
"endS": 2.7,
"tone": "key"
},
{
"text": "dias",
"startS": 2.7,
"endS": 3,
"tone": "key"
},
{
"text": "e",
"startS": 3,
"endS": 3.16
},
{
"text": "40",
"startS": 3.16,
"endS": 3.5,
"tone": "key"
},
{
"text": "noites,",
"startS": 3.5,
"endS": 3.96
},
{
"text": "e",
"startS": 4.14,
"endS": 4.4
},
{
"text": "as",
"startS": 4.4,
"endS": 4.6
},
{
"text": "águas",
"startS": 4.6,
"endS": 4.9
},
{
"text": "prevaleceram",
"startS": 4.9,
"endS": 5.56
},
{
"text": "por",
"startS": 5.56,
"endS": 5.76
},
{
"text": "150",
"startS": 5.76,
"endS": 6.28,
"tone": "key"
},
{
"text": "dias.",
"startS": 6.28,
"endS": 6.9,
"tone": "key"
}
],
"audioEnv": {
"fps": 30,
"values": [
0,
0,
0,
0,
0,
0.67,
1,
0.69,
0.33,
0.16,
0.18,
0.16,
0.12,
0.45,
0.91,
1,
0.96,
0.21,
0.11,
0.47,
0.28,
0.05,
0,
0,
0,
0,
0,
0,
0.14,
0.09,
0.1,
0.29,
0.63,
0.59,
0.46,
0.14,
0.2,
0.93,
0.76,
0.06,
0.01,
0.19,
0.73,
0.83,
0.81,
0.73,
0.39,
0.09,
0.03,
0.01,
0.07,
0.26,
0.08,
0.01,
0,
0.01,
0,
0,
0,
0,
0.17,
0.19,
0.53,
0.62,
0.42,
1,
1,
1,
0.36,
0.01,
0.1,
0.66,
1,
1,
0.64,
0.5,
0.47,
0.57,
0.56,
0.29,
0.04,
0.62,
0.62,
0.31,
0.11,
0.12,
0.16,
0.37,
1,
0.99,
0.62,
0.15,
0.08,
0.4,
0.16,
0.03,
0.29,
0.9,
0.84,
0.5,
0.46,
0.54,
0.5,
0.31,
0.04,
0.67,
0.72,
0.34,
0.38,
0.4,
0.56,
0.58,
0.51,
0.47,
0.18,
0.03,
0.11,
0.1,
0.07,
0.04,
0.02,
0.02,
0.01,
0,
0,
0,
0,
0,
0,
0.1,
0.54,
1,
1,
0.79,
0.53,
0.15,
0.05,
0.38,
0.92,
1,
1,
0.54,
0.16,
0.37,
0.81,
0.55,
0.12,
0.06,
0.01,
0.36,
0.63,
0.72,
0.15,
0.41,
0.83,
0.45,
0.56,
0.77,
0.26,
0.03,
0.02,
0.18,
0.75,
0.65,
0.43,
0.55,
0.41,
0.06,
0.1,
0.53,
0.22,
0.06,
0.08,
0.02,
0.02,
0.03,
0.57,
0.5,
0.47,
0.34,
0.04,
0.35,
0.3,
0.05,
0.03,
0.35,
0.65,
0.36,
0.07,
0.12,
0.59,
0.62,
0.58,
0.31,
0.02,
0.53,
0.74,
0.34,
0.1,
0.12,
0.17,
0.28,
0.37,
0.46,
0.39,
0.28,
0.07,
0.02,
0.02,
0.03,
0.01,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
}
+429
View File
@@ -0,0 +1,429 @@
{
"schemaVersion": 1,
"width": 1080,
"height": 1920,
"fps": 30,
"durationS": 5.558,
"seed": 78,
"scene": {
"kind": "place",
"time": "night",
"litHouse": false
},
"place": {
"ground": "water",
"horizon": 0.5,
"flood": {
"from": 0.55,
"to": 0.55
},
"elements": [
{
"kind": "ark",
"x": 0.5,
"z": 0.4,
"float": true,
"scale": 1.05
},
{
"kind": "waves",
"x": 0.2,
"z": 0.08
},
{
"kind": "waves",
"x": 0.85,
"z": 0.12,
"flip": true
},
{
"kind": "cloud",
"x": 0.14462242798353908,
"z": 0.539212962962963,
"flip": true
},
{
"kind": "cloud",
"x": 0.8876139403292181,
"z": 0.6995884773662552,
"flip": true
}
]
},
"palette": "night",
"camera": {
"push": 1.09,
"panX": 0
},
"hud": {
"badge": "Ep. 1",
"label": "Noé e a Arca a história e as c"
},
"actors": [
{
"kind": "person",
"x": 0.3,
"y": 0.8,
"scale": 0.9,
"enterS": 0.15,
"character": {
"name": "Noé",
"look": {
"build": "slim",
"height": 0.96,
"skin": "#c98a5e",
"hair": {
"style": "long",
"color": "#e2e2e8"
},
"beard": {
"style": "long",
"color": "#eeeef2"
},
"glasses": "none",
"brows": "thick",
"top": {
"style": "robe",
"color": "#a8865a",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "long",
"lids": 0.5,
"wrinkles": 0.85,
"head": "oval"
}
},
"expression": "neutral",
"pose": "think",
"timeline": [
{
"do": "express",
"atP": 0.6699999999999999,
"expression": "smile"
},
{
"do": "sit",
"atP": 0.58
},
{
"do": "pose",
"pose": "think",
"atP": 0.65
}
],
"framing": "full",
"flip": false
},
{
"kind": "person",
"x": 0.7,
"y": 0.8,
"scale": 0.9,
"enterS": 0.35,
"character": {
"name": "Esposa de Noé",
"look": {
"build": "average",
"height": 0.92,
"skin": "#d09a70",
"hair": {
"style": "long",
"color": "#c9c9cf"
},
"beard": {
"style": "none",
"color": "#a9a9b0"
},
"glasses": "none",
"brows": "thick",
"top": {
"style": "robe",
"color": "#8a6f9e",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "button",
"lids": 0.3,
"wrinkles": 0.7,
"head": "round"
}
},
"expression": "neutral",
"pose": "think",
"timeline": [
{
"do": "express",
"atP": 0.6699999999999999,
"expression": "smile"
},
{
"do": "sit",
"atP": 0.58
},
{
"do": "pose",
"pose": "think",
"atP": 0.65
}
],
"framing": "full",
"flip": true
}
],
"props": [],
"texts": [
{
"kind": "tag",
"text": "≈ 1 ano a bordo",
"x": 0.5,
"y": 0.17,
"atS": 0.1,
"tone": "info"
}
],
"words": [
{
"text": "Pelas",
"startS": 0,
"endS": 0.48
},
{
"text": "datas",
"startS": 0.48,
"endS": 0.74
},
{
"text": "do",
"startS": 0.74,
"endS": 0.96
},
{
"text": "Gênesis,",
"startS": 0.96,
"endS": 1.48
},
{
"text": "a",
"startS": 1.66,
"endS": 1.88
},
{
"text": "família",
"startS": 1.88,
"endS": 2.18
},
{
"text": "ficou",
"startS": 2.18,
"endS": 2.54
},
{
"text": "cerca",
"startS": 2.54,
"endS": 2.88
},
{
"text": "de",
"startS": 2.88,
"endS": 3.06
},
{
"text": "um",
"startS": 3.06,
"endS": 3.22
},
{
"text": "ano",
"startS": 3.22,
"endS": 3.48
},
{
"text": "dentro",
"startS": 3.48,
"endS": 3.82
},
{
"text": "da",
"startS": 3.82,
"endS": 4.02
},
{
"text": "arca.",
"startS": 4.02,
"endS": 4.32
}
],
"audioEnv": {
"fps": 30,
"values": [
0,
0,
0,
0,
0,
0.27,
0.85,
1,
0.47,
0.69,
0.94,
0.96,
0.31,
0.12,
0.07,
0.63,
1,
1,
1,
0.62,
0.03,
0.15,
0.64,
0.62,
0.2,
0.04,
0.34,
0.91,
0.78,
0.34,
0.17,
0.21,
0.64,
0.82,
0.78,
0.54,
0.38,
0.41,
0.22,
0.05,
0.06,
0.11,
0.04,
0.03,
0.02,
0.01,
0,
0,
0,
0,
0,
0,
0.01,
0.77,
0.53,
0.08,
0.02,
0.35,
0.95,
0.74,
0.48,
0.57,
0.69,
0.53,
0.36,
0.67,
1,
0.35,
0.03,
0.03,
0.63,
0.26,
0.05,
0.48,
0.86,
0.85,
0.39,
0.07,
0.03,
0.02,
0.4,
0.84,
0.61,
0.26,
0.02,
0.12,
0.77,
0.76,
0.2,
0.12,
0.21,
0.56,
0.7,
0.82,
0.55,
0.5,
0.55,
0.65,
0.7,
0.66,
0.6,
0.52,
0.42,
0.76,
0.65,
0.23,
0.12,
0.06,
0.64,
0.95,
0.86,
0.71,
0.54,
0.34,
0.1,
0.32,
0.34,
0.12,
1,
1,
1,
0.84,
0.63,
0.5,
0.18,
0.09,
0.04,
0.05,
0.16,
0.15,
0.02,
0.01,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
}
+406
View File
@@ -0,0 +1,406 @@
{
"schemaVersion": 1,
"width": 1080,
"height": 1920,
"fps": 30,
"durationS": 6.206,
"seed": 85,
"scene": {
"kind": "place",
"time": "day",
"litHouse": false
},
"place": {
"ground": "water",
"horizon": 0.5,
"flood": {
"from": 0.55,
"to": 0.55
},
"elements": [
{
"kind": "ark",
"x": 0.5,
"z": 0.4,
"float": true,
"scale": 1.05
},
{
"kind": "waves",
"x": 0.2,
"z": 0.08
},
{
"kind": "waves",
"x": 0.85,
"z": 0.12,
"flip": true
},
{
"kind": "cloud",
"x": 0.13570447530864196,
"z": 0.36669410150891635,
"flip": false
},
{
"kind": "cloud",
"x": 0.8650385802469136,
"z": 0.47676097393689987,
"flip": false
}
]
},
"palette": "day",
"camera": {
"push": 1.05,
"panX": 0
},
"hud": {
"badge": "Ep. 1",
"label": "Noé e a Arca a história e as c"
},
"actors": [
{
"kind": "person",
"x": 0.5,
"y": 0.78,
"enterS": 0.15,
"character": {
"name": "Noé",
"look": {
"build": "slim",
"height": 0.96,
"skin": "#c98a5e",
"hair": {
"style": "long",
"color": "#e2e2e8"
},
"beard": {
"style": "long",
"color": "#eeeef2"
},
"glasses": "none",
"brows": "thick",
"top": {
"style": "robe",
"color": "#a8865a",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "long",
"lids": 0.5,
"wrinkles": 0.85,
"head": "oval"
}
},
"expression": "neutral",
"pose": "think",
"timeline": [
{
"do": "look",
"dir": "up",
"atP": 0.54
},
{
"do": "pose",
"pose": "think",
"atP": 0.71
}
],
"framing": "full",
"flip": false
},
{
"kind": "animal",
"species": "raven",
"x": 0.06,
"y": 0.3,
"scale": 2.4,
"fly": true,
"walk": {
"to": 0.82
}
}
],
"props": [],
"texts": [
{
"kind": "tag",
"text": "Corvo: ia e voltava",
"x": 0.5,
"y": 0.17,
"atS": 0.1,
"tone": "info"
}
],
"words": [
{
"text": "Com",
"startS": 0,
"endS": 0.28
},
{
"text": "as",
"startS": 0.28,
"endS": 0.54
},
{
"text": "águas",
"startS": 0.54,
"endS": 0.86
},
{
"text": "baixando,",
"startS": 0.86,
"endS": 1.38
},
{
"text": "Noé",
"startS": 1.72,
"endS": 1.92
},
{
"text": "soltou",
"startS": 1.92,
"endS": 2.26
},
{
"text": "um",
"startS": 2.26,
"endS": 2.42
},
{
"text": "corvo,",
"startS": 2.42,
"endS": 2.78,
"tone": "key"
},
{
"text": "que",
"startS": 2.88,
"endS": 3.18
},
{
"text": "ia",
"startS": 3.18,
"endS": 3.42
},
{
"text": "e",
"startS": 3.42,
"endS": 3.56
},
{
"text": "voltava",
"startS": 3.56,
"endS": 3.98,
"tone": "key"
},
{
"text": "até",
"startS": 3.98,
"endS": 4.18
},
{
"text": "a",
"startS": 4.18,
"endS": 4.34
},
{
"text": "terra",
"startS": 4.34,
"endS": 4.52
},
{
"text": "secar.",
"startS": 4.52,
"endS": 5.02
}
],
"audioEnv": {
"fps": 30,
"values": [
0,
0,
0,
0,
0,
0.06,
0.45,
0.95,
0.63,
0.62,
0.91,
0.93,
0.79,
0.36,
0.1,
0.06,
0.52,
0.91,
1,
0.94,
0.66,
0.18,
0.31,
0.85,
0.66,
0.17,
0.11,
0.32,
1,
0.77,
0.47,
0.16,
0.16,
0.12,
0.29,
0.67,
0.63,
0.45,
0.35,
0.15,
0.12,
0.06,
0.02,
0,
0,
0.01,
0.01,
0.01,
0,
0,
0.15,
0.42,
0.65,
0.62,
0.64,
0.67,
0.64,
0.28,
0.06,
0.08,
0.77,
1,
0.37,
0.06,
0,
0.77,
1,
1,
0.88,
0.69,
0.48,
0.2,
0.01,
0.08,
0.43,
0.93,
1,
0.92,
0.29,
0.18,
0.06,
0.03,
0.08,
0.01,
0.01,
0,
0,
0,
0,
0,
0,
0.02,
0.03,
0.5,
0.62,
0.57,
0.45,
0.43,
0.44,
0.49,
0.49,
0.68,
0.77,
0.52,
0.64,
0.39,
0.12,
0.78,
1,
0.81,
0.31,
0.02,
0.05,
0.76,
0.98,
1,
0.96,
0.32,
0.24,
0.77,
0.42,
0.02,
0,
0.38,
0.66,
1,
0.94,
0.71,
0.08,
0,
0.28,
0.67,
0.59,
0.68,
0.42,
0.44,
0.47,
0.21,
0.02,
0.02,
0.56,
0.68,
0.09,
0.01,
0.38,
0.79,
0.8,
0.5,
0.27,
0.08,
0.02,
0.01,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
}
+589
View File
@@ -0,0 +1,589 @@
{
"schemaVersion": 1,
"width": 1080,
"height": 1920,
"fps": 30,
"durationS": 11.078,
"seed": 92,
"scene": {
"kind": "place",
"time": "day",
"litHouse": false
},
"place": {
"ground": "water",
"horizon": 0.5,
"flood": {
"from": 0.55,
"to": 0.55
},
"elements": [
{
"kind": "ark",
"x": 0.5,
"z": 0.4,
"float": true,
"scale": 1.05
},
{
"kind": "waves",
"x": 0.2,
"z": 0.08
},
{
"kind": "waves",
"x": 0.85,
"z": 0.12,
"flip": true
},
{
"kind": "cloud",
"x": 0.12678652263374485,
"z": 0.5941752400548697,
"flip": true
},
{
"kind": "cloud",
"x": 0.902463220164609,
"z": 0.6539334705075446,
"flip": false
}
]
},
"palette": "day",
"camera": {
"push": 1.07,
"panX": 0
},
"hud": {
"badge": "Ep. 1",
"label": "Noé e a Arca a história e as c"
},
"actors": [
{
"kind": "person",
"x": 0.34,
"y": 0.78,
"enterS": 0.15,
"character": {
"name": "Noé",
"look": {
"build": "slim",
"height": 0.96,
"skin": "#c98a5e",
"hair": {
"style": "long",
"color": "#e2e2e8"
},
"beard": {
"style": "long",
"color": "#eeeef2"
},
"glasses": "none",
"brows": "thick",
"top": {
"style": "robe",
"color": "#a8865a",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "long",
"lids": 0.5,
"wrinkles": 0.85,
"head": "oval"
}
},
"expression": "neutral",
"pose": "point",
"timeline": [
{
"do": "express",
"atP": 0.6699999999999999,
"expression": "smile"
},
{
"do": "pose",
"pose": "hold",
"atP": 0.53
}
],
"framing": "full",
"item": "olive",
"flip": false
},
{
"kind": "animal",
"species": "dove",
"x": 0.06,
"y": 0.3,
"scale": 2.4,
"fly": true,
"walk": {
"to": 0.82
},
"carry": "olive"
}
],
"props": [],
"texts": [
{
"kind": "tag",
"text": "Pomba e ramo de oliveira",
"x": 0.5,
"y": 0.17,
"atS": 0.1,
"tone": "info"
}
],
"words": [
{
"text": "Depois,",
"startS": 0,
"endS": 0.62
},
{
"text": "Noé",
"startS": 1.06,
"endS": 1.28
},
{
"text": "soltou",
"startS": 1.28,
"endS": 1.72
},
{
"text": "uma",
"startS": 1.72,
"endS": 1.92
},
{
"text": "pomba.",
"startS": 1.92,
"endS": 2.44,
"tone": "key"
},
{
"text": "Ela",
"startS": 3.12,
"endS": 3.48
},
{
"text": "voltou",
"startS": 3.48,
"endS": 3.9
},
{
"text": "sem",
"startS": 3.9,
"endS": 4.12
},
{
"text": "achar",
"startS": 4.12,
"endS": 4.54
},
{
"text": "onde",
"startS": 4.54,
"endS": 4.66
},
{
"text": "pousar,",
"startS": 4.66,
"endS": 5.16
},
{
"text": "na",
"startS": 5.28,
"endS": 5.44
},
{
"text": "segunda",
"startS": 5.44,
"endS": 5.8
},
{
"text": "vez,",
"startS": 5.8,
"endS": 6.24
},
{
"text": "trouxe",
"startS": 6.42,
"endS": 6.82
},
{
"text": "uma",
"startS": 6.82,
"endS": 6.98
},
{
"text": "folha",
"startS": 6.98,
"endS": 7.34
},
{
"text": "de",
"startS": 7.34,
"endS": 7.44
},
{
"text": "oliveira,",
"startS": 7.44,
"endS": 7.92,
"tone": "key"
},
{
"text": "na",
"startS": 8.14,
"endS": 8.34
},
{
"text": "terceira,",
"startS": 8.34,
"endS": 8.86
},
{
"text": "não",
"startS": 9.04,
"endS": 9.36
},
{
"text": "voltou.",
"startS": 9.36,
"endS": 9.82
}
],
"audioEnv": {
"fps": 30,
"values": [
0,
0,
0,
0,
0,
0.18,
0.13,
1,
1,
0.59,
0.04,
0.01,
0,
0.35,
0.97,
1,
0.94,
0.93,
0.8,
0.21,
0.1,
0.08,
0.05,
0.01,
0,
0,
0,
0,
0,
0,
0.19,
0.55,
0.61,
0.69,
0.7,
0.59,
0.43,
0.57,
0.4,
0.07,
0.06,
0.22,
1,
0.62,
0.32,
0.06,
0.01,
0.27,
1,
1,
1,
0.7,
0.69,
0.51,
0.31,
0.52,
0.91,
0.86,
0.19,
0.02,
0,
0.17,
0.61,
0.61,
0.52,
0.43,
0.29,
0.17,
0.23,
0.18,
0.05,
0.01,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0.45,
0.76,
0.89,
0.55,
0.82,
0.9,
0.55,
0.1,
0.61,
0.75,
0.6,
0.29,
0.03,
0,
0.61,
0.8,
0.75,
0.62,
0.25,
0.05,
0.03,
0.03,
0.57,
0.44,
0.37,
0.47,
0.69,
0.49,
0.14,
0.13,
0.17,
0.12,
0.63,
0.97,
1,
0.71,
0.59,
0.51,
0.5,
0.32,
0.17,
0.41,
0.05,
0.01,
0.45,
0.71,
0.59,
0.26,
0.08,
0.2,
0.65,
0.74,
0.68,
0.39,
0.11,
0.04,
0.02,
0.01,
0,
0,
0.01,
0.2,
0.51,
0.55,
0.13,
0.02,
0.03,
0.52,
0.35,
0.15,
0.3,
0.76,
0.49,
0.49,
0.41,
0.8,
0.82,
0.84,
0.22,
0.08,
0.27,
0.93,
1,
1,
0.67,
0.38,
0.07,
0.04,
0.04,
0.02,
0.01,
0,
0,
0,
0,
0,
0,
0.04,
0.38,
0.63,
0.86,
0.66,
0.23,
0.06,
0.1,
0.31,
0.49,
0.36,
0.81,
0.97,
0.37,
0.05,
0.02,
0.02,
0.36,
1,
1,
0.97,
0.39,
0.8,
1,
0.83,
0.13,
0.33,
0.94,
0.65,
0.39,
0.83,
0.6,
0.22,
0.1,
0.42,
1,
1,
0.7,
0.36,
0.24,
0.26,
0.07,
0.01,
0,
0,
0.01,
0.01,
0,
0,
0,
0.12,
0.3,
0.74,
0.81,
0.14,
0.01,
0.37,
1,
0.55,
0.17,
0.06,
0.02,
0.02,
0.42,
0.82,
0.82,
0.81,
0.5,
0.36,
0.27,
0.03,
0.01,
0,
0,
0,
0,
0,
0.08,
0.25,
0.5,
0.59,
0.99,
0.72,
0.56,
0.6,
0.43,
0.2,
0.42,
0.93,
0.63,
0.47,
0.34,
0.02,
0.01,
0.4,
1,
0.73,
0.45,
0.17,
0.03,
0.01,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
}
+550
View File
@@ -0,0 +1,550 @@
{
"schemaVersion": 1,
"width": 1080,
"height": 1920,
"fps": 30,
"durationS": 10.118,
"seed": 99,
"scene": {
"kind": "place",
"time": "dawn",
"litHouse": false
},
"place": {
"ground": "dirt",
"flood": {
"from": 0.66,
"to": 0.72
},
"elements": [
{
"kind": "mountain",
"x": 0.5,
"z": 0.82,
"scale": 1.35
},
{
"kind": "mountain",
"x": 0.1,
"z": 0.96
},
{
"kind": "mountain",
"x": 0.92,
"z": 0.95
},
{
"kind": "ark",
"x": 0.46,
"z": 0.82,
"scale": 0.8,
"lift": 0.1
},
{
"kind": "cloud",
"x": 0.11786856995884773,
"z": 0.42165637860082306,
"flip": false
}
]
},
"palette": "dusk",
"camera": {
"push": 1.09,
"panX": 0
},
"hud": {
"badge": "Ep. 1",
"label": "Noé e a Arca a história e as c"
},
"actors": [
{
"kind": "person",
"x": 0.5,
"y": 0.78,
"enterS": 0.15,
"character": {
"name": "Noé",
"look": {
"build": "slim",
"height": 0.96,
"skin": "#c98a5e",
"hair": {
"style": "long",
"color": "#e2e2e8"
},
"beard": {
"style": "long",
"color": "#eeeef2"
},
"glasses": "none",
"brows": "thick",
"top": {
"style": "robe",
"color": "#a8865a",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "long",
"lids": 0.5,
"wrinkles": 0.85,
"head": "oval"
}
},
"expression": "neutral",
"pose": "stand",
"timeline": [
{
"do": "express",
"atP": 0.6499999999999999,
"expression": "smile"
},
{
"do": "look",
"dir": "left",
"atP": 0.55
},
{
"do": "shake_head",
"times": 1,
"dur": 1.2,
"atP": 0.55
}
],
"framing": "medium",
"flip": false
}
],
"props": [],
"texts": [
{
"kind": "tag",
"text": "Ararate ≈ Urartu (região)",
"x": 0.5,
"y": 0.17,
"atS": 0.1,
"tone": "info"
}
],
"words": [
{
"text": "A",
"startS": 0,
"endS": 0.28
},
{
"text": "arca",
"startS": 0.28,
"endS": 0.68
},
{
"text": "pousou,",
"startS": 0.68,
"endS": 1.08
},
{
"text": "diz",
"startS": 1.3,
"endS": 1.56
},
{
"text": "o",
"startS": 1.56,
"endS": 1.72
},
{
"text": "Gênesis,",
"startS": 1.72,
"endS": 2.22
},
{
"text": "sobre",
"startS": 2.46,
"endS": 2.74
},
{
"text": "os",
"startS": 2.74,
"endS": 2.92
},
{
"text": "montes",
"startS": 2.92,
"endS": 3.32
},
{
"text": "de",
"startS": 3.32,
"endS": 3.42
},
{
"text": "Ararat,",
"startS": 3.42,
"endS": 3.84
},
{
"text": "uma",
"startS": 4.06,
"endS": 4.4
},
{
"text": "região,",
"startS": 4.4,
"endS": 4.84,
"tone": "key"
},
{
"text": "não",
"startS": 5.08,
"endS": 5.38
},
{
"text": "necessariamente",
"startS": 5.38,
"endS": 6
},
{
"text": "o",
"startS": 6,
"endS": 6.26
},
{
"text": "pico",
"startS": 6.26,
"endS": 6.5
},
{
"text": "hoje",
"startS": 6.5,
"endS": 6.76
},
{
"text": "chamado",
"startS": 6.76,
"endS": 7.2
},
{
"text": "Monte",
"startS": 7.2,
"endS": 7.58
},
{
"text": "Arara,",
"startS": 7.58,
"endS": 7.98
},
{
"text": "na",
"startS": 8.18,
"endS": 8.36
},
{
"text": "Turquia.",
"startS": 8.36,
"endS": 8.88
}
],
"audioEnv": {
"fps": 30,
"values": [
0,
0,
0,
0,
0.01,
0.51,
1,
0.97,
1,
1,
0.85,
0.9,
0.8,
0.68,
0.36,
0.22,
0.02,
0.12,
0.76,
0.85,
0.12,
0.01,
0.31,
0.83,
0.94,
0.47,
0.21,
0.08,
0.3,
0.96,
0.99,
0.7,
0.34,
0.07,
0.02,
0,
0,
0,
0,
0,
0.17,
0.11,
0.14,
0.54,
0.78,
0.58,
0.17,
0.27,
0.98,
0.91,
0.35,
0.2,
0.31,
0.83,
0.75,
0.68,
0.44,
0.49,
0.47,
0.38,
0.08,
0.04,
0.18,
0.16,
0.03,
0.02,
0.03,
0.01,
0,
0,
0.01,
0.01,
0,
0,
0.01,
0.04,
0.08,
0.4,
1,
1,
0.21,
0.39,
0.62,
1,
0.7,
0.23,
0.1,
0.15,
0.41,
0.62,
0.81,
0.76,
0.9,
0.84,
0.79,
0.16,
0.15,
0.41,
0.41,
0.21,
0.19,
0.83,
1,
0.92,
0.85,
1,
0.77,
0.38,
0.73,
0.68,
0.77,
0.74,
0.6,
0.12,
0.06,
0.16,
0.09,
0.06,
0.01,
0,
0,
0,
0,
0,
0,
0,
0,
0.38,
0.53,
0.51,
1,
1,
0.79,
0.63,
0.7,
0.86,
0.73,
0.35,
0.18,
0.22,
0.39,
0.88,
0.89,
0.76,
0.68,
0.39,
0.2,
0.04,
0,
0,
0.01,
0.01,
0,
0,
0,
0,
0.4,
0.55,
0.86,
0.92,
0.49,
0.6,
0.52,
0.52,
0.82,
0.75,
0.1,
0.04,
0.44,
0.48,
0.06,
0.03,
0.65,
0.82,
0.49,
0.87,
0.6,
0.5,
0.59,
0.61,
0.51,
0.54,
0.31,
0.09,
0.22,
0.48,
0.05,
0.01,
0.4,
0.8,
1,
0.78,
0.06,
0.08,
0.54,
0.95,
0.95,
1,
1,
0.94,
0.72,
0.33,
0.18,
0.37,
0.26,
0.17,
0.16,
0.46,
0.9,
0.74,
0.47,
0.72,
0.93,
1,
0.62,
0.18,
0.69,
0.6,
0.47,
0.47,
0.57,
0.72,
0.81,
0.73,
0.59,
0.39,
0.08,
0.13,
0.79,
1,
0.77,
0.83,
1,
0.91,
0.88,
0.85,
0.51,
0.47,
0.45,
0.25,
0.08,
0.03,
0.01,
0,
0,
0,
0.05,
0.18,
0.49,
0.93,
0.54,
0.03,
0,
0.32,
0.64,
0.39,
0.08,
0.03,
0.01,
0.03,
0.1,
0.62,
0.68,
0.79,
0.53,
0.21,
0.07,
0.01,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
}
+751
View File
@@ -0,0 +1,751 @@
{
"schemaVersion": 1,
"width": 1080,
"height": 1920,
"fps": 30,
"durationS": 8.006,
"seed": 106,
"scene": {
"kind": "place",
"time": "day",
"litHouse": false
},
"place": {
"ground": "grass",
"elements": [
{
"kind": "rainbow",
"x": 0.5,
"z": 0.97,
"scale": 2.3
},
{
"kind": "mountain",
"x": 0.2,
"z": 0.95
},
{
"kind": "mountain",
"x": 0.85,
"z": 0.94
},
{
"kind": "ark",
"x": 0.78,
"z": 0.8,
"scale": 0.6
},
{
"kind": "palm",
"x": 0.10895061728395061,
"z": 0.7737062757201646,
"flip": true
},
{
"kind": "bush",
"x": 0.8573125,
"z": 0.712417695473251,
"flip": false
}
]
},
"palette": "dusk",
"camera": {
"push": 1.05,
"panX": 0
},
"hud": {
"badge": "Ep. 1",
"label": "Noé e a Arca a história e as c"
},
"actors": [
{
"kind": "person",
"x": 0.14,
"y": 0.8,
"scale": 0.6,
"enterS": 0.15,
"character": {
"name": "Noé",
"look": {
"build": "slim",
"height": 0.96,
"skin": "#c98a5e",
"hair": {
"style": "long",
"color": "#e2e2e8"
},
"beard": {
"style": "long",
"color": "#eeeef2"
},
"glasses": "none",
"brows": "thick",
"top": {
"style": "robe",
"color": "#a8865a",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "long",
"lids": 0.5,
"wrinkles": 0.85,
"head": "oval"
}
},
"expression": "neutral",
"pose": "arms_up",
"timeline": [
{
"do": "express",
"atP": 0.6699999999999999,
"expression": "happy"
},
{
"do": "look",
"dir": "up",
"atP": 0.48
},
{
"do": "pose",
"pose": "celebrate",
"atP": 0.62
},
{
"do": "bounce",
"times": 2,
"atP": 0.62
}
],
"framing": "full",
"flip": false
},
{
"kind": "person",
"x": 0.5,
"y": 0.8,
"scale": 0.6,
"enterS": 0.55,
"character": {
"name": "Sem",
"look": {
"build": "average",
"height": 1.02,
"skin": "#c08055",
"hair": {
"style": "short",
"color": "#6b4226"
},
"beard": {
"style": "full",
"color": "#6b4226"
},
"glasses": "none",
"brows": "thin",
"top": {
"style": "robe",
"color": "#2f6db3",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "round",
"lids": 0.1,
"wrinkles": 0.4,
"head": "round"
}
},
"expression": "neutral",
"pose": "arms_up",
"timeline": [
{
"do": "express",
"atP": 0.6699999999999999,
"expression": "happy"
},
{
"do": "look",
"dir": "up",
"atP": 0.48
},
{
"do": "pose",
"pose": "celebrate",
"atP": 0.62
},
{
"do": "bounce",
"times": 2,
"atP": 0.62
}
],
"framing": "full",
"flip": false
},
{
"kind": "person",
"x": 0.86,
"y": 0.8,
"scale": 0.6,
"enterS": 0.9500000000000001,
"character": {
"name": "Jafé",
"look": {
"build": "slim",
"height": 1.08,
"skin": "#d4a074",
"hair": {
"style": "side",
"color": "#6b4226"
},
"beard": {
"style": "goatee",
"color": "#6b4226"
},
"glasses": "none",
"brows": "thin",
"top": {
"style": "robe",
"color": "#c8443a",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "round",
"lids": 0.1,
"wrinkles": 0,
"head": "round"
}
},
"expression": "neutral",
"pose": "arms_up",
"timeline": [
{
"do": "express",
"atP": 0.6699999999999999,
"expression": "happy"
},
{
"do": "look",
"dir": "up",
"atP": 0.48
},
{
"do": "pose",
"pose": "celebrate",
"atP": 0.62
},
{
"do": "bounce",
"times": 2,
"atP": 0.62
}
],
"framing": "full",
"flip": true
},
{
"kind": "person",
"x": 0.32,
"y": 0.8300000000000001,
"scale": 0.6,
"enterS": 0.35,
"character": {
"name": "Esposa de Noé",
"look": {
"build": "average",
"height": 0.92,
"skin": "#d09a70",
"hair": {
"style": "long",
"color": "#c9c9cf"
},
"beard": {
"style": "none",
"color": "#a9a9b0"
},
"glasses": "none",
"brows": "thick",
"top": {
"style": "robe",
"color": "#8a6f9e",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "button",
"lids": 0.3,
"wrinkles": 0.7,
"head": "round"
}
},
"expression": "neutral",
"pose": "arms_up",
"timeline": [
{
"do": "express",
"atP": 0.6699999999999999,
"expression": "happy"
},
{
"do": "look",
"dir": "up",
"atP": 0.48
},
{
"do": "pose",
"pose": "celebrate",
"atP": 0.62
},
{
"do": "bounce",
"times": 2,
"atP": 0.62
}
],
"framing": "full",
"flip": false
},
{
"kind": "person",
"x": 0.68,
"y": 0.8300000000000001,
"scale": 0.6,
"enterS": 0.7500000000000001,
"character": {
"name": "Cam",
"look": {
"build": "heavy",
"height": 1,
"skin": "#9a6440",
"hair": {
"style": "curly",
"color": "#3a2a1e"
},
"beard": {
"style": "stubble",
"color": "#3a2a1e"
},
"glasses": "none",
"brows": "thin",
"top": {
"style": "robe",
"color": "#56704a",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "round",
"lids": 0.1,
"wrinkles": 0,
"head": "wide",
"belly": true
}
},
"expression": "neutral",
"pose": "arms_up",
"timeline": [
{
"do": "express",
"atP": 0.6699999999999999,
"expression": "happy"
},
{
"do": "look",
"dir": "up",
"atP": 0.48
},
{
"do": "pose",
"pose": "celebrate",
"atP": 0.62
},
{
"do": "bounce",
"times": 2,
"atP": 0.62
}
],
"framing": "full",
"flip": true
}
],
"props": [],
"texts": [
{
"kind": "tag",
"text": "Arco-íris = aliança (Gn 9)",
"x": 0.5,
"y": 0.17,
"atS": 0.1,
"tone": "info"
}
],
"words": [
{
"text": "Depois",
"startS": 0,
"endS": 0.52
},
{
"text": "do",
"startS": 0.52,
"endS": 0.7
},
{
"text": "dilúvio,",
"startS": 0.7,
"endS": 1.18
},
{
"text": "o",
"startS": 1.34,
"endS": 1.56
},
{
"text": "arco",
"startS": 1.56,
"endS": 1.82,
"tone": "key"
},
{
"text": "-íris",
"startS": 1.82,
"endS": 2.04,
"tone": "key"
},
{
"text": "surge",
"startS": 2.04,
"endS": 2.4
},
{
"text": "no",
"startS": 2.4,
"endS": 2.56
},
{
"text": "Gênesis",
"startS": 2.56,
"endS": 2.98
},
{
"text": "como",
"startS": 2.98,
"endS": 3.16
},
{
"text": "sinal",
"startS": 3.16,
"endS": 3.5
},
{
"text": "de",
"startS": 3.5,
"endS": 3.62
},
{
"text": "uma",
"startS": 3.62,
"endS": 3.78
},
{
"text": "aliança.",
"startS": 3.78,
"endS": 4.2,
"tone": "key"
},
{
"text": "Nunca",
"startS": 4.52,
"endS": 4.88,
"tone": "danger"
},
{
"text": "mais",
"startS": 4.88,
"endS": 5.18
},
{
"text": "um",
"startS": 5.18,
"endS": 5.32
},
{
"text": "dilúvio",
"startS": 5.32,
"endS": 5.8
},
{
"text": "destruiria",
"startS": 5.8,
"endS": 6.38
},
{
"text": "a",
"startS": 6.38,
"endS": 6.5
},
{
"text": "Terra.",
"startS": 6.5,
"endS": 6.7
}
],
"audioEnv": {
"fps": 30,
"values": [
0,
0,
0,
0,
0,
0.26,
0.16,
0.76,
1,
1,
0.07,
0.01,
0.03,
0.64,
0.86,
0.77,
0.48,
0.16,
0.03,
0.65,
0.9,
0.27,
0.12,
0.36,
0.83,
0.62,
0.42,
0.74,
0.88,
0.91,
1,
0.37,
0.11,
0.12,
0.25,
0.11,
0.01,
0,
0,
0.01,
0.01,
0,
0,
0,
0.2,
0.73,
1,
0.63,
0.2,
0.13,
0.01,
0.08,
0.32,
0.7,
0.67,
0.52,
0.47,
0.51,
0.22,
0.43,
0.52,
0.16,
0.11,
0.13,
0.09,
0.24,
0.91,
1,
0.74,
0.41,
0.19,
0.29,
0.65,
0.38,
0.5,
0.76,
0.76,
0.38,
0.13,
0.33,
0.8,
0.62,
0.46,
0.58,
0.44,
0.12,
0.27,
0.27,
0.14,
0.07,
0.03,
0.44,
0.69,
0.45,
0.61,
0.46,
0.06,
0.05,
0.34,
0.7,
0.55,
0.62,
0.77,
0.92,
0.87,
0.73,
0.24,
0.13,
0.5,
0.53,
0.46,
0.6,
0.68,
0.63,
0.57,
0.74,
0.93,
0.98,
0.69,
0.65,
0.56,
0.4,
0.1,
0.01,
0.03,
0.2,
0.08,
0.01,
0,
0,
0.01,
0.01,
0.01,
0,
0,
0.31,
0.53,
0.67,
0.74,
0.76,
0.69,
0.64,
0.34,
0.03,
0.29,
1,
1,
0.69,
0.42,
0.59,
0.85,
0.75,
0.88,
0.78,
0.58,
0.15,
0.35,
0.53,
0.59,
0.59,
0.28,
0.15,
0.49,
0.82,
0.57,
0.45,
0.8,
0.98,
1,
1,
0.29,
0.11,
0.47,
0.67,
0.24,
0.24,
0.66,
0.39,
0.14,
0.06,
0.05,
0.67,
0.7,
1,
1,
0.92,
0.26,
0.65,
0.46,
1,
0.96,
0.9,
0.12,
0.01,
0.2,
0.84,
0.95,
0.69,
0.55,
0.22,
0.15,
0.15,
0.08,
0.02,
0.01,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
}
+422
View File
@@ -0,0 +1,422 @@
{
"schemaVersion": 1,
"width": 1080,
"height": 1920,
"fps": 30,
"durationS": 6.902,
"seed": 113,
"scene": {
"kind": "place",
"time": "day",
"litHouse": false
},
"place": {
"ground": "dirt",
"elements": [
{
"kind": "house",
"x": 0.12,
"z": 0.45,
"color": "#d8b88a"
},
{
"kind": "house",
"x": 0.86,
"z": 0.6,
"color": "#c9a576",
"flip": true
},
{
"kind": "palm",
"x": 0.1000326646090535,
"z": 0.5149279835390946,
"flip": false
},
{
"kind": "tent",
"x": 0.8947371399176954,
"z": 0.3781764403292181,
"flip": false
},
{
"kind": "palm",
"x": 0.23596939300411524,
"z": 0.6900360082304526,
"flip": true
},
{
"kind": "mountain",
"x": 0.7287294238683127,
"z": 0.95,
"flip": false
},
{
"kind": "wall",
"x": 0.5,
"z": 0.8,
"color": "#d8b88a"
}
]
},
"palette": "day",
"camera": {
"push": 1.07,
"panX": 0
},
"hud": {
"badge": "Ep. 1",
"label": "Noé e a Arca a história e as c"
},
"actors": [
{
"kind": "person",
"x": 0.34,
"y": 0.78,
"enterS": 0.15,
"character": {
"name": "Noé",
"look": {
"build": "slim",
"height": 0.96,
"skin": "#c98a5e",
"hair": {
"style": "long",
"color": "#e2e2e8"
},
"beard": {
"style": "long",
"color": "#eeeef2"
},
"glasses": "none",
"brows": "thick",
"top": {
"style": "robe",
"color": "#a8865a",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "long",
"lids": 0.5,
"wrinkles": 0.85,
"head": "oval"
}
},
"expression": "neutral",
"pose": "think",
"timeline": [
{
"do": "express",
"atP": 0.33,
"expression": "smile"
},
{
"do": "sit",
"atP": 0.3
},
{
"do": "pose",
"pose": "think",
"atP": 0.46
}
],
"framing": "full",
"flip": false
}
],
"props": [
{
"icon": "book",
"x": 0.74,
"y": 0.5,
"size": 0.17,
"label": "Escritura",
"enterS": 0.3,
"tone": "info",
"shake": false,
"rings": false,
"crossed": false
}
],
"texts": [
{
"kind": "tag",
"text": "600 anos → 950 anos",
"x": 0.5,
"y": 0.17,
"atS": 0.1,
"tone": "info"
}
],
"words": [
{
"text": "Noé",
"startS": 0,
"endS": 0.58
},
{
"text": "tinha",
"startS": 0.58,
"endS": 0.76
},
{
"text": "600",
"startS": 0.76,
"endS": 1.12,
"tone": "key"
},
{
"text": "anos",
"startS": 1.12,
"endS": 1.68,
"tone": "key"
},
{
"text": "no",
"startS": 1.68,
"endS": 1.86
},
{
"text": "dilúvio",
"startS": 1.86,
"endS": 2.36
},
{
"text": "e,",
"startS": 2.36,
"endS": 2.52
},
{
"text": "segundo",
"startS": 2.72,
"endS": 3.08
},
{
"text": "Gênesis,",
"startS": 3.08,
"endS": 3.66
},
{
"text": "morreu",
"startS": 3.92,
"endS": 4.3
},
{
"text": "aos",
"startS": 4.3,
"endS": 4.48
},
{
"text": "950.",
"startS": 4.48,
"endS": 5.48,
"tone": "key"
}
],
"audioEnv": {
"fps": 30,
"values": [
0,
0,
0,
0,
0.03,
0.55,
0.67,
0.9,
1,
1,
0.78,
0.66,
0.71,
0.7,
0.53,
0.08,
0.06,
0.26,
0.25,
0.26,
0.56,
0.58,
0.66,
0.5,
0.06,
0.04,
0.53,
0.81,
0.57,
0.11,
0.02,
0.02,
0.05,
0.61,
0.67,
0.62,
0.47,
0.1,
0.08,
0.74,
0.62,
0.27,
0.06,
0.3,
0.84,
0.69,
0.67,
0.59,
0.51,
0.64,
0.59,
0.2,
0.05,
0.19,
0.71,
0.59,
0.12,
0.15,
0.68,
0.88,
0.58,
0.47,
1,
1,
1,
0.89,
0.32,
0.08,
0.28,
0.49,
0.44,
0.33,
0.18,
0.05,
0.01,
0,
0,
0.01,
0,
0,
0.01,
0.01,
0.02,
0.05,
0.74,
0.55,
0.23,
0.15,
0.44,
0.57,
0.63,
0.47,
0.61,
1,
0.53,
0.18,
0.17,
0.61,
0.91,
0.81,
0.51,
0.47,
0.42,
0.33,
0.05,
0.05,
0.17,
0.06,
0.03,
0.03,
0.03,
0.01,
0,
0.01,
0.01,
0.01,
0,
0,
0.16,
0.46,
0.8,
1,
0.76,
0.65,
0.6,
0.76,
0.98,
1,
0.76,
1,
0.98,
1,
0.42,
0.11,
0.03,
0.49,
0.84,
0.81,
0.21,
0.18,
0.47,
0.18,
0.02,
0.02,
0.03,
0.58,
0.73,
0.59,
0.43,
0.09,
0.14,
0.51,
0.14,
0.15,
0.48,
0.32,
0.03,
0.04,
0.56,
0.7,
0.41,
0.09,
0.35,
0.75,
0.57,
0.49,
0.32,
0.1,
0.02,
0.14,
0.07,
0.01,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
}
+428
View File
@@ -0,0 +1,428 @@
{
"schemaVersion": 1,
"width": 1080,
"height": 1920,
"fps": 30,
"durationS": 8.03,
"seed": 120,
"scene": {
"kind": "place",
"time": "night",
"litHouse": false
},
"place": {
"ground": "floor",
"indoor": true,
"elements": [
{
"kind": "shelf",
"x": 0.09111471193415638,
"z": 0.2561496913580247,
"flip": true
},
{
"kind": "window",
"x": 0.872161779835391,
"z": 0.6439351851851851,
"flip": true
},
{
"kind": "shelf",
"x": 0.23806995884773663,
"z": 0.4636651234567901,
"flip": false
},
{
"kind": "frame",
"x": 0.7338392489711935,
"z": 0.5653395061728395,
"flip": false
},
{
"kind": "frame",
"x": 0.06446965020576131,
"z": 0.5989583333333333,
"flip": true
},
{
"kind": "pendant",
"x": 0.5,
"z": 0.45
}
]
},
"palette": "sepia",
"light": "spot",
"camera": {
"push": 1.09,
"panX": 0
},
"hud": {
"badge": "Ep. 1",
"label": "Noé e a Arca a história e as c"
},
"actors": [],
"props": [
{
"icon": "tablet",
"x": 0.5,
"y": 0.46,
"size": 0.17,
"label": "Tábua de argila",
"enterS": 0.3,
"tone": "info",
"shake": false,
"rings": false,
"crossed": false
}
],
"texts": [
{
"kind": "tag",
"text": "Epopeia de Gilgamesh",
"x": 0.5,
"y": 0.17,
"atS": 0.1,
"tone": "info"
}
],
"words": [
{
"text": "Uma",
"startS": 0,
"endS": 0.32
},
{
"text": "história",
"startS": 0.32,
"endS": 0.7
},
{
"text": "antiga",
"startS": 0.7,
"endS": 1.06
},
{
"text": "lembra",
"startS": 1.06,
"endS": 1.42
},
{
"text": "essa.",
"startS": 1.42,
"endS": 1.76
},
{
"text": "Na",
"startS": 1.94,
"endS": 2.12
},
{
"text": "epopeia",
"startS": 2.12,
"endS": 2.62,
"tone": "key"
},
{
"text": "de",
"startS": 2.62,
"endS": 2.76
},
{
"text": "Gilgami,",
"startS": 2.76,
"endS": 3.24
},
{
"text": "o",
"startS": 3.54,
"endS": 3.64
},
{
"text": "Tnapishim",
"startS": 3.64,
"endS": 4.16
},
{
"text": "sobrevive",
"startS": 4.16,
"endS": 4.7
},
{
"text": "a",
"startS": 4.7,
"endS": 4.78
},
{
"text": "um",
"startS": 4.78,
"endS": 4.9
},
{
"text": "dilúvio",
"startS": 4.9,
"endS": 5.32
},
{
"text": "num",
"startS": 5.32,
"endS": 5.46
},
{
"text": "barco",
"startS": 5.46,
"endS": 5.92
},
{
"text": "e",
"startS": 5.92,
"endS": 6.02
},
{
"text": "solta",
"startS": 6.02,
"endS": 6.4
},
{
"text": "aves.",
"startS": 6.4,
"endS": 6.74
}
],
"audioEnv": {
"fps": 30,
"values": [
0,
0,
0,
0,
0,
0.54,
0.75,
0.65,
0.65,
0.8,
0.61,
0.19,
0.16,
0.06,
0,
0.82,
1,
1,
1,
0.83,
0.66,
0.74,
0.44,
0.36,
0.25,
0.07,
0.15,
0.18,
0.87,
0.46,
0.12,
0.89,
1,
0.73,
0.5,
0.61,
0.66,
0.67,
0.56,
0.27,
0.6,
0.77,
0.91,
0.7,
0.69,
0.74,
0.68,
0.49,
0.17,
0.01,
0.01,
0.03,
0.15,
0.02,
0.01,
0,
0,
0,
0,
0,
0,
0.15,
0.46,
0.67,
0.79,
0.2,
0.01,
0.38,
1,
0.36,
0.02,
0,
0.48,
0.81,
0.78,
0.88,
0.9,
0.74,
0.78,
0.32,
0.14,
0.21,
0.29,
0.16,
0.14,
0.5,
0.86,
0.69,
0.18,
0.12,
0.77,
0.93,
0.74,
0.55,
0.41,
0.25,
0.19,
0.11,
0.04,
0.01,
0,
0,
0,
0.01,
0,
0,
0.35,
0.58,
0.09,
0.1,
0.3,
0.69,
0.76,
0.28,
0.01,
0.18,
0.61,
0.32,
0.15,
0.23,
0.19,
0.25,
0.54,
0.54,
0.37,
0.06,
0.07,
0.57,
1,
0.17,
0.59,
0.7,
0.9,
0.37,
0.07,
0.2,
0.69,
0.8,
0.7,
0.15,
0.38,
0.92,
0.53,
0.37,
0.43,
0.45,
0.12,
0.25,
0.66,
0.5,
0.45,
0.51,
0.95,
1,
1,
0.84,
0.17,
0.21,
0.74,
0.57,
0.42,
0.41,
0.39,
0.42,
0.42,
0.42,
0.18,
0.28,
1,
1,
0.71,
0.73,
0.41,
0.18,
0.11,
0.01,
0.03,
0.38,
0.73,
0.64,
0.08,
0.07,
0.07,
0.27,
1,
1,
0.84,
0.75,
0.06,
0.04,
0.8,
0.99,
0.77,
0.7,
0.63,
0.46,
0.12,
0.03,
0.14,
0.19,
0.06,
0.03,
0.03,
0.02,
0.01,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
}
+537
View File
@@ -0,0 +1,537 @@
{
"schemaVersion": 1,
"width": 1080,
"height": 1920,
"fps": 30,
"durationS": 10.718,
"seed": 127,
"scene": {
"kind": "place",
"time": "night",
"litHouse": false
},
"place": {
"ground": "floor",
"indoor": true,
"elements": [
{
"kind": "shelf",
"x": 0.14219675925925926,
"z": 0.5973713991769547,
"flip": false
},
{
"kind": "window",
"x": 0.9095864197530864,
"z": 0.30969393004115225,
"flip": true
},
{
"kind": "shelf",
"x": 0.24017052469135802,
"z": 0.8372942386831276,
"flip": false
},
{
"kind": "frame",
"x": 0.7389490740740741,
"z": 0.6301723251028806,
"flip": true
},
{
"kind": "frame",
"x": 0.05092206790123457,
"z": 0.5383281893004115,
"flip": true
},
{
"kind": "pendant",
"x": 0.5,
"z": 0.45
}
]
},
"palette": "sepia",
"light": "spot",
"camera": {
"push": 1.05,
"panX": 0
},
"hud": {
"badge": "Ep. 1",
"label": "Noé e a Arca a história e as c"
},
"actors": [],
"props": [
{
"icon": "tablet",
"x": 0.3,
"y": 0.46,
"size": 0.13,
"label": "Tábua de argila",
"enterS": 0.3,
"tone": "info",
"shake": false,
"rings": false,
"crossed": false
},
{
"icon": "book",
"x": 0.72,
"y": 0.46,
"size": 0.13,
"label": "Escritura",
"enterS": 0.8,
"tone": "info",
"shake": false,
"rings": false,
"crossed": false
}
],
"texts": [
{
"kind": "tag",
"text": "Tábua K.3375 • achada em 1872",
"x": 0.5,
"y": 0.17,
"atS": 0.1,
"tone": "info"
}
],
"words": [
{
"text": "A",
"startS": 0,
"endS": 0.32
},
{
"text": "Tábua",
"startS": 0.32,
"endS": 0.66,
"tone": "key"
},
{
"text": "do",
"startS": 0.66,
"endS": 0.78
},
{
"text": "Dilúvio,",
"startS": 0.78,
"endS": 1.28
},
{
"text": "do",
"startS": 1.44,
"endS": 1.7
},
{
"text": "século",
"startS": 1.7,
"endS": 2.1
},
{
"text": "VII",
"startS": 2.1,
"endS": 2.46
},
{
"text": "a",
"startS": 2.46,
"endS": 2.72
},
{
"text": ".C.,",
"startS": 2.72,
"endS": 3.6
},
{
"text": "achada",
"startS": 3.6,
"endS": 4.18,
"tone": "key"
},
{
"text": "em",
"startS": 4.18,
"endS": 4.3
},
{
"text": "Nínive",
"startS": 4.3,
"endS": 4.6
},
{
"text": "e",
"startS": 4.6,
"endS": 4.72
},
{
"text": "identificada",
"startS": 4.72,
"endS": 5.36
},
{
"text": "por",
"startS": 5.36,
"endS": 5.58
},
{
"text": "George",
"startS": 5.58,
"endS": 5.82
},
{
"text": "Smith",
"startS": 5.82,
"endS": 6.3
},
{
"text": "em",
"startS": 6.3,
"endS": 6.46
},
{
"text": "1872,",
"startS": 6.46,
"endS": 7.8,
"tone": "key"
},
{
"text": "está",
"startS": 8.26,
"endS": 8.48
},
{
"text": "no",
"startS": 8.48,
"endS": 8.62
},
{
"text": "Museu",
"startS": 8.62,
"endS": 8.94
},
{
"text": "Britânico.",
"startS": 8.94,
"endS": 9.5
}
],
"audioEnv": {
"fps": 30,
"values": [
0,
0,
0,
0,
0.01,
0.95,
0.97,
0.51,
0.03,
0,
0.03,
1,
1,
0.91,
0.83,
0.28,
0.15,
0.88,
1,
0.96,
0.19,
0.22,
0.83,
0.97,
0.26,
0.14,
0.39,
0.85,
0.56,
0.31,
0.74,
0.94,
0.98,
0.96,
0.36,
0.08,
0.12,
0.19,
0.14,
0.01,
0,
0,
0,
0,
0,
0,
0.12,
0.15,
0.57,
0.67,
0.5,
0.1,
0.05,
0.03,
0.04,
0.87,
0.76,
0.67,
0.16,
0.01,
0.37,
0.7,
0.82,
0.58,
0.11,
0.04,
0.03,
0.55,
0.98,
0.86,
0.54,
0.03,
0.16,
0.24,
0.2,
0.21,
0.7,
0.71,
0.58,
0.6,
0.49,
0.22,
0.15,
0.29,
0.24,
0.13,
0.29,
0.65,
0.09,
0.02,
0.22,
0.34,
0.79,
0.89,
0.69,
0.39,
0.11,
0.08,
0.01,
0.13,
0.17,
0.06,
0.01,
0,
0,
0.01,
0.01,
0.01,
0.01,
0,
0,
0,
0.24,
0.82,
0.6,
0.25,
0.18,
0.21,
0.17,
0.6,
1,
0.97,
0.56,
0.17,
0.4,
0.73,
0.81,
0.49,
0.52,
0.55,
0.6,
0.84,
0.86,
0.54,
0.74,
0.56,
0.16,
0.41,
0.55,
0.83,
0.63,
0.13,
1,
0.83,
0.69,
0.25,
0.14,
0.09,
0.02,
0.61,
0.5,
0.04,
0.01,
0.16,
0.96,
1,
0.99,
1,
0.52,
0.22,
0.97,
0.52,
0.03,
0.01,
0.45,
0.72,
0.45,
0.39,
0.17,
0.3,
1,
1,
1,
1,
1,
0.73,
0.57,
0.31,
0.17,
0.47,
0.58,
0.2,
0.09,
0.18,
0.55,
0.67,
0.78,
0.62,
0.05,
0.13,
0.19,
0.43,
0.5,
0.59,
0.61,
0.76,
0.98,
0.71,
0.67,
1,
1,
0.31,
0.04,
0.19,
0.44,
0.14,
0.06,
0.03,
0.05,
0.56,
0.65,
0.57,
0.6,
0.27,
0.04,
0.38,
0.36,
0.17,
0.12,
0.08,
0.02,
0.28,
0.55,
0.09,
0.15,
0.57,
0.35,
0.06,
0.75,
0.69,
0.2,
0.24,
0.79,
0.79,
0.65,
0.49,
0.05,
0.04,
0.03,
0.02,
0,
0,
0.01,
0.01,
0,
0,
0,
0.17,
0.47,
0.23,
0.06,
0.01,
0.11,
0.97,
0.84,
0.41,
0.53,
0.55,
0.36,
0.36,
0.83,
0.57,
0.24,
0.09,
0.52,
1,
1,
1,
0.2,
0.71,
0.67,
1,
0.09,
0.01,
0.29,
0.73,
0.74,
0.54,
0.37,
0.23,
0.28,
0.08,
0.01,
0.12,
0.11,
0.02,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
}
+366
View File
@@ -0,0 +1,366 @@
{
"schemaVersion": 1,
"width": 1080,
"height": 1920,
"fps": 30,
"durationS": 7.55,
"seed": 134,
"scene": {
"kind": "place",
"time": "day",
"litHouse": false
},
"place": {
"ground": "dirt",
"elements": [
{
"kind": "mountain",
"x": 0.5,
"z": 0.9,
"scale": 1.4
},
{
"kind": "mountain",
"x": 0.12,
"z": 0.96
},
{
"kind": "rock",
"x": 0.13327880658436214,
"z": 0.33859310699588474,
"flip": true
},
{
"kind": "rock",
"x": 0.8870110596707819,
"z": 0.5754526748971194,
"flip": false
},
{
"kind": "cloud",
"x": 0.24227109053497942,
"z": 0.5406155692729767,
"flip": false
}
]
},
"palette": "day",
"camera": {
"push": 1.07,
"panX": 0
},
"hud": {
"badge": "Ep. 1",
"label": "Noé e a Arca a história e as c"
},
"actors": [],
"props": [],
"texts": [
{
"kind": "tag",
"text": "Buscas no séc. XX: nada",
"x": 0.5,
"y": 0.17,
"atS": 0.1,
"tone": "info"
}
],
"words": [
{
"text": "No",
"startS": 0,
"endS": 0.32
},
{
"text": "século",
"startS": 0.32,
"endS": 0.78
},
{
"text": "XX,",
"startS": 0.78,
"endS": 1.12
},
{
"text": "expedições",
"startS": 1.54,
"endS": 2.1
},
{
"text": "procuraram",
"startS": 2.1,
"endS": 2.68
},
{
"text": "a",
"startS": 2.68,
"endS": 2.8
},
{
"text": "arca",
"startS": 2.8,
"endS": 3.12
},
{
"text": "no",
"startS": 3.12,
"endS": 3.24
},
{
"text": "Monte",
"startS": 3.24,
"endS": 3.48
},
{
"text": "Arara,",
"startS": 3.48,
"endS": 3.88
},
{
"text": "sem",
"startS": 4.06,
"endS": 4.38
},
{
"text": "sucesso,",
"startS": 4.38,
"endS": 4.96
},
{
"text": "segundo",
"startS": 5.26,
"endS": 5.68
},
{
"text": "a",
"startS": 5.68,
"endS": 5.84
},
{
"text": "Britannica.",
"startS": 5.84,
"endS": 6.32
}
],
"audioEnv": {
"fps": 30,
"values": [
0,
0,
0,
0,
0.06,
0.41,
0.58,
0.83,
0.85,
0.39,
0.06,
0.04,
0.03,
0.32,
1,
1,
0.77,
0.08,
0.01,
0.35,
1,
0.7,
0.86,
0.89,
0.56,
0.13,
0.09,
0.56,
0.68,
0.62,
0.66,
0.47,
0.07,
0.13,
0.07,
0.05,
0.01,
0,
0,
0,
0,
0,
0,
0.14,
0.11,
0.04,
0.07,
0.02,
0.18,
0.78,
0.6,
0.21,
0.17,
0.5,
0.59,
0.11,
0.08,
0.07,
0.1,
0.61,
0.61,
0.56,
0.35,
0.12,
0.08,
0,
0.28,
1,
0.42,
0.03,
0.07,
0.58,
0.97,
0.63,
1,
1,
1,
0.68,
0.75,
0.56,
0.49,
0.77,
0.79,
0.76,
0.74,
0.86,
0.92,
0.77,
0.29,
0.15,
0.07,
0.08,
0.6,
0.63,
0.3,
0.63,
0.56,
0.47,
0.41,
0.63,
0.74,
0.6,
0.53,
0.12,
0.13,
0.51,
1,
0.95,
0.57,
0.99,
0.89,
0.85,
0.9,
0.52,
0.41,
0.46,
0.28,
0.07,
0.02,
0,
0,
0,
0,
0,
0.01,
0.01,
0.01,
0.03,
0.55,
0.53,
0.51,
0.49,
0.11,
0.07,
0.1,
0.74,
0.52,
0.06,
0.03,
0.03,
0.13,
0.88,
1,
0.95,
0.66,
0.19,
0.03,
0.04,
0.08,
0.12,
0.01,
0,
0,
0,
0,
0,
0,
0,
0.01,
0.01,
0.02,
0.36,
0.72,
0.44,
0.17,
0.19,
0.49,
0.73,
0.72,
0.54,
0.42,
1,
0.83,
0.19,
0.38,
0.46,
1,
0.29,
0.03,
0.72,
0.79,
0.52,
0.5,
0.58,
0.52,
0.28,
0.01,
0.09,
0.19,
0.15,
0.01,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
}
+466
View File
@@ -0,0 +1,466 @@
{
"schemaVersion": 1,
"width": 1080,
"height": 1920,
"fps": 30,
"durationS": 9.926,
"seed": 141,
"scene": {
"kind": "place",
"time": "dawn",
"litHouse": false
},
"place": {
"ground": "dirt",
"elements": [
{
"kind": "mountain",
"x": 0.5,
"z": 0.9,
"scale": 1.4
},
{
"kind": "mountain",
"x": 0.12,
"z": 0.96
},
{
"kind": "rock",
"x": 0.12436085390946502,
"z": 0.6798148148148149,
"flip": false
},
{
"kind": "rock",
"x": 0.8644356995884773,
"z": 0.8412114197530863,
"flip": true
},
{
"kind": "cloud",
"x": 0.2443716563786008,
"z": 0.389701646090535,
"flip": true
},
{
"kind": "outcrop",
"x": 0.5,
"z": 0.35,
"scale": 1.2
}
]
},
"palette": "dusk",
"camera": {
"push": 1.09,
"panX": 0
},
"hud": {
"badge": "Ep. 1",
"label": "Noé e a Arca a história e as c"
},
"actors": [],
"props": [],
"texts": [
{
"kind": "tag",
"text": "Durupınar: rocha natural",
"x": 0.5,
"y": 0.17,
"atS": 0.1,
"tone": "info"
}
],
"words": [
{
"text": "Em",
"startS": 0,
"endS": 0.3
},
{
"text": "Durupinar,",
"startS": 0.3,
"endS": 0.84
},
{
"text": "perto",
"startS": 1.14,
"endS": 1.42
},
{
"text": "do",
"startS": 1.42,
"endS": 1.6
},
{
"text": "Arara,",
"startS": 1.6,
"endS": 1.96
},
{
"text": "uma",
"startS": 2.26,
"endS": 2.52
},
{
"text": "formação",
"startS": 2.52,
"endS": 3.1
},
{
"text": "lembra",
"startS": 3.1,
"endS": 3.48
},
{
"text": "um",
"startS": 3.48,
"endS": 3.6
},
{
"text": "barco.",
"startS": 3.6,
"endS": 3.98
},
{
"text": "Um",
"startS": 4.4,
"endS": 5.02
},
{
"text": "estudo",
"startS": 5.02,
"endS": 5.46
},
{
"text": "de",
"startS": 5.46,
"endS": 5.6
},
{
"text": "1996",
"startS": 5.6,
"endS": 6.9,
"tone": "key"
},
{
"text": "a",
"startS": 6.9,
"endS": 7.2
},
{
"text": "descreve",
"startS": 7.2,
"endS": 7.62
},
{
"text": "como",
"startS": 7.62,
"endS": 7.86
},
{
"text": "rocha",
"startS": 7.86,
"endS": 8.22,
"tone": "key"
},
{
"text": "natural.",
"startS": 8.22,
"endS": 8.58,
"tone": "key"
}
],
"audioEnv": {
"fps": 30,
"values": [
0,
0,
0,
0,
0,
0.5,
0.8,
0.73,
0.67,
0.27,
0.43,
0.72,
0.66,
0.6,
0.7,
0.11,
0.02,
0.64,
0.72,
0.62,
0.75,
0.8,
0.79,
0.75,
0.57,
0.18,
0.05,
0.03,
0.01,
0,
0,
0,
0,
0,
0,
0.48,
1,
0.79,
0.64,
0.2,
0.14,
0.02,
0.05,
0.54,
0.23,
0.33,
1,
1,
1,
1,
0.97,
0.82,
0.85,
0.88,
0.83,
0.77,
0.52,
0.46,
0.53,
0.37,
0.17,
0.08,
0.01,
0,
0,
0,
0,
0,
0,
0,
0.19,
0.95,
0.53,
0.56,
0.86,
0.74,
0.23,
0.03,
0.03,
0.79,
0.92,
0.61,
0.53,
0.52,
0.97,
0.98,
0.48,
0.06,
0.03,
0.03,
0.06,
0.98,
0.75,
0.76,
0.64,
0.52,
0.46,
0.7,
0.68,
0.68,
0.55,
0.44,
0.56,
0.61,
0.64,
0.64,
0.56,
0.46,
0.18,
0.76,
0.89,
0.81,
0.56,
0.27,
0.1,
0.04,
0,
0.06,
0.16,
0.03,
0.01,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0.55,
0.73,
0.85,
0.87,
0.85,
0.31,
0.13,
0.17,
0.05,
0,
0.2,
0.71,
0.74,
0.64,
0.3,
0.27,
0.88,
0.38,
0.13,
0.3,
0.49,
0.43,
0.74,
0.74,
0.8,
0.86,
0.67,
1,
1,
0.51,
0.16,
0.53,
0.33,
0.03,
0.02,
0.03,
0.72,
0.65,
0.66,
0.41,
0.03,
0.08,
0.17,
0.19,
0.36,
0.38,
0.67,
0.81,
0.62,
0.09,
0.56,
0.7,
0.62,
0.19,
0.13,
0.81,
0.58,
0.07,
0.02,
0.03,
0.69,
0.98,
0.77,
0.38,
0.1,
0.38,
1,
0.69,
0.13,
0.24,
0.16,
0.07,
0.07,
0.03,
0.39,
0.66,
1,
1,
1,
0.21,
0.25,
0.71,
0.21,
0.02,
0.61,
1,
0.46,
0.55,
0.91,
0.52,
0.28,
0.47,
1,
1,
1,
0.66,
0.14,
0.16,
0.34,
0.74,
0.63,
0.88,
0.95,
0.45,
0.02,
0.04,
0.79,
0.63,
0.86,
0.9,
0.87,
0.69,
0.24,
0.07,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
}
+602
View File
@@ -0,0 +1,602 @@
{
"schemaVersion": 1,
"width": 1080,
"height": 1920,
"fps": 30,
"durationS": 12.612,
"seed": 148,
"scene": {
"kind": "place",
"time": "day",
"litHouse": false
},
"place": {
"ground": "grass",
"elements": [
{
"kind": "rainbow",
"x": 0.5,
"z": 0.97,
"scale": 2.3
},
{
"kind": "mountain",
"x": 0.2,
"z": 0.95
},
{
"kind": "mountain",
"x": 0.85,
"z": 0.94
},
{
"kind": "ark",
"x": 0.78,
"z": 0.8,
"scale": 0.6
},
{
"kind": "palm",
"x": 0.1154429012345679,
"z": 0.42103652263374486,
"flip": true
},
{
"kind": "bush",
"x": 0.9018603395061728,
"z": 0.5069701646090534,
"flip": true
}
]
},
"palette": "dusk",
"camera": {
"push": 1.05,
"panX": 0
},
"hud": {
"badge": "Ep. 1",
"label": "Noé e a Arca a história e as c"
},
"actors": [
{
"kind": "person",
"x": 0.5,
"y": 0.78,
"enterS": 0.15,
"character": {
"name": "Noé",
"look": {
"build": "slim",
"height": 0.96,
"skin": "#c98a5e",
"hair": {
"style": "long",
"color": "#e2e2e8"
},
"beard": {
"style": "long",
"color": "#eeeef2"
},
"glasses": "none",
"brows": "thick",
"top": {
"style": "robe",
"color": "#a8865a",
"accent": "#6b4a2a"
},
"bottom": {
"style": "pants",
"color": "#2c3346"
},
"shoes": "#6b4a2a",
"footwear": "sandals",
"nose": "long",
"lids": 0.5,
"wrinkles": 0.85,
"head": "oval"
}
},
"expression": "neutral",
"pose": "wave",
"timeline": [
{
"do": "express",
"atP": 0.39,
"expression": "happy"
},
{
"do": "wave",
"atP": 0.34
}
],
"framing": "medium",
"flip": false
}
],
"props": [],
"texts": [
{
"kind": "tag",
"text": "Qual você não conhecia?",
"x": 0.5,
"y": 0.17,
"atS": 0.1,
"tone": "info"
}
],
"words": [
{
"text": "Qual",
"startS": 0,
"endS": 0.34,
"tone": "key"
},
{
"text": "você",
"startS": 0.34,
"endS": 0.66,
"tone": "key"
},
{
"text": "não",
"startS": 0.66,
"endS": 0.84
},
{
"text": "conhecia?",
"startS": 0.84,
"endS": 1.5,
"tone": "key"
},
{
"text": "Grupos",
"startS": 2.22,
"endS": 2.86
},
{
"text": "ainda",
"startS": 2.86,
"endS": 3.1
},
{
"text": "pesquisam",
"startS": 3.1,
"endS": 3.66
},
{
"text": "o",
"startS": 3.66,
"endS": 3.76
},
{
"text": "local,",
"startS": 3.76,
"endS": 4.08
},
{
"text": "mas",
"startS": 4.32,
"endS": 4.62
},
{
"text": "não",
"startS": 4.62,
"endS": 4.78
},
{
"text": "há",
"startS": 4.78,
"endS": 4.94
},
{
"text": "comprovação",
"startS": 4.94,
"endS": 5.58
},
{
"text": "aceita.",
"startS": 5.58,
"endS": 6.08
},
{
"text": "Qual",
"startS": 6.58,
"endS": 7.16,
"tone": "key"
},
{
"text": "curiosidade",
"startS": 7.16,
"endS": 7.8
},
{
"text": "você",
"startS": 7.8,
"endS": 8.1,
"tone": "key"
},
{
"text": "não",
"startS": 8.1,
"endS": 8.3
},
{
"text": "conhecia?",
"startS": 8.3,
"endS": 8.9,
"tone": "key"
},
{
"text": "Comente",
"startS": 9.74,
"endS": 10.38
},
{
"text": "e",
"startS": 10.38,
"endS": 10.58
},
{
"text": "siga!",
"startS": 10.58,
"endS": 10.84
}
],
"audioEnv": {
"fps": 30,
"values": [
0,
0,
0,
0,
0,
0.03,
0.03,
0.95,
1,
0.97,
0.77,
0.35,
0.11,
0.53,
1,
0.58,
0.04,
0.03,
0.06,
1,
0.7,
0.47,
0.54,
0.84,
0.78,
0.78,
0.5,
0.12,
0.1,
0.7,
1,
0.77,
0.6,
0.61,
0.4,
0.05,
0.02,
0.03,
0.06,
0.33,
0.45,
0.44,
0.46,
0.4,
0.21,
0.05,
0.02,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0.01,
0.25,
0.12,
0.57,
0.51,
0.79,
0.97,
0.89,
0.27,
0.01,
0.03,
0.54,
0.52,
0.17,
0.47,
0.89,
0.55,
0.42,
0.51,
0.57,
0.7,
1,
0.11,
0.01,
0.52,
0.7,
0.38,
0.04,
0.05,
0.01,
0.02,
0.41,
1,
0.76,
0.13,
0.55,
0.66,
0.53,
0.61,
0.62,
0.97,
1,
0.97,
0.25,
0.01,
0.12,
0.6,
1,
0.93,
0.82,
0.69,
0.39,
0.1,
0.01,
0,
0,
0,
0,
0,
0,
0.12,
0.43,
0.83,
0.74,
0.56,
0.29,
0.11,
0.12,
0.43,
0.88,
0.68,
0.52,
0.56,
0.79,
0.79,
0.62,
0.12,
0.01,
0.07,
0.62,
0.47,
0.18,
0.27,
0.55,
0.74,
0.17,
0.52,
1,
0.57,
0.13,
0.02,
0.02,
0.03,
0.71,
0.73,
0.56,
0.62,
0.74,
0.46,
0.06,
0.02,
0.02,
0.05,
0.73,
0.83,
0.58,
0.26,
0.01,
0.05,
0.13,
0.05,
0.01,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0.04,
0.75,
1,
1,
0.56,
0.09,
0,
0.07,
0.61,
0.54,
1,
1,
0.74,
0.16,
0.29,
0.64,
0.17,
0.35,
1,
1,
1,
0.86,
0.69,
0.17,
0.2,
0.48,
0.21,
0.24,
0.9,
0.7,
0.09,
0.02,
0.04,
0.83,
0.51,
0.42,
0.65,
0.73,
0.65,
0.3,
0.09,
0.36,
0.87,
1,
0.67,
0.58,
0.54,
0.16,
0.03,
0.02,
0.05,
0.18,
0.47,
0.44,
0.43,
0.4,
0.21,
0.06,
0.03,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0.09,
0.91,
1,
0.79,
0.49,
0.48,
0.64,
0.68,
0.72,
0.77,
0.64,
0.58,
0.3,
0.1,
0.17,
0.42,
0.76,
0.15,
0.03,
0.02,
0.03,
0.29,
0.79,
0.72,
0.17,
0.06,
0.36,
0.36,
0.1,
0.02,
0.01,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
}
+9
View File
@@ -0,0 +1,9 @@
{
"cast": [
"noe",
"esposa-de-noe",
"sem",
"cam",
"jafe"
]
}
+78
View File
@@ -0,0 +1,78 @@
# Noé e a Arca: a história resumida e as curiosidades que pouca gente conhece
Duração alvo: 180 s · Formato: documental (vídeo único)
Estilo: Cartoon · Vertical 9:16 · Narrativa religiosa contada como relato ("segundo o Gênesis", "o texto diz"), em tom curioso e respeitoso.
Narração: 435 palavras em 22 trechos (1 a 2 frases cada, de 14 a 29 palavras); cerca de 181 s a 2,4 palavras/s. A coluna t (s) é a estimativa acumulada; a duração final depende da voz escolhida.
## Gancho (0–2 s)
A arca pronta, enorme, ao lado de Noé pequeno, que olha para ela. O texto "Altura de 4 andares" aparece desde o primeiro quadro. Deus não é representado: só céu, luz e nuvens.
## Roteiro cena a cena
Direção: só aparece quem é citado na coluna Imagem. Deus nunca é desenhado nem recebe falas. A única fala entre aspas (trecho 7) é dramatização anunciada na própria narração ("Dá para imaginar…"), não é texto bíblico. Os códigos de versículo e as fontes estão no fim do arquivo; não são falados.
| t (s) | Imagem / B-roll | Texto na tela | Narração |
|---|---|---|---|
| 0–8 | Arca pronta em terra firme, dia; Noé olhou para o céu e depois para a arca, surpreso; régua de medida (côvado) no chão | Altura de 4 andares | Um barco da altura de um prédio de quatro andares, feito à mão: a arca de Noé, segundo o Gênesis. |
| 8–16 | Vilarejo antigo, dia; Noé caminhou entre as casas simples, sereno; Bíblia aberta / pergaminho em destaque | Noé: homem justo (Gn 6:9) | Quem era Noé? A Bíblia conta que ele era um homem justo e íntegro entre os seus contemporâneos. |
| 16–26 | Vilarejo antigo, noite, céu com nuvens; Noé olhou em volta, preocupado; depois Noé ajoelhou e orou, olhando para o céu | Gn 6:5-13 | Segundo o relato, a Terra estava cheia de maldade. Noé recebeu a ordem de construir uma arca para salvar a família e os animais. |
| 26–34 | Canteiro da arca em construção, dia; Noé segurou uma tábua e pensou, determinado; tábuas, martelo e andaime | Gofer: espécie incerta | Ela seria de madeira de gofer, cuja espécie é incerta, e coberta de betume por dentro e por fora. |
| 34–41 | Canteiro da arca em construção, dia; Noé apontou para a arca; Jafé segurou a régua de medida (côvado) | 300 × 50 × 30 côvados | A arca tinha trezentos côvados de comprimento, cinquenta de largura e trinta de altura, diz o Gênesis. |
| 41–52 | Arca pronta em terra firme, dia; Noé com a régua de medida (côvado); Sem olhou em volta, surpreso | 1 côvado ≈ 45 cm; ≈ 135 × 22 × 13 m | Com o côvado valendo cerca de quarenta e cinco centímetros, estima-se cento e trinta e cinco metros de comprimento, vinte e dois de largura e treze de altura. |
| 52–61 | Canteiro da arca em construção, dia; Noé fala (close), determinado; ao fundo Sem e Jafé martelando tábuas | 3 andares + porta + janela | Eram três andares, uma porta na lateral e uma janela. Dá para imaginar Noé dizendo aos filhos: "Vamos, tábua por tábua." |
| 61–68 | Arca pronta em terra firme, dia; fila de animais entrando na arca; casal de elefantes, girafa e leão; Noé acenou, feliz | 1 casal de cada espécie | Depois vieram os animais. O Gênesis fala em um casal de cada espécie, macho e fêmea. |
| 68–76 | Campo aberto, dia; ovelha, cavalo e camelo em pares, pomba no alto; Noé apontou e contou os pares, pensou; Cam olhou em volta | Puros e aves: 7 pares | Mas há um detalhe: dos animais puros e das aves, o texto fala em sete pares, não em um só. |
| 76–83 | Arca pronta em terra firme, amanhecer; Noé, a esposa de Noé, Sem, Cam e Jafé entram na arca, sereno | 8 pessoas na arca | Entraram também oito pessoas: Noé, a esposa, os filhos Sem, Cam e Jafé, e as três noras. |
| 83–91 | Chuva forte virando tempestade; dilúvio com as águas subindo; a arca começa a flutuar; Noé olhou para o céu, com medo | 40 dias • 150 dias de água | A chuva, diz o texto, durou quarenta dias e quarenta noites, e as águas prevaleceram por cento e cinquenta dias. |
| 91–97 | Arca flutuando no mar sem fim, noite e depois amanhecer; Noé e a esposa de Noé sentaram, pensaram, serenos | ≈ 1 ano a bordo | Pelas datas do Gênesis, a família ficou cerca de um ano dentro da arca. |
| 97–104 | Arca flutuando no mar sem fim, dia; corvo voando; Noé olhou para o céu e pensou | Corvo: ia e voltava | Com as águas baixando, Noé soltou um corvo, que ia e voltava até a terra secar. |
| 104–113 | Arca flutuando no mar sem fim, dia; pomba voando com ramo de oliveira; Noé segurou o ramo de oliveira, aliviado | Pomba e ramo de oliveira | Depois, Noé soltou uma pomba. Ela voltou sem achar onde pousar; na segunda vez, trouxe uma folha de oliveira; na terceira, não voltou. |
| 113–123 | Montes de Ararat, amanhecer; arca pousada no monte; Noé olhou em volta, aliviado | Ararate ≈ Urartu (região) | A arca pousou, diz o Gênesis, sobre os montes de Ararate: uma região, não necessariamente o pico hoje chamado Monte Ararat, na Turquia. |
| 123–131 | Arco-íris no céu, dia; Noé, a esposa de Noé, Sem, Cam e Jafé olharam para o céu e comemoraram, felizes | Arco-íris = aliança (Gn 9) | Depois do dilúvio, o arco-íris surge no Gênesis como sinal de uma aliança: nunca mais um dilúvio destruiria a terra. |
| 131–138 | Vilarejo antigo, dia; Noé sentou, sereno, e pensou; pergaminho aberto ao lado | 600 anos → 950 anos | Noé tinha seiscentos anos no dilúvio e, segundo o Gênesis, morreu aos novecentos e cinquenta. |
| 138–145 | Museu; tábua de argila em destaque, sem personagens | Epopeia de Gilgamesh | Uma história antiga lembra essa: na Epopeia de Gilgamesh, Utnapishtim sobrevive a um dilúvio num barco e solta aves. |
| 145–158 | Museu; tábua de argila em close, depois pergaminho; sem personagens | Tábua K.3375 • achada em 1872 | A Tábua do Dilúvio, do século sete antes de Cristo, achada em Nínive e identificada por George Smith em mil oitocentos e setenta e dois, está no Museu Britânico. |
| 158–164 | Montanha na Turquia, dia; campo aberto ao pé dos montes, vazio, sem personagens | Buscas no séc. XX: nada | No século vinte, expedições procuraram a arca no Monte Ararat, sem sucesso, segundo a Britannica. |
| 164–174 | Montanha na Turquia, amanhecer; formação de rocha em forma de barco, vista de longe | Durupınar: rocha natural | Em Durupınar, perto do Ararat, uma formação lembra um barco. Um estudo de mil novecentos e noventa e seis a descreve como rocha natural. |
| 174–181 | Arco-íris no céu, dia; Noé acenou, feliz, olhando para o espectador | Qual você não conhecia? | Grupos ainda pesquisam o local, mas não há comprovação aceita. Qual curiosidade você não conhecia? Comente e siga. |
## Texto de capa / overlay.title (até 80 caracteres, ideal ≤ 30)
`overlay.title`: `Noé e a Arca: curiosidades`
Contagem: 26 caracteres, incluindo espaços. Sem opções de votação.
## Fontes (título, instituição, link e o fato que cada uma sustenta)
- **F1 — Gênesis 6 (ARA), Bíblia Online.** Noé "homem justo" (6:9); maldade e violência (6:5-13); gofer, betume, medidas em côvados, três andares, porta lateral, janela (6:14-16); casal de cada espécie (6:19-20). [Gn 6](https://www.bibliaonline.com.br/ara/gn/6).
- **F2 — Gênesis 7 (ARA).** Sete pares dos animais puros e das aves (7:2-3); Noé com seiscentos anos (7:6); data da entrada, ano 600, mês 2, dia 17 (7:11); quarenta dias e quarenta noites (7:12); oito pessoas (7:13); águas prevalecem cento e cinquenta dias (7:24). [Gn 7](https://www.bibliaonline.com.br/ara/gn/7).
- **F3 — Gênesis 8 (ARA).** Arca pousa nos montes de Ararate (8:4); corvo que ia e voltava (8:7); pomba, folha de oliveira, terceira soltura (8:8-12); terra seca, ano 601, mês 2, dia 27 (8:14). [Gn 8](https://www.bibliaonline.com.br/ara/gn/8).
- **F4 — Gênesis 9 (ARA).** Arco-íris como sinal da aliança (9:12-17); Noé morre aos novecentos e cinquenta anos (9:29). [Gn 9](https://www.bibliaonline.com.br/ara/gn/9).
- **F5 — "The Flood Tablet" (K.3375), British Museum.** Tábua do dilúvio da Epopeia de Gilgamesh, século VII a.C., de Nínive, identificada por George Smith em 1872. [Objeto](https://www.britishmuseum.org/collection/object/W_K-3375).
- **F6 — "Mount Ararat", Encyclopaedia Britannica.** Ararat ligado a Urartu; o nome bíblico designa região, não necessariamente o pico atual; expedições do século XX sem sucesso. [Verbete](https://www.britannica.com/place/Mount-Ararat).
- **F7 — "Epic of Gilgamesh", Encyclopaedia Britannica.** Utnapishtim, o dilúvio, o barco e as aves soltas. [Verbete](https://www.britannica.com/topic/Epic-of-Gilgamesh).
- **F8 — Collins, L. G.; Fasold, D. (1996). "Bogus 'Noah's Ark' from Turkey Exposed as a Common Geologic Structure". Journal of Geoscience Education 44(4).** Durupınar descrito como formação geológica natural.
Sem fonte listada (dado informado no pedido): o côvado de cerca de quarenta e cinco centímetros e a conta de 135 × 22 × 13 m. Por isso a narração usa "cerca de" e "estima-se". A equivalência "prédio de quatro andares" para treze metros é aproximação do roteiro, não de uma fonte.
## Necessidades de produção (cenário, imagens, mapas, animações que a cena atual ainda não faz)
Peças genéricas do estilo Cartoon, já em produção; nada abaixo é cena 3D.
| Peça | Uso |
|---|---|
| Arca (pronta, em terra, flutuando, pousada no monte) | trechos 1, 6, 8, 10, 11–15 |
| Arca em construção, tábuas, andaime, martelo | trechos 4, 5, 7 |
| Régua de medida (côvado) | trechos 1, 5, 6 |
| Chuva forte, tempestade, ondas e águas subindo | trechos 11–13 |
| Arco-íris | trechos 16 e 22 |
| Animais: elefante, girafa, leão, ovelha, cavalo, camelo, pomba, corvo | trechos 8, 9, 13, 14 |
| Ramo de oliveira | trecho 14 |
| Tábua de argila, Bíblia aberta / pergaminho | trechos 2, 17–19 |
| Figurino: túnica, barba longa, sandália (Noé, Sem, Cam, Jafé, esposa de Noé) | todos os trechos com personagem |
| Montes de Ararat, montanha na Turquia, formação de rocha em forma de barco | trechos 15, 20, 21 |
| Boca mexendo na fala entre aspas | trecho 7 (Noé em close) |
Pendências: gerar a narração e medir a duração real (a estimativa de 181 s usa 2,4 palavras/s); trocar o texto da tela se uma fala for cortada.
File diff suppressed because it is too large Load Diff
+37
View File
@@ -0,0 +1,37 @@
# Pauta — Noé e a Arca
Trilho: HISTÓRIA (documental de curiosidade) · Conta(s) de destino: não informada · Atualizada em: 2026-11-18
## Ideias
| # | Ideia (1 linha) | Gancho (0–2 s) | Pagamento | Por que compartilhar | Status |
|---|---|---|---|---|---|
| 1 | Noé e a Arca: a história resumida e as curiosidades que pouca gente conhece | "Um barco da altura de um prédio de quatro andares, feito à mão." | Detalhes pouco conhecidos (sete pares de animais puros, cerca de um ano a bordo, Ararate como região) e o estado das buscas pela arca | Contraria a versão de livro infantil; cada pessoa descobre algo novo e comenta | aprovada |
## Resumo
- Tema: a história de Noé e da arca, segundo o Gênesis, e curiosidades sobre o relato.
- Ângulo: contar o essencial em ordem e destacar o que pouca gente sabe, sempre separando o que o texto diz do que se sabe por fontes externas (Britannica, British Museum, estudo geológico de 1996).
- Público: amplo, curioso, incluindo quem só conhece a versão infantil. Tom curioso e respeitoso, sem zombar nem afirmar como fato científico o que é relato de fé.
- Formato: documental, vídeo único vertical 9:16, estilo Cartoon, sem votação.
- Duração: 180 s (o pedido muda a regra padrão de 45–90 s), 435 palavras de narração em 22 trechos.
- Fecho: convite a comentar ("qual curiosidade você não conhecia?") e seguir.
## Arco (história) — 3 a 5 partes
| Parte | O que muda | Risco/informação nova | Termina em |
|---|---|---|---|
| 1. Noé e a ordem | Quem era Noé e por que construiu a arca | Medidas, gofer, andares | Construção pronta |
| 2. Animais e família | Animais e oito pessoas entram | Sete pares dos animais puros | Início da chuva |
| 3. Dilúvio e espera | Chuva, 150 dias, cerca de um ano a bordo, corvo e pomba | Terra seca | Pouso nos montes de Ararate |
| 4. Aliança | Arco-íris | Ararate é região, não só um pico | Idades de Noé |
| 5. Curiosidades e buscas | Gilgamesh, Tábua do Dilúvio, buscas e Durupınar | Sem comprovação aceita | Convite a comentar e seguir |
## Necessidades de produção
- Peças Cartoon já em produção: arca, arca em construção, chuva, ondas, arco-íris, animais, ramo de oliveira, martelo, andaime, tábua de argila, túnica, barba longa, sandália. Detalhes em `ep01.md`.
- Boca mexendo na fala entre aspas do trecho 7 (dramatização de Noé).
## Aprendizados (da etapa 8)
- Pendente: preencher após a publicação.