gravity
One object is the center. The others orbit it on rings, farther rings turning slower like real orbits, or fall toward it and settle, in the plane of the page.
Add the script once, then use the tags anywhere.
<script type="module" src="https://mmaxence.github.io/solids/solids.js"></script>
Or copy the library into your project: download solids.js from the repo and serve it yourself. No build step, no other files.
Usage
Set interaction="gravity" on the scene. Interactions are scene rules: they work on every object inside, whatever its type. Several run in the order written.
Options
| Attribute | Type | Default | Range | Description |
|---|---|---|---|---|
gravity-strength | number | 0.6 | 0 to 1 | Strength (scene attribute gravity-strength) |
gravity-gap | number | 24 | 0 to 200 | Clearance from the center in px (an object's gravity-gap overrides) |
License
MIT. Use it anywhere, credit appreciated.