Pular para o conteúdo
PixelCorp SpaceEstúdio de IA corporativa/ skills para o seu negócio
Teste real

A lojinha que dobra de clientes: animação feita com um pedido

O pedido em português que eu mandei para o Claude, o arquivo que ele entregou e o tempo que levou no meu teste. Testei em 10/11/2026: do Enter até o arquivo pronto foram 19 minutos e 39 segundos, sem eu mexer em nada. Aqui está o pedido para copiar, o arquivo para baixar e como trocar a cena.

Ivan Lessa

Ivan Lessa
@oivandigital · IA aplicada a negócios, sem hype

Não precisa ser programador, basta saber pedir

Copiar o pedido ↓

Imagem de capa: A lojinha que dobra de clientes: animação feita com um pedido

Serve pra você?

Serve para quem quer uma animação simples para explicar uma ideia (crescimento, fila, metas) sem programa de animação. O resultado é um arquivo .html que abre em qualquer navegador. Eu usei o Claude Code, a IA da Anthropic que cria arquivos no seu computador e que vem nos planos pagos do Claude (Pro: R$ 110 por mês no mensal, conferido em 10/11/2026 em claude.com/pricing).

O pedido

Copie e cole no Claude Code, numa pasta vazia.

Pedido usado no teste

Do jeito que eu mandei, sem mudar nada.

Monte uma animação 3D, estilo desenho animado, de uma lojinha de rua cujos clientes dobram de 3 em 3 segundos: começa com 1 cliente e a fila na porta vai crescendo, com um contador grande na tela (1, 2, 4, 8...) até 1.024. Formato vertical de celular. Entregue tudo num único arquivo lojinha.html que eu abro no navegador, sem instalar nada.

Para outra cena

Troque lojinha de rua por padaria, barbearia ou o seu negócio, e peça de novo. Cada versão é um pedido novo: o resultado e o tempo podem mudar.

Para ver

Abra o arquivo lojinha.html no navegador. No meu teste ele trouxe contador, fila crescendo, câmera que se afasta e um cartão no final.

Baixe o arquivo que o Claude entregou

O arquivo do teste, sem edição. Abre no navegador, sem instalar nada.

