npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

whs-cube-spheres

v1.0.1

Published

This plugin has a container with multiple spheres.

Downloads

5

Readme

XO code style Three NPM Version Build Status PRs Welcome Coverage Status Known Vulnerabilities Discord

OpenCollective Backers OpenCollective Sponsors

Framework for developing 3D web apps

Contributors welcome! :P How to start contributing

Development chat - opens in discord app. Ask for help here;)

Support the project - [Donate] buy developers a ☕

$ npm install --save whs

Showcases

You can find lots of examples at showcases.

Why?

  • 🤔 Because making of even a basic Three.js application requires at least ~20 lines of code (see this tutorial)

    • Three.js: you will need to setup: scene, renderer, camera, make an animate() function before making the actual app.

    • Whitestorm.js: There are modules that helps you easily setup them:

      const app = new WHS.App([
        new WHS.ElementModule(), // attach to DOM
        new WHS.SceneModule(), // creates THREE.Scene instance
        new WHS.CameraModule(), // creates PerspectiveCamera instance
        new WHS.RenderingModule() // creates WebGLRenderer instance
      ]);
      
      app.start(); // run animation

      See more about modules

  • 💣 Adding physics is hard.

    • Three.js: To make your app run with physics you need to make a second world with same 3d objects and apply their transform (position & rotation) to your rendered scene objects (THREE.Scene for example) in every frame.

    • Whitestorm.js: Can be done with modules in a few lines:

      const app = new WHS.App([
        // Other modules...
        new PHYSICS.WorldModule()
      ]);
      
      const sphere = new WHS.Sphere({
        geometry: {
          radius: 3
        },
      
        modules: [
          new PHYSICS.SphereModule({
            mass: 10
          })
        ],
      
        material: new THREE.MeshBasicMaterial({color: 0xff0000}) // red material
      });
      
      app.start(); // run animation

      Use physics-module-ammonext as your physics module.

      Try with physics on Codepen:

  • 🔌 Components & plugins

    • Three.js: You can create meshes with geometry and material.

    • Whitestorm.js: You can create components with advanced custom functionality.

      export class BasicComponent extends WHS.MeshComponent {
        build() {
          return new THREE.Mesh(
            new THREE.IcosahedronGeometry(3, 5),
            new THREE.MeshBasicMaterial({color: 0xffffff})
          )
        }
      
        randomize() { // Additional function
          this.position.set(Math.random() * 10, Math.random() * 10, Math.random() * 10);
        }
      }
    • See Component system in interactive 3D of web article for more info.


Download

CDN

Proudly hosted by cdnjs

Features

  • 💎 Simple in usage
  • :rocket: Speeds up 3D scene prototyping
  • 🔌 Component based scene graph
  • 💣 Simple integration of any high performance physics even with Worker (Multithreading)
  • :dizzy: Automatization of rendering
  • 🆕 ES2015+ based
  • :large_blue_diamond: Extension system (modules)
  • :package: Webpack friendly
  • ✔️ Integrated Three.js rendering engine
  • :revolving_hearts: Work with Whitestorm.js and Three.js at the same time

WEBPACK

Use whitestorm-app-boilerplate

Documentation

Documentation for beta is currently in progress. Contact developers in discord chat

Basic application

Try on Codepen:

const app = new WHS.App([
  new WHS.ElementModule(), // attach to DOM
  new WHS.SceneModule(), // creates THREE.Scene instance
  new WHS.CameraModule({
    position: new THREE.Vector3(0, 0, -10)
  }), // creates PerspectiveCamera instance
  new WHS.RenderingModule(), // creates WebGLRenderer instance
  new WHS.OrbitControlsModule() // orbit controls
]);

const sphere = new WHS.Sphere({ // Create sphere comonent.
  geometry: {
    radius: 3
  },

  material: new THREE.MeshBasicMaterial({
    color: 0xffffff, // White color.
  }),

  position: new THREE.Vector3(0, 1, 0) // x: 0, y: 1, z: 0
});

sphere.addTo(app);
console.log(sphere.native); // Logs THREE.Mesh of this component

app.start(); // run animation

React integration

You can easily integrate Whitestorm.js with React using react-whs tool!

$ npm install react react-whs --save

Try with React on Codepen:

Example:


import React, {Component} from 'react';
import {App, Sphere} from 'react-whs';

export class Application extends Component {
  render() {
    return (
      <App modules={[
        new WHS.SceneModule(),
        new WHS.CameraModule({
          position: {
            z: 20
          }
        }),
        new WHS.RenderingModule(),
        new WHS.OrbitControlsModule()
      ]}>
        <Sphere
          geometry={[3, 32, 32]}
          material={new THREE.MeshBasicMaterial({color: 0xffffff})}
          key="1"
        />
      </App>
    )
  }
}

Modules

Devtools

|Name|Status|Description| |:--:|:----:|:----------| |whs-module-statsjs|statsjs-npm|WhitestormJS module for JavaScript Performance Monitor ⚡⌛| |whs-module-dat.gui|datgui-npm|User Interface for runtime editing properties 🔑🛠🔩|

Physics

|Name|Status|Description| |:--:|:----:|:----------| |physics-module-ammonext|physics-ammonext-npm|Physics module based on Ammo.js|

Audio

|Name|Status|Description| |:--:|:----:|:----------| |whs-module-audio| WIP |Audio module for 3D positional sound 🔉|

Integrations

|Name|Status|Description| |:--:|:----:|:----------| |react-whs|react-whs-npm|Integration with ReactJS|

Backers

Support us with a monthly donation and help us continue framework development🎉 and adding new features💡🎁.

Sponsors

Become a sponsor and get your logo on on our README on Github with a link to your website🔭.

Sponsors

forthebadge