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

3ui-aleguy02

v1.0.1

Published

You can easily implement interactive 3D elements into your website's UI with this package

Downloads

4

Readme

3UI lets you create interactive 3D elements to make your website a little more fun. It's currently made for beginner developers building websites with HTML, CSS, and Javascript. 3UI's elements dynamically react to different sized divs, or containers as I'll call them here. 3UI uses three.js to render scenes, I encourage you to take a look at three.js's official documentation if you want to understand what's going on under the hood. https://threejs.org/docs/index.html#manual/en/introduction/Creating-a-scene

How To Use:

Creating these interactive elements can be done in 3 steps:

  1. Create a shape with one of the shape functions. Currently, 3UI supports three shapes: Cube, Sphere, and Diamond
  2. Create a scene with the Scene function
  3. Render the scene with the createScene function

Full Documentation

This is my first time attempting any sort of docs, please bear with me. I'll also be copy pasting some lines directly from three.js's official documentation, so again I encourage you to take a look if you want to understand what's happening.

Cube(color: hexadecimal number, wireframe: boolean)

Returns a Mesh object that looks like a cube.

color - Hexadecimal number representing the color of the shape. Default is 0xff0000 (red)

wireframe - Render geometry as wireframe. Default is false (i.e. render as flat polygons).

Sphere(color: hexadecimal number, wireframe: boolean)

Returns a Mesh object that looks like a sphere.

color - Hexadecimal number representing the color of the shape. Default is 0xff0000 (red)

wireframe - Render geometry as wireframe. Default is false (i.e. render as flat polygons).

Diamond(color: hexadecimal number, wireframe: boolean)

Returns a Mesh object that looks like a diamond.

color - Hexadecimal number representing the color of the shape. Default is 0xff0000 (red)

wireframe - Render geometry as wireframe. Default is false (i.e. render as flat polygons).

Scene(color: hexadecimal number)

Returns a Scene object that makes up the background of the render.

color - Hexadecimal number representing the background color of the scene. Default is 0xffffff (white)

createScene(shape: object, scene: object, id: string)

Renders a shape and scene and fits them into a container.

shape - Mesh object representing your shape

scene - Scene object representing your background color id - string representing the id property of the container interface representing the container's identifier, reflecting the id global attribute

Example Code

The following code creates a red cube on a white background contained in a div with the id "animation-container"

import * as ThreeUI from "3ui-aleguy02"

const shape = ThreeUI.Cube()
const scene = ThreeUI.Scene()
ThreeUI.createScene(shape, scene, "animation-container")