Baixar lojinha.html
Ler o texto completo (28 KB)
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover">
<meta name="theme-color" content="#15132b">
<title>A Lojinha que Dobra — 1, 2, 4, 8… 1.024 clientes</title>
<style>
:root{--u:3.6px}
*{box-sizing:border-box}
html,body{margin:0;height:100%;background:#15132b;overflow:hidden;
  font-family:"Fredoka","Baloo 2","Nunito","Varela Round","Arial Rounded MT Bold","Helvetica Rounded",system-ui,-apple-system,"Segoe UI",sans-serif;
  -webkit-user-select:none;user-select:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
#stage{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);overflow:hidden;background:#7fcbff;
  box-shadow:0 0 0 1px #000,0 20px 60px rgba(0,0,0,.6);border-radius:calc(var(--u)*4)}
#stage.full{border-radius:0;box-shadow:none}
canvas{position:absolute;inset:0;width:100%;height:100%;display:block}
#hud{position:absolute;inset:0;pointer-events:none}
.title{position:absolute;top:calc(var(--u)*4);left:0;right:0;text-align:center;font-weight:800;font-size:calc(var(--u)*4);letter-spacing:.1em;color:#fff}
.title span{display:inline-block;background:#ff6b6b;border:calc(var(--u)*.55) solid #2b2a52;padding:.3em 1em;border-radius:2em;box-shadow:0 .28em 0 #2b2a52}
#counter{position:absolute;top:calc(var(--u)*12.5);left:0;right:0;text-align:center;line-height:1}
#num{display:inline-block;font-weight:900;font-size:calc(var(--u)*24);color:#ffe66d;letter-spacing:-.02em;
  -webkit-text-stroke:calc(var(--u)*1.1) #2b2a52;paint-order:stroke fill;
  text-shadow:0 calc(var(--u)*1.3) 0 #2b2a52,0 calc(var(--u)*2.2) calc(var(--u)*3) rgba(0,0,0,.35);transform-origin:50% 60%}
#num.pop{animation:pop .6s cubic-bezier(.2,1.7,.4,1)}
#num.gold{color:#fff;animation:gold 1.2s ease-in-out infinite alternate}
@keyframes pop{0%{transform:scale(.55) rotate(-7deg)}55%{transform:scale(1.28) rotate(3deg)}100%{transform:scale(1) rotate(0)}}
@keyframes gold{from{color:#ffe66d;transform:scale(1)}to{color:#fff;transform:scale(1.06)}}
#lbl{font-weight:800;font-size:calc(var(--u)*4.6);color:#fff;text-shadow:0 .1em 0 #2b2a52;letter-spacing:.05em;margin-top:calc(var(--u)*1.5)}
#x2{position:absolute;right:calc(var(--u)*7);top:calc(var(--u)*11);font-weight:900;font-size:calc(var(--u)*8.5);color:#2b2a52;background:#4ecdc4;
  border:calc(var(--u)*.7) solid #2b2a52;border-radius:50%;width:calc(var(--u)*17);height:calc(var(--u)*17);display:flex;align-items:center;justify-content:center;
  transform:scale(0);opacity:0;box-shadow:0 .2em 0 #2b2a52}
#x2.go{animation:x2 1.5s cubic-bezier(.2,1.4,.4,1) forwards}
@keyframes x2{0%{transform:scale(0) rotate(-40deg);opacity:0}22%{transform:scale(1.2) rotate(8deg);opacity:1}55%{transform:scale(1) rotate(0);opacity:1}100%{transform:scale(.7) translateY(-70%);opacity:0}}
#hint{position:absolute;bottom:calc(var(--u)*16);left:calc(var(--u)*10);right:calc(var(--u)*10);text-align:center;font-weight:800;font-size:calc(var(--u)*4.2);
  color:#2b2a52;background:#fff;border:calc(var(--u)*.55) solid #2b2a52;border-radius:1.2em;padding:.5em .8em;box-shadow:0 .3em 0 #2b2a52;
  transition:opacity .6s,transform .6s}
#hint.hide{opacity:0;transform:translateY(30%)}
#bottom{position:absolute;left:calc(var(--u)*6);right:calc(var(--u)*6);bottom:calc(var(--u)*4.5)}
#bar{height:calc(var(--u)*3.6);background:rgba(43,42,82,.5);border:calc(var(--u)*.55) solid #2b2a52;border-radius:2em;overflow:hidden}
#fill{height:100%;width:0;background:#ffe66d;border-radius:2em}
#btxt{display:flex;justify-content:space-between;font-weight:800;color:#fff;font-size:calc(var(--u)*3.8);text-shadow:0 .1em 0 #2b2a52;margin-top:calc(var(--u)*1.4)}
#end{position:absolute;left:calc(var(--u)*7);right:calc(var(--u)*7);top:50%;transform:translateY(-50%) scale(.6);opacity:0;pointer-events:none;
  background:#fff;border:calc(var(--u)*.7) solid #2b2a52;border-radius:calc(var(--u)*5);padding:calc(var(--u)*5) calc(var(--u)*4);text-align:center;
  box-shadow:0 .4em 0 #2b2a52,0 1em 3em rgba(0,0,0,.35);transition:opacity .5s,transform .5s cubic-bezier(.2,1.5,.4,1)}
#end.show{opacity:1;transform:translateY(-50%) scale(1);pointer-events:auto}
#end h2{margin:0;font-size:calc(var(--u)*7.5);color:#2b2a52;line-height:1.15}
#end h2 b{color:#e8453c}
#end p{margin:.6em 0 1em;font-size:calc(var(--u)*4.2);color:#5a5880;font-weight:700}
#end button{font:inherit;font-weight:900;font-size:calc(var(--u)*5);color:#2b2a52;background:#ffe66d;border:calc(var(--u)*.6) solid #2b2a52;
  border-radius:2em;padding:.5em 1.4em;box-shadow:0 .3em 0 #2b2a52;cursor:pointer}
#end button:active{transform:translateY(.2em);box-shadow:0 .1em 0 #2b2a52}
</style>
</head>
<body>
<div id="stage">
  <canvas id="cv"></canvas>
  <div id="hud">
    <div class="title"><span>LOJINHA DA ESQUINA</span></div>
    <div id="counter"><div id="num">1</div><div id="lbl">cliente na fila</div></div>
    <div id="x2">×2</div>
    <div id="hint">A clientela <b>dobra</b> a cada <b>3 segundos</b>…</div>
    <div id="bottom">
      <div id="bar"><div id="fill"></div></div>
      <div id="btxt"><span id="next">dobra em 3,0 s</span><span id="time">0,0 s</span></div>
    </div>
    <div id="end">
      <h2>De <b>1</b> a <b>1.024</b> clientes<br>em só <b>30 segundos</b>!</h2>
      <p>Isso é crescimento exponencial.</p>
      <button id="again">▶ Ver de novo</button>
    </div>
  </div>
</div>
<script>
(function(){
'use strict';
const $=id=>document.getElementById(id);
const stage=$('stage'), cv=$('cv'), ctx=cv.getContext('2d');
const numEl=$('num'), lblEl=$('lbl'), fillEl=$('fill'), x2El=$('x2'), timeEl=$('time'), nextEl=$('next'), endEl=$('end'), hintEl=$('hint');
const TAU=Math.PI*2, FOV=58*Math.PI/180, OUT='#2b2a52', NEAR=0.25;
const FONT=getComputedStyle(document.body).fontFamily||'sans-serif';
const MAXN=1024, STEP=3, DOUBLINGS=10, TOTAL=STEP*DOUBLINGS;
let W=360,H=640,DPR=1,CX=180,CY=350,FOCAL=600;

/* ---------- layout ---------- */
function resize(){
  const vw=innerWidth, vh=innerHeight; let w,h;
  if(vw<vh){ w=vw; h=vh; stage.classList.add('full'); }
  else { w=Math.min(vw, vh*9/16); h=w*16/9; stage.classList.remove('full'); }
  stage.style.width=w+'px'; stage.style.height=h+'px'; stage.style.setProperty('--u',(w/100)+'px');
  DPR=Math.min(window.devicePixelRatio||1,2);
  cv.width=Math.round(w*DPR); cv.height=Math.round(h*DPR);
  W=w; H=h; CX=W/2; CY=H*0.62; FOCAL=(H/2)/Math.tan(FOV/2);
}
addEventListener('resize',resize); resize();

/* ---------- helpers ---------- */
function hash(i,s){ let x=Math.imul(i+1,374761393)+Math.imul(s+1,668265263); x=Math.imul(x^(x>>>13),1274126177); x^=x>>>16; return (x>>>0)/4294967296; }
const clamp=(v,a,b)=>v<a?a:v>b?b:v;
const colCache=new Map();
function shade(hex,k){
  const key=hex+k; let c=colCache.get(key); if(c) return c;
  const r=parseInt(hex.slice(1,3),16),g=parseInt(hex.slice(3,5),16),b=parseInt(hex.slice(5,7),16);
  c='rgb('+clamp(Math.round(r*k),0,255)+','+clamp(Math.round(g*k),0,255)+','+clamp(Math.round(b*k),0,255)+')';
  colCache.set(key,c); return c;
}
function rr(x,y,w,h,r){ ctx.beginPath(); ctx.moveTo(x+r,y); ctx.lineTo(x+w-r,y); ctx.quadraticCurveTo(x+w,y,x+w,y+r); ctx.lineTo(x+w,y+h-r); ctx.quadraticCurveTo(x+w,y+h,x+w-r,y+h); ctx.lineTo(x+r,y+h); ctx.quadraticCurveTo(x,y+h,x,y+h-r); ctx.lineTo(x,y+r); ctx.quadraticCurveTo(x,y,x+r,y); ctx.closePath(); }
function circ(x,y,r){ ctx.beginPath(); ctx.arc(x,y,r,0,TAU); ctx.closePath(); }

/* ---------- camera ---------- */
let E=[0,5,12], F=[0,0,-1], R=[1,0,0], U=[0,1,0];
function setCamera(eye,tgt){
  let fx=tgt[0]-eye[0],fy=tgt[1]-eye[1],fz=tgt[2]-eye[2]; let l=Math.hypot(fx,fy,fz); fx/=l;fy/=l;fz/=l;
  let rx=-fz, ry=0, rz=fx; l=Math.hypot(rx,rz)||1; rx/=l; rz/=l;            // cross(f, up) = right
  const ux=ry*fz-rz*fy, uy=rz*fx-rx*fz, uz=rx*fy-ry*fx;                     // cross(r, f)
  E=eye; F=[fx,fy,fz]; R=[rx,ry,rz]; U=[ux,uy,uz];
}
function toCam(p){ const dx=p[0]-E[0],dy=p[1]-E[1],dz=p[2]-E[2];
  return [dx*R[0]+dy*R[1]+dz*R[2], dx*U[0]+dy*U[1]+dz*U[2], dx*F[0]+dy*F[1]+dz*F[2]]; }
function sc(c){ const s=FOCAL/c[2]; return [CX+c[0]*s, CY-c[1]*s]; }
function proj(p){ const c=toCam(p); if(c[2]<NEAR) return null; const s=FOCAL/c[2]; return [CX+c[0]*s, CY-c[1]*s, c[2], s]; }
function eyeFrom(d,az,el,tgt){ return [tgt[0]+d*Math.sin(az)*Math.cos(el), tgt[1]+d*Math.sin(el), tgt[2]+d*Math.cos(az)*Math.cos(el)]; }
function horizonY(){ const l=Math.hypot(F[0],F[2])||1; const dx=F[0]/l, dz=F[2]/l; const du=dx*U[0]+dz*U[2], df=dx*F[0]+dz*F[2]; return CY-FOCAL*du/df; }

/* ---------- polygon pipeline ---------- */
function clipNear(poly){
  const out=[]; const n=poly.length;
  for(let i=0;i<n;i++){ const a=poly[i], b=poly[(i+1)%n]; const ina=a[2]>=NEAR, inb=b[2]>=NEAR;
    if(ina) out.push(a);
    if(ina!==inb){ const tt=(NEAR-a[2])/(b[2]-a[2]); out.push([a[0]+(b[0]-a[0])*tt, a[1]+(b[1]-a[1])*tt, NEAR]); } }
  return out;
}
function polyEntry(wpts,fill,opt){
  let cam=[], anyIn=false, allIn=true, dsum=0;
  for(const p of wpts){ const c=toCam(p); cam.push(c); dsum+=c[2]; if(c[2]>=NEAR) anyIn=true; else allIn=false; }
  if(!anyIn) return null;
  if(!allIn) cam=clipNear(cam);
  if(cam.length<3) return null;
  const pts=cam.map(sc); const d=dsum/wpts.length-(opt&&opt.bias||0);
  return {d, pts, fill, stroke:!(opt&&opt.stroke===false), lw:clamp(FOCAL*0.03/(dsum/wpts.length),0.7,2.6)};
}
function addPoly(list,wpts,fill,opt){ const e=polyEntry(wpts,fill,opt); if(e) list.push(e); return e; }
function drawEntry(it){
  if(it.fn){ it.fn(); return; }
  const p=it.pts; ctx.beginPath(); ctx.moveTo(p[0][0],p[0][1]); for(let i=1;i<p.length;i++) ctx.lineTo(p[i][0],p[i][1]); ctx.closePath();
  ctx.fillStyle=it.fill; ctx.fill();
  if(it.stroke){ ctx.lineWidth=it.lw; ctx.strokeStyle=OUT; ctx.stroke(); }
}
function flush(list){ list.sort((a,b)=>b.d-a.d); for(let i=0;i<list.length;i++) drawEntry(list[i]); }
function faceVisible(nx,ny,nz,cx,cy,cz){ return nx*(cx-E[0])+ny*(cy-E[1])+nz*(cz-E[2])<0; }
const KTOP=1.14, KFRONT=1.0, KLEFT=0.88, KRIGHT=0.78, KBACK=0.7;
function box(list,x0,x1,y0,y1,z0,z1,col,opt){
  const bias=opt&&opt.bias||0, stroke=!(opt&&opt.stroke===false), o={bias,stroke};
  if(faceVisible(0,1,0,(x0+x1)/2,y1,(z0+z1)/2)) addPoly(list,[[x0,y1,z0],[x1,y1,z0],[x1,y1,z1],[x0,y1,z1]],shade(col,KTOP),o);
  if(faceVisible(0,0,1,(x0+x1)/2,(y0+y1)/2,z1)) addPoly(list,[[x0,y0,z1],[x1,y0,z1],[x1,y1,z1],[x0,y1,z1]],shade(col,KFRONT),o);
  if(faceVisible(0,0,-1,(x0+x1)/2,(y0+y1)/2,z0)) addPoly(list,[[x0,y0,z0],[x1,y0,z0],[x1,y1,z0],[x0,y1,z0]],shade(col,KBACK),o);
  if(faceVisible(-1,0,0,x0,(y0+y1)/2,(z0+z1)/2)) addPoly(list,[[x0,y0,z0],[x0,y0,z1],[x0,y1,z1],[x0,y1,z0]],shade(col,KLEFT),o);
  if(faceVisible(1,0,0,x1,(y0+y1)/2,(z0+z1)/2)) addPoly(list,[[x1,y0,z0],[x1,y0,z1],[x1,y1,z1],[x1,y1,z0]],shade(col,KRIGHT),o);
}
// text on a quad (TL, TR, BL in world); ratio = height/width of the quad
function text3D(list,p0,p1,p3,str,fontPx,color,bias,nrm){
  if(nrm && !faceVisible(nrm[0],nrm[1],nrm[2],p0[0],p0[1],p0[2])) return;
  const c0=toCam(p0),c1=toCam(p1),c3=toCam(p3); if(c0[2]<NEAR||c1[2]<NEAR||c3[2]<NEAR) return;
  const s0=sc(c0),s1=sc(c1),s3=sc(c3);
  const wv=Math.hypot(p1[0]-p0[0],p1[1]-p0[1],p1[2]-p0[2]), hv=Math.hypot(p3[0]-p0[0],p3[1]-p0[1],p3[2]-p0[2]);
  const ww=100, hh=100*hv/wv;
  list.push({d:(c0[2]+c1[2]+c3[2])/3-bias, fn(){
    ctx.save(); ctx.transform((s1[0]-s0[0])/ww,(s1[1]-s0[1])/ww,(s3[0]-s0[0])/hh,(s3[1]-s0[1])/hh,s0[0],s0[1]);
    ctx.font='900 '+fontPx+'px '+FONT; ctx.textAlign='center'; ctx.textBaseline='middle';
    ctx.fillStyle=color; ctx.fillText(str,ww/2,hh/2); ctx.restore(); }});
}

/* ---------- queue slots ---------- */
const slots=[];
(function(){ let r=0;
  while(slots.length<MAXN){
    const half=Math.min(3.6+r*0.95,15.5), z=1.6+r*0.86, dir=(r%2===0)?1:-1, xs=[];
    for(let x=(r===0?0.8:-half); x<=half+1e-6; x+=0.62) xs.push(x);
    if(dir<0) xs.reverse();
    for(const x of xs){ if(slots.length>=MAXN) break; const i=slots.length;
      slots.push({x:x+(hash(i,7)-.5)*.22, z:z+(hash(i,8)-.5)*.34, row:r, dir, half}); }
    r++; }
})();

/* ---------- people ---------- */
const SHIRTS=['#ff6b6b','#4ecdc4','#ffe66d','#a06cd5','#ff9f43','#54a0ff','#1dd1a1','#f368e0','#ff793f','#2ed573','#ffffff','#ffb8b8'];
const PANTS=['#2f3542','#57606f','#3742fa','#5352ed','#8b5a2b','#1e3799','#6d214f'];
const SKINS=['#ffdbac','#f1c27d','#e0ac69','#c68642','#8d5524','#5c3a21'];
const HAIRS=['#2d1b0e','#5a3825','#111111','#d4a017','#b55239','#f4f4f4','#e8453c','#2b2a52'];
const people=[];
for(let i=0;i<MAXN;i++){
  const sl=slots[i]; const k=i===0?0:Math.floor(Math.log2(i))+1;
  people.push({ i, sl, k, tStart:i===0?-10:k*STEP+hash(i,1)*1.1, dur:1.25+hash(i,2)*0.55, spawnX:sl.dir*(sl.half+11),
    shirt:SHIRTS[Math.floor(hash(i,3)*SHIRTS.length)], pants:PANTS[Math.floor(hash(i,4)*PANTS.length)],
    skin:SKINS[Math.floor(hash(i,5)*SKINS.length)], hair:HAIRS[Math.floor(hash(i,6)*HAIRS.length)],
    style:Math.floor(hash(i,10)*4), h:0.88+hash(i,11)*0.24, phase:hash(i,12)*TAU, hopDelay:hash(i,9)*0.3 });
}
const keeper={ keeper:true, shirt:'#54a0ff', pants:'#2f3542', skin:'#f1c27d', hair:'#2d1b0e', style:0, h:1.0, phase:1.3 };

function drawPerson(P,sx,sy,s,lod,walking,t,hop){
  ctx.save(); ctx.translate(sx,sy); const S=s*P.h; ctx.scale(S,-S);
  ctx.lineWidth=Math.min(2.4,Math.max(0.8,s*0.06))/S; ctx.strokeStyle=OUT; ctx.lineJoin='round'; ctx.lineCap='round';
  const ph=P.phase; let bob,swing=0;
  if(walking){ bob=Math.abs(Math.sin(t*15+ph))*0.09; swing=Math.sin(t*15+ph)*0.14; }
  else bob=Math.sin(t*2.5+ph)*0.012+hop;
  ctx.translate(0,bob);
  if(lod>=1){ ctx.fillStyle=P.pants; ctx.fillRect(-0.19,0,0.16,0.5+swing); ctx.fillRect(0.03,0,0.16,0.5-swing);
    if(lod>=2){ ctx.strokeRect(-0.19,0,0.16,0.5+swing); ctx.strokeRect(0.03,0,0.16,0.5-swing); } }
  if(lod>=2){ ctx.fillStyle=P.shirt;
    rr(-0.42,0.52,0.15,0.46,0.075); ctx.fill(); ctx.stroke();
    if(P.keeper){ ctx.save(); ctx.translate(0.33,0.92); ctx.rotate(-0.75-Math.sin(t*9)*0.35); rr(-0.075,0,0.15,0.5,0.075); ctx.fill(); ctx.stroke();
      ctx.fillStyle=P.skin; circ(0,0.5,0.085); ctx.fill(); ctx.stroke(); ctx.restore(); }
    else { rr(0.27,0.52,0.15,0.46,0.075); ctx.fill(); ctx.stroke(); ctx.fillStyle=P.skin; circ(0.345,0.52,0.08); ctx.fill(); ctx.stroke(); }
    ctx.fillStyle=P.skin; circ(-0.345,0.52,0.08); ctx.fill(); ctx.stroke(); }
  ctx.fillStyle=P.shirt; rr(-0.28,0.42,0.56,0.64,0.16); ctx.fill(); if(lod>=1) ctx.stroke();
  if(P.keeper){ ctx.fillStyle='#ffffff'; rr(-0.19,0.42,0.38,0.52,0.06); ctx.fill(); ctx.stroke(); ctx.fillStyle='#e8453c'; circ(0,0.7,0.06); ctx.fill(); }
  ctx.fillStyle=P.skin; circ(0,1.3,0.27); ctx.fill(); if(lod>=1) ctx.stroke();
  if(lod>=1){ ctx.fillStyle=P.hair;
    if(P.style===2){ ctx.beginPath(); ctx.arc(0,1.3,0.275,0.1*Math.PI,0.9*Math.PI); ctx.closePath(); ctx.fill(); if(lod>=2) ctx.stroke();
      ctx.fillRect(-0.36,1.38,0.72,0.07); if(lod>=2) ctx.strokeRect(-0.36,1.38,0.72,0.07); }
    else { ctx.beginPath(); ctx.arc(0,1.3,0.275,0.12*Math.PI,0.88*Math.PI); ctx.closePath(); ctx.fill(); if(lod>=2) ctx.stroke();
      if(P.style===1){ circ(0,1.62,0.11); ctx.fill(); if(lod>=2) ctx.stroke(); }
      if(P.style===3){ ctx.fillRect(-0.31,0.95,0.1,0.45); ctx.fillRect(0.21,0.95,0.1,0.45); if(lod>=2){ ctx.strokeRect(-0.31,0.95,0.1,0.45); ctx.strokeRect(0.21,0.95,0.1,0.45); } } } }
  if(lod>=2){ ctx.fillStyle=OUT; circ(-0.09,1.3,0.036); ctx.fill(); circ(0.09,1.3,0.036); ctx.fill();
    ctx.beginPath(); ctx.arc(0,1.2,0.085,1.15*Math.PI,1.85*Math.PI); ctx.stroke();
    if(lod>=3){ ctx.fillStyle='rgba(255,120,120,.55)'; circ(-0.17,1.2,0.045); ctx.fill(); circ(0.17,1.2,0.045); ctx.fill(); } }
  ctx.restore();
}
function drawTree(sx,sy,s){
  ctx.save(); ctx.translate(sx,sy); ctx.scale(s,-s);
  const cs=[[0,2.2,0.95],[-0.75,1.75,0.7],[0.75,1.75,0.7],[0,2.95,0.65],[-0.45,2.65,0.55],[0.45,2.65,0.55]];
  const lw=Math.min(2.4,Math.max(0.8,s*0.06))/s;
  ctx.fillStyle=OUT; for(const c of cs){ circ(c[0],c[1],c[2]+lw); ctx.fill(); }
  ctx.fillStyle='#5cb85c'; for(const c of cs){ circ(c[0],c[1],c[2]); ctx.fill(); }
  ctx.fillStyle='#8ad87a'; circ(-0.35,2.45,0.42); ctx.fill(); circ(0.5,2.1,0.28); ctx.fill();
  ctx.fillStyle='#ff6b6b'; circ(0.6,1.5,0.1); ctx.fill(); circ(-0.9,2.1,0.1); ctx.fill(); circ(0.1,3.2,0.1); ctx.fill();
  ctx.restore();
}

/* ---------- static scene ---------- */
function car(list,x,z,col){
  box(list,x-1.8,x+1.8,0.35,1.1,z-0.85,z+0.85,col);
  box(list,x-0.9,x+1.0,1.1,1.8,z-0.75,z+0.75,col,{bias:0.3});
  box(list,x-0.8,x+0.9,1.2,1.7,z-0.78,z+0.78,'#bfe8ff',{bias:0.6});
  const wc='#2f3542'; for(const dx of [-1.1,1.1]) for(const dz of [-0.75,0.75]) box(list,x+dx-0.32,x+dx+0.32,0,0.62,z+dz-0.16,z+dz+0.16,wc,{bias:0.2});
  box(list,x-1.85,x-1.75,0.6,0.85,z-0.6,z+0.6,'#ffe66d',{bias:0.4}); box(list,x+1.75,x+1.85,0.6,0.85,z-0.6,z+0.6,'#ff6b6b',{bias:0.4});
}
function windows(list,x0,x1,y0,y1,z,cols,rows,col){
  const w=(x1-x0)/cols,h=(y1-y0)/rows;
  for(let i=0;i<cols;i++) for(let j=0;j<rows;j++){ const a=x0+i*w+w*0.22,b=x0+(i+1)*w-w*0.22,c=y0+j*h+h*0.2,d=y0+(j+1)*h-h*0.2;
    addPoly(list,[[a,c,z],[b,c,z],[b,d,z],[a,d,z]],col,{bias:2.5});
    addPoly(list,[[a,d-(d-c)*0.3,z],[b,d-(d-c)*0.3,z],[b,d,z],[a,d,z]],'#ffffff',{bias:2.6,stroke:false}); }
}
function buildScene(A){
  // neighbours
  box(A,-16.5,-9.9,0,3.6,-4,-0.6,'#f9a8c9'); box(A,-16.8,-9.6,3.6,3.9,-4.3,-0.3,'#c86b8f'); windows(A,-16,-10.4,0.9,3.2,-0.6,3,2,'#fff3c4');
  box(A,-9.6,-3.5,0,4.6,-4,-0.3,'#9ecae1'); box(A,-9.9,-3.2,4.6,4.9,-4.3,0,'#4a7fa5'); windows(A,-9.2,-3.9,0.9,4.2,-0.3,2,2,'#fff3c4');
  addPoly(A,[[-7.1,0,-0.29],[-5.9,0,-0.29],[-5.9,2.0,-0.29],[-7.1,2.0,-0.29]],'#4a7fa5',{bias:2.5});
  box(A,3.5,9.6,0,4.0,-4,-0.5,'#c9a0dc'); box(A,3.2,9.9,4.0,4.3,-4.3,-0.2,'#7a4f9a'); windows(A,3.9,9.2,0.9,3.6,-0.5,2,2,'#fff3c4');
  box(A,9.9,16.5,0,3.3,-4,-0.7,'#ffd59e'); box(A,9.6,16.8,3.3,3.6,-4.3,-0.4,'#d08a3c'); windows(A,10.4,16,0.9,2.9,-0.7,3,2,'#fff3c4');
  // the shop
  box(A,-3.1,3.1,0,3.3,-4,0,'#f7c56b');
  box(A,-3.4,3.4,3.3,3.65,-4.3,0.3,'#e8453c');
  box(A,-0.5,0.5,3.65,4.4,-2.6,-1.8,'#f7c56b',{bias:0.1}); box(A,-0.6,0.6,4.4,4.6,-2.7,-1.7,'#e8453c',{bias:0.2}); // chimney
  box(A,-2.5,2.5,2.45,3.15,0,0.14,'#ffffff',{bias:0.4});
  text3D(A,[-2.4,3.12,0.141],[2.4,3.12,0.141],[-2.4,2.48,0.141],'LOJINHA',10.5,'#e8453c',0.5,[0,0,1]);
  // awning
  for(let i=0;i<9;i++){ const a=-2.9+i*(5.8/9), b=a+5.8/9; const c=(i%2)?'#fff6e5':'#e8453c';
    addPoly(A,[[a,2.42,0.02],[b,2.42,0.02],[b,2.05,1.35],[a,2.05,1.35]],shade(c,1.06),{bias:3.0});
    addPoly(A,[[a,2.05,1.35],[b,2.05,1.35],[b,1.8,1.35],[a,1.8,1.35]],c,{bias:3.1}); }
  // windows with goods
  for(const sgn of [-1,1]){ const a=sgn<0?-2.65:1.05, b=sgn<0?-1.05:2.65;
    addPoly(A,[[a,0.75,0.012],[b,0.75,0.012],[b,2.05,0.012],[a,2.05,0.012]],'#bfe8ff',{bias:2.5});
    for(let j=0;j<2;j++){ const y=1.05+j*0.5; addPoly(A,[[a+0.08,y,0.02],[b-0.08,y,0.02],[b-0.08,y+0.06,0.02],[a+0.08,y+0.06,0.02]],'#8b5a2b',{bias:2.6,stroke:false});
      for(let g=0;g<3;g++){ const gx=a+0.2+g*0.47, gc=['#ff6b6b','#4ecdc4','#a06cd5','#ffe66d','#ff9f43','#2ed573'][(g+j*3+(sgn>0?2:0))%6];
        addPoly(A,[[gx,y+0.06,0.03],[gx+0.3,y+0.06,0.03],[gx+0.3,y+0.36,0.03],[gx,y+0.36,0.03]],gc,{bias:2.7}); } }
    addPoly(A,[[(a+b)/2-0.03,0.75,0.025],[(a+b)/2+0.03,0.75,0.025],[(a+b)/2+0.03,2.05,0.025],[(a+b)/2-0.03,2.05,0.025]],'#ffffff',{bias:2.8,stroke:false});
    box(A,a-0.05,b+0.05,0.5,0.75,0,0.3,'#8b5a2b',{bias:3.0});
    for(let f=0;f<4;f++){ const fx=a+0.15+f*((b-a-0.3)/3); addPoly(A,[[fx-0.12,0.75,0.12],[fx+0.12,0.75,0.12],[fx+0.12,1.0,0.12],[fx-0.12,1.0,0.12]],['#ff6b6b','#f368e0','#ffe66d','#ff9f43'][f],{bias:3.1}); } }
  // door
  addPoly(A,[[-0.62,0,0.012],[0.62,0,0.012],[0.62,2.15,0.012],[-0.62,2.15,0.012]],'#8b5a2b',{bias:2.5});
  addPoly(A,[[-0.42,1.2,0.02],[0.42,1.2,0.02],[0.42,1.95,0.02],[-0.42,1.95,0.02]],'#bfe8ff',{bias:2.6});
  addPoly(A,[[-0.38,0.55,0.02],[0.38,0.55,0.02],[0.38,1.0,0.02],[-0.38,1.0,0.02]],'#ffffff',{bias:2.6});
  text3D(A,[-0.36,0.98,0.03],[0.36,0.98,0.03],[-0.36,0.57,0.03],'ABERTO',12,'#2ed573',2.7,[0,0,1]);
  A.push({d:toCam([0.45,0.95,0.03])[2]-2.9, fn(){ const q=proj([0.45,1.1,0.03]); if(!q) return; ctx.fillStyle='#ffe66d'; circ(q[0],q[1],Math.max(1.2,0.05*q[3])); ctx.fill(); ctx.lineWidth=1; ctx.strokeStyle=OUT; ctx.stroke(); }});
  box(A,-1.0,1.0,0,0.16,0,0.55,'#c2bdb0',{bias:3.0});
  // cars
  car(A,-19.5,5.6,'#ff6b6b'); car(A,19.5,5.6,'#4ea8de');
}
function buildProps(B){
  for(const sx of [-1,1]){ box(B,sx*5.6-0.07,sx*5.6+0.07,0,3.4,2.68,2.82,'#2f3542'); box(B,sx*5.6-0.3,sx*5.6+0.3,3.4,3.8,2.45,3.05,'#ffe66d'); box(B,sx*5.6-0.36,sx*5.6+0.36,3.8,3.95,2.39,3.11,'#2f3542',{bias:0.1});
    box(B,sx*8.7-0.2,sx*8.7+0.2,0,1.4,2.55,2.95,'#8b5a2b');
    const q=proj([sx*8.7,0,2.75]); if(q) B.push({d:q[2]-0.9, fn(){ drawTree(q[0],q[1],q[3]); }}); }
  // bench + hydrant (left of door)
  box(B,-3.0,-1.5,0.42,0.55,0.95,1.5,'#8b5a2b'); box(B,-3.0,-1.5,0.55,1.05,0.95,1.05,'#8b5a2b',{bias:0.1});
  box(B,-2.9,-2.75,0,0.42,1.0,1.45,'#2f3542'); box(B,-1.75,-1.6,0,0.42,1.0,1.45,'#2f3542');
  box(B,-2.2,-1.8,0,0.7,1.75,2.15,'#e8453c'); box(B,-2.1,-1.9,0.7,0.85,1.8,2.1,'#e8453c',{bias:0.1});
}
function groundPass(t){
  // sky
  const hy=horizonY();
  const g=ctx.createLinearGradient(0,0,0,Math.max(hy,1)); g.addColorStop(0,'#4facfe'); g.addColorStop(1,'#d9f3ff');
  ctx.fillStyle=g; ctx.fillRect(0,0,W,H);
  // sun
  const sunX=W*0.82, sunY=hy-H*0.19;
  ctx.fillStyle='rgba(255,230,109,.35)'; circ(sunX,sunY,W*0.15); ctx.fill();
  ctx.fillStyle='#ffe66d'; circ(sunX,sunY,W*0.085); ctx.fill(); ctx.lineWidth=2.5; ctx.strokeStyle=OUT; ctx.stroke();
  // clouds
  const cl=[[0.1,0.24,1.1],[0.45,0.31,0.8],[0.8,0.27,0.9],[0.3,0.14,0.7],[0.65,0.1,1.0]];
  for(let i=0;i<cl.length;i++){ const c=cl[i]; const span=W+200; let x=((c[0]*W+t*9*c[2]+camS.az*W*0.9)%span+span)%span-100; const y=hy-H*c[1], s=W*0.045*c[2];
    ctx.fillStyle='#ffffff'; ctx.strokeStyle=OUT; ctx.lineWidth=2.2;
    ctx.beginPath(); ctx.arc(x,y,s,0,TAU); ctx.arc(x+s*1.2,y-s*0.35,s*1.15,0,TAU); ctx.arc(x+s*2.5,y,s*0.95,0,TAU); ctx.closePath(); ctx.fill(); ctx.stroke();
    ctx.fillStyle='#ffffff'; ctx.beginPath(); ctx.rect(x-s*0.3,y-s*0.1,s*3.6,s*1.05); ctx.fill(); }
  // hills
  for(const [zz,col,amp,fr] of [[-70,'#9fe3c0',6,0.11],[-45,'#74c46a',3.5,0.19]]){
    const pts=[]; for(let x=-240;x<=240;x+=10) pts.push([x,2+amp*(0.6+0.5*Math.sin(x*fr)+0.4*Math.sin(x*fr*2.3+1)),zz]); pts.push([240,-3,zz]); pts.push([-240,-3,zz]);
    const e=polyEntry(pts,col,{stroke:false}); if(e) drawEntry(e); }
  // ground
  const gq=[ [[[-300,0,-300],[300,0,-300],[300,0,0],[-300,0,0]],'#8fd17a'],
             [[[-300,0,0],[300,0,0],[300,0,3],[-300,0,3]],'#dcd7c8'],
             [[[-300,0,3],[300,0,3],[300,0,300],[-300,0,300]],'#666a7d'] ];
  for(const [p,c] of gq){ const e=polyEntry(p,c,{stroke:false}); if(e) drawEntry(e); }
  for(let x=-30;x<=30;x+=1.5){ const e=polyEntry([[x-0.025,0.001,0],[x+0.025,0.001,0],[x+0.025,0.001,3],[x-0.025,0.001,3]],'#c8c2b2',{stroke:false}); if(e) drawEntry(e); }
  const curb=polyEntry([[-300,0.001,2.85],[300,0.001,2.85],[300,0.001,3.05],[-300,0.001,3.05]],'#b9b3a3',{stroke:false}); if(curb) drawEntry(curb);
  for(let x=-90;x<=90;x+=4){ const e=polyEntry([[x,0.002,8.9],[x+2.2,0.002,8.9],[x+2.2,0.002,9.2],[x,0.002,9.2]],'#f5d35b',{stroke:false}); if(e) drawEntry(e); }
  for(const sx of [-1,1]) for(let i=0;i<5;i++){ const z=3.4+i*1.1; const e=polyEntry([[sx*18.5-1.6,0.002,z],[sx*18.5+1.6,0.002,z],[sx*18.5+1.6,0.002,z+0.55],[sx*18.5-1.6,0.002,z+0.55]],'#eeeeee',{stroke:false}); if(e) drawEntry(e); }
}

/* ---------- confetti ---------- */
let confetti=[];
function burst(){ confetti=[]; const cols=['#ff6b6b','#4ecdc4','#ffe66d','#a06cd5','#ff9f43','#2ed573','#54a0ff','#f368e0'];
  for(let i=0;i<220;i++){ const a=-Math.PI/2+(Math.random()-.5)*1.6, v=W*(0.9+Math.random()*1.4);
    confetti.push({x:CX+(Math.random()-.5)*W*0.3,y:H*0.33,vx:Math.cos(a)*v,vy:Math.sin(a)*v,c:cols[i%cols.length],r:Math.random()*TAU,vr:(Math.random()-.5)*12,w:W*0.02+Math.random()*W*0.015,h:W*0.012,life:3.5+Math.random()}); } }
function drawConfetti(dt){
  if(!confetti.length) return; const gy=W*2.2;
  for(const p of confetti){ p.vy+=gy*dt; p.vx*=0.985; p.x+=p.vx*dt; p.y+=p.vy*dt; p.r+=p.vr*dt; p.life-=dt;
    ctx.save(); ctx.translate(p.x,p.y); ctx.rotate(p.r); ctx.globalAlpha=clamp(p.life,0,1); ctx.fillStyle=p.c; ctx.fillRect(-p.w/2,-p.h/2,p.w,Math.abs(p.h*Math.cos(p.r*2))+1); ctx.restore(); }
  confetti=confetti.filter(p=>p.life>0&&p.y<H+50);
}

/* ---------- camera planner ---------- */
const camS={dist:14, az:0.28, el:0.32, tz:2, init:false};
function planCamera(k,N,t){
  const last=slots[N-1]; const zMax=1.6+last.row*0.86+0.5, xh=last.half+0.9;
  const az=0.28+0.07*Math.sin(t*0.23)+(t>TOTAL?0.32*Math.sin((t-TOTAL)*0.22):0);
  const el=0.22+0.20*(k/DOUBLINGS);
  const tz=Math.max(1.2,zMax*0.45);
  const tgt=[0,0.8,tz];
  const pts=[[-3.4,3.7,0.4],[3.4,3.7,0.4],[-xh,0,1.0],[xh,0,1.0],[-xh,0,zMax],[xh,0,zMax],[-xh,1.8,zMax],[xh,1.8,zMax],[0,0,zMax+0.3]];
  let lo=5, hi=140;
  for(let it=0;it<18;it++){ const mid=(lo+hi)/2; setCamera(eyeFrom(mid,az,el,tgt),tgt); let ok=true;
    for(const p of pts){ const q=proj(p); if(!q||q[0]<W*0.04||q[0]>W*0.96||q[1]<H*0.255||q[1]>H*0.905){ ok=false; break; } }
    if(ok) hi=mid; else lo=mid; }
  return {dist:hi,az,el,tz};
}

/* ---------- main loop ---------- */
let t0=performance.now()/1000, last=t0, shownK=-1, ended=false, burstDone=false;
const qs=new URLSearchParams(location.search); const tParam=parseFloat(qs.get('t')); if(!isNaN(tParam)) t0-=tParam;
function restart(){ t0=performance.now()/1000; shownK=-1; ended=false; burstDone=false; confetti=[]; camS.init=false; endEl.classList.remove('show'); numEl.classList.remove('gold'); hintEl.classList.remove('hide'); }
$('again').addEventListener('click',e=>{ e.stopPropagation(); restart(); });
stage.addEventListener('pointerdown',()=>{ if(ended) restart(); });

const A=[], B=[];
function frame(){
  requestAnimationFrame(frame);
  const now=performance.now()/1000; const dt=Math.min(0.05,now-last); last=now; const t=now-t0;
  const k=Math.min(DOUBLINGS,Math.floor(t/STEP)), N=1<<k;

  // HUD
  if(k!==shownK){ shownK=k; numEl.textContent=N.toLocaleString('pt-BR'); lblEl.textContent=N===1?'cliente na fila':'clientes na fila';
    numEl.classList.remove('pop'); void numEl.offsetWidth; numEl.classList.add('pop');
    if(k>0){ x2El.classList.remove('go'); void x2El.offsetWidth; x2El.classList.add('go'); }
    if(k===DOUBLINGS) numEl.classList.add('gold'); }
  if(t>6.5) hintEl.classList.add('hide');
  if(k<DOUBLINGS){ const rem=STEP-(t-k*STEP); fillEl.style.width=((t-k*STEP)/STEP*100)+'%'; nextEl.textContent='dobra em '+rem.toFixed(1).replace('.',',')+' s'; }
  else { fillEl.style.width='100%'; nextEl.textContent='1.024 clientes! 🎉'; if(!burstDone){ burstDone=true; burst(); } if(t>TOTAL+2.4&&!ended){ ended=true; endEl.classList.add('show'); } }
  timeEl.textContent='⏱ '+Math.min(t,TOTAL).toFixed(1).replace('.',',')+' s';

  // camera
  const want=planCamera(k,N,t);
  if(!camS.init){ Object.assign(camS,want); camS.init=true; }
  else { const a=1-Math.exp(-dt*2.0); camS.dist+=(want.dist-camS.dist)*a; camS.az+=(want.az-camS.az)*a; camS.el+=(want.el-camS.el)*a; camS.tz+=(want.tz-camS.tz)*a; }
  const tgt=[0,0.8,camS.tz]; setCamera(eyeFrom(camS.dist,camS.az,camS.el,tgt),tgt);

  ctx.setTransform(DPR,0,0,DPR,0,0);
  groundPass(t);

  // people positions
  const vis=[]; const tk=k*STEP; const ry=Math.sin(camS.el)*0.95;
  for(let i=0;i<N;i++){ const P=people[i]; if(t<P.tStart) continue;
    const p=(t-P.tStart)/P.dur; const walking=p<1; const x=walking?P.spawnX+(P.sl.x-P.spawnX)*p:P.sl.x;
    const q=proj([x,0,P.sl.z]); if(!q) continue; if(q[0]<-W*0.3||q[0]>W*1.3||q[1]<-H*0.2||q[1]>H*1.3) continue;
    let hop=0; if(!walking&&k>0&&P.tStart+P.dur<tk){ const u=(t-tk-P.hopDelay)/0.45; if(u>0&&u<1) hop=Math.sin(u*Math.PI)*0.28; }
    vis.push({P,q,walking,hop}); }
  // shadows
  ctx.fillStyle='rgba(43,42,82,.22)';
  for(const v of vis){ const s=v.q[3]; if(s*1.6<10) continue; ctx.beginPath(); ctx.ellipse(v.q[0],v.q[1]+s*0.02,s*0.3,s*0.3*ry,0,0,TAU); ctx.fill(); }
  const kq=proj([-1.0,0,1.15]); if(kq){ const s=kq[3]; ctx.beginPath(); ctx.ellipse(kq[0],kq[1],s*0.3,s*0.3*ry,0,0,TAU); ctx.fill(); }
  for(const sx of [-1,1]){ const q=proj([sx*8.7,0,2.75]); if(q){ ctx.beginPath(); ctx.ellipse(q[0],q[1],q[3]*1.4,q[3]*1.4*ry,0,0,TAU); ctx.fill(); } }

  A.length=0; buildScene(A); flush(A);
  B.length=0; buildProps(B);
  for(const v of vis){ const s=v.q[3], px=s*1.6*v.P.h; const lod=px>=70?3:px>=34?2:px>=13?1:0;
    B.push({d:v.q[2], fn:()=>drawPerson(v.P,v.q[0],v.q[1],s,lod,v.walking,t,v.hop)}); }
  if(kq) B.push({d:kq[2], fn:()=>drawPerson(keeper,kq[0],kq[1],kq[3],3,false,t,0)});
  flush(B);

  drawConfetti(dt);
}
requestAnimationFrame(frame);
})();
</script>
</body>
</html>

O teste (10/11/2026)

  • Tempo19 min 39 s do Enter até o arquivo pronto, com o modelo padrão da conta.
  • O que veioUm arquivo de 29 KB com a cena desenhada em código (sem imagens externas), contador de 1 a 1.024, fila em serpentina e cartão final.
  • O que não veio perfeitoAlgumas nuvens aparecem cortadas e o cartão final tem ponto de exclamação. Eu não mexi para mostrar o resultado real.
Cuidados: Só a ponta do iceberg: para usar IA de verdade na empresa entram os dados dos clientes, a segurança e a LGPD (lei de proteção de dados). Não cole dados reais de clientes em pedidos de teste.

Glossário para leigos

  • Claude CodeA versão do Claude que trabalha no seu computador e cria arquivos numa pasta.
  • Arquivo .htmlUma página que abre no navegador (Chrome, Edge, Safari), mesmo sem internet.

Isso é só a ponta do iceberg.

Na sua empresa de verdade entram modelos mais avançados, que não treinam com os seus dados, mais segurança e LGPD. Na Imersão de IA para o seu negócio, eu coloco a IA para trabalhar com limites definidos por você.

Veja também

Gostou? Me siga e receba mais.

Toda semana, uma ferramenta de IA explicada para quem tem negócio. Comente LOJINHA no Instagram e eu te mando os links.