Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

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 page

Installation

npm install @flodlc/nebula

usage

Vanilla JS

import{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()

React

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.

Config

keyoption typedefaultComment
starsCountnumber350Recommended: <1000
starsColorstring#ffffff
starsRotationSpeednumber3
cometFrequencenumber150 disables the comets
nebulasIntensitynumber10
sunScalenumber10 hides the Sun
planetsScalenumber10 hides the planets
solarSystemOrbitenumber65Recommended: <100
solarSystemSpeedOrbitnumber100

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

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2026 Movatter.jp