fire-paper-loader
O que ela faz
Esta skill orienta um agente de IA na criação de uma tela de carregamento com um anel de papel em chamas, desenhada em um worker de segundo plano. Ela serve para sites que carregam páginas pesadas e precisam de um carregador que continue se movendo.
Quando usar
- ✓Quando uma página demora a carregar e o carregador precisa continuar se movendo.
- ✓Quando você quer uma introdução dramática de papel queimando que se dissolve na página.
- ✓Quando um carregador congelaria enquanto a página principal está ocupada.
Link da skill
https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/fire-paper-loader/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Crie um carregador de papel queimando para o meu site que continue animado mesmo quando a página estiver ocupada carregando.”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
O agente inicia um worker de segundo plano a partir do head da página, que desenha a chama no seu próprio canvas, para que ela continue rodando enquanto a página principal está ocupada. Uma contagem de progresso e um fade suave levam à página.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do GitHub.
Fire-Paper Loader
A ring of burning paper opens on black while the page builds. The mechanism: the fire is drawn by a Worker on an OffscreenCanvas that is started from <head>, so the ring keeps burning while the main thread is blocked for hundreds of milliseconds. The flame look is staging; a loader that stops dead for 450 ms reads as a hang whatever it looks like.
Nearest skills: web-design-performance covers general page speed; this one is specifically a loader that survives a blocked thread. For the burning-paper look on scroll transitions (not a loader), the flame GLSL is the same kbFlame but the page draws it. For a spinner or AI-status orb, use thinking-orbs.
Stack, verified in the source: Vanilla JavaScript, raw WebGL 1 (GLSL ES 1.00, no Three.js in the loader), Worker plus OffscreenCanvas, CSS for the label and fade.
Start from the head, not from the body
Symptom: the loader appears 1-2 s late, or the worker never gets a GL context, or the fire stands still while three.js downloads. A worker can start and create its WebGL context only while the main thread is free, which is during stylesheet loading in <head> and not again until the page is parsed.
- In a
<script>in<head>: create a canvas,transferControlToOffscreen(), start a Worker from a Blob URL of a tiny boot script, post{kbPre, canvas}and callgetContext('webgl', {antialias:false, alpha:false, depth:false, stencil:false})in the worker there and then. Keep the canvas and worker onwindow.__kbPre. - The boot script is only a shell. The loader's own
<script>(later in the body) sends its owntextContentto the worker with{kbInit, src, canvas:null, t0, origin: performance.timeOrigin, reduced, view, target}, and the workerevals it. One source text runs on both threads:const IN_W = typeof document === 'undefined'. Two copies drift apart. - Guard every step: no
Worker, noOffscreenCanvas, notransferControlToOffscreen, workeronerror, or afailmessage means draw on the main thread with the same code after the same warm-up. - Convert clocks. The worker's
performance.now()differs from the page's: sendperformance.timeOrigin, and addperformance.timeOrigin - originin the worker so every timestamp the page reads is its own.
Compile in parallel, warm the pipeline, then show
Symptom: the first visible frames are the slowest of the load (30-130 ms, once 408 ms on Metal).
- Create both programs (ring, cinders), attach shaders,
linkProgramboth, and only then ask for status. WithKHR_parallel_shader_compilethe driver compiles on its own threads; readingCOMPILE_STATUSper shader defeats it. Skip the per-shader check when the extension exists. warmUp(): run a real frame's draws of both programs into a 1x1 viewport, thenreadPixels1 pixel, waited. A first draw builds the GPU pipeline; make that happen before anything is seen.- Only then start
requestAnimationFrame. The page'sLOAD.ready()resolves when the worker draws (typically 0.15-0.3 s, timed out at 1.2 s); the build awaits it so it does not hold the thread off for a second while the fire stands still. - Show one canvas, not two. Drawing the fire on both threads first cost compile time in the first visible frames.
The ring's pace is planned in what is seen
Symptom: the coal sits at one size for a second, then leaps 2.5x; or a ring that stalls is overtaken by a faster one and reads as two fires.
- Plan the growth in
S = gain + ln(radius / first radius), not in the raw progressu. Equal steps in S look like equal growth at every size. The fade-in weighs 0.3 in S (at 1 it held the size back for 0.9 s). - Follow
Swith a critically damped spring (omega 5/s, speed clamped to 1.6/s, integrated in 1/120 s sub-steps) toward a goal that is the real progress but never behind a creep:creep = 0.38*(1 - exp(-t/800 ms)), and the goal cannot passWAIT0.290 while waiting, easing towardCEIL0.335 with a 2.5 s time constant. A hard hold and progress arriving in lumps read as a ring parked, then shoved. - Never still: minimum
VMIN0.016/s (about 5 px a frame at 8 fps), maximumVMAX0.05/s. The seen radius: a 4 px fleck at progress 0, 5.8 px by 0.15, then the burn's own radius. - Before the page has said anything, progress creeps on its own clock, so the ring lives while three.js is still on the wire.
Hand off without a stall
Symptom: the ring lurches into the page's intro, or the page stutters for 55-240
Perguntas frequentes
Por que usa um worker?
Um worker roda separadamente da página principal, então a chama continua se movendo mesmo quando a página está bloqueada.
Cobre a velocidade geral da página?
Não. A skill observa que uma skill geral de velocidade cobre a velocidade da página. Esta é apenas para o carregador.
Que tipo de código ela usa?
Usa JavaScript puro e WebGL, sem uma biblioteca 3D grande.
Detalhes
Descrição original do autor
Build a burning-paper ring loader whose GLSL flame is drawn by a Worker on an OffscreenCanvas started from the head, so a main thread blocked by the page build cannot freeze it, with a progress count, an even-paced run into the hand-off, and a clean fade to the page. Covers the ember thread and ember gradient, porous char, worker start-up, parallel shader compile with a waited 1-px warm-up draw, hand-off without a stall, reduced motion and hidden-tab behaviour. Use for a loading screen, preloader, page loader, splash, "kindling", burn loader, ember ring, burning paper hole, fire loader, or a l
repo: MengTo/Skills
Popularidade
- Estrelas no GitHub
- 7,2 mil
- Posição no ranking
- #13429
- Licença
- MIT
- Atualizada em
- 01/11/2026
Comentários
- …
Mais skills deste repositório
3d-cloth-material
7,2 milAjuda seu agente a criar tecido tramado realista no Three.js, com trama de fios, brilho suave, dobras naturais, barras e costuras.
3d-falling-leaves
7,2 milAjuda seu agente a acrescentar folhas caindo realistas a uma cena 3D, com folhas que giram, são levadas pelo vento e reaproveitadas conforme a câmera se move.
3d-four-seasons
7,2 milAjuda seu agente a acrescentar visuais de primavera, verão, outono e inverno a uma cena 3D, alterando folhagem, luz, céu e neve sem reconstruir a cena.
3d-high-poly-models
7,2 milAjuda seu agente a criar modelos 3D detalhados com formas suaves e bordas convincentes, e depois preparar versões mais leves que rodem bem na web.
Skills parecidas
angular-developer
280 milAjuda seu agente a criar código Angular e a dar conselhos sobre a estrutura do projeto. É útil para iniciar novos projetos, criar partes do código ou melhorar a performance e acessibilidade.
frontend-a11y
280 milAjuda seu agente a tornar interfaces web acessíveis para todos. Ele garante que sites e apps funcionem bem com leitores de tela e navegação por teclado.
frontend-patterns
280 milFaz seu agente aplicar padrões modernos no desenvolvimento frontend. Ele otimiza performance, gerencia estado e segue boas práticas em React e Next.js.