matterjs
यह क्या करती है
यह स्किल एजेंट को Matter.js, एक ब्राउज़र के लिए 2D भौतिकी लाइब्रेरी, एक चलने वाले शुरुआती दृश्य के साथ सेट करना सिखाती है। यह उन डेवलपर्स के लिए है जिन्हें पेज पर गिरती चीज़ें, खींचने वाले इंटरैक्शन या दूसरे भौतिकी प्रभाव चाहिए।
कब इस्तेमाल करें
- ✓जब आप चाहते हैं कि वेब पेज की चीज़ें सरल भौतिकी इंजन से गिरें, उछलें या टकराएँ।
- ✓जब आप चाहते हैं कि विज़िटर कैनवास दृश्य में माउस से चीज़ें खींच सकें।
- ✓जब सिंगल पेज ऐप में भौतिकी दृश्य को सही तरह से बंद करना हो।
Skill का लिंक
https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/matterjs/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“क्या आप मेरे वेब पेज में गिरते डिब्बों वाला भौतिकी दृश्य जोड़ने में मदद कर सकते हैं, जिसे लोग माउस से खींच सकें?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट एक engine, एक renderer और एक runner बनाता है, दुनिया में एक ज़मीन और कुछ आकार जोड़ता है, और अगर आप माँगें तो माउस कंट्रोल भी जोड़ता है। वह यह भी समझाता है कि पेज बदलने पर दृश्य को कैसे बंद किया जाए।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Matter.js Skill
Workflow
- Confirm environment (plain HTML, React, or canvas-only) and rendering approach (Matter.Render for debug vs custom renderer).
- Provide a minimal Engine/World/Render/Runner setup and add bodies.
- Add interactions (mouse constraint) or constraints only if requested.
- Share cleanup steps for SPA or teardown scenarios.
Minimal setup
<script>
const { Engine, Render, Runner, Bodies, Composite } = Matter;
const engine = Engine.create();
const render = Render.create({
element: document.body,
engine: engine,
options: {
width: 800,
height: 600,
wireframes: false
}
});
const runner = Runner.create();
Runner.run(runner, engine);
Render.run(render);
const ground = Bodies.rectangle(400, 610, 810, 60, { isStatic: true });
const box = Bodies.rectangle(400, 200, 80, 80);
Composite.add(engine.world, [ground, box]);
</script>
Common patterns
- Use
Composite.add(engine.world, [...])to add bodies to the world. - Use
Render.create({ element, engine })to create a canvas automatically, or pass acanvasyou create yourself. - Set
render.options.wireframes = falsefor solid rendering. - Use
Runner.run(runner, engine)for a simple loop, or callEngine.updatein your own loop if you need custom timing.
Mouse interaction (optional)
const { Mouse, MouseConstraint } = Matter;
const mouse = Mouse.create(render.canvas);
const mouseConstraint = MouseConstraint.create(engine, { mouse });
Composite.add(engine.world, mouseConstraint);
render.mouse = mouse;
Cleanup checklist (SPA)
- Stop the runner with
Runner.stop(runner). - Remove the render canvas from the DOM.
- Clear engine and world if needed.
Questions to ask when specs are missing
- What viewport size and scaling should the canvas use?
- Are we using Matter.Render or a custom renderer?
- Do you want mouse/touch drag interaction?
- Should the simulation loop be paused when offscreen?
अक्सर पूछे जाने वाले सवाल
क्या इसे इस्तेमाल करने के लिए भौतिकी जानना ज़रूरी है?
नहीं। स्किल एक न्यूनतम काम करने वाला सेटअप देती है, जिसे आप चरण-दर-चरण बदल सकते हैं।
क्या यह React के साथ काम कर सकता है?
हाँ। स्किल सादे HTML, React और सिर्फ़ canvas वाले सेटअप को कवर करती है, और पहले पूछती है कि आप कौन सा इस्तेमाल करते हैं।
क्या बिना माँगे कुछ जुड़ता है?
नहीं। माउस इंटरैक्शन और बाधाएँ सिर्फ़ तब जुड़ती हैं जब आप उनकी माँग करें।
जानकारी
लेखक का मूल विवरण
Use when implementing 2D physics interactions with Matter.js, including Engine/World setup, Render/Runner configuration, adding bodies and constraints, and scroll/interaction-friendly canvas scenes.
repo: MengTo/Skills
लोकप्रियता
- GitHub स्टार
- 7.2k
- रैंकिंग में स्थान
- #13449
- लाइसेंस
- 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 फॉलो करवाता है।