fire-paper-loader
यह क्या करती है
यह स्किल एजेंट को जलते कागज़ के घेरे वाली लोडिंग स्क्रीन बनाना सिखाती है, जो एक बैकग्राउंड वर्कर में बनती है। यह उन साइटों के लिए है जो भारी पेज लोड करती हैं और ऐसा लोडर चाहती हैं जो चलता रहे।
कब इस्तेमाल करें
- ✓जब पेज लोड होने में समय लगे और लोडर को चलते रहना चाहिए।
- ✓जब आप चाहते हैं कि जलते कागज़ का नाटकीय परिचय पेज में घुल जाए।
- ✓जब मुख्य पेज व्यस्त होने पर लोडर वरना जम जाए।
Skill का लिंक
https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/fire-paper-loader/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरी साइट के लिए जलते कागज़ का लोडर बनाइए, जो पेज व्यस्त होकर लोड होते समय भी चलता रहे।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट पेज के head सेक्शन से एक बैकग्राउंड वर्कर शुरू करता है, जो अपने कैनवास पर लौ बनाता है, इसलिए मुख्य पेज व्यस्त होने पर भी वह चलती रहती है। प्रगति की गिनती और चिकने फ़ेड से पेज तक पहुँच बनती है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे 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
अक्सर पूछे जाने वाले सवाल
वर्कर क्यों इस्तेमाल होता है?
वर्कर मुख्य पेज से अलग चलता है, इसलिए पेज रुके होने पर भी लौ चलती रहती है।
क्या यह सामान्य पेज की गति को भी कवर करता है?
नहीं। स्किल कहती है कि पेज की गति के लिए एक सामान्य गति स्किल है। यह सिर्फ़ लोडर के लिए है।
किस तरह का कोड इस्तेमाल होता है?
यह सादा JavaScript और WebGL इस्तेमाल करता है, बिना किसी बड़ी 3D लाइब्रेरी के।
जानकारी
लेखक का मूल विवरण
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
लोकप्रियता
- GitHub स्टार
- 7.2k
- रैंकिंग में स्थान
- #13429
- लाइसेंस
- MIT
- अपडेट की गई
- 1/11/2026
कमेंट
- …
इस repository की और skills
3d-cloth-material
7.2kआपके एजेंट को Three.js में असली बुने हुए कपड़े जैसा दिखने वाला मटीरियल बनाने में मदद करती है, जिसमें धागों की बुनाई, हल्की चमक, प्राकृतिक सिलवटें, किनारे और सीवन हों।
3d-falling-leaves
7.2kआपके एजेंट को 3D दृश्य में असली लगने वाली गिरती पत्तियाँ जोड़ने देती है, जो लुढ़कती हैं, हवा के साथ बहती हैं और कैमरा हिलने पर दोबारा इस्तेमाल होती हैं।
3d-four-seasons
7.2kआपके एजेंट को 3D दृश्य में वसंत, गर्मी, शरद और सर्दी के रूप जोड़ने देती है, जिसमें हरियाली, रोशनी, आसमान और बर्फ़ बिना दृश्य दोबारा बनाए बदलते हैं।
3d-high-poly-models
7.2kआपके एजेंट को चिकने आकार और विश्वसनीय किनारों वाले विस्तृत 3D मॉडल बनाने देती है, और फिर वेब पर अच्छे चलने वाले हल्के संस्करण तैयार करती है।
मिलती-जुलती skills
angular-developer
280kआपके एजेंट को Angular code बनाने और प्रोजेक्ट स्ट्रक्चर पर सलाह देने में मदद करता है। नए प्रोजेक्ट शुरू करने, code के हिस्से बनाने, या performance और accessibility सुधारने में उपयोगी है।
frontend-a11y
280kआपके एजेंट को web interfaces को सबके लिए accessible बनाने में मदद करता है। यह सुनिश्चित करता है कि websites और apps screen readers और keyboard navigation के साथ अच्छे से काम करें।
frontend-patterns
280kआपके एजेंट को React और Next.js में frontend development के modern patterns लागू करने में मदद करता है। यह performance optimize करता है, state manage करता है और best practices फॉलो करवाता है।