E1 · Gate on the rehearsal
10 minRun "build the page and pass the gate".
Done when: PORTÃO: 4/4 OK and saída: 0.
Lesson 8 · 20 min
Time to put it all together on a page of your own. You start from the kit's template, swap the photo and the text for those of your product, redo the two films, pass the four-check gate and publish to GitHub Pages. The same checker that ran on your machine runs against the public URL: it is what says you are live.
Start the lesson
Goal: build your page from the kit's template, pass gate 4 of 4 and publish to GitHub Pages.
The four deliverables the page brings together. Click a step to see the "done when".
Clip of your product (generator or rehearsal with clipe.sh) and frames at the native rate, checked by conferir-quadros.py.
The frames in the kit engine, with the ?jump and __ready contract. If you asked the skill for the page from kit/site, the same checker verifies it.
If your film has more than one clip, chain them and run the site-movimento gates before assembling.
Vertical film within budget and the page still for anyone who asked for less motion.
Lessons 1, 4, and 5 come in when the page asks for them: the weight decision, a Three.js scene, and the brand film.
The rehearsal swaps the front-facing lens for the lens lying down; in yours, swap in your product photo and rewrite the texts in index.html.
K=~/projetos/formacao-cinema-ia-sites-v72/kit
E=${TMPDIR:-/tmp}/ensaio-sites/a8; rm -rf "$E"; mkdir -p "$E"
# your site starts as a copy of the template; swap the product photo for yours (here: the lens lying down)
cp -r "$K/site" "$E/meu-site"; rm -f "$E/meu-site"/erro-*.html
bash "$K/scripts/clipe.sh" "$K/exemplos/lente2.jpg" "$E/h.mp4" 6 1.0 1.3
bash "$K/scripts/clipe.sh" "$K/exemplos/lente2.jpg" "$E/v.mp4" 6 1.0 1.3 1080x1920
bash "$K/scripts/quadros.sh" "$E/h.mp4" "$E/meu-site/frames" 1024 6
bash "$K/scripts/quadros.sh" "$E/v.mp4" "$E/meu-site/frames-v" 600 8
bash "$K/scripts/portao.sh" "$E/meu-site"; echo "saída: $?"#!/usr/bin/env bash
# portao.sh — o portão final da página: 4 conferências, uma por vez, sem modelo e sem serviço pago.
# 1. peso visitante mais pesado ≤ ORCAMENTO MB (padrão 6) e primeira pintura ≤ 0,5 MB
# 2. computador 1366×768: rolagem em 0 %, 50 % e 100 % com o quadro certo e tela pintada
# 3. celular 390×844 em pé: filme vertical (frames-v/), sem transbordo
# 4. reduzir com "reduzir movimento": o filme fica parado
# Uso: bash portao.sh <pasta-do-site> (ORCAMENTO=8 bash portao.sh … muda o teto)
set -uo pipefail
K=$(cd "$(dirname "$0")/.." && pwd)
SITE=$(cd "$1" && pwd)
T=$(mktemp -d); trap 'kill $S 2>/dev/null; rm -rf "$T"' EXIT
node "$K/scripts/servir.mjs" "$SITE" > "$T/url" & S=$!
until U=$(cat "$T/url" 2>/dev/null) && [ -n "$U" ] && curl -s -o /dev/null "$U"; do sleep 0.3; done
ok=0
python3 "$K/scripts/peso.py" "$SITE" --orcamento "${ORCAMENTO:-6}" --inicial 0.5 > "$T/1" && ok=$((ok+1)) && echo "1 peso: OK" || { echo "1 peso: FALHA"; grep -E "ACIMA" "$T/1"; }
for n in "2 computador:" "3 celular:--celular" "4 reduzir:--reduzir"; do
rot=${n%%:*}; op=${n#*:}
node "$K/scripts/verificar.mjs" "$U" $op > "$T/v" && ok=$((ok+1)) && echo "$rot: OK" || { echo "$rot: FALHA"; grep "^FALHA" "$T/v"; }
done
echo "PORTÃO: $ok/4 $([ $ok -eq 4 ] && echo OK || echo FALHOU)"
[ $ok -eq 4 ]h.mp4: 6,0 s · 24 fps · 1920×1080 v.mp4: 6,0 s · 24 fps · 1080×1920 QUADROS: 144 · 1024×576 · 2,2 MB · 24 fps QUADROS: 144 · 600×1066 · 3,5 MB · 24 fps 1 peso: OK 2 computador: OK 3 celular: OK 4 reduzir: OK PORTÃO: 4/4 OK saída: 0
The gate runs the four checks one at a time and exits with 0 only if all four pass.
A public repository with the page at the root, GitHub Pages on the main branch. Then, the checker against the public URL.
cd <your-site-folder> git init -b main && git add . && git commit -m "my page with a scroll film" gh repo create <your-user>/<repo-name> --public --source . --push gh api -X POST repos/<your-user>/<repo-name>/pages -f 'source[branch]=main' -f 'source[path]=/'
K=~/projetos/formacao-cinema-ia-sites-v72/kit
curl -s -o /dev/null -w "%{http_code}\n" https://inematds.github.io/formacao-cinema-ia-sites-v72/kit/site/
node "$K/scripts/verificar.mjs" https://inematds.github.io/formacao-cinema-ia-sites-v72/kit/site/; echo "saída: $?"200 Chromium 156.0.8078.4 (Playwright 1.64.0) · 1366×768 quadros: 144 (frames/) rolagem 0% → quadro 0 · tela pintada rolagem 50% → quadro 72 · tela pintada rolagem 100% → quadro 143 · tela pintada transbordo horizontal: não OK: 3 de 3 posições saída: 0
This is the kit page published along with the course. Run the same block with your page's URL, which usually ends up at https://[seu-usuario].github.io/[nome-do-repo]/ a few minutes after the push.
Your page, from the template to live.
Run "build the page and pass the gate".
Done when: PORTÃO: 4/4 OK and saída: 0.
Copy kit/site to a folder of your own, delete the erro-*.html copies, swap the photo (clipe.sh in both formats), redo the frames, rewrite the index.html text using only facts about your product, and run the lesson 6 copy gate and portao.sh.
Done when: The copy gate answers texto limpo and portao.sh answers PORTÃO: 4/4 OK with saída: 0.
Publish using the "publicar a pasta no GitHub Pages" block and run the checker with your URL.
Done when: curl -s -o /dev/null -w "%{http_code}" [your URL] answers 200 and the checker answers OK: 3 de 3 posições with saída: 0.
Pick a start date and how much time you have per week.
The explanation appears after you answer.
Question 1 of 4
portao.sh returned "PORTÃO: 3/4 FALHOU" with "1 peso: FALHA". What do you do first?
Question 2 of 4
Why run the checker against the public URL too?
Question 3 of 4
What text goes in your page's index.html?
Question 4 of 4
Which of these is NOT one of the four checks in portao.sh?
Choose an option. The explanation appears after your attempt.