primocode 10.12.0 → 10.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +74 -12
- package/bin/primocode.js +148 -8
- package/lib/act.js +48 -1
- package/lib/catalogo.js +12 -1
- package/lib/config.js +1 -0
- package/lib/estudio/assinaturas/gerativo.json +1 -1
- package/lib/estudio/camadas.js +4 -0
- package/lib/estudio/cota.js +150 -0
- package/lib/estudio/dados/projetos/clube-ad5.json +105 -0
- package/lib/estudio/dados/projetos/clube-ae-sem-memoria.json +107 -0
- package/lib/estudio/dados/projetos/clube-agent.json +120 -0
- package/lib/estudio/dados/projetos/clube-antes-e-agora.json +86 -0
- package/lib/estudio/dados/projetos/clube-apresentando-clube.json +110 -0
- package/lib/estudio/dados/projetos/clube-bluevisa.json +106 -0
- package/lib/estudio/dados/projetos/clube-caught-in-the-fire.json +127 -0
- package/lib/estudio/dados/projetos/clube-chat-cliente-satisfeito.json +98 -0
- package/lib/estudio/dados/projetos/clube-chatgpt-anuncios.json +120 -0
- package/lib/estudio/dados/projetos/clube-claude-dj.json +140 -0
- package/lib/estudio/dados/projetos/clube-claude-mcp.json +142 -0
- package/lib/estudio/dados/projetos/clube-cleanui.json +106 -0
- package/lib/estudio/dados/projetos/clube-clinica-take-unico.json +128 -0
- package/lib/estudio/dados/projetos/clube-clinica.json +104 -0
- package/lib/estudio/dados/projetos/clube-clube-opener.json +125 -0
- package/lib/estudio/dados/projetos/clube-clube.json +108 -0
- package/lib/estudio/dados/projetos/clube-codigo.json +101 -0
- package/lib/estudio/dados/projetos/clube-distilbook.json +104 -0
- package/lib/estudio/dados/projetos/clube-drive-upload.json +115 -0
- package/lib/estudio/dados/projetos/clube-dub.json +119 -0
- package/lib/estudio/dados/projetos/clube-enxovaly.json +105 -0
- package/lib/estudio/dados/projetos/clube-fecha7.json +118 -0
- package/lib/estudio/dados/projetos/clube-filatov.json +128 -0
- package/lib/estudio/dados/projetos/clube-frame.json +108 -0
- package/lib/estudio/dados/projetos/clube-glass.json +118 -0
- package/lib/estudio/dados/projetos/clube-letra-em-apps.json +84 -0
- package/lib/estudio/dados/projetos/clube-letra-globo-3d.json +111 -0
- package/lib/estudio/dados/projetos/clube-letra-nos-apps.json +146 -0
- package/lib/estudio/dados/projetos/clube-letra-seis-mundos.json +100 -0
- package/lib/estudio/dados/projetos/clube-lula-3.json +146 -0
- package/lib/estudio/dados/projetos/clube-morph.json +119 -0
- package/lib/estudio/dados/projetos/clube-motion-designer.json +115 -0
- package/lib/estudio/dados/projetos/clube-motion-pacote.json +112 -0
- package/lib/estudio/dados/projetos/clube-movimento.json +103 -0
- package/lib/estudio/dados/projetos/clube-not-like-us.json +117 -0
- package/lib/estudio/dados/projetos/clube-pinterest-inspiracao.json +86 -0
- package/lib/estudio/dados/projetos/clube-pixel-e-tinta.json +108 -0
- package/lib/estudio/dados/projetos/clube-ponte.json +118 -0
- package/lib/estudio/dados/projetos/clube-processo-edit-tonal.json +126 -0
- package/lib/estudio/dados/projetos/clube-processo-motion-100-ia.json +109 -0
- package/lib/estudio/dados/projetos/clube-promo.json +114 -0
- package/lib/estudio/dados/projetos/clube-proposito.json +115 -0
- package/lib/estudio/dados/projetos/clube-rankhog.json +128 -0
- package/lib/estudio/dados/projetos/clube-recursao.json +116 -0
- package/lib/estudio/dados/projetos/clube-revelar.json +118 -0
- package/lib/estudio/dados/projetos/clube-robo.json +125 -0
- package/lib/estudio/dados/projetos/clube-shelby-ep2.json +144 -0
- package/lib/estudio/dados/projetos/clube-shelby.json +97 -0
- package/lib/estudio/dados/projetos/clube-solar-eclipse.json +96 -0
- package/lib/estudio/dados/projetos/clube-soldier.json +128 -0
- package/lib/estudio/dados/projetos/clube-som-de-cena.json +108 -0
- package/lib/estudio/dados/projetos/clube-spotify-candidatura.json +112 -0
- package/lib/estudio/dados/projetos/clube-tda-app.json +118 -0
- package/lib/estudio/dados/projetos/clube-tda-ia.json +75 -0
- package/lib/estudio/dados/projetos/clube-telegram-chat.json +118 -0
- package/lib/estudio/dados/projetos/clube-telegram-ilha.json +106 -0
- package/lib/estudio/dados/projetos/clube-tennessee-nike.json +132 -0
- package/lib/estudio/dados/projetos/clube-tudo-se-move.json +112 -0
- package/lib/estudio/dados/projetos/clube-uiad.json +107 -0
- package/lib/estudio/dados/projetos/clube-viralgrow.json +108 -0
- package/lib/estudio/dados/projetos/clube-whose-side.json +140 -0
- package/lib/estudio/dados/projetos/clube-youtube-inscrever.json +108 -0
- package/lib/estudio/dados/projetos/elementos-do-site-em-movimento.json +49 -0
- package/lib/estudio/dados/projetos/explainer-narrado.json +51 -0
- package/lib/estudio/dados/projetos/lancamento-de-produto.json +51 -0
- package/lib/estudio/dados/projetos/motion-so-com-sons.json +50 -0
- package/lib/estudio/dados/projetos/titulo-em-after-effects.json +51 -0
- package/lib/estudio/dados/projetos/tour-de-saas.json +50 -0
- package/lib/estudio/dados/projetos-ae/antes-e-agora/ae/cenas.jsx +733 -0
- package/lib/estudio/dados/projetos-ae/antes-e-agora/assets/fazer_assets.py +88 -0
- package/lib/estudio/dados/projetos-ae/letra-em-apps/ae/cenas.jsx +402 -0
- package/lib/estudio/dados/projetos-ae/letra-em-apps/assets/preparar_assets.py +17 -0
- package/lib/estudio/dados/projetos-ae/letra-em-apps/assets/svg_para_ae.py +25 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/BRIEF-AGENTES.md +31 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/README.md +53 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/ROTEIRO-CENAS.md +69 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/ae/A-agenda.jsx +148 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/ae/B-docs.jsx +174 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/ae/C-alttab.jsx +113 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/ae/D-spotify.jsx +118 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/ae/E-notas.jsx +146 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/ae/F-jornal1.jsx +144 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/ae/G-google.jsx +153 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/ae/H-mapa.jsx +176 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/ae/I-imagens.jsx +132 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/ae/J-jornal2.jsx +191 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/ae/K-maps.jsx +184 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/ae/camera-movimentos.jsx +48 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/ae/camera.jsx +57 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/ae/card-spotify.jsx +98 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/ae/digitar.jsx +38 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/ae/jornal-comum.jsx +196 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/ae/letra.jsx +23 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/ae/letra_automatica.py +83 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/ae/montagem.jsx +74 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/ae/w-agenda/render_html.py +13 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/ae/w-agenda/util.jsx +162 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/ae/w-midia-comum.jsx +114 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/ae/wg-util.jsx +360 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/assets/F-jornal1/render_html.py +13 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/assets/render_w-midia.py +26 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/assets/w-midia-ferramentas/inclin.py +30 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/assets/w-midia-ferramentas/medir_d.py +36 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/assets/w-midia-ferramentas/medir_e.py +27 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/camera/ajustar_movimentos.py +61 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/camera/ancorar.py +74 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/camera/assar.py +47 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/camera/camera3d_jornal.py +172 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/camera/comparar.py +32 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/camera/dados_ae_jornal.py +46 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/camera/folha_contato.py +28 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/camera/homografia_jornal.py +74 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/camera/integrar.py +44 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/camera/medir_quadro_a_quadro.py +32 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/camera/mesa_2d.py +64 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/camera/plot_cenas.py +11 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/camera/retificar_quadros.py +38 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/camera/w-agenda/assar_ab.py +52 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/camera/w-agenda/medir_ab.py +59 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/camera/wg_ajustar_h.py +111 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/camera/wg_corrige_cam.py +17 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/camera/wg_ecc_cadeia.py +80 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/camera/wg_finalizar_cam.py +65 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/camera/wg_mosaico.py +61 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/guia-do-metodo/tutorial-lyric-edit-interfaces/01-gramatica-e-roteiro.md +55 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/guia-do-metodo/tutorial-lyric-edit-interfaces/02-camera.md +66 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/guia-do-metodo/tutorial-lyric-edit-interfaces/03-montagem-no-ae.md +50 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/guia-do-metodo/tutorial-lyric-edit-interfaces/04-render-e-conferencia.md +43 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/guia-do-metodo/tutorial-lyric-edit-interfaces/05-abertura-celular-mergulho.md +43 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/guia-do-metodo/tutorial-lyric-edit-interfaces.md +42 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/transicao/atraso_imagem.py +31 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/transicao/fundo.py +56 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/transicao/juntar.py +45 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/transicao/montar.py +177 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/transicao/rastreio.py +74 -0
- package/lib/estudio/dados/projetos-ae/letra-nos-apps/transicao/sincronia.py +18 -0
- package/lib/estudio/dados/projetos-ae/pinterest-inspiracao/ae/cenas.jsx +530 -0
- package/lib/estudio/dados/projetos-ae/pinterest-inspiracao/assets/fazer_assets.py +107 -0
- package/lib/estudio/dados/projetos-ae/processo-motion-100-ia/assets/pessoas/figurinha.py +46 -0
- package/lib/estudio/dados/projetos-ae/processo-motion-100-ia/comp-a/BRIEF-A.md +83 -0
- package/lib/estudio/dados/projetos-ae/processo-motion-100-ia/comp-a/audio.py +179 -0
- package/lib/estudio/dados/projetos-ae/processo-motion-100-ia/comp-a/confere.py +20 -0
- package/lib/estudio/dados/projetos-ae/processo-motion-100-ia/comp-a/dados/tempo-parte1.js +1 -0
- package/lib/estudio/dados/projetos-ae/processo-motion-100-ia/comp-a/dados/tempo-parte2.js +1 -0
- package/lib/estudio/dados/projetos-ae/processo-motion-100-ia/comp-a/gerar_emojis.py +11 -0
- package/lib/estudio/dados/projetos-ae/processo-motion-100-ia/comp-a/img/filmes/_indice.js +122 -0
- package/lib/estudio/dados/projetos-ae/processo-motion-100-ia/comp-a/js/base.js +380 -0
- package/lib/estudio/dados/projetos-ae/processo-motion-100-ia/comp-a/js/main.js +86 -0
- package/lib/estudio/dados/projetos-ae/processo-motion-100-ia/comp-a/js/p1a.js +169 -0
- package/lib/estudio/dados/projetos-ae/processo-motion-100-ia/comp-a/js/p1b.js +455 -0
- package/lib/estudio/dados/projetos-ae/processo-motion-100-ia/comp-a/js/p1c.js +389 -0
- package/lib/estudio/dados/projetos-ae/processo-motion-100-ia/comp-a/js/p2.js +379 -0
- package/lib/estudio/dados/projetos-ae/processo-motion-100-ia/comp-a/video.py +62 -0
- package/lib/estudio/dados/projetos-ae/processo-motion-100-ia/take-unico/README.md +65 -0
- package/lib/estudio/dados/projetos-ae/processo-motion-100-ia/take-unico/oraculo_take.py +137 -0
- package/lib/estudio/dados/projetos-ae/processo-motion-100-ia/take-unico/render_take.py +388 -0
- package/lib/estudio/dados/projetos-ae/processo-motion-100-ia/take-unico/take.js +235 -0
- package/lib/estudio/diretor.js +2 -1
- package/lib/estudio/editor.js +285 -0
- package/lib/estudio/efeitos-fabrica/terminal-digitando.jsx +2 -1
- package/lib/estudio/effectcraft.js +152 -0
- package/lib/estudio/exportar.js +181 -0
- package/lib/estudio/gerativo.js +44 -15
- package/lib/estudio/index.js +126 -5
- package/lib/estudio/kit/gerativo.jsx +15 -0
- package/lib/estudio/kit-ae/base.jsx +1146 -0
- package/lib/estudio/kit-ae/cenas.jsx +395 -0
- package/lib/estudio/kit-ae/primitivas.jsx +911 -0
- package/lib/estudio/kokoro.js +3 -1
- package/lib/estudio/maquina-diretor.js +393 -0
- package/lib/estudio/maquina-elementos.js +134 -0
- package/lib/estudio/maquina-layout.js +198 -0
- package/lib/estudio/maquina-som.js +478 -0
- package/lib/estudio/maquina-trilha.js +160 -0
- package/lib/estudio/maquina-voz.js +429 -0
- package/lib/estudio/maquina.js +516 -0
- package/lib/estudio/projetos.js +60 -0
- package/lib/estudio/remotion.js +6 -4
- package/lib/estudio/revisor.js +61 -0
- package/lib/estudio/voicestudio.js +81 -0
- package/lib/headless.js +71 -0
- package/lib/hooks.js +72 -0
- package/lib/local/cerebro.json +398 -12
- package/lib/local/entrada.js +46 -2
- package/lib/marca-kit.js +309 -0
- package/lib/mcp.js +286 -6
- package/lib/perigo.js +31 -3
- package/lib/planos.js +47 -19
- package/lib/preparar.js +111 -0
- package/lib/retomar.js +55 -0
- package/lib/sandbox.js +197 -0
- package/lib/skills.js +3 -1
- package/lib/tools.js +13 -4
- package/lib/ui.js +1 -1
- package/lib/video/auto.js +18 -3
- package/package.json +4 -2
- package/skills/after-effects/SKILL.md +52 -0
- package/skills/maquina-de-motion/SKILL.md +84 -0
- package/skills/motion-de-primeira/SKILL.md +33 -51
|
@@ -0,0 +1,911 @@
|
|
|
1
|
+
/* primitivas.jsx — as primitivas de cena do estudio_motion (ES3), além dos 8 tipos de cenas.jsx.
|
|
2
|
+
|
|
3
|
+
Vocabulário tirado das 68 receitas do Clube (identidade, montagem e decisões) e dos scripts AE dos 5 projetos:
|
|
4
|
+
interface recriada em camadas, cena que vira a próxima, cadeia de câmera com nulls, tipografia cinética,
|
|
5
|
+
contador, gráfico que cresce, mapa com pino, card que pula, cursor que conduz, notificação, chat, linha do
|
|
6
|
+
tempo, laço de processo, explosão de ícones, máscara que revela, split antes/depois, objeto 3D falso com
|
|
7
|
+
sombra, partículas, relógio, calendário, funil, parede de logos, prompt, odômetro, medidor, carimbo, leque,
|
|
8
|
+
ondas, rolagem, prova social.
|
|
9
|
+
|
|
10
|
+
Todas leem o mesmo conteúdo (titulo, sub, itens, valor, rotulo, antes, depois, texto, autor, botao) e usam
|
|
11
|
+
os ELEMENTOS REAIS do assunto (KIT.elementos). Posições são frações do quadro, então valem em 9:16, 1:1 e 16:9.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
function kPre(comp, P) { var g = { W: comp.width, H: comp.height, u: kU(comp), v: kVert(comp), cam: kBase(comp, P) }; g.cx = g.W / 2; g.cy = g.H / 2; return g; }
|
|
15
|
+
function kSobre(P) { return kLum(P.ac) > 0.5 ? '#14110F' : '#FFFFFF'; }
|
|
16
|
+
function kT(g, comp, P, str, y, o) {
|
|
17
|
+
o = o || {};
|
|
18
|
+
var t0 = o.t0 != null ? o.t0 : 0.14, W = g.W, H = g.H;
|
|
19
|
+
var topo = g.v && y < H * 0.5; // título de cabeçalho: vai para o topo da zona segura, em NO MÁXIMO 2 linhas, e o CONTEÚDO desce para baixo da faixa dele
|
|
20
|
+
var r = texto(comp, str, { tamanho: (o.tam || (g.v ? 96 : 84)) * g.u, cor: o.cor || P.fg, corDestaque: o.corD || P.ac, x: o.x == null ? g.cx : o.x, y: topo ? 0 : y, parent: topo ? (g.cam.camNo || g.cam.no) : g.cam.no, entrada: o.entrada, t0: Q(str, t0), largura: o.largura || g.W * (g.v ? 0.86 : 0.74), maxLinhas: topo ? 2 : (o.maxLinhas || 3), sublinhado: o.sublinhado, fonte: o.fonte, sobrepoe: o.sobrepoe, passo: o.passo, entreLinhas: o.entreLinhas, livre: o.livre, principal: o.principal !== false, titulo: true });
|
|
21
|
+
if (o.som !== false && r.tempos.length) { som(r.tempos[0], 'pop', 0.6); if (r.tempos.length > 2) som(r.tempos[r.tempos.length - 1], 'tique', 0.4); }
|
|
22
|
+
if (topo && r.camadas.length) {
|
|
23
|
+
var zl = kZonaTexto(comp, true), Ct = o.ct != null ? o.ct : H * 0.2, Cb = H - zl.bot, B = r.y + r.h / 2 + 24; // B = base da faixa reservada (caixa + 24 px)
|
|
24
|
+
KIT.tituloB = B;
|
|
25
|
+
KIT.rects.push({ espaco: 't', banda: true, cena: KIT.cenaIdx, x0: r.x - r.w / 2 - 24, x1: r.x + r.w / 2 + 24, y0: r.y - r.h / 2 - 24, y1: B, t0: 0, t1: 1, texto: false, nome: 'faixa do título' });
|
|
26
|
+
if (B > Ct + 2) {
|
|
27
|
+
var s = Math.max(0.7, Math.min(1, (Cb - B) / (Cb - Ct)));
|
|
28
|
+
KIT.remap = { s: s, px: g.cx, py: B, ax: g.cx, ay: Ct };
|
|
29
|
+
var cn = g.cam.no; kA(cn).setValue([g.cx, Ct]); kP(cn).setValue([g.cx, B]); kS(cn).setValue([s * 100, s * 100]);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return r;
|
|
33
|
+
}
|
|
34
|
+
function kItens(d, padrao, n) { var it = (d.itens && d.itens.length ? d.itens : padrao).slice(0, n || 5); return it; }
|
|
35
|
+
function kEstrelaPts(r, ri) { var p = [], i; for (i = 0; i < 10; i++) { var a = -Math.PI / 2 + i * Math.PI / 5, rr = i % 2 ? ri : r; p.push([Math.cos(a) * rr, Math.sin(a) * rr]); } return p; }
|
|
36
|
+
function kContr(a, b) { var x = kLum(a) + 0.05, y = kLum(b) + 0.05; return x > y ? x / y : y / x; }
|
|
37
|
+
function kEsc(s) { return String(s).replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\r?\n/g, ' '); }
|
|
38
|
+
/* digita(comp, str, {x (borda esquerda), y, tamanho, fonte, cor, largura, parent, t0, cps}): texto que se escreve com cursor piscando. */
|
|
39
|
+
function digita(comp, str, o) {
|
|
40
|
+
var tam = o.tamanho || 40, w = kMedir(comp, str, o.fonte, tam);
|
|
41
|
+
while (w > o.largura && tam > 18) { tam *= 0.93; w = kMedir(comp, str, o.fonte, tam); }
|
|
42
|
+
var L = comp.layers.addText(str); L.name = 'digitando'; if (o.parent) kPai(L, o.parent);
|
|
43
|
+
var td = kDoc(L, o.fonte, tam, o.cor || '#111111', { just: 'left' });
|
|
44
|
+
kP(L).setValue([o.x, o.y + tam * 0.33]);
|
|
45
|
+
var cps = o.cps || 16, t0 = o.t0, n = str.length;
|
|
46
|
+
td.expression = 'var s = "' + kEsc(str) + '"; var n = Math.floor(Math.max(0, time - ' + t0.toFixed(3) + ') * ' + cps + '); s.substr(0, Math.min(s.length, n)) + ((time > ' + t0.toFixed(3) + ' && Math.floor(time * 2.4) % 2 == 0 && n < s.length + 10) ? "|" : "")';
|
|
47
|
+
var k, ns = Math.min(10, Math.ceil(n / 3));
|
|
48
|
+
for (k = 0; k < ns; k++) som(t0 + (k * 3) / cps, 'digita', 0.55);
|
|
49
|
+
return { L: L, w: w, tam: tam, fim: t0 + n / cps };
|
|
50
|
+
}
|
|
51
|
+
function kFundoSimples(comp, P) { fundo(comp, P.bg, {}); return camera(comp); }
|
|
52
|
+
|
|
53
|
+
// ---------------------------------------------------------------- 1. cinético: uma palavra por vez, cada uma entra de um jeito
|
|
54
|
+
function cenaCinetico(comp, P, d) {
|
|
55
|
+
var g = kPre(comp, P), W = g.W, H = g.H, u = g.u, cam = g.cam;
|
|
56
|
+
var pal = kPalavras(d.titulo || d.texto || ''), n = pal.length, i;
|
|
57
|
+
var modos = ['palavra', 'voa', 'mascara', 'sobe', 'voa', 'palavra'];
|
|
58
|
+
var passo = Math.max(0.28, Math.min(0.62, (comp.duration - 0.5) / (n + 0.6)));
|
|
59
|
+
var disco = forma(comp, 'circulo', { x: g.cx, y: g.cy, w: Math.min(W, H) * 0.9, cor: P.card, parent: cam.no, nome: 'disco' });
|
|
60
|
+
for (i = 0; i < n; i++) {
|
|
61
|
+
var ti = Q(pal[i].t, 0.14 + i * passo), fim = i < n - 1 ? Math.max(ti + 0.22, Q(pal[i + 1].t, 0.14 + (i + 1) * passo) - 0.02) : comp.duration;
|
|
62
|
+
var cor = pal[i].kw ? P.ac : (i % 2 ? P.fg : P.mudo == P.fg ? P.fg : P.fg);
|
|
63
|
+
var r = texto(comp, (pal[i].kw ? '*' : '') + pal[i].t, { tamanho: (g.v ? 230 : 200) * u, cor: i % 3 == 2 ? P.ac : P.fg, corDestaque: P.ac, x: g.cx, y: g.cy, parent: cam.no, entrada: modos[i % modos.length], t0: ti, largura: W * 0.84, maxLinhas: 1, sublinhado: false, fala: false, sobrepoe: true });
|
|
64
|
+
var j; for (j = 0; j < r.camadas.length; j++) if (i < n - 1) curva(kO(r.camadas[j]), [[fim, 100, null, 30], [fim + 0.06, 0, 60, null]]);
|
|
65
|
+
mola(kS(disco), ti, [88, 88], [100, 100], { quique: 0.5, dur: 0.45 });
|
|
66
|
+
som(ti, i % 2 ? 'tique' : 'pop', 0.55);
|
|
67
|
+
}
|
|
68
|
+
som(0.1, 'sobe', 0.5);
|
|
69
|
+
cam.empurra(0.6, 0, 0, 1.0).empurra(comp.duration - 0.2, 0, 0, 1.1);
|
|
70
|
+
fecha(comp);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// ---------------------------------------------------------------- 2. interface recriada em camadas (paralaxe)
|
|
74
|
+
function cenaInterface(comp, P, d) {
|
|
75
|
+
var g = kPre(comp, P), W = g.W, H = g.H, u = g.u, cam = g.cam, v = g.v, T0 = 0.12;
|
|
76
|
+
var ww = v ? W * 0.8 : W * 0.56, wh = v ? H * 0.46 : H * 0.72, wx = v ? g.cx : W * 0.66, wy = v ? H * 0.58 : g.cy;
|
|
77
|
+
if (d.titulo) kT(g, comp, P, d.titulo, v ? H * 0.17 : g.cy, { x: v ? g.cx : W * 0.22, largura: v ? W * 0.86 : W * 0.34, tam: v ? 84 : 76, maxLinhas: 4 });
|
|
78
|
+
var win = grupo(comp, { x: wx, y: wy, parent: cam.no, nome: 'janela' });
|
|
79
|
+
var corpo = forma(comp, 'retangulo', { x: 0, y: 0, w: ww, h: wh, r: 38 * u, cor: P.card, traco: P.mudo, tracoL: 3 * u, parent: win, nome: 'janela-corpo', entrada: 'cresce', t0: T0 + 0.1 });
|
|
80
|
+
var bar = forma(comp, 'retangulo', { x: 0, y: -wh / 2 + 34 * u, w: ww, h: 68 * u, r: 38 * u, cor: P.bg, alfa: 60, parent: win, nome: 'barra', entrada: 'fade', t0: T0 + 0.25 });
|
|
81
|
+
var i, cores = ['#FF5F57', '#FEBC2E', '#28C840'];
|
|
82
|
+
for (i = 0; i < 3; i++) forma(comp, 'circulo', { x: -ww / 2 + (36 + i * 34) * u, y: -wh / 2 + 34 * u, w: 20 * u, cor: cores[i], parent: win, entrada: 'pop', t0: T0 + 0.3 + i * 0.05, nome: 'ponto' });
|
|
83
|
+
// camada do fundo (sidebar) e camada da frente (cartões): se movem em velocidades diferentes
|
|
84
|
+
var lado = grupo(comp, { x: 0, y: 0, parent: win, nome: 'camada-lado' }), frente = grupo(comp, { x: 0, y: 0, parent: win, nome: 'camada-frente' });
|
|
85
|
+
kP(lado).expression = 'value + [Math.sin(time*0.9)*5, Math.cos(time*0.7)*4]';
|
|
86
|
+
kP(frente).expression = 'value + [Math.sin(time*0.9+1)*-11, Math.cos(time*0.7+1)*-8]';
|
|
87
|
+
var sw = ww * 0.22, sx = -ww / 2 + sw / 2 + 18 * u;
|
|
88
|
+
var sb = forma(comp, 'retangulo', { x: sx, y: 34 * u, w: sw, h: wh - 140 * u, r: 24 * u, cor: P.bg, alfa: 55, parent: lado, nome: 'sidebar' });
|
|
89
|
+
curva(kP(sb), [[T0 + 0.3, [sx - 80 * u, 34 * u], null, 25], [T0 + 0.8, [sx, 34 * u], 85, null]]);
|
|
90
|
+
var it = kItens(d, ['Início', 'Clientes', 'Vendas'], 4), n = it.length;
|
|
91
|
+
for (i = 0; i < n; i++) {
|
|
92
|
+
var ly = -wh / 2 + 150 * u + i * 70 * u, tl = Q(it[i], T0 + 0.6 + i * 0.22);
|
|
93
|
+
var pill = forma(comp, 'pilula', { x: sx, y: ly, w: sw * 0.82, h: 46 * u, cor: i == 0 ? P.ac : P.mudo, alfa: i == 0 ? 100 : 30, parent: lado, entrada: 'pop', t0: tl, nome: 'menu' });
|
|
94
|
+
texto(comp, it[i], { tamanho: 26 * u, cor: i == 0 ? kSobre(P) : P.fg, x: sx, y: ly, parent: lado, entrada: 'sobe', t0: tl + 0.06, largura: sw * 0.72, maxLinhas: 1, sublinhado: false, livre: true, fala: false });
|
|
95
|
+
som(tl, 'tique', 0.45);
|
|
96
|
+
}
|
|
97
|
+
var cx0 = sx + sw / 2 + 24 * u, cwid = ww / 2 - cx0 - 22 * u, k, vals = [d.valor || '+128', '4,9', '32'];
|
|
98
|
+
for (k = 0; k < 3; k++) {
|
|
99
|
+
var cw = (cwid - 2 * 18 * u) / 3, kx = cx0 + cw / 2 + k * (cw + 18 * u), ky = -wh / 2 + 160 * u, tk = Q(vals[k], T0 + 1.0 + k * 0.2);
|
|
100
|
+
var cd = forma(comp, 'retangulo', { x: kx, y: ky, w: cw, h: 130 * u, r: 24 * u, cor: k == 0 ? P.ac : P.bg, alfa: k == 0 ? 100 : 70, parent: frente, entrada: 'pop', t0: tk, quique: 0.6, nome: 'card' });
|
|
101
|
+
texto(comp, String(vals[k]), { fonte: P.fonteTitulo, tamanho: 46 * u, cor: k == 0 ? kSobre(P) : P.fg, x: kx, y: ky - 6 * u, parent: frente, entrada: 'palavra', t0: tk + 0.08, largura: cw * 0.86, maxLinhas: 1, sublinhado: false, livre: true, fala: false });
|
|
102
|
+
som(tk, 'pop', 0.5);
|
|
103
|
+
}
|
|
104
|
+
// gráfico de barras dentro da janela
|
|
105
|
+
var by = wh / 2 - 60 * u, nb = 7;
|
|
106
|
+
for (i = 0; i < nb; i++) {
|
|
107
|
+
var bh = (60 + ((i * 53) % 90) + i * 14) * u, bw = (cwid - (nb - 1) * 12 * u) / nb, bx = cx0 + bw / 2 + i * (bw + 12 * u), tb = T0 + 1.5 + i * 0.07;
|
|
108
|
+
var b = forma(comp, 'retangulo', { x: bx, y: by, w: bw, h: bh, r: 8 * u, cor: i == nb - 1 ? P.ac : P.mudo, alfa: i == nb - 1 ? 100 : 55, parent: frente, nome: 'barra-grafico' });
|
|
109
|
+
kA(b).setValue([0, bh / 2]); kP(b).setValue([bx, by + bh / 2 - bh / 2 + bh / 2 - bh / 2]);
|
|
110
|
+
kP(b).setValue([bx, by]);
|
|
111
|
+
mola(kS(b), tb, [100, 0], [100, 100], { quique: 0.5, dur: 0.6 });
|
|
112
|
+
}
|
|
113
|
+
som(T0 + 1.5, 'sobe', 0.45);
|
|
114
|
+
mola(kS(win), T0 + 0.1, [78, 78], [100, 100], { quique: 0.4, dur: 0.8 }); // depois dos filhos: o EffectCraft compensa a escala do pai no parentesco
|
|
115
|
+
cam.empurra(0.8, 0, 0, 1.0).empurra(T0 + 1.8, v ? 0 : -60 * u, v ? 70 * u : 0, 1.08).empurra(comp.duration - 0.2, v ? 0 : -90 * u, v ? 110 * u : 0, 1.12);
|
|
116
|
+
fecha(comp);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// ---------------------------------------------------------------- 3. mergulho: a tela do celular vira a próxima cena
|
|
120
|
+
function cenaMergulho(comp, P, d) {
|
|
121
|
+
var g = kPre(comp, P), W = g.W, H = g.H, u = g.u, cam = g.cam, v = g.v, T0 = 0.12, dur = comp.duration, alvo = d.proxBg || P.ac;
|
|
122
|
+
var esc = v ? 0.62 * H / 960 * 0.92 : 0.7 * H / 960;
|
|
123
|
+
if (d.titulo) kT(g, comp, P, d.titulo, v ? H * 0.14 : g.cy, { x: v ? g.cx : W * 0.26, largura: v ? W * 0.86 : W * 0.4, tam: v ? 92 : 84, maxLinhas: 3 });
|
|
124
|
+
var px = v ? g.cx : W * 0.7, py = v ? H * 0.58 : g.cy;
|
|
125
|
+
var cel = celular(comp, { x: px, y: py, escala: esc, parent: cam.no, t0: T0 + 0.1, tela: alvo });
|
|
126
|
+
var corTxt = kLum(alvo) > 0.5 ? '#14110F' : '#FFFFFF';
|
|
127
|
+
var pr = d.prox || d.rotulo || d.sub || '';
|
|
128
|
+
if (pr) texto(comp, pr, { tamanho: 58, cor: corTxt, corDestaque: corTxt, x: 0, y: -40, parent: cel.no, entrada: 'palavra', t0: T0 + 0.9, largura: 360, maxLinhas: 4, sublinhado: false, livre: true, fala: false });
|
|
129
|
+
var el = elemento(comp, 0, { x: 0, y: 200, w: 190, parent: cel.no, entrada: 'pop', t0: T0 + 0.7, flutua: 8 });
|
|
130
|
+
som(T0 + 0.7, 'pop', 0.6);
|
|
131
|
+
var tm = dur - 1.0, dedo = null;
|
|
132
|
+
cel.toque(tm - 0.5, 0, 200, { cor: corTxt });
|
|
133
|
+
// o mergulho: o celular cresce em volta do centro da tela até preencher o quadro
|
|
134
|
+
var e0 = esc * 100, kk = Math.max(W, H) / 380 * 100 * 1.15;
|
|
135
|
+
curva(kS(cel.no), [[tm, [e0, e0], null, 14], [tm + 0.75, [e0 * 4, e0 * 4], 30, 40], [tm + 0.98, [kk * 1.6, kk * 1.6], 45, null]]);
|
|
136
|
+
curva(kP(cel.no), [[tm, [px, py], null, 20], [tm + 0.75, [g.cx, g.cy], 70, null]]);
|
|
137
|
+
som(tm, 'sobe', 0.7); som(tm + 0.7, 'troca', 0.7);
|
|
138
|
+
var tampa = comp.layers.addSolid(kCor(alvo), 'tampa', W, H, 1); tampa.parent = null;
|
|
139
|
+
curva(kO(tampa), [[tm + 0.6, 0, null, 30], [tm + 0.92, 100, 70, null]]);
|
|
140
|
+
cam.empurra(0.8, 0, 0, 1.02);
|
|
141
|
+
fecha(comp);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// ---------------------------------------------------------------- 4. câmera em cadeia de nulls: painéis numa tela grande
|
|
145
|
+
function cenaCameraNulls(comp, P, d) {
|
|
146
|
+
var g = kPre(comp, P), W = g.W, H = g.H, u = g.u, cam = g.cam, v = g.v, T0 = 0.12;
|
|
147
|
+
var it = kItens(d, ['Primeiro', 'Segundo', 'Terceiro'], 4), n = it.length, i;
|
|
148
|
+
var mundo = grupo(comp, { x: g.cx, y: g.cy, parent: cam.no, nome: 'pan' }); // null 1: o deslocamento
|
|
149
|
+
var zoom = grupo(comp, { x: 0, y: 0, parent: mundo, nome: 'zoom' }); // null 2: o respiro de escala
|
|
150
|
+
var pw = v ? W * 0.74 : W * 0.5, ph = v ? H * 0.5 : H * 0.62, gap = v ? H * 0.62 : W * 0.6;
|
|
151
|
+
var ts = [], tot = comp.duration - 0.5, passo = Math.max(0.55, (tot - 0.4) / n);
|
|
152
|
+
for (i = 0; i < n; i++) {
|
|
153
|
+
var ox = v ? 0 : i * gap, oy = v ? i * gap : 0, ti = Q(it[i], 0.3 + i * passo);
|
|
154
|
+
ts.push(ti);
|
|
155
|
+
var c = forma(comp, 'retangulo', { x: ox, y: oy, w: pw, h: ph, r: 56 * u, cor: i % 2 ? P.card : P.ac, parent: zoom, nome: 'painel' });
|
|
156
|
+
var tc = i % 2 ? P.fg : kSobre(P), ta = i % 2 ? P.ac : kSobre(P);
|
|
157
|
+
texto(comp, String(i + 1), { fonte: P.fonteTitulo, tamanho: 220 * u, cor: ta, corDestaque: ta, x: ox - pw * 0.28, y: oy - ph * 0.25, parent: zoom, entrada: 'palavra', t0: 0.3, largura: pw * 0.4, maxLinhas: 1, sublinhado: false, livre: true, fala: false });
|
|
158
|
+
elemento(comp, i, { x: ox + pw * 0.25, y: oy - ph * 0.22, w: pw * 0.38, parent: zoom, flutua: 8, fase: i });
|
|
159
|
+
texto(comp, it[i], { tamanho: 70 * u, cor: tc, corDestaque: ta, x: ox, y: oy + ph * 0.22, parent: zoom, entrada: 'mascara', t0: 0.4, largura: pw * 0.82, maxLinhas: 3, sublinhado: false, livre: true, fala: false });
|
|
160
|
+
}
|
|
161
|
+
// a câmera viaja: cada parada é uma mola do null de deslocamento, com o null de zoom respirando no caminho
|
|
162
|
+
for (i = 0; i < n; i++) {
|
|
163
|
+
var tt = i == 0 ? 0.05 : Math.max(0.5, ts[i] - 0.35), alvoX = v ? g.cx : g.cx - i * gap, alvoY = v ? g.cy - i * gap : g.cy;
|
|
164
|
+
if (i == 0) kP(mundo).setValue([alvoX, alvoY]);
|
|
165
|
+
else {
|
|
166
|
+
var de = kP(mundo).valueAtTime(tt, false);
|
|
167
|
+
mola(kP(mundo), tt, [v ? g.cx : g.cx - (i - 1) * gap, v ? g.cy - (i - 1) * gap : g.cy], [alvoX, alvoY], { quique: 0.3, dur: 0.75 });
|
|
168
|
+
curva(kS(zoom), [[tt, [100, 100], null, 25], [tt + 0.3, [78, 78], 60, 40], [tt + 0.75, [100, 100], 70, null]]);
|
|
169
|
+
som(tt, 'troca', 0.6);
|
|
170
|
+
}
|
|
171
|
+
som(tt + 0.5, 'pop', 0.5);
|
|
172
|
+
}
|
|
173
|
+
cam.empurra(0.8, 0, 0, 1.0).empurra(comp.duration - 0.2, 0, 0, 1.06);
|
|
174
|
+
fecha(comp);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// ---------------------------------------------------------------- 5. gráfico de barras que cresce
|
|
178
|
+
function cenaBarras(comp, P, d) {
|
|
179
|
+
var g = kPre(comp, P), W = g.W, H = g.H, u = g.u, cam = g.cam, v = g.v, T0 = 0.12;
|
|
180
|
+
var it = kItens(d, ['Antes', 'Mês 1', 'Mês 2', 'Agora'], 5), n = it.length, i;
|
|
181
|
+
var tt = kT(g, comp, P, d.titulo || '', v ? H * 0.16 : H * 0.17, { maxLinhas: 2, tam: v ? 88 : 76 });
|
|
182
|
+
var area = [W * 0.2, H * 0.3, W * 0.8, H * 0.78], aw = area[2] - area[0], ah = area[3] - area[1];
|
|
183
|
+
var bw = Math.min(aw / n * 0.62, 190 * u), gap = aw / n, i0;
|
|
184
|
+
var base = forma(comp, 'retangulo', { x: g.cx, y: area[3] + 6 * u, w: aw + 30 * u, h: 8 * u, cor: P.mudo, parent: cam.no, entrada: 'fade', t0: T0, nome: 'base' });
|
|
185
|
+
var tops = [];
|
|
186
|
+
for (i = 0; i < n; i++) {
|
|
187
|
+
var altura = ah * (0.2 + 0.8 * Math.pow((i + 1) / n, 1.5)), bx = area[0] + gap * (i + 0.5), ti = Q(it[i], T0 + 0.3 + i * 0.4), ult = i == n - 1;
|
|
188
|
+
var b = forma(comp, 'retangulo', { x: bx, y: area[3], w: bw, h: altura, r: 18 * u, cor: ult ? P.ac : P.card, traco: ult ? null : P.mudo, tracoL: 3 * u, parent: cam.no, nome: 'barra' });
|
|
189
|
+
kA(b).setValue([0, altura / 2]);
|
|
190
|
+
mola(kS(b), ti, [100, 0], [100, 100], { quique: ult ? 0.7 : 0.4, dur: 0.7 });
|
|
191
|
+
som(ti, ult ? 'impacto' : 'pop', ult ? 0.8 : 0.55);
|
|
192
|
+
texto(comp, it[i], { opcional: true, fonte: P.fonteTexto, tamanho: 34 * u, cor: P.mudo, x: bx, y: area[3] + 52 * u, parent: cam.no, entrada: 'sobe', t0: ti + 0.1, largura: gap * 0.92, maxLinhas: 2, sublinhado: false, fala: false });
|
|
193
|
+
tops.push([bx, area[3] - altura]);
|
|
194
|
+
}
|
|
195
|
+
var vt = d.valor || '';
|
|
196
|
+
if (vt) {
|
|
197
|
+
var tp = Q(vt, T0 + 0.3 + n * 0.4 + 0.2), bub = forma(comp, 'pilula', { x: tops[n - 1][0], y: tops[n - 1][1] - 70 * u, w: 250 * u, h: 100 * u, cor: P.fg, parent: cam.no, entrada: 'pop', t0: tp, quique: 0.7, nome: 'valor' });
|
|
198
|
+
texto(comp, vt, { fonte: P.fonteTitulo, tamanho: 58 * u, cor: P.bg, corDestaque: P.bg, x: tops[n - 1][0], y: tops[n - 1][1] - 70 * u, parent: cam.no, entrada: 'palavra', t0: tp + 0.06, largura: 220 * u, maxLinhas: 1, sublinhado: false, livre: true, fala: false });
|
|
199
|
+
som(tp, 'brilho', 0.6);
|
|
200
|
+
}
|
|
201
|
+
var pts = [[tops[0][0], tops[0][1] - 40 * u], [tops[n - 1][0] - bw * 0.3, tops[n - 1][1] - 40 * u]], tl = T0 + 0.3 + n * 0.4;
|
|
202
|
+
caminho(comp, [[tops[0][0], tops[0][1] - 40 * u], [tops[Math.floor(n / 2)][0], tops[Math.floor(n / 2)][1] - 50 * u], [tops[n - 1][0], tops[n - 1][1] - 40 * u]], { cor: P.ac, esp: 8 * u, t0: tl, dur: 0.7, parent: cam.no, suave: true, nome: 'tendencia' });
|
|
203
|
+
cam.empurra(0.8, 0, 0, 1.0).empurra(comp.duration - 0.2, 0, -20 * u, 1.08);
|
|
204
|
+
fecha(comp);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// ---------------------------------------------------------------- 6. gráfico de linha que se desenha
|
|
208
|
+
function cenaLinha(comp, P, d) {
|
|
209
|
+
var g = kPre(comp, P), W = g.W, H = g.H, u = g.u, cam = g.cam, v = g.v, T0 = 0.12, i;
|
|
210
|
+
kT(g, comp, P, d.titulo || '', v ? H * 0.16 : H * 0.17, { maxLinhas: 2, tam: v ? 88 : 76 });
|
|
211
|
+
var x0 = W * 0.13, x1 = W * 0.87, y0 = v ? H * 0.34 : H * 0.34, y1 = v ? H * 0.68 : H * 0.8, N = 7;
|
|
212
|
+
for (i = 0; i < 4; i++) { var gy = y0 + (y1 - y0) * i / 3; forma(comp, 'retangulo', { x: g.cx, y: gy, w: x1 - x0, h: 3 * u, cor: P.mudo, alfa: 35, parent: cam.no, entrada: 'fade', t0: T0 + i * 0.06, nome: 'grade' }); }
|
|
213
|
+
var vs = [0.12, 0.2, 0.17, 0.38, 0.5, 0.46, 0.88], pts = [], area = [];
|
|
214
|
+
for (i = 0; i < N; i++) pts.push([x0 + (x1 - x0) * i / (N - 1), y1 - (y1 - y0) * vs[i]]);
|
|
215
|
+
var tl = T0 + 0.45, dd = 1.3;
|
|
216
|
+
var ar = pts.slice(0); ar.push([x1, y1]); ar.push([x0, y1]);
|
|
217
|
+
var fill = caminho(comp, ar, { preenche: P.ac, fecha: true, parent: cam.no, alfa: 0, nome: 'area' });
|
|
218
|
+
curva(kO(fill), [[tl + dd * 0.6, 0, null, 30], [tl + dd + 0.4, 22, 60, null]]);
|
|
219
|
+
caminho(comp, pts, { cor: P.ac, esp: 14 * u, t0: tl, dur: dd, parent: cam.no, suave: true, nome: 'linha' });
|
|
220
|
+
for (i = 0; i < N; i++) {
|
|
221
|
+
var tp = tl + dd * i / (N - 1);
|
|
222
|
+
forma(comp, 'circulo', { x: pts[i][0], y: pts[i][1], w: (i == N - 1 ? 46 : 28) * u, cor: i == N - 1 ? P.ac : P.bg, traco: P.ac, tracoL: 7 * u, parent: cam.no, entrada: 'pop', t0: tp, quique: 0.6, nome: 'ponto' });
|
|
223
|
+
if (i % 2 == 0) som(tp, 'ponto' + (1 + i % 5), 0.5);
|
|
224
|
+
}
|
|
225
|
+
var vt = d.valor || '+', te = Q(vt, tl + dd);
|
|
226
|
+
var ult = pts[N - 1];
|
|
227
|
+
forma(comp, 'pilula', { x: ult[0] - 150 * u, y: ult[1] - 90 * u, w: 280 * u, h: 104 * u, cor: P.fg, parent: cam.no, entrada: 'pop', t0: te, quique: 0.7, nome: 'valor' });
|
|
228
|
+
texto(comp, vt, { fonte: P.fonteTitulo, tamanho: 62 * u, cor: P.bg, corDestaque: P.bg, x: ult[0] - 150 * u, y: ult[1] - 90 * u, parent: cam.no, entrada: 'palavra', t0: te + 0.06, largura: 250 * u, maxLinhas: 1, sublinhado: false, livre: true, fala: false });
|
|
229
|
+
som(tl, 'sobe', 0.5); som(te, 'brilho', 0.7);
|
|
230
|
+
if (d.rotulo) texto(comp, d.rotulo, { fonte: P.fonteTexto, tamanho: 46 * u, cor: P.mudo, x: g.cx, y: y1 + 84 * u, parent: cam.no, entrada: 'sobe', t0: Q(d.rotulo, te + 0.2), largura: W * 0.8, maxLinhas: 2, sublinhado: false });
|
|
231
|
+
cam.empurra(0.8, 0, 0, 1.0).empurra(tl + dd, -30 * u, -10 * u, 1.07).empurra(comp.duration - 0.2, -50 * u, -20 * u, 1.1);
|
|
232
|
+
fecha(comp);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// ---------------------------------------------------------------- 7. mapa com pinos que caem
|
|
236
|
+
function cenaMapa(comp, P, d) {
|
|
237
|
+
var g = kPre(comp, P), W = g.W, H = g.H, u = g.u, cam = g.cam, v = g.v, T0 = 0.12, i;
|
|
238
|
+
var mapa = grupo(comp, { x: g.cx, y: g.cy, parent: cam.no, nome: 'mapa' });
|
|
239
|
+
var s = Math.max(W, H) * 1.3;
|
|
240
|
+
forma(comp, 'retangulo', { x: 0, y: 0, w: s, h: s, cor: P.card, parent: mapa, nome: 'terra' });
|
|
241
|
+
var rio = caminho(comp, [[-s / 2, s * 0.18], [-s * 0.15, s * 0.05], [s * 0.1, s * 0.22], [s / 2, s * 0.1]], { cor: P.ac, esp: 70 * u, alfa: 35, parent: mapa, suave: true, t0: 0.05, dur: 0.8, nome: 'rio' });
|
|
242
|
+
for (i = -4; i <= 4; i++) {
|
|
243
|
+
caminho(comp, [[i * s * 0.11, -s / 2], [i * s * 0.11 + (i % 2) * 40 * u, s / 2]], { cor: P.mudo, esp: (i % 3 == 0 ? 16 : 8) * u, alfa: 45, parent: mapa, t0: 0.05 + Math.abs(i) * 0.03, dur: 0.6, nome: 'rua' });
|
|
244
|
+
caminho(comp, [[-s / 2, i * s * 0.11], [s / 2, i * s * 0.11 - (i % 2) * 30 * u]], { cor: P.mudo, esp: (i % 3 == 0 ? 16 : 8) * u, alfa: 45, parent: mapa, t0: 0.1 + Math.abs(i) * 0.03, dur: 0.6, nome: 'rua' });
|
|
245
|
+
}
|
|
246
|
+
var it = kItens(d, ['Aqui', 'Perto', 'Você'], 4), n = it.length;
|
|
247
|
+
for (i = 0; i < n; i++) {
|
|
248
|
+
var a = i * 2.1 + 0.6, px = Math.cos(a) * W * (v ? 0.25 : 0.2) + (i - n / 2) * 20 * u, py = Math.sin(a) * H * 0.16 + (i - 1) * 30 * u + (v ? 40 * u : 0);
|
|
249
|
+
var ti = Q(it[i], 0.5 + i * 0.5), pin = grupo(comp, { x: px, y: py, parent: mapa, nome: 'pino' });
|
|
250
|
+
var rad = forma(comp, 'circulo', { x: 0, y: 0, w: 220 * u, traco: P.ac, tracoL: 6 * u, alfa: 0, parent: pin, nome: 'radar' });
|
|
251
|
+
curva(kS(rad), [[ti + 0.3, [20, 20], null, 20], [ti + 1.2, [140, 140], 80, null]]);
|
|
252
|
+
curva(kO(rad), [[ti + 0.3, 70, null, 30], [ti + 1.2, 0, 70, null]]);
|
|
253
|
+
var cab = forma(comp, 'circulo', { x: 0, y: -60 * u, w: 78 * u, cor: i == n - 1 ? P.ac : P.fg, parent: pin, nome: 'pino-cabeca' });
|
|
254
|
+
caminho(comp, [[-30 * u, -42 * u], [0, 0], [30 * u, -42 * u]], { preenche: i == n - 1 ? P.ac : P.fg, fecha: true, parent: pin, nome: 'pino-ponta' });
|
|
255
|
+
forma(comp, 'circulo', { x: 0, y: -60 * u, w: 28 * u, cor: P.bg, parent: pin, nome: 'pino-miolo' });
|
|
256
|
+
curva(kO(pin), [[ti - 0.001 > 0 ? ti - 0.04 : 0, 0, null, 20], [ti, 100, null, 30]]);
|
|
257
|
+
mola(kP(pin), ti, [px, py - 420 * u], [px, py], { quique: 0.7, dur: 0.7 });
|
|
258
|
+
som(ti + 0.28, 'pop', 0.7);
|
|
259
|
+
var cx2 = px + (px > 0 ? -1 : 1) * 0, ly = py - 150 * u;
|
|
260
|
+
forma(comp, 'pilula', { x: px, y: ly, w: Math.min(W * 0.4, 320 * u), h: 66 * u, cor: P.fg, parent: mapa, entrada: 'pop', t0: ti + 0.4, quique: 0.5, nome: 'rotulo' });
|
|
261
|
+
texto(comp, it[i], { fonte: P.fonteTexto, tamanho: 34 * u, cor: P.bg, corDestaque: P.bg, x: px, y: ly, parent: mapa, entrada: 'sobe', t0: ti + 0.46, largura: Math.min(W * 0.36, 290 * u), maxLinhas: 1, sublinhado: false, livre: true, fala: false });
|
|
262
|
+
}
|
|
263
|
+
if (d.titulo) kT(g, comp, P, d.titulo, v ? H * 0.13 : H * 0.14, { maxLinhas: 2, tam: v ? 84 : 72, sobrepoe: true });
|
|
264
|
+
curva(kS(mapa), [[0, [118, 118], null, 25], [comp.duration, [100, 100], 40, null]]);
|
|
265
|
+
cam.empurra(0.8, 0, 0, 1.0).empurra(comp.duration - 0.2, 0, 0, 1.08);
|
|
266
|
+
fecha(comp);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// ---------------------------------------------------------------- 8. cards que pulam
|
|
270
|
+
function cenaCardsPulam(comp, P, d) {
|
|
271
|
+
var g = kPre(comp, P), W = g.W, H = g.H, u = g.u, cam = g.cam, v = g.v, T0 = 0.12, i;
|
|
272
|
+
var it = kItens(d, ['Um', 'Dois', 'Três'], 4), n = it.length;
|
|
273
|
+
if (d.titulo) kT(g, comp, P, d.titulo, v ? H * 0.15 : H * 0.5, { x: v ? g.cx : W * 0.26, largura: v ? W * 0.86 : W * 0.4, maxLinhas: 3, tam: v ? 90 : 80 });
|
|
274
|
+
var cw = v ? W * 0.8 : W * 0.44, ch = Math.min(v ? H * 0.15 : H * 0.2, (H * 0.62) / n - 16 * u), top = v ? H * 0.31 : H * 0.5 - (n * (ch + 18 * u)) / 2 + ch / 2, cx0 = v ? g.cx : W * 0.72;
|
|
275
|
+
for (i = 0; i < n; i++) {
|
|
276
|
+
var y = top + i * (ch + 18 * u) + (v ? ch / 2 : 0), ti = Q(it[i], T0 + 0.3 + i * 0.42), ult = i == n - 1, rot = (i % 2 ? 1 : -1) * 5;
|
|
277
|
+
var c = forma(comp, 'retangulo', { x: cx0, y: y, w: cw, h: ch, r: 36 * u, cor: ult ? P.ac : P.card, traco: ult ? null : P.mudo, tracoL: 3 * u, parent: cam.no, nome: 'card' });
|
|
278
|
+
mola(kP(c), ti, [cx0 + (i % 2 ? 1 : -1) * 40 * u, y + H * 0.45], [cx0, y], { quique: 0.75, dur: 0.85 });
|
|
279
|
+
mola(kR(c), ti, rot * 2, 0, { quique: 0.6, dur: 0.9 });
|
|
280
|
+
curva(kO(c), [[ti - 0.04, 0, null, 30], [ti, 100, null, 30]]);
|
|
281
|
+
som(ti + 0.22, 'pop', 0.6);
|
|
282
|
+
var ex = cx0 - cw / 2 + ch * 0.62;
|
|
283
|
+
var ic = elemento(comp, i, { x: ex, y: y, w: ch * 0.78, parent: cam.no, entrada: 'pop', t0: ti + 0.3, quique: 0.7 });
|
|
284
|
+
texto(comp, it[i], { tamanho: Math.min(58 * u, ch * 0.42), cor: ult ? kSobre(P) : P.fg, corDestaque: ult ? kSobre(P) : P.ac, x: cx0 + ch * 0.4, y: y, parent: cam.no, entrada: 'sobe', t0: ti + 0.3, largura: cw - ch * 1.6, maxLinhas: 2, sublinhado: false, fala: false });
|
|
285
|
+
}
|
|
286
|
+
cam.empurra(0.8, 0, -10 * u, 1.03).empurra(comp.duration - 0.2, 0, 20 * u, 1.08);
|
|
287
|
+
fecha(comp);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// ---------------------------------------------------------------- 9. cursor que conduz
|
|
291
|
+
function kCursor(comp, parent, u, cor, borda) {
|
|
292
|
+
var L = comp.layers.addShape(); L.name = 'cursor'; if (parent) kPai(L, parent);
|
|
293
|
+
var gp = L.property('ADBE Root Vectors Group').addProperty('ADBE Vector Group'), v = gp.property('ADBE Vectors Group');
|
|
294
|
+
var pa = v.addProperty('ADBE Vector Shape - Group'), S = new Shape(), s = 1.5 * u;
|
|
295
|
+
S.vertices = [[0, 0], [0, 38 * s], [9 * s, 29 * s], [16 * s, 44 * s], [23 * s, 41 * s], [16 * s, 27 * s], [29 * s, 27 * s]];
|
|
296
|
+
var z = [], i; for (i = 0; i < 7; i++) z.push([0, 0]);
|
|
297
|
+
S.inTangents = z; S.outTangents = z; S.closed = true;
|
|
298
|
+
pa.property('ADBE Vector Shape').setValue(S);
|
|
299
|
+
var st = v.addProperty('ADBE Vector Graphic - Stroke'); st.property('ADBE Vector Stroke Color').setValue(kCor(borda)); st.property('ADBE Vector Stroke Width').setValue(4 * u);
|
|
300
|
+
try { st.property('ADBE Vector Stroke Line Join').setValue(2); } catch (e) { }
|
|
301
|
+
v.addProperty('ADBE Vector Graphic - Fill').property('ADBE Vector Fill Color').setValue(kCor(cor));
|
|
302
|
+
kO(L).setValue(0);
|
|
303
|
+
return L;
|
|
304
|
+
}
|
|
305
|
+
function cenaCursor(comp, P, d) {
|
|
306
|
+
var g = kPre(comp, P), W = g.W, H = g.H, u = g.u, cam = g.cam, v = g.v, T0 = 0.12;
|
|
307
|
+
if (d.titulo) kT(g, comp, P, d.titulo, v ? H * 0.15 : H * 0.15, { maxLinhas: 2, tam: v ? 86 : 70 });
|
|
308
|
+
var pw = v ? W * 0.86 : W * 0.6, ph = v ? H * 0.42 : H * 0.62, px = g.cx, py = v ? H * 0.52 : H * 0.57;
|
|
309
|
+
var painel = forma(comp, 'retangulo', { x: px, y: py, w: pw, h: ph, r: 44 * u, cor: P.card, traco: P.mudo, tracoL: 3 * u, parent: cam.no, entrada: 'cresce', t0: T0, nome: 'painel' });
|
|
310
|
+
var campoW = pw * 0.84, campoH = 110 * u, cy1 = py - ph * 0.2;
|
|
311
|
+
var campo = forma(comp, 'pilula', { x: px, y: cy1, w: campoW, h: campoH, cor: P.bg, traco: P.mudo, tracoL: 3 * u, parent: cam.no, entrada: 'pop', t0: T0 + 0.2, nome: 'campo' });
|
|
312
|
+
var foco = forma(comp, 'pilula', { x: px, y: cy1, w: campoW + 14 * u, h: campoH + 14 * u, traco: P.ac, tracoL: 6 * u, alfa: 0, parent: cam.no, nome: 'foco' });
|
|
313
|
+
var bw = pw * 0.5, bh = 112 * u, by = py + ph * 0.24;
|
|
314
|
+
var bt = botao(comp, { x: px, y: by, w: bw, h: bh, rotulo: d.botao || 'Enviar', cor: P.ac, corTexto: kSobre(P), t0: T0 + 0.4, tam: 46 * u, parent: cam.no });
|
|
315
|
+
var cur = kCursor(comp, cam.no, u, P.fg, P.bg);
|
|
316
|
+
var tc = T0 + 0.9, txt = d.texto || d.sub || d.rotulo || 'o que você quer';
|
|
317
|
+
kP(cur).setValue([px + pw * 0.6, py + ph * 0.9]);
|
|
318
|
+
curva(kP(cur), [[tc - 0.7, [px + pw * 0.6, py + ph * 0.9], null, 20], [tc, [px - campoW * 0.3, cy1 + 10 * u], 75, 30]]);
|
|
319
|
+
curva(kO(cur), [[tc - 0.7, 0, null, 30], [tc - 0.5, 100, 60, null]]);
|
|
320
|
+
curva(kS(cur), [[tc, [100, 100], null, 25], [tc + 0.07, [82, 82], 70, 40], [tc + 0.2, [100, 100], 70, null]]);
|
|
321
|
+
curva(kO(foco), [[tc, 0, null, 30], [tc + 0.12, 100, 60, null]]);
|
|
322
|
+
som(tc, 'clique', 0.8);
|
|
323
|
+
var dg = digita(comp, txt, { x: px - campoW / 2 + 36 * u, y: cy1, tamanho: 42 * u, fonte: P.fonteTexto, cor: P.fg, largura: campoW * 0.86, parent: cam.no, t0: tc + 0.25, cps: 26 });
|
|
324
|
+
var t2 = Math.max(dg.fim + 0.15, tc + 0.9);
|
|
325
|
+
curva(kP(cur), [[tc + 0.1, [px - campoW * 0.3, cy1 + 10 * u], null, 25], [t2, [px + bw * 0.1, by + 8 * u], 75, 30]]);
|
|
326
|
+
curva(kS(cur), [[t2, [100, 100], null, 25], [t2 + 0.07, [82, 82], 70, 40], [t2 + 0.2, [100, 100], 70, null]]);
|
|
327
|
+
bt.aperta(t2);
|
|
328
|
+
var res = forma(comp, 'pilula', { x: px, y: py + ph * 0.02, w: campoW * 0.9, h: 96 * u, cor: P.ac, parent: cam.no, entrada: 'pop', t0: t2 + 0.25, quique: 0.7, nome: 'resultado' });
|
|
329
|
+
check(comp, { x: px - campoW * 0.36, y: py + ph * 0.02, tam: 44 * u, cor: kSobre(P), parent: cam.no, t0: t2 + 0.4 });
|
|
330
|
+
texto(comp, d.rotulo || 'Pronto!', { fonte: P.fonteTitulo, tamanho: 44 * u, cor: kSobre(P), corDestaque: kSobre(P), x: px + 20 * u, y: py + ph * 0.02, parent: cam.no, entrada: 'sobe', t0: t2 + 0.3, largura: campoW * 0.6, maxLinhas: 1, sublinhado: false, livre: true, fala: false });
|
|
331
|
+
som(t2 + 0.28, 'brilho', 0.7);
|
|
332
|
+
curva(kO(cur), [[t2 + 0.7, 100, null, 30], [t2 + 0.95, 0, 60, null]]);
|
|
333
|
+
cam.empurra(0.8, 0, 0, 1.02).empurra(tc, 0, -10 * u, 1.06).empurra(t2 + 0.2, 0, 30 * u, 1.1).empurra(comp.duration - 0.2, 0, 40 * u, 1.12);
|
|
334
|
+
fecha(comp);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
// ---------------------------------------------------------------- 10. notificações empilhadas
|
|
338
|
+
function cenaNotificacoes(comp, P, d) {
|
|
339
|
+
var g = kPre(comp, P), W = g.W, H = g.H, u = g.u, cam = g.cam, v = g.v, T0 = 0.12, i;
|
|
340
|
+
var esc = v ? 0.66 * H / 960 * 0.92 : 0.7 * H / 960;
|
|
341
|
+
if (d.titulo) kT(g, comp, P, d.titulo, v ? H * 0.14 : g.cy, { x: v ? g.cx : W * 0.27, largura: v ? W * 0.86 : W * 0.4, maxLinhas: 3, tam: v ? 90 : 80 });
|
|
342
|
+
var cel = celular(comp, { x: v ? g.cx : W * 0.7, y: v ? H * 0.58 : g.cy, escala: esc, parent: cam.no, t0: T0 + 0.1, tela: P.bg == P.card ? '#222222' : (kLum(P.bg) > 0.5 ? '#EDEDF0' : '#1B1B20') });
|
|
343
|
+
var claro = kLum(P.bg) > 0.5, ban = claro ? '#FFFFFF' : '#2E2E35', tx = claro ? '#1B1B1F' : '#F4F4F6';
|
|
344
|
+
var it = kItens(d, ['Nova mensagem', 'Agenda confirmada', 'Pagamento recebido'], 4), n = it.length;
|
|
345
|
+
var hora = texto(comp, d.rotulo || '09:41', { fonte: P.fonteTitulo, tamanho: 120, cor: tx, corDestaque: tx, x: 0, y: -290, parent: cel.no, entrada: 'sobe', t0: T0 + 0.7, largura: 340, maxLinhas: 1, sublinhado: false, livre: true, fala: false });
|
|
346
|
+
for (i = 0; i < n; i++) {
|
|
347
|
+
var ti = Q(it[i], T0 + 0.6 + i * 0.3), y = -130 + i * 128;
|
|
348
|
+
var b = forma(comp, 'retangulo', { x: 0, y: y, w: 392, h: 110, r: 30, cor: ban, parent: cel.no, nome: 'banner' });
|
|
349
|
+
curva(kP(b), [[ti, [0, y - 520], null, 22], [ti + 0.45, [0, y], 80, null]]);
|
|
350
|
+
mola(kS(b), ti + 0.3, [96, 96], [100, 100], { quique: 0.5, dur: 0.4 });
|
|
351
|
+
curva(kO(b), [[ti - 0.04, 0, null, 30], [ti, 100, null, 30]]);
|
|
352
|
+
var ic = forma(comp, 'retangulo', { x: -152, y: y, w: 62, h: 62, r: 16, cor: i % 2 ? P.ac : P.fg, parent: cel.no, nome: 'icone-app' });
|
|
353
|
+
curva(kP(ic), [[ti, [-152, y - 520], null, 22], [ti + 0.45, [-152, y], 80, null]]);
|
|
354
|
+
curva(kO(ic), [[ti - 0.04, 0, null, 30], [ti, 100, null, 30]]);
|
|
355
|
+
var tt = texto(comp, it[i], { tamanho: 30, cor: tx, x: 38, y: y, parent: cel.no, entrada: 'sobe', t0: ti + 0.4, largura: 250, maxLinhas: 2, sublinhado: false, livre: true, fala: false });
|
|
356
|
+
som(ti + 0.1, 'notif', 0.8);
|
|
357
|
+
}
|
|
358
|
+
var bd = forma(comp, 'circulo', { x: 150, y: -390, w: 70, cor: '#FF3B30', parent: cel.no, entrada: 'pop', t0: T0 + 1.0, quique: 0.8, nome: 'badge' });
|
|
359
|
+
var bn = comp.layers.addText('0'); bn.name = 'badge-num'; kPai(bn, cel.no);
|
|
360
|
+
var td = kDoc(bn, P.fonteTitulo, 40, '#FFFFFF'); kP(bn).setValue([150, -377]);
|
|
361
|
+
td.expression = 'var n = Math.floor((time - ' + (T0 + 1.0) + ') / 0.6) + 1; String(Math.max(0, Math.min(' + n + ', n)))';
|
|
362
|
+
cam.empurra(0.8, 0, 0, 1.02).empurra(comp.duration - 0.2, v ? 0 : 40 * u, v ? 40 * u : 0, 1.1);
|
|
363
|
+
fecha(comp);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
// ---------------------------------------------------------------- 11. chat com balões
|
|
367
|
+
function cenaChat(comp, P, d) {
|
|
368
|
+
var g = kPre(comp, P), W = g.W, H = g.H, u = g.u, cam = g.cam, v = g.v, T0 = 0.12, i;
|
|
369
|
+
var it = kItens(d, ['Oi, tudo bem?', 'Vi que você sumiu', 'Posso ajudar?'], 4), n = it.length;
|
|
370
|
+
if (d.titulo) kT(g, comp, P, d.titulo, v ? H * 0.12 : H * 0.14, { maxLinhas: 2, tam: v ? 80 : 66 });
|
|
371
|
+
var cw = v ? W * 0.84 : W * 0.5, top = v ? H * 0.3 : H * 0.28, passo = Math.min(v ? H * 0.14 : H * 0.17, (H * 0.5) / n), y = top + passo * 0.5;
|
|
372
|
+
var tam = Math.max(56 * u, H * 0.036), maxw = cw * 0.78, fonte = P.fonteTexto;
|
|
373
|
+
for (i = 0; i < n; i++) {
|
|
374
|
+
var meu = i % 2 == 1, ti = Q(it[i], T0 + 0.3 + i * 0.4);
|
|
375
|
+
var cor = meu ? P.ac : P.card, tcor = meu ? kSobre(P) : P.fg;
|
|
376
|
+
// o balão é medido ANTES (largura do texto, linhas) e desenhado por baixo do texto, com cauda, encostado no lado de quem fala
|
|
377
|
+
var w0 = kMedir(comp, it[i], fonte, tam), linhas = Math.max(1, Math.ceil(w0 / maxw)), tw = Math.min(w0 + 8, maxw);
|
|
378
|
+
var bwid = tw + 64 * u, bhei = linhas * tam * 1.3 + 44 * u;
|
|
379
|
+
var cxb = meu ? g.cx + cw / 2 - bwid / 2 : g.cx - cw / 2 + bwid / 2;
|
|
380
|
+
var bx = meu ? g.cx + cw / 2 : g.cx - cw / 2, k;
|
|
381
|
+
for (k = 0; k < 3; k++) { // três pontinhos "digitando" antes do balão
|
|
382
|
+
var pt = forma(comp, 'circulo', { x: bx + (meu ? -1 : 1) * (50 + k * 30) * u, y: y, w: 18 * u, cor: P.mudo, parent: cam.no, nome: 'digitando', alfa: 0 });
|
|
383
|
+
curva(kO(pt), [[ti - 0.3, 0, null, 30], [ti - 0.22, 100, 60, 30], [ti - 0.04, 100, null, 30], [ti, 0, null, 30]]);
|
|
384
|
+
kP(pt).expression = 'value + [0, Math.sin(time*9+' + k + ')*5]';
|
|
385
|
+
}
|
|
386
|
+
var b = forma(comp, 'retangulo', { x: cxb, y: y, w: bwid, h: bhei, r: 44 * u, cor: cor, parent: cam.no, nome: 'balao' });
|
|
387
|
+
var sg = meu ? 1 : -1, ex = meu ? cxb + bwid / 2 : cxb - bwid / 2, ey = y + bhei / 2;
|
|
388
|
+
var cauda = caminho(comp, [[ex - sg * 46 * u, ey - 24 * u], [ex + sg * 14 * u, ey + 22 * u], [ex - sg * 4 * u, ey - 48 * u]], { preenche: cor, fecha: true, parent: cam.no, nome: 'balao-cauda' });
|
|
389
|
+
var tt = texto(comp, it[i], { fonte: fonte, tamanho: tam, cor: tcor, corDestaque: tcor, x: cxb, y: y, parent: cam.no, entrada: 'sobe', t0: ti + 0.04, largura: tw + 8, maxLinhas: linhas, sublinhado: false, fala: false, sobrepoe: true, livre: true });
|
|
390
|
+
mola(kS(b), ti, [60, 60], [100, 100], { quique: 0.7, dur: 0.55 });
|
|
391
|
+
curva(kO(b), [[ti - 0.03, 0, null, 30], [ti, 100, null, 30]]);
|
|
392
|
+
curva(kO(cauda), [[ti - 0.03, 0, null, 30], [ti, 100, null, 30]]);
|
|
393
|
+
mola(kS(cauda), ti, [60, 60], [100, 100], { quique: 0.7, dur: 0.55 });
|
|
394
|
+
som(ti, meu ? 'tap' : 'notif', 0.6);
|
|
395
|
+
y += passo;
|
|
396
|
+
}
|
|
397
|
+
cam.empurra(0.8, 0, 0, 1.02).empurra(comp.duration - 0.2, 0, -20 * u, 1.07);
|
|
398
|
+
fecha(comp);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
// ---------------------------------------------------------------- 12. linha do tempo
|
|
402
|
+
function cenaLinhaTempo(comp, P, d) {
|
|
403
|
+
var g = kPre(comp, P), W = g.W, H = g.H, u = g.u, cam = g.cam, v = g.v, T0 = 0.12, i;
|
|
404
|
+
var it = kItens(d, ['Dia 1', 'Semana 2', 'Mês 3'], 5), n = it.length;
|
|
405
|
+
if (d.titulo) kT(g, comp, P, d.titulo, v ? H * 0.14 : H * 0.16, { maxLinhas: 2, tam: v ? 88 : 72 });
|
|
406
|
+
var a = v ? [W * 0.28, H * 0.3] : [W * 0.14, H * 0.58], b = v ? [W * 0.28, H * 0.86] : [W * 0.86, H * 0.58];
|
|
407
|
+
caminho(comp, [a, b], { cor: P.mudo, esp: 10 * u, t0: T0, dur: 0.6, parent: cam.no, nome: 'trilho' });
|
|
408
|
+
var prog = caminho(comp, [a, b], { cor: P.ac, esp: 14 * u, t0: T0 + 0.4, dur: 1.1, parent: cam.no, nome: 'progresso' });
|
|
409
|
+
var cometa = forma(comp, 'circulo', { x: a[0], y: a[1], w: 44 * u, cor: P.ac, parent: cam.no, nome: 'cometa', alfa: 0 });
|
|
410
|
+
var tl = T0 + 0.4, dd = 1.1;
|
|
411
|
+
curva(kP(cometa), [[tl, a, null, 18], [tl + dd, b, 78, null]]); curva(kO(cometa), [[tl, 0, null, 30], [tl + 0.1, 100, 60, 30]]);
|
|
412
|
+
for (i = 0; i < n; i++) {
|
|
413
|
+
var f = n == 1 ? 0.5 : i / (n - 1), px = a[0] + (b[0] - a[0]) * f, py = a[1] + (b[1] - a[1]) * f, ti = Q(it[i], tl + dd * f);
|
|
414
|
+
var no = forma(comp, 'circulo', { x: px, y: py, w: 64 * u, cor: i == n - 1 ? P.ac : P.bg, traco: P.ac, tracoL: 10 * u, parent: cam.no, entrada: 'pop', t0: ti, quique: 0.7, nome: 'marco' });
|
|
415
|
+
som(ti, 'ponto' + (1 + i % 5), 0.6);
|
|
416
|
+
var tx = v ? px + 70 * u : px, ty = v ? py : py - 110 * u - (i % 2) * 0;
|
|
417
|
+
if (!v && i % 2) ty = py + 120 * u;
|
|
418
|
+
texto(comp, it[i], { tamanho: (v ? 52 : 44) * u, cor: P.fg, corDestaque: P.ac, x: v ? px + 60 * u + (W * 0.4) / 2 : px, y: v ? py : ty, parent: cam.no, entrada: v ? 'mascara' : 'sobe', t0: ti + 0.1, largura: v ? W * 0.4 : W * 0.2, maxLinhas: 2, sublinhado: false, fala: false });
|
|
419
|
+
elemento(comp, i, { x: v ? W * 0.8 : px, y: v ? py : (i % 2 ? py + 50 * u : py - 50 * u) + (v ? 0 : 0), w: v ? 130 * u : 0.01, parent: cam.no, entrada: v ? 'pop' : null, t0: ti + 0.2 });
|
|
420
|
+
}
|
|
421
|
+
cam.empurra(0.8, 0, 0, 1.02).empurra(comp.duration - 0.2, 0, 0, 1.07);
|
|
422
|
+
fecha(comp);
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
// ---------------------------------------------------------------- 13. laço de processo
|
|
426
|
+
function cenaLaco(comp, P, d) {
|
|
427
|
+
var g = kPre(comp, P), W = g.W, H = g.H, u = g.u, cam = g.cam, v = g.v, T0 = 0.12, i;
|
|
428
|
+
var it = kItens(d, ['Ideia', 'Teste', 'Ajuste'], 5), n = it.length;
|
|
429
|
+
var cx = g.cx, cy = v ? H * 0.5 : H * 0.54, R = Math.min(W, H) * (v ? 0.24 : 0.3);
|
|
430
|
+
if (d.titulo) kT(g, comp, P, d.titulo, v ? H * 0.17 : H * 0.14, { maxLinhas: 2, tam: v ? 76 : 66 });
|
|
431
|
+
var trilho = forma(comp, 'circulo', { x: cx, y: cy, w: R * 2, traco: P.mudo, tracoL: 8 * u, alfa: 60, parent: cam.no, entrada: 'cresce', t0: T0, nome: 'trilho' });
|
|
432
|
+
var prog = forma(comp, 'circulo', { x: cx, y: cy, w: R * 2, traco: P.ac, tracoL: 14 * u, parent: cam.no, nome: 'progresso' });
|
|
433
|
+
kR(prog).setValue(-90);
|
|
434
|
+
var gg = prog.property('ADBE Root Vectors Group').property(1).property('ADBE Vectors Group');
|
|
435
|
+
var tm = gg.addProperty('ADBE Vector Filter - Trim');
|
|
436
|
+
var dd = 1.2;
|
|
437
|
+
curva(tm.property('ADBE Vector Trim End'), [[T0 + 0.4, 0, null, 20], [T0 + 0.4 + dd, 100, 80, null]]);
|
|
438
|
+
try { gg.property('ADBE Vector Graphic - Stroke').property('ADBE Vector Stroke Line Cap').setValue(2); } catch (e) { }
|
|
439
|
+
// o ponto que orbita o laço
|
|
440
|
+
var orb = grupo(comp, { x: cx, y: cy, parent: cam.no, nome: 'orbita' });
|
|
441
|
+
curva(kR(orb), [[T0 + 0.4, -90, null, 20], [T0 + 0.4 + dd, 270, 80, null]]);
|
|
442
|
+
forma(comp, 'circulo', { x: R, y: 0, w: 40 * u, cor: P.fg, parent: orb, nome: 'satelite' });
|
|
443
|
+
for (i = 0; i < n; i++) {
|
|
444
|
+
var a = -Math.PI / 2 + i * 2 * Math.PI / n, px = cx + Math.cos(a) * R, py = cy + Math.sin(a) * R, ti = Q(it[i], T0 + 0.4 + dd * i / n);
|
|
445
|
+
forma(comp, 'circulo', { x: px, y: py, w: 132 * u, cor: P.bg, traco: P.ac, tracoL: 9 * u, parent: cam.no, entrada: 'pop', t0: ti, quique: 0.7, nome: 'etapa' });
|
|
446
|
+
elemento(comp, i, { x: px, y: py, w: 84 * u, parent: cam.no, entrada: 'pop', t0: ti + 0.06, quique: 0.7 });
|
|
447
|
+
var lx = px, ly = py + (Math.sin(a) < -0.5 ? -118 * u : 118 * u);
|
|
448
|
+
texto(comp, it[i], { opcional: true, fonte: P.fonteTexto, tamanho: 40 * u, cor: P.fg, corDestaque: P.ac, x: lx, y: ly, parent: cam.no, entrada: 'sobe', t0: ti + 0.1, largura: W * 0.26, maxLinhas: 2, sublinhado: false, fala: false });
|
|
449
|
+
som(ti, 'ponto' + (1 + i % 5), 0.6);
|
|
450
|
+
}
|
|
451
|
+
som(T0 + 0.4, 'sobe', 0.4);
|
|
452
|
+
if (d.rotulo) texto(comp, d.rotulo, { fonte: P.fonteTitulo, tamanho: 52 * u, cor: P.fg, corDestaque: P.ac, x: cx, y: cy, parent: cam.no, entrada: 'palavra', t0: Q(d.rotulo, T0 + 0.6), largura: R * 1.1, maxLinhas: 3, sublinhado: false, livre: true, fala: false });
|
|
453
|
+
cam.empurra(0.8, 0, 0, 1.0).empurra(comp.duration - 0.2, 0, 0, 1.08);
|
|
454
|
+
fecha(comp);
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
// ---------------------------------------------------------------- 14. explosão de elementos reais
|
|
458
|
+
function cenaExplosao(comp, P, d) {
|
|
459
|
+
var g = kPre(comp, P), W = g.W, H = g.H, u = g.u, cam = g.cam, v = g.v, T0 = 0.12, i;
|
|
460
|
+
var it = kItens(d, ['Um', 'Dois', 'Três', 'Quatro'], 4), n = Math.max(3, Math.min(4, it.length));
|
|
461
|
+
var cx = g.cx, cy = v ? H * 0.46 : g.cy, R = Math.min(W, H) * (v ? 0.34 : 0.34);
|
|
462
|
+
var hub = forma(comp, 'circulo', { x: cx, y: cy, w: Math.min(W, H) * 0.26, cor: P.ac, parent: cam.no, entrada: 'pop', t0: T0, quique: 0.6, nome: 'centro' });
|
|
463
|
+
som(T0, 'impacto', 0.6);
|
|
464
|
+
if (d.titulo) texto(comp, d.titulo, { fonte: P.fonteTitulo, tamanho: 54 * u, cor: kSobre(P), corDestaque: kSobre(P), x: cx, y: cy, parent: cam.no, entrada: 'palavra', t0: Q(d.titulo, T0 + 0.1), largura: Math.min(W, H) * 0.22, maxLinhas: 3, sublinhado: false, livre: true, fala: false });
|
|
465
|
+
for (i = 0; i < n; i++) {
|
|
466
|
+
var a = -Math.PI / 2 + i * 2 * Math.PI / n + 0.3, ew = Math.min(W, H) * 0.2, x = Math.max(W * KIT.MX + ew / 2, Math.min(W * (1 - KIT.MX) - ew / 2, cx + Math.cos(a) * R * (v ? 1.0 : 1.5))), y = Math.max(H * 0.17 + ew / 2, Math.min(H * 0.74 - ew, cy + Math.sin(a) * R * (v ? 1.22 : 1.0))), ti = Q(it[i] || '', T0 + 0.45 + i * 0.22);
|
|
467
|
+
var e = elemento(comp, i, { x: cx, y: cy, w: Math.min(W, H) * 0.2, parent: cam.no, nome: 'el-explode' });
|
|
468
|
+
curva(kO(e), [[ti - 0.04, 0, null, 30], [ti, 100, null, 30]]);
|
|
469
|
+
mola(kP(e), ti, [cx, cy], [x, y], { quique: 0.7, dur: 0.85 });
|
|
470
|
+
mola(kS(e), ti, [30, 30], [100 * 1.0, 100 * 1.0], { quique: 0.6, dur: 0.8 });
|
|
471
|
+
mola(kR(e), ti, (i % 2 ? 1 : -1) * 120, 0, { quique: 0.5, dur: 0.9 });
|
|
472
|
+
som(ti, 'pop', 0.7);
|
|
473
|
+
if (it[i]) texto(comp, it[i], { opcional: true, fonte: P.fonteTexto, tamanho: 38 * u, cor: P.fg, corDestaque: P.ac, x: x, y: y + Math.min(W, H) * 0.14, parent: cam.no, entrada: 'sobe', t0: ti + 0.35, largura: W * 0.32, maxLinhas: 2, sublinhado: false, fala: false });
|
|
474
|
+
kEstouro(comp, cam, x, y, ti + 0.05, i % 2 ? P.ac : P.fg, 5, 90 * u, false);
|
|
475
|
+
kP(e).expression = 'value + [Math.sin(time*1.8+' + i + ')*8, Math.cos(time*1.5+' + i + ')*8]';
|
|
476
|
+
}
|
|
477
|
+
cam.empurra(0.8, 0, 0, 1.0).empurra(comp.duration - 0.2, 0, -10 * u, 1.09);
|
|
478
|
+
fecha(comp);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
// ---------------------------------------------------------------- 15. máscara que revela
|
|
482
|
+
function cenaRevela(comp, P, d) {
|
|
483
|
+
var g = kPre(comp, P), W = g.W, H = g.H, u = g.u, cam = g.cam, v = g.v, T0 = 0.12;
|
|
484
|
+
var cx = g.cx, cy = v ? H * 0.4 : g.cy, D = Math.min(W, H) * (v ? 0.84 : 0.8);
|
|
485
|
+
var disco = comp.layers.addSolid(kCor(kContr(P.ac, P.bg) > 1.8 ? P.ac : P.fg), 'revela-disco', W, H, 1); kPai(disco, cam.no);
|
|
486
|
+
kMascaraAnim(disco, kCircShape(cx, cy, 2), kCircShape(cx, cy, D / 2), T0, 0.9);
|
|
487
|
+
var el = elemento(comp, 0, { x: cx, y: cy, w: D * 0.82, parent: cam.no, flutua: 10 });
|
|
488
|
+
curva(kO(el), [[T0 + 0.35, 0, null, 30], [T0 + 0.6, 100, 60, null]]);
|
|
489
|
+
mola(kS(el), T0 + 0.35, [40, 40], [100, 100], { quique: 0.6, dur: 0.8 });
|
|
490
|
+
// a palavra gigante atrás, revelada em faixas
|
|
491
|
+
var gig = d.rotulo || d.sub || '';
|
|
492
|
+
if (gig) {
|
|
493
|
+
var gt = texto(comp, String(gig).toUpperCase(), { fonte: P.fonteTitulo, tamanho: 260 * u, cor: P.card, corDestaque: P.card, x: cx, y: cy, parent: cam.no, entrada: 'mascara', t0: T0 + 0.1, largura: W * 0.9, maxLinhas: 1, sublinhado: false, livre: true, fala: false, caixa: false, semAuditoria: true });
|
|
494
|
+
var j; for (j = 0; j < gt.camadas.length; j++) gt.camadas[j].moveToEnd();
|
|
495
|
+
}
|
|
496
|
+
disco.moveToEnd();
|
|
497
|
+
som(T0, 'sobe', 0.6); som(T0 + 0.9, 'impacto', 0.7);
|
|
498
|
+
kEstouro(comp, cam, cx, cy, T0 + 0.9, P.fg, 10, D * 0.6, false);
|
|
499
|
+
if (d.titulo) kT(g, comp, P, d.titulo, v ? H * 0.78 : g.cy, { x: v ? g.cx : W * 0.2, largura: v ? W * 0.86 : W * 0.34, maxLinhas: 3, tam: v ? 92 : 80, t0: T0 + 1.0 });
|
|
500
|
+
cam.empurra(0.8, 0, 0, 1.0).empurra(comp.duration - 0.2, 0, 0, 1.1);
|
|
501
|
+
fecha(comp);
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
// ---------------------------------------------------------------- 16. split antes/depois com divisor que varre
|
|
505
|
+
function cenaSplit(comp, P, d) {
|
|
506
|
+
var g = kPre(comp, P), W = g.W, H = g.H, u = g.u, v = g.v, T0 = 0.12;
|
|
507
|
+
// split LIMPO com a paleta do vídeo: dois painéis de tela cheia, sem pai (não andam com a câmera: nenhuma borda aparece), antes à esquerda/
|
|
508
|
+
// em cima e depois (cor de destaque) varrido por uma máscara; os textos ficam por cima do painel certo
|
|
509
|
+
var pb = KIT.paletaBase || { fundo: P.bg, tinta: P.fg, destaque: P.ac };
|
|
510
|
+
var corAntes = pb.fundo, tAntes = pb.tinta, corDepois = pb.destaque, tDepois = kLum(pb.destaque) > 0.5 ? '#14110F' : '#FFFFFF';
|
|
511
|
+
var base = comp.layers.addSolid(kCor(corAntes), 'antes-fundo', W, H, 1);
|
|
512
|
+
var ts = T0 + 1.2, dd = 0.7;
|
|
513
|
+
var al = v ? [g.cx, H * 0.34] : [W * 0.25, g.cy], bl = v ? [g.cx, H * 0.7] : [W * 0.75, g.cy], wd = v ? W * 0.8 : W * 0.38, off = v ? 150 : 230;
|
|
514
|
+
texto(comp, 'ANTES', { fonte: P.fonteTitulo, tamanho: 36 * u, cor: tAntes, corDestaque: tAntes, x: al[0], y: al[1] - off * u, entrada: 'sobe', t0: T0 + 0.1, largura: wd, maxLinhas: 1, sublinhado: false, fala: false, caixa: false, sobrepoe: true });
|
|
515
|
+
texto(comp, d.antes || '', { tamanho: 92 * u, cor: tAntes, corDestaque: tAntes, x: al[0], y: al[1], entrada: 'palavra', t0: Q(d.antes || '', T0 + 0.3), largura: wd, maxLinhas: 3, sublinhado: false, sobrepoe: true });
|
|
516
|
+
elemento(comp, 0, { x: al[0], y: al[1] + (v ? 240 : 250) * u, w: 150 * u, entrada: 'pop', t0: T0 + 0.2 });
|
|
517
|
+
var depois = comp.layers.addSolid(kCor(corDepois), 'depois-fundo', W, H, 1); // por cima do antes: o que vem depois cobre o que ficou para trás
|
|
518
|
+
var m0 = v ? kRetShape(0, 0, W, 0, 0) : kRetShape(0, 0, 0, H, 0), m1 = kRetShape(0, 0, W, H, 0);
|
|
519
|
+
var mk = depois.property('ADBE Mask Parade').addProperty('ADBE Mask Atom'), mp = mk.property('ADBE Mask Shape');
|
|
520
|
+
mp.setValue(m0); mp.setValueAtTime(kFrame(ts), m0); mp.setValueAtTime(kFrame(ts) + dd, m1);
|
|
521
|
+
var div = forma(comp, 'retangulo', { x: g.cx, y: g.cy, w: v ? W : 12 * u, h: v ? 12 * u : H, cor: tDepois, nome: 'divisor', alfa: 0 });
|
|
522
|
+
curva(kP(div), [[ts, v ? [g.cx, 0] : [0, g.cy], null, 25], [ts + dd, v ? [g.cx, H] : [W, g.cy], 75, null]]);
|
|
523
|
+
curva(kO(div), [[ts - 0.02, 0, null, 30], [ts, 100, null, 30], [ts + dd, 100, null, 30], [ts + dd + 0.1, 0, 60, null]]);
|
|
524
|
+
texto(comp, 'DEPOIS', { fonte: P.fonteTitulo, tamanho: 36 * u, cor: tDepois, corDestaque: tDepois, x: bl[0], y: bl[1] - off * u, entrada: 'sobe', t0: ts + dd, largura: wd, maxLinhas: 1, sublinhado: false, fala: false, caixa: false, sobrepoe: true });
|
|
525
|
+
texto(comp, d.depois || '', { fonte: P.fonteTitulo, tamanho: 104 * u, cor: tDepois, corDestaque: tDepois, x: bl[0], y: bl[1], entrada: 'palavra', t0: Math.max(ts + dd - 0.2, Q(d.depois || '', ts + dd)), largura: wd, maxLinhas: 3, sublinhado: false, sobrepoe: true });
|
|
526
|
+
elemento(comp, 1, { x: bl[0], y: bl[1] + (v ? 240 : 250) * u, w: 170 * u, entrada: 'pop', t0: ts + dd + 0.2 });
|
|
527
|
+
som(T0 + 0.3, 'pop', 0.5); som(ts, 'troca', 0.8);
|
|
528
|
+
KIT.fit = false;
|
|
529
|
+
fecha(comp);
|
|
530
|
+
KIT.fit = true;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
// ---------------------------------------------------------------- 17. objeto herói 3D falso, com sombra e anéis
|
|
534
|
+
function cenaHeroi(comp, P, d) {
|
|
535
|
+
var g = kPre(comp, P), W = g.W, H = g.H, u = g.u, cam = g.cam, v = g.v, T0 = 0.12, i;
|
|
536
|
+
var cx = v ? g.cx : W * 0.34, cy = v ? H * 0.38 : g.cy, S = Math.min(W, H) * (v ? 0.56 : 0.62);
|
|
537
|
+
var halo = forma(comp, 'circulo', { x: cx, y: cy, w: S * 1.25, cor: P.ac, alfa: 22, parent: cam.no, entrada: 'cresce', t0: T0, nome: 'halo' });
|
|
538
|
+
for (i = 0; i < 2; i++) {
|
|
539
|
+
var an = forma(comp, 'circulo', { x: cx, y: cy, w: S * (1.0 + i * 0.28), traco: P.ac, tracoL: 5 * u, alfa: 55 - i * 20, parent: cam.no, entrada: 'cresce', t0: T0 + 0.1 + i * 0.1, nome: 'anel' });
|
|
540
|
+
kS(an).expression = 'var s = [value[0], value[1] * 0.34]; s';
|
|
541
|
+
kR(an).expression = 'time * ' + (i ? -24 : 30);
|
|
542
|
+
}
|
|
543
|
+
sombraChao(comp, cx, cy + S * 0.5, S * 0.55, { parent: cam.no, t0: T0 + 0.2, alfa: 30 });
|
|
544
|
+
var h = elemento(comp, 0, { x: cx, y: cy, w: S * 0.72, parent: cam.no, entrada: 'pop', t0: T0 + 0.1, quique: 0.7 });
|
|
545
|
+
try { // 3D de verdade: o objeto balança em Y e X com perspectiva
|
|
546
|
+
h.threeDLayer = true;
|
|
547
|
+
h.property('ADBE Transform Group').property('ADBE Rotate Y').expression = 'Math.sin(time * 1.6) * 38';
|
|
548
|
+
h.property('ADBE Transform Group').property('ADBE Rotate X').expression = 'Math.cos(time * 1.2) * 12';
|
|
549
|
+
kP(h).expression = 'value + [0, Math.sin(time * 2) * 14, 0]';
|
|
550
|
+
} catch (e) { kP(h).expression = 'value + [0, Math.sin(time*2)*14]'; }
|
|
551
|
+
kR(h).expression = 'Math.sin(time*1.4)*6';
|
|
552
|
+
som(T0 + 0.1, 'impacto', 0.7);
|
|
553
|
+
var it = kItens(d, [], 3), n = it.length;
|
|
554
|
+
var tx = v ? g.cx : W * 0.7;
|
|
555
|
+
if (d.titulo) kT(g, comp, P, d.titulo, v ? H * 0.12 : H * 0.28, { x: v ? g.cx : W * 0.7, largura: v ? W * 0.86 : W * 0.44, maxLinhas: 3, tam: v ? 88 : 76, t0: T0 + 0.4, sobrepoe: true });
|
|
556
|
+
for (i = 0; i < n; i++) {
|
|
557
|
+
var ti = Q(it[i], T0 + 0.9 + i * 0.4), y = v ? H * 0.64 + i * H * 0.078 : H * 0.5 + i * H * 0.1, lw = v ? W * 0.7 : W * 0.34, x = v ? g.cx : W * 0.7;
|
|
558
|
+
forma(comp, 'pilula', { x: x, y: y, w: lw, h: (v ? 78 : 72) * u, cor: P.card, traco: P.ac, tracoL: 4 * u, parent: cam.no, entrada: 'pop', t0: ti, quique: 0.6, nome: 'callout' });
|
|
559
|
+
forma(comp, 'circulo', { x: x - lw / 2 + 40 * u, y: y, w: 26 * u, cor: P.ac, parent: cam.no, entrada: 'pop', t0: ti + 0.05, nome: 'bolinha' });
|
|
560
|
+
texto(comp, it[i], { fonte: P.fonteTexto, tamanho: 36 * u, cor: P.fg, corDestaque: P.ac, x: x + 22 * u, y: y, parent: cam.no, entrada: 'sobe', t0: ti + 0.08, largura: lw - 110 * u, maxLinhas: 1, sublinhado: false, fala: false });
|
|
561
|
+
som(ti, 'pop', 0.55);
|
|
562
|
+
}
|
|
563
|
+
particulas(comp, { n: 14, cor: P.ac, parent: cam.no, tipo: 'flutua', raio: 9, area: [cx - S * 0.6, cy - S * 0.6, cx + S * 0.6, cy + S * 0.5], alfa: 80, t0: T0 + 0.3 });
|
|
564
|
+
cam.empurra(0.8, 0, 0, 1.0).empurra(comp.duration - 0.2, 0, 0, 1.1);
|
|
565
|
+
fecha(comp);
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
// ---------------------------------------------------------------- 18. brasas/partículas em volta de uma frase
|
|
569
|
+
function cenaParticulas(comp, P, d) {
|
|
570
|
+
var g = kPre(comp, P), W = g.W, H = g.H, u = g.u, cam = g.cam, v = g.v, T0 = 0.14;
|
|
571
|
+
particulas(comp, { n: 46, cores: [P.ac, P.fg, P.ac, P.mudo], parent: cam.no, tipo: d.queda ? 'cai' : 'sobe', raio: 15, area: [0, H * 0.15, W, H * 1.1], alfa: 85, t0: 0.05, gira: !!d.queda, forma: d.queda ? 'retangulo' : 'circulo' });
|
|
572
|
+
var tt = texto(comp, d.titulo || d.texto || '', { tamanho: (v ? 150 : 124) * u, cor: P.fg, corDestaque: P.ac, x: g.cx, y: g.cy, parent: cam.no, entrada: 'voa', t0: T0, largura: W * (v ? 0.86 : 0.78), maxLinhas: 4 });
|
|
573
|
+
var i; for (i = 0; i < tt.tempos.length; i++) som(tt.tempos[i], 'pop', 0.55);
|
|
574
|
+
som(T0, 'sobe', 0.5); if (tt.tempos.length) som(tt.fim - 0.3, 'brilho', 0.6);
|
|
575
|
+
if (d.sub) texto(comp, d.sub, { fonte: P.fonteTexto, tamanho: 50 * u, cor: P.mudo, x: g.cx, y: tt.y + tt.h / 2 + 90 * u, parent: cam.no, entrada: 'sobe', t0: Q(d.sub, tt.fim), largura: W * 0.74, maxLinhas: 2, sublinhado: false });
|
|
576
|
+
cam.empurra(0.9, 0, -20 * u, 1.04).empurra(comp.duration - 0.3, 0, 30 * u, 1.1);
|
|
577
|
+
fecha(comp);
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
// ---------------------------------------------------------------- 19. relógio
|
|
581
|
+
function cenaRelogio(comp, P, d) {
|
|
582
|
+
var g = kPre(comp, P), W = g.W, H = g.H, u = g.u, cam = g.cam, v = g.v, T0 = 0.12, i;
|
|
583
|
+
var cx = v ? g.cx : W * 0.34, cy = v ? H * 0.42 : g.cy, R = Math.min(W, H) * (v ? 0.34 : 0.32);
|
|
584
|
+
var rel = grupo(comp, { x: cx, y: cy, parent: cam.no, nome: 'relogio' });
|
|
585
|
+
forma(comp, 'circulo', { x: 0, y: 0, w: R * 2, cor: P.card, traco: P.fg, tracoL: 14 * u, parent: rel, entrada: 'pop', t0: T0, quique: 0.6, nome: 'mostrador' });
|
|
586
|
+
for (i = 0; i < 12; i++) {
|
|
587
|
+
var a = i * Math.PI / 6, tk = forma(comp, 'retangulo', { x: Math.sin(a) * R * 0.84, y: -Math.cos(a) * R * 0.84, w: (i % 3 == 0 ? 12 : 6) * u, h: (i % 3 == 0 ? 40 : 22) * u, cor: i % 3 == 0 ? P.ac : P.mudo, parent: rel, nome: 'marca' });
|
|
588
|
+
kR(tk).setValue(i * 30); curva(kO(tk), [[T0 + 0.2 + i * 0.03, 0, null, 30], [T0 + 0.3 + i * 0.03, 100, 60, null]]);
|
|
589
|
+
}
|
|
590
|
+
var hm = (String(d.valor || '7:00').match(/(\d+)[h:](\d*)/) || [0, 7, 0]), hora = parseInt(hm[1], 10) % 12, minu = parseInt(hm[2] || '0', 10) || 0;
|
|
591
|
+
var hA = forma(comp, 'pilula', { x: 0, y: 0, w: 18 * u, h: R * 0.5, cor: P.fg, parent: rel, nome: 'hora' }); kA(hA).setValue([0, R * 0.25]);
|
|
592
|
+
var mA = forma(comp, 'pilula', { x: 0, y: 0, w: 12 * u, h: R * 0.74, cor: P.ac, parent: rel, nome: 'minuto' }); kA(mA).setValue([0, R * 0.37]);
|
|
593
|
+
var t1 = T0 + 0.5, t2 = t1 + 1.5;
|
|
594
|
+
curva(kR(hA), [[t1, 0, null, 20], [t2, hora * 30 + minu / 2 + 360, 80, null]]);
|
|
595
|
+
curva(kR(mA), [[t1, 0, null, 20], [t2, minu * 6 + 1440, 80, null]]);
|
|
596
|
+
forma(comp, 'circulo', { x: 0, y: 0, w: 34 * u, cor: P.fg, parent: rel, nome: 'eixo' });
|
|
597
|
+
som(t1, 'sobe', 0.5);
|
|
598
|
+
var ts = t2;
|
|
599
|
+
kP(rel).expression = 'var p = value; if (time > ' + ts.toFixed(2) + ' && time < ' + (ts + 0.7).toFixed(2) + ') { p + [Math.sin(time*60)*9, 0] } else p';
|
|
600
|
+
som(ts, 'sino', 0.9);
|
|
601
|
+
var vt = d.valor || '7:00';
|
|
602
|
+
var tx = v ? g.cx : W * 0.72, ty = v ? H * 0.68 : g.cy - H * 0.06;
|
|
603
|
+
texto(comp, vt, { fonte: P.fonteTitulo, tamanho: (v ? 170 : 170) * u, cor: P.ac, corDestaque: P.ac, x: tx, y: ty, parent: cam.no, entrada: 'palavra', t0: Math.max(ts, Q(vt, ts)), largura: W * (v ? 0.8 : 0.4), maxLinhas: 1, sublinhado: false, fala: false });
|
|
604
|
+
if (d.titulo) kT(g, comp, P, d.titulo, v ? H * 0.12 : g.cy + H * 0.1, { x: v ? g.cx : W * 0.72, largura: v ? W * 0.86 : W * 0.4, maxLinhas: 2, tam: v ? 80 : 64, sobrepoe: true });
|
|
605
|
+
kEstouro(comp, cam, cx, cy, ts, P.ac, 10, R * 1.15, false);
|
|
606
|
+
cam.empurra(0.8, 0, 0, 1.0).empurra(ts, 0, -10 * u, 1.08).empurra(comp.duration - 0.2, 0, 0, 1.1);
|
|
607
|
+
fecha(comp);
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
// ---------------------------------------------------------------- 20. calendário que se preenche
|
|
611
|
+
function cenaCalendario(comp, P, d) {
|
|
612
|
+
var g = kPre(comp, P), W = g.W, H = g.H, u = g.u, cam = g.cam, v = g.v, T0 = 0.12, i;
|
|
613
|
+
if (d.titulo) kT(g, comp, P, d.titulo, v ? H * 0.15 : g.cy, { x: v ? g.cx : W * 0.24, largura: v ? W * 0.86 : W * 0.36, maxLinhas: 3, tam: v ? 88 : 74 });
|
|
614
|
+
var cols = v ? 5 : 7, rows = v ? 6 : 5, area = v ? [W * 0.1, H * 0.3, W * 0.9, H * 0.72] : [W * 0.46, H * 0.16, W * 0.92, H * 0.84];
|
|
615
|
+
var cw = (area[2] - area[0]) / cols, ch = (area[3] - area[1]) / rows, s = Math.min(cw, ch) * 0.78, k = 0;
|
|
616
|
+
var cheios = {}, seq = [3, 8, 10, 15, 17, 22, 24, 29, 31, 5, 12, 19, 26, 33, 1, 7, 14, 21, 28, 34];
|
|
617
|
+
var nfill = Math.min(seq.length, 14);
|
|
618
|
+
for (i = 0; i < nfill; i++) cheios[seq[i]] = i;
|
|
619
|
+
for (i = 0; i < cols * rows; i++) {
|
|
620
|
+
var c = i % cols, r = Math.floor(i / cols), x = area[0] + cw * (c + 0.5), y = area[1] + ch * (r + 0.5), ti = T0 + (c + r) * 0.03;
|
|
621
|
+
var cel = forma(comp, 'retangulo', { x: x, y: y, w: s, h: s, r: s * 0.26, cor: P.card, traco: P.mudo, tracoL: 2 * u, parent: cam.no, entrada: 'pop', t0: ti, quique: 0.4, nome: 'dia' });
|
|
622
|
+
if (cheios[i] != null) {
|
|
623
|
+
var tf = T0 + 0.6 + cheios[i] * 0.06;
|
|
624
|
+
try { curva(kFillProp(cel), [[tf, kCor(P.card), null, 30], [tf + 0.15, kCor(P.ac), 60, null]]); } catch (e) { }
|
|
625
|
+
curva(kS(cel), [[tf, [100, 100], null, 25], [tf + 0.08, [116, 116], 70, 40], [tf + 0.3, [100, 100], 70, null]]);
|
|
626
|
+
check(comp, { x: x, y: y, tam: s * 0.42, cor: kSobre(P), parent: cam.no, t0: tf + 0.06 });
|
|
627
|
+
if (cheios[i] % 2 == 0) som(tf, 'tique', 0.45);
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
som(T0 + 0.8, 'sobe', 0.4);
|
|
631
|
+
if (d.valor) {
|
|
632
|
+
var tv = T0 + 0.6 + nfill * 0.06;
|
|
633
|
+
forma(comp, 'pilula', { x: v ? g.cx : W * 0.24, y: v ? H * 0.75 : H * 0.72, w: 360 * u, h: 110 * u, cor: P.ac, parent: cam.no, entrada: 'pop', t0: Math.min(tv, comp.duration - 0.8), quique: 0.7, nome: 'meta' });
|
|
634
|
+
texto(comp, d.valor, { fonte: P.fonteTitulo, tamanho: 62 * u, cor: kSobre(P), corDestaque: kSobre(P), x: v ? g.cx : W * 0.24, y: v ? H * 0.75 : H * 0.72, parent: cam.no, entrada: 'palavra', t0: Math.min(tv, comp.duration - 0.8) + 0.06, largura: 330 * u, maxLinhas: 1, sublinhado: false, fala: false });
|
|
635
|
+
som(Math.min(tv, comp.duration - 0.8), 'caixa', 0.7);
|
|
636
|
+
}
|
|
637
|
+
cam.empurra(0.8, 0, 0, 1.0).empurra(comp.duration - 0.2, 0, 0, 1.06);
|
|
638
|
+
fecha(comp);
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
// ---------------------------------------------------------------- 21. funil com pontos que caem
|
|
642
|
+
function cenaFunil(comp, P, d) {
|
|
643
|
+
var g = kPre(comp, P), W = g.W, H = g.H, u = g.u, cam = g.cam, v = g.v, T0 = 0.12, i;
|
|
644
|
+
var it = kItens(d, ['Contatos', 'Respostas', 'Agendas'], 4), n = it.length;
|
|
645
|
+
if (d.titulo) kT(g, comp, P, d.titulo, v ? H * 0.14 : g.cy, { x: v ? g.cx : W * 0.22, largura: v ? W * 0.86 : W * 0.34, maxLinhas: 2, tam: v ? 86 : 72 });
|
|
646
|
+
var fx = v ? g.cx : W * 0.66, top = v ? H * 0.27 : H * 0.14, bot = v ? H * 0.8 : H * 0.86, fh = (bot - top) / n, wTop = v ? W * 0.84 : W * 0.5, wBot = wTop * 0.3;
|
|
647
|
+
for (i = 0; i < n; i++) {
|
|
648
|
+
var w0 = wTop + (wBot - wTop) * i / n, w1 = wTop + (wBot - wTop) * (i + 1) / n, y0 = top + i * fh, y1 = y0 + fh - 8 * u, ti = Q(it[i], T0 + 0.15 + i * 0.25);
|
|
649
|
+
var tz = caminho(comp, [[fx - w0 / 2, y0], [fx + w0 / 2, y0], [fx + w1 / 2, y1], [fx - w1 / 2, y1]], { preenche: i == n - 1 ? P.ac : P.card, cor: i == n - 1 ? null : P.mudo, esp: 3 * u, fecha: true, parent: cam.no, nome: 'estagio' });
|
|
650
|
+
curva(kO(tz), [[ti, 0, null, 30], [ti + 0.3, 100, 60, null]]);
|
|
651
|
+
mola(kS(tz), ti, [88, 88], [100, 100], { quique: 0.4, dur: 0.5 });
|
|
652
|
+
texto(comp, it[i], { fonte: P.fonteTexto, tamanho: 38 * u, cor: i == n - 1 ? kSobre(P) : P.fg, corDestaque: P.ac, x: fx, y: (y0 + y1) / 2, parent: cam.no, entrada: 'sobe', t0: ti + 0.1, largura: Math.max(180 * u, w1 * 0.9), maxLinhas: 1, sublinhado: false, fala: false });
|
|
653
|
+
som(ti, 'pop', 0.5);
|
|
654
|
+
}
|
|
655
|
+
// pontos que caem pelo funil (alguns somem a cada estágio)
|
|
656
|
+
var np = 18;
|
|
657
|
+
for (i = 0; i < np; i++) {
|
|
658
|
+
var dx = ((i * 37) % 100) / 100 - 0.5, p = forma(comp, 'circulo', { x: fx + dx * wTop * 0.7, y: top - 20 * u, w: 22 * u, cor: i % 5 == 0 ? P.fg : P.ac, parent: cam.no, nome: 'ponto', alfa: 0 });
|
|
659
|
+
var vel = 0.35 + (i % 4) * 0.05, off = i / np, alvoX = fx + dx * wBot * 0.9;
|
|
660
|
+
kP(p).expression = 'var q = ((time - ' + (T0 + 0.8) + ') * ' + vel.toFixed(2) + ' + ' + off.toFixed(2) + ') % 1; var yy = ' + (top - 20 * u).toFixed(1) + ' + q * ' + (bot - top + 40 * u).toFixed(1) + '; var xx = ' + (fx + dx * wTop * 0.7).toFixed(1) + ' + (' + alvoX.toFixed(1) + ' - ' + (fx + dx * wTop * 0.7).toFixed(1) + ') * q; [xx, yy]';
|
|
661
|
+
kO(p).expression = 'var q = ((time - ' + (T0 + 0.8) + ') * ' + vel.toFixed(2) + ' + ' + off.toFixed(2) + ') % 1; time < ' + (T0 + 0.8) + ' ? 0 : (q > ' + (0.95 - (i % 3) * 0.3).toFixed(2) + ' ? 0 : 100)';
|
|
662
|
+
}
|
|
663
|
+
if (d.valor) {
|
|
664
|
+
var tv = comp.duration - 1.0;
|
|
665
|
+
texto(comp, d.valor, { fonte: P.fonteTitulo, tamanho: 110 * u, cor: kSobre(P), corDestaque: kSobre(P), x: fx, y: bot - fh * 0.5 + 60 * u, parent: cam.no, entrada: 'palavra', t0: Math.max(T0 + n * 0.5, Q(d.valor, tv)), largura: wBot * 1.4, maxLinhas: 1, sublinhado: false, fala: false, livre: true });
|
|
666
|
+
som(tv, 'caixa', 0.8);
|
|
667
|
+
}
|
|
668
|
+
cam.empurra(0.8, 0, 0, 1.0).empurra(comp.duration - 0.2, 0, 0, 1.06);
|
|
669
|
+
fecha(comp);
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
// ---------------------------------------------------------------- 22. parede de elementos reais correndo
|
|
673
|
+
function cenaParedeLogos(comp, P, d) {
|
|
674
|
+
var g = kPre(comp, P), W = g.W, H = g.H, u = g.u, cam = g.cam, v = g.v, T0 = 0.12, r, c;
|
|
675
|
+
var rows = v ? 5 : 4, tile = Math.min(W, H) * (v ? 0.19 : 0.2), gapx = tile * 1.35, ncol = Math.ceil((W * 1.6) / gapx) + 1;
|
|
676
|
+
var par = grupo(comp, { x: g.cx, y: g.cy, parent: cam.no, nome: 'parede' });
|
|
677
|
+
var k = 0;
|
|
678
|
+
for (r = 0; r < rows; r++) {
|
|
679
|
+
var y = (r - (rows - 1) / 2) * tile * 1.45, dir = r % 2 ? 1 : -1, linha = grupo(comp, { x: 0, y: y, parent: par, nome: 'linha' });
|
|
680
|
+
kP(linha).expression = 'value + [' + dir + ' * time * ' + (60 + r * 14).toFixed(0) + ' * ' + u.toFixed(2) + ', 0]';
|
|
681
|
+
curva(kO(linha), [[T0 + r * 0.08, 0, null, 30], [T0 + r * 0.08 + 0.3, 100, 60, null]]);
|
|
682
|
+
for (c = -Math.ceil(ncol / 2); c <= Math.ceil(ncol / 2); c++) {
|
|
683
|
+
var cardx = c * gapx + (r % 2 ? gapx / 2 : 0);
|
|
684
|
+
forma(comp, 'retangulo', { x: cardx, y: 0, w: tile, h: tile, r: tile * 0.26, cor: P.card, traco: P.mudo, tracoL: 2 * u, parent: linha, nome: 'tile' });
|
|
685
|
+
elemento(comp, k, { x: cardx, y: 0, w: tile * 0.66, parent: linha });
|
|
686
|
+
k++;
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
kR(par).setValue(-8);
|
|
690
|
+
var plaquinha = forma(comp, 'retangulo', { x: g.cx, y: g.cy, w: W * (v ? 0.88 : 0.62), h: H * (v ? 0.2 : 0.26), r: 48 * u, cor: P.bg, traco: P.ac, tracoL: 8 * u, parent: cam.no, entrada: 'pop', t0: T0 + 0.7, quique: 0.5, nome: 'faixa' });
|
|
691
|
+
kT(g, comp, P, d.titulo || '', g.cy, { maxLinhas: 2, tam: v ? 84 : 72, t0: T0 + 0.8, largura: W * (v ? 0.8 : 0.56), sobrepoe: true });
|
|
692
|
+
som(T0, 'sobe', 0.5); som(T0 + 0.7, 'impacto', 0.7);
|
|
693
|
+
cam.empurra(0.8, 0, 0, 1.0).empurra(comp.duration - 0.2, 0, 0, 1.08);
|
|
694
|
+
fecha(comp);
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
// ---------------------------------------------------------------- 23. prompt digitado → gera → resultado (PrimoCode)
|
|
698
|
+
function cenaPrompt(comp, P, d) {
|
|
699
|
+
var g = kPre(comp, P), W = g.W, H = g.H, u = g.u, cam = g.cam, v = g.v, T0 = 0.12;
|
|
700
|
+
if (d.titulo) kT(g, comp, P, d.titulo, v ? H * 0.13 : H * 0.14, { maxLinhas: 2, tam: v ? 84 : 66 });
|
|
701
|
+
var pw = v ? W * 0.88 : W * 0.62, ph = v ? H * 0.5 : H * 0.62, px = g.cx, py = v ? H * 0.56 : H * 0.58;
|
|
702
|
+
var jan = forma(comp, 'retangulo', { x: px, y: py, w: pw, h: ph, r: 40 * u, cor: P.card, traco: P.mudo, tracoL: 3 * u, parent: cam.no, entrada: 'cresce', t0: T0, nome: 'janela' });
|
|
703
|
+
var iw = pw * 0.9, ih = 120 * u, iy = py - ph / 2 + 100 * u;
|
|
704
|
+
forma(comp, 'retangulo', { x: px, y: iy, w: iw, h: ih, r: 28 * u, cor: P.bg, traco: P.ac, tracoL: 4 * u, parent: cam.no, entrada: 'pop', t0: T0 + 0.2, nome: 'prompt' });
|
|
705
|
+
var tc = T0 + 0.45, txt = d.texto || d.sub || 'Quero um app que faça isso';
|
|
706
|
+
var dg = digita(comp, txt, { x: px - iw / 2 + 30 * u, y: iy, tamanho: 38 * u, fonte: P.fonteTexto, cor: P.fg, largura: iw - 160 * u, parent: cam.no, t0: tc, cps: 30 });
|
|
707
|
+
var env = forma(comp, 'circulo', { x: px + iw / 2 - 56 * u, y: iy, w: 70 * u, cor: P.ac, parent: cam.no, entrada: 'pop', t0: T0 + 0.35, nome: 'enviar' });
|
|
708
|
+
var t2 = Math.max(dg.fim + 0.15, tc + 1.0);
|
|
709
|
+
curva(kS(env), [[t2, [100, 100], null, 25], [t2 + 0.07, [84, 84], 70, 40], [t2 + 0.25, [100, 100], 70, null]]); som(t2, 'clique', 0.9);
|
|
710
|
+
// barra de progresso "gerando"
|
|
711
|
+
var by = iy + ih / 2 + 60 * u, bw = iw * 0.9;
|
|
712
|
+
forma(comp, 'pilula', { x: px, y: by, w: bw, h: 22 * u, cor: P.bg, parent: cam.no, entrada: 'fade', t0: t2 + 0.1, nome: 'trilho-prog' });
|
|
713
|
+
var pg = forma(comp, 'pilula', { x: px - bw / 2, y: by, w: bw, h: 22 * u, cor: P.ac, parent: cam.no, nome: 'progresso' }); kA(pg).setValue([-bw / 2, 0]);
|
|
714
|
+
curva(kS(pg), [[t2 + 0.15, [0, 100], null, 20], [t2 + 0.85, [100, 100], 70, null]]);
|
|
715
|
+
curva(kO(pg), [[t2 + 0.1, 0, null, 30], [t2 + 0.15, 100, null, 30]]);
|
|
716
|
+
som(t2 + 0.2, 'sobe', 0.6);
|
|
717
|
+
// o resultado: um mini app que pula
|
|
718
|
+
var it = kItens(d, ['Agenda', 'Clientes', 'Pagamentos'], 3), tr = t2 + 0.8, n = it.length, i, rh = (ph - (by - py + ph / 2) - 60 * u) / n - 14 * u;
|
|
719
|
+
for (i = 0; i < n; i++) {
|
|
720
|
+
var ry = by + 70 * u + rh / 2 + i * (rh + 14 * u), ti = Q(it[i], tr + i * 0.2);
|
|
721
|
+
ti = Math.max(ti, tr);
|
|
722
|
+
forma(comp, 'retangulo', { x: px, y: ry, w: iw, h: rh, r: 26 * u, cor: i == 0 ? P.ac : P.bg, parent: cam.no, entrada: 'pop', t0: ti, quique: 0.7, nome: 'resultado' });
|
|
723
|
+
if (v) elemento(comp, i, { x: px - iw / 2 + rh * 0.7, y: ry, w: rh * 0.7, parent: cam.no, entrada: 'pop', t0: ti + 0.06 }); // em 16:9 a linha é baixa: só o texto e o check (ícone de 12% da largura não cabe)
|
|
724
|
+
texto(comp, it[i], { tamanho: Math.min(40 * u, rh * 0.45), cor: i == 0 ? kSobre(P) : P.fg, corDestaque: P.ac, x: px + rh * 0.3, y: ry, parent: cam.no, entrada: 'sobe', t0: ti + 0.1, largura: iw - rh * 2, maxLinhas: 1, sublinhado: false, fala: false });
|
|
725
|
+
check(comp, { x: px + iw / 2 - rh * 0.6, y: ry, tam: rh * 0.34, cor: i == 0 ? kSobre(P) : P.ac, parent: cam.no, t0: ti + 0.25 });
|
|
726
|
+
som(ti, 'notif', 0.6);
|
|
727
|
+
}
|
|
728
|
+
cam.empurra(0.8, 0, 0, 1.02).empurra(tr, 0, 20 * u, 1.06).empurra(comp.duration - 0.2, 0, 30 * u, 1.1);
|
|
729
|
+
fecha(comp);
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
// ---------------------------------------------------------------- 24. odômetro de palavras
|
|
733
|
+
function cenaOdometro(comp, P, d) {
|
|
734
|
+
var g = kPre(comp, P), W = g.W, H = g.H, u = g.u, v = g.v, T0 = 0.12, i;
|
|
735
|
+
fundo(comp, P.bg, {}); var cam = camera(comp);
|
|
736
|
+
var it = kItens(d, ['rápido', 'simples', 'seu'], 6), n = it.length, tam = (v ? 150 : 120) * u, lh = tam * 1.5;
|
|
737
|
+
var cy = v ? H * 0.46 : g.cy;
|
|
738
|
+
var slot = grupo(comp, { x: g.cx, y: cy, parent: cam.no, nome: 'slot' });
|
|
739
|
+
var cor;
|
|
740
|
+
for (i = 0; i < n; i++) {
|
|
741
|
+
var ult = i == n - 1;
|
|
742
|
+
texto(comp, (ult ? '*' : '') + it[i], { tamanho: tam, cor: i % 2 ? P.mudo : P.fg, corDestaque: P.ac, x: 0, y: i * lh, parent: slot, entrada: null, t0: 0, largura: W * 0.84, maxLinhas: 1, sublinhado: false, fala: false, livre: true, entrada: 'fade' });
|
|
743
|
+
}
|
|
744
|
+
// o slot rola: cada parada com quique, a última cai no destaque
|
|
745
|
+
var tr = Q(it[n - 1], T0 + 0.5 + 0.3 * n), passo = Math.max(0.2, Math.min(0.45, (tr - T0 - 0.3) / Math.max(1, n - 1)));
|
|
746
|
+
for (i = 1; i < n; i++) {
|
|
747
|
+
var ti = T0 + 0.3 + (i - 1) * passo; if (i == n - 1) ti = Math.max(ti, tr - 0.35);
|
|
748
|
+
mola(kP(slot), ti, [g.cx, cy - (i - 1) * lh], [g.cx, cy - i * lh], { quique: i == n - 1 ? 0.6 : 0.2, dur: i == n - 1 ? 0.7 : 0.4 });
|
|
749
|
+
som(ti + 0.1, i == n - 1 ? 'impacto' : 'tique', i == n - 1 ? 0.8 : 0.5);
|
|
750
|
+
}
|
|
751
|
+
kP(slot).setValueAtTime(0, [g.cx, cy]);
|
|
752
|
+
// máscaras de cima e de baixo escondem o resto da fita
|
|
753
|
+
var jan = lh * 0.62;
|
|
754
|
+
forma(comp, 'retangulo', { x: g.cx, y: cy - jan - H, w: W * 1.2, h: H * 2, cor: P.bg, parent: cam.no, nome: 'tampa-cima' });
|
|
755
|
+
forma(comp, 'retangulo', { x: g.cx, y: cy + jan + H, w: W * 1.2, h: H * 2, cor: P.bg, parent: cam.no, nome: 'tampa-baixo' });
|
|
756
|
+
forma(comp, 'pilula', { x: g.cx, y: cy - jan, w: W * 0.8, h: 5 * u, cor: P.mudo, alfa: 50, parent: cam.no, nome: 'guia' });
|
|
757
|
+
forma(comp, 'pilula', { x: g.cx, y: cy + jan, w: W * 0.8, h: 5 * u, cor: P.mudo, alfa: 50, parent: cam.no, nome: 'guia' });
|
|
758
|
+
if (d.titulo) texto(comp, d.titulo, { tamanho: (v ? 90 : 76) * u, cor: P.fg, corDestaque: P.ac, x: g.cx, y: cy - lh * 1.1, parent: cam.no, entrada: 'sobe', t0: Q(d.titulo, T0), largura: W * 0.84, maxLinhas: 2, sublinhado: false });
|
|
759
|
+
if (d.sub) texto(comp, d.sub, { fonte: P.fonteTexto, tamanho: 52 * u, cor: P.mudo, x: g.cx, y: cy + lh * 1.1 + 40 * u, parent: cam.no, entrada: 'sobe', t0: Q(d.sub, tr + 0.2), largura: W * 0.8, maxLinhas: 2, sublinhado: false });
|
|
760
|
+
cam.empurra(0.8, 0, 0, 1.0).empurra(comp.duration - 0.2, 0, 0, 1.06);
|
|
761
|
+
fecha(comp);
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
// ---------------------------------------------------------------- 25. medidor (gauge)
|
|
765
|
+
function cenaMedidor(comp, P, d) {
|
|
766
|
+
var g = kPre(comp, P), W = g.W, H = g.H, u = g.u, cam = g.cam, v = g.v, T0 = 0.12, i;
|
|
767
|
+
var cx = v ? g.cx : W * 0.64, cy = v ? H * 0.44 : H * 0.62, R = Math.min(W, H) * (v ? 0.36 : 0.34);
|
|
768
|
+
if (d.titulo) kT(g, comp, P, d.titulo, v ? H * 0.15 : g.cy, { x: v ? g.cx : W * 0.22, largura: v ? W * 0.86 : W * 0.36, maxLinhas: 3, tam: v ? 88 : 72 });
|
|
769
|
+
var trilho = forma(comp, 'circulo', { x: cx, y: cy, w: R * 2, traco: P.card, tracoL: 40 * u, parent: cam.no, nome: 'trilho' });
|
|
770
|
+
kR(trilho).setValue(-90);
|
|
771
|
+
var gt = trilho.property('ADBE Root Vectors Group').property(1).property('ADBE Vectors Group'), tt = gt.addProperty('ADBE Vector Filter - Trim'); tt.property('ADBE Vector Trim End').setValue(50);
|
|
772
|
+
var prog = forma(comp, 'circulo', { x: cx, y: cy, w: R * 2, traco: P.ac, tracoL: 40 * u, parent: cam.no, nome: 'valor' });
|
|
773
|
+
kR(prog).setValue(-90);
|
|
774
|
+
var gp = prog.property('ADBE Root Vectors Group').property(1).property('ADBE Vectors Group'), tp = gp.addProperty('ADBE Vector Filter - Trim');
|
|
775
|
+
var alvo = Math.max(0.2, Math.min(0.95, parseFloat(String(d.alvo || '0.82')) || 0.82)), t1 = T0 + 0.5, dd = 1.3;
|
|
776
|
+
curva(tp.property('ADBE Vector Trim End'), [[t1, 0, null, 18], [t1 + dd, alvo * 50, 85, null]]);
|
|
777
|
+
for (i = 0; i <= 10; i++) { var a = Math.PI + i * Math.PI / 10; var tk = forma(comp, 'retangulo', { x: cx + Math.cos(a) * (R + 46 * u), y: cy + Math.sin(a) * (R + 46 * u), w: 6 * u, h: 22 * u, cor: P.mudo, parent: cam.no, nome: 'marca', entrada: 'fade', t0: T0 + i * 0.03 }); kR(tk).setValue(i * 18 - 90); }
|
|
778
|
+
var agulha = forma(comp, 'pilula', { x: cx, y: cy, w: 16 * u, h: R * 0.9, cor: P.fg, parent: cam.no, nome: 'agulha' }); kA(agulha).setValue([0, R * 0.45]);
|
|
779
|
+
var ang = -90 + alvo * 180;
|
|
780
|
+
curva(kR(agulha), [[t1, -90, null, 18], [t1 + dd * 0.85, ang + 8, 80, 30], [t1 + dd, ang, 70, null]]);
|
|
781
|
+
forma(comp, 'circulo', { x: cx, y: cy, w: 46 * u, cor: P.ac, parent: cam.no, nome: 'eixo' });
|
|
782
|
+
som(t1, 'sobe', 0.6); som(t1 + dd, 'impacto', 0.8);
|
|
783
|
+
var vt = d.valor || '82%';
|
|
784
|
+
texto(comp, vt, { fonte: P.fonteTitulo, tamanho: (v ? 190 : 150) * u, cor: P.fg, corDestaque: P.ac, x: cx, y: cy + R * 0.42, parent: cam.no, entrada: 'palavra', t0: Math.max(t1 + dd - 0.1, Q(vt, t1 + dd)), largura: R * 1.6, maxLinhas: 1, sublinhado: false, fala: false, livre: true });
|
|
785
|
+
if (d.rotulo) texto(comp, d.rotulo, { fonte: P.fonteTexto, tamanho: 46 * u, cor: P.mudo, x: cx, y: cy + R * 0.42 + 115 * u, parent: cam.no, entrada: 'sobe', t0: Q(d.rotulo, t1 + dd + 0.2), largura: R * 1.8, maxLinhas: 2, sublinhado: false });
|
|
786
|
+
kEstouro(comp, cam, cx, cy, t1 + dd, P.ac, 10, R * 1.1, false);
|
|
787
|
+
cam.empurra(0.8, 0, 0, 1.0).empurra(t1 + dd, 0, -10 * u, 1.07).empurra(comp.duration - 0.2, 0, 0, 1.1);
|
|
788
|
+
fecha(comp);
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
// ---------------------------------------------------------------- 26. carimbo que bate no papel
|
|
792
|
+
function cenaCarimbo(comp, P, d) {
|
|
793
|
+
var g = kPre(comp, P), W = g.W, H = g.H, u = g.u, cam = g.cam, v = g.v, T0 = 0.12, i;
|
|
794
|
+
var pw = v ? W * 0.78 : W * 0.42, ph = v ? H * 0.5 : H * 0.8, px = g.cx, py = v ? H * 0.46 : g.cy;
|
|
795
|
+
var papel = forma(comp, 'retangulo', { x: px, y: py, w: pw, h: ph, r: 14 * u, cor: kLum(P.bg) > 0.5 ? '#FFFFFF' : '#EDEAE2', parent: cam.no, nome: 'papel' });
|
|
796
|
+
mola(kP(papel), T0, [px, py + H * 0.5], [px, py], { quique: 0.4, dur: 0.8 }); mola(kR(papel), T0, 6, -2, { quique: 0.5, dur: 0.9 });
|
|
797
|
+
som(T0 + 0.1, 'papel', 0.8);
|
|
798
|
+
var it = kItens(d, ['Nome do cliente', 'Serviço contratado', 'Prazo combinado'], 4), n = it.length;
|
|
799
|
+
for (i = 0; i < n; i++) {
|
|
800
|
+
var y = py - ph * 0.3 + i * ph * 0.11, tl = T0 + 0.5 + i * 0.2;
|
|
801
|
+
var ln = forma(comp, 'pilula', { x: px, y: y, w: pw * 0.74, h: 12 * u, cor: '#C9C4B8', parent: papel, nome: 'linha' });
|
|
802
|
+
kP(ln).setValue([0, y - py]);
|
|
803
|
+
curva(kS(ln), [[tl, [0, 100], null, 25], [tl + 0.4, [100, 100], 75, null]]);
|
|
804
|
+
}
|
|
805
|
+
var ts = Q(d.titulo || '', T0 + 1.3), cs = P.ac, sx = px + pw * 0.08, sy = py + ph * 0.12, sz = Math.min(pw * 0.72, 520 * u);
|
|
806
|
+
var st = grupo(comp, { x: sx, y: sy, parent: cam.no, nome: 'carimbo' });
|
|
807
|
+
forma(comp, 'circulo', { x: 0, y: 0, w: sz, traco: cs, tracoL: 14 * u, parent: st, nome: 'selo-anel' });
|
|
808
|
+
forma(comp, 'circulo', { x: 0, y: 0, w: sz * 0.86, traco: cs, tracoL: 4 * u, parent: st, nome: 'selo-anel2' });
|
|
809
|
+
texto(comp, String(d.titulo || 'APROVADO').replace(/\*/g, '').toUpperCase(), { fonte: P.fonteTitulo, tamanho: 110 * u, cor: cs, corDestaque: cs, x: 0, y: 0, parent: st, entrada: null, t0: 0, largura: sz * 0.74, maxLinhas: 2, sublinhado: false, fala: false, livre: true, caixa: false });
|
|
810
|
+
kR(st).setValue(-12);
|
|
811
|
+
// a batida: de grande e transparente para o lugar, com tremor no papel e na câmera
|
|
812
|
+
curva(kS(st), [[ts, [260, 260], null, 14], [ts + 0.14, [100, 100], 40, 40], [ts + 0.2, [106, 106], 70, 40], [ts + 0.5, [100, 100], 70, null]]);
|
|
813
|
+
curva(kO(st), [[ts - 0.04, 0, null, 30], [ts, 0, null, 30], [ts + 0.1, 100, 50, null]]);
|
|
814
|
+
curva(kP(papel), [[ts + 0.14, [px, py], null, null], [ts + 0.17, [px + 14 * u, py + 10 * u], -1, -1], [ts + 0.22, [px - 12 * u, py - 6 * u], -1, -1], [ts + 0.3, [px, py], 60, null]]);
|
|
815
|
+
som(ts + 0.12, 'impacto', 1.0); som(ts + 0.12, 'papel', 0.5);
|
|
816
|
+
kEstouro(comp, cam, sx, sy, ts + 0.14, cs, 12, sz * 0.7, false);
|
|
817
|
+
if (d.rotulo) texto(comp, d.rotulo, { fonte: P.fonteTexto, tamanho: 50 * u, cor: P.fg, corDestaque: P.ac, x: g.cx, y: py + ph / 2 + 80 * u, parent: cam.no, entrada: 'sobe', t0: Q(d.rotulo, ts + 0.5), largura: W * 0.8, maxLinhas: 2, sublinhado: false });
|
|
818
|
+
cam.empurra(0.8, 0, 0, 1.0).empurra(ts + 0.15, 0, 0, 1.08).empurra(comp.duration - 0.2, 0, -10 * u, 1.1);
|
|
819
|
+
fecha(comp);
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
// ---------------------------------------------------------------- 27. leque de cartas
|
|
823
|
+
function cenaLeque(comp, P, d) {
|
|
824
|
+
var g = kPre(comp, P), W = g.W, H = g.H, u = g.u, cam = g.cam, v = g.v, T0 = 0.12, i;
|
|
825
|
+
var it = kItens(d, ['Um', 'Dois', 'Três'], 5), n = it.length;
|
|
826
|
+
if (d.titulo) kT(g, comp, P, d.titulo, v ? H * 0.14 : H * 0.18, { maxLinhas: 2, tam: v ? 86 : 70, sobrepoe: true });
|
|
827
|
+
var px = g.cx, py = v ? H * 0.86 : H * 1.05, cw = v ? W * 0.42 : W * 0.22, ch = cw * 1.45, spread = v ? 14 : 11;
|
|
828
|
+
for (i = 0; i < n; i++) {
|
|
829
|
+
var ang = (i - (n - 1) / 2) * spread, ti = Q(it[i], T0 + 0.35 + i * 0.28), ult = i == n - 1;
|
|
830
|
+
var carta = grupo(comp, { x: px, y: py, parent: cam.no, nome: 'carta' });
|
|
831
|
+
kA(carta).setValue([0, 0]);
|
|
832
|
+
var c = forma(comp, 'retangulo', { x: 0, y: -ch * 0.78, w: cw, h: ch, r: 34 * u, cor: ult ? P.ac : P.card, traco: ult ? null : P.mudo, tracoL: 3 * u, parent: carta, nome: 'carta-corpo' });
|
|
833
|
+
elemento(comp, i, { x: 0, y: -ch * 0.95, w: cw * 0.6, parent: carta });
|
|
834
|
+
texto(comp, it[i], { fonte: P.fonteTexto, tamanho: 36 * u, cor: ult ? kSobre(P) : P.fg, corDestaque: P.ac, x: 0, y: -ch * 0.52, parent: carta, entrada: 'fade', t0: ti, largura: cw * 0.84, maxLinhas: 2, sublinhado: false, fala: false, livre: true });
|
|
835
|
+
mola(kR(carta), ti - 0.1, 0, ang, { quique: 0.55, dur: 0.8 });
|
|
836
|
+
curva(kO(carta), [[ti - 0.14, 0, null, 30], [ti - 0.1, 100, null, 30]]);
|
|
837
|
+
som(ti, 'papel', 0.6);
|
|
838
|
+
if (ult) { curva(kP(carta), [[ti + 0.7, [px, py], null, 25], [ti + 1.0, [px, py - ch * 0.18], 75, null]]); som(ti + 0.7, 'brilho', 0.6); }
|
|
839
|
+
}
|
|
840
|
+
cam.empurra(0.8, 0, 0, 1.0).empurra(comp.duration - 0.2, 0, -30 * u, 1.08);
|
|
841
|
+
fecha(comp);
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
// ---------------------------------------------------------------- 28. ondas de áudio
|
|
845
|
+
function cenaOndas(comp, P, d) {
|
|
846
|
+
var g = kPre(comp, P), W = g.W, H = g.H, u = g.u, cam = g.cam, v = g.v, T0 = 0.12, i;
|
|
847
|
+
var nb = 29, bw = Math.min(W * 0.8 / nb * 0.6, 34 * u), gap = W * 0.8 / nb, cy = v ? H * 0.4 : g.cy - H * 0.06, mh = Math.min(H * 0.3, 420 * u);
|
|
848
|
+
for (i = 0; i < nb; i++) {
|
|
849
|
+
var x = g.cx + (i - (nb - 1) / 2) * gap, env = Math.exp(-Math.pow((i - (nb - 1) / 2) / (nb * 0.32), 2));
|
|
850
|
+
var b = forma(comp, 'pilula', { x: x, y: cy, w: bw, h: mh, cor: i % 5 == 2 ? P.fg : P.ac, parent: cam.no, nome: 'onda' });
|
|
851
|
+
kS(b).expression = 'var a = 0.14 + 0.86 * ' + env.toFixed(2) + ' * Math.abs(Math.sin(time * ' + (3.1 + (i % 7) * 0.55).toFixed(2) + ' + ' + (i * 1.3).toFixed(2) + ') * Math.cos(time * ' + (1.7 + (i % 5) * 0.4).toFixed(2) + ' + ' + i + ')); var e = Math.min(1, time / 0.5); [100, 100 * a * e]';
|
|
852
|
+
curva(kO(b), [[T0 + Math.abs(i - nb / 2) * 0.015, 0, null, 30], [T0 + 0.25 + Math.abs(i - nb / 2) * 0.015, 100, 60, null]]);
|
|
853
|
+
}
|
|
854
|
+
som(T0, 'sobe', 0.4);
|
|
855
|
+
if (d.titulo) kT(g, comp, P, d.titulo, v ? H * 0.68 : g.cy + H * 0.3, { maxLinhas: 3, tam: v ? 90 : 72, t0: T0 + 0.5 });
|
|
856
|
+
elemento(comp, 0, { x: g.cx, y: v ? H * 0.16 : H * 0.12, w: 190 * u, parent: cam.no, entrada: 'pop', t0: T0 + 0.1, flutua: 8 });
|
|
857
|
+
cam.empurra(0.8, 0, 0, 1.02).empurra(comp.duration - 0.2, 0, 0, 1.08);
|
|
858
|
+
fecha(comp);
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
// ---------------------------------------------------------------- 29. rolagem de feed
|
|
862
|
+
function cenaRolagem(comp, P, d) {
|
|
863
|
+
var g = kPre(comp, P), W = g.W, H = g.H, u = g.u, cam = g.cam, v = g.v, T0 = 0.12, i;
|
|
864
|
+
var it = kItens(d, ['Post um', 'Post dois', 'Post três'], 5), n = it.length;
|
|
865
|
+
var cw = v ? W * 0.8 : W * 0.38, ch = v ? H * 0.2 : H * 0.28, gap = 28 * u, x = v ? g.cx : W * 0.7;
|
|
866
|
+
var feed = grupo(comp, { x: x, y: 0, parent: cam.no, nome: 'feed' });
|
|
867
|
+
var total = n * (ch + gap), y0 = v ? H * 0.3 : H * 0.14, tl = T0 + 0.2, dd = 1.3;
|
|
868
|
+
for (i = 0; i < n + 1; i++) {
|
|
869
|
+
var y = y0 + i * (ch + gap) + ch / 2, idx = i % n;
|
|
870
|
+
forma(comp, 'retangulo', { x: 0, y: y, w: cw, h: ch, r: 36 * u, cor: P.card, traco: P.mudo, tracoL: 3 * u, parent: feed, nome: 'post' });
|
|
871
|
+
elemento(comp, i, { x: -cw / 2 + ch * 0.55, y: y, w: ch * 0.7, parent: feed });
|
|
872
|
+
texto(comp, it[idx], { tamanho: Math.min(44 * u, ch * 0.28), cor: P.fg, corDestaque: P.ac, x: ch * 0.28, y: y - ch * 0.12, parent: feed, entrada: 'fade', t0: T0, largura: cw - ch * 1.5, maxLinhas: 2, sublinhado: false, fala: false, livre: true });
|
|
873
|
+
forma(comp, 'pilula', { x: ch * 0.28 - (cw - ch * 1.6) * 0.18, y: y + ch * 0.28, w: (cw - ch * 1.6) * 0.6, h: 12 * u, cor: P.mudo, alfa: 45, parent: feed, nome: 'linha-skel' });
|
|
874
|
+
var cor = forma(comp, 'circulo', { x: cw / 2 - 52 * u, y: y - ch * 0.28, w: 40 * u, cor: P.ac, parent: feed, nome: 'coracao', alfa: 0 });
|
|
875
|
+
var tco = tl + dd * (i + 0.7) / (n + 0.6);
|
|
876
|
+
curva(kO(cor), [[tco, 0, null, 30], [tco + 0.1, 100, 60, null]]); mola(kS(cor), tco, [0, 0], [100, 100], { quique: 0.8, dur: 0.5 });
|
|
877
|
+
if (i < n) som(tco, 'pop', 0.5);
|
|
878
|
+
}
|
|
879
|
+
curva(kP(feed), [[tl, [x, 0], null, 20], [tl + dd, [x, -(ch + gap) * 1.0], 80, null]]);
|
|
880
|
+
forma(comp, 'retangulo', { x: x - cw / 2 - 20 * u, y: g.cy, w: 8 * u, h: H * 0.5, r: 4 * u, cor: P.ac, parent: cam.no, entrada: 'fade', t0: T0, nome: 'barra-rolagem' });
|
|
881
|
+
if (d.titulo) kT(g, comp, P, d.titulo, v ? H * 0.13 : g.cy, { x: v ? g.cx : W * 0.24, largura: v ? W * 0.86 : W * 0.36, maxLinhas: 3, tam: v ? 84 : 70, sobrepoe: true });
|
|
882
|
+
som(tl, 'sobe', 0.4);
|
|
883
|
+
cam.empurra(0.8, 0, 0, 1.02).empurra(comp.duration - 0.2, 0, 0, 1.06);
|
|
884
|
+
fecha(comp);
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
// ---------------------------------------------------------------- 30. prova social (estrelas + depoimento)
|
|
888
|
+
function cenaEstrelas(comp, P, d) {
|
|
889
|
+
var g = kPre(comp, P), W = g.W, H = g.H, u = g.u, cam = g.cam, v = g.v, T0 = 0.12, i;
|
|
890
|
+
var cw = v ? W * 0.84 : W * 0.56, ch = v ? H * 0.5 : H * 0.7, cx = g.cx, cy = g.cy;
|
|
891
|
+
var card = forma(comp, 'retangulo', { x: cx, y: cy, w: cw, h: ch, r: 54 * u, cor: P.card, traco: P.mudo, tracoL: 3 * u, parent: cam.no, entrada: 'cresce', t0: T0, nome: 'cartao' });
|
|
892
|
+
var ey = cy - ch * 0.34, es = 74 * u;
|
|
893
|
+
for (i = 0; i < 5; i++) {
|
|
894
|
+
var ti = T0 + 0.4 + i * 0.16, sx = cx + (i - 2) * es * 1.15;
|
|
895
|
+
var est = caminho(comp, kEstrelaPts(es * 0.5, es * 0.22), { preenche: P.ac, fecha: true, parent: cam.no, nome: 'estrela' });
|
|
896
|
+
kP(est).setValue([sx, ey]);
|
|
897
|
+
mola(kS(est), ti, [0, 0], [100, 100], { quique: 0.8, dur: 0.55 }); mola(kR(est), ti, -40, 0, { quique: 0.5, dur: 0.6 });
|
|
898
|
+
som(ti, 'ponto' + (1 + i % 5), 0.6);
|
|
899
|
+
}
|
|
900
|
+
var nota = d.valor || '4,9';
|
|
901
|
+
texto(comp, nota, { fonte: P.fonteTitulo, tamanho: 130 * u, cor: P.fg, corDestaque: P.ac, x: cx, y: ey + es * 1.5, parent: cam.no, entrada: 'palavra', t0: Math.max(T0 + 1.3, Q(nota, T0 + 1.3)), largura: cw * 0.5, maxLinhas: 1, sublinhado: false, fala: false });
|
|
902
|
+
var tx = d.texto || d.titulo || '';
|
|
903
|
+
texto(comp, tx, { tamanho: (v ? 52 : 46) * u, cor: P.fg, corDestaque: P.ac, x: cx, y: cy + ch * 0.12, parent: cam.no, entrada: 'palavra', t0: Q(tx, T0 + 1.7), passo: 0.12, largura: cw * 0.82, maxLinhas: 5 });
|
|
904
|
+
if (d.autor) {
|
|
905
|
+
elemento(comp, 0, { x: cx - cw * 0.3, y: cy + ch * 0.38, w: 90 * u, parent: cam.no, entrada: 'pop', t0: T0 + 2.0 });
|
|
906
|
+
texto(comp, d.autor, { fonte: P.fonteTexto, tamanho: 40 * u, cor: P.mudo, x: cx + 30 * u, y: cy + ch * 0.38, parent: cam.no, entrada: 'sobe', t0: T0 + 2.1, largura: cw * 0.5, maxLinhas: 1, sublinhado: false, fala: false });
|
|
907
|
+
}
|
|
908
|
+
som(T0 + 1.3, 'brilho', 0.6);
|
|
909
|
+
cam.empurra(0.8, 0, 0, 1.02).empurra(comp.duration - 0.2, 0, 0, 1.08);
|
|
910
|
+
fecha(comp);
|
|
911
|
+
}
|