- Notifications
You must be signed in to change notification settings - Fork4
Nebula is a lightweight JavaScript library for creating beautiful universe and sky animations. Including configurable Stars, Nebulas, Comets, Planets and Suns. Compatible with SSR
NotificationsYou must be signed in to change notification settings
flodlc/nebula
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Nebula is a lightweight (1kb compressed) JavaScript library that creates beautiful universe and sky animations.
Including configurable Stars, Nebulas, Comets, Planets and Suns.
Nebula comes with a vanilla JS and a React wrapper.
Compatible with SSR
Demo pagenpm install @flodlc/nebulaimport{createNebula}from"@flodlc/nebula";<divid="nebula-element"></div>constelement=document.getElementById("nebula-element");constnebula=createNebula(element,{starsCount:250,starsRotationSpeed:3,nebulasIntensity:8, ...});// ... if needed:nebula.destroy()
import{ReactNebula}from"@flodlc/nebula";exportdefaultApp=()=>{return(<> // With default config<ReactNebula/> // With custom config<ReactNebulaconfig={{starsCount:250,starsRotationSpeed:3,nebulasIntensity:8, ...}}/></>);}
The canvas is positionedabsolute and takes the size of its parent.
| key | option type | default | Comment |
|---|---|---|---|
starsCount | number | 350 | Recommended: <1000 |
starsColor | string | #ffffff | |
starsRotationSpeed | number | 3 | |
cometFrequence | number | 15 | 0 disables the comets |
nebulasIntensity | number | 10 | |
sunScale | number | 1 | 0 hides the Sun |
planetsScale | number | 1 | 0 hides the planets |
solarSystemOrbite | number | 65 | Recommended: <100 |
solarSystemSpeedOrbit | number | 100 |
About
Nebula is a lightweight JavaScript library for creating beautiful universe and sky animations. Including configurable Stars, Nebulas, Comets, Planets and Suns. Compatible with SSR
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.