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

ng3-flat-ui

v0.0.22

Published

Angular UI component library for [three.js](https://threejs.org/)

Downloads

12

Readme

Ng3 Flat UI

Angular UI component library for three.js

image

Components work in browser window using touch or mouse.

Components also work in VR using ray caster to provide an in-scene user interface.

Components include

  • button
  • card actions
  • icon button
  • checkbox
  • color
  • number
  • slider
  • text
  • toggle
  • label
  • progress bar
  • radio button
  • drop-down list
  • icon
  • tabs
  • data grid with optional pagination
  • avatar icon
  • image
  • card with optional drag support
  • card actions
  • divider
  • material icon and button
  • menu and mini-menu
  • multi-line text input with scrolling

Panels include

  • expansion panel
  • dragable panel (window)

Input methods include

  • keyboard
  • number pad
  • color picker
  • list

Group directives are provided for automatic vertical or horiztonal layout.

A default theme is provided, but can be override. A matrix theme provides example of doing this.

Components use angular-three as a foundation for defining scene objects.

Documentation

See ng3-flat-ui for detailed documentation

Before you Start

This library assumes you have a decent understanding of three.js scene, lighting, geometry and material. Also, being familiar with angular-three really helps.

Getting started

Start with recent Angular CLI project

ng add @angular-three/schematics

ng add @angular-three/soba

ng add ng3-flat-ui

To app.module.ts, add the following

import { NgtCanvasModule } from '@angular-three/core';
import { NgtStatsModule } from '@angular-three/core/stats';

import { NgtMeshModule } from '@angular-three/core/meshes';
import { NgtBoxGeometryModule } from '@angular-three/core/geometries';
import { NgtMeshBasicMaterialModule } from '@angular-three/core/materials';

import { NgtColorAttributeModule } from '@angular-three/core/attributes';
import { NgtAmbientLightModule } from '@angular-three/core/lights';

import { Ng3FlatUiModule } from 'ng3-flat-ui';

Under imports, add

    NgtCanvasModule,
    NgtStatsModule,

    NgtMeshModule,
    NgtBoxGeometryModule,
    NgtMeshBasicMaterialModule,

    NgtColorAttributeModule,
    NgtAmbientLightModule,

    Ng3FlatUiModule,

Modify app.component.html or add the following to a component

<div style="height:100vh">
  <ngt-canvas [camera]="{ position: [0, 0, 3]}">
    <ngt-color attach="background" color="black"></ngt-color>

    <ngt-ambient-light></ngt-ambient-light>

    <ngt-mesh [position]="[0, -0.2, 0]" [rotation]="[0, 1.57/2, 0]">
      <ngt-box-geometry></ngt-box-geometry>
      <ngt-mesh-basic-material [color]="color"></ngt-mesh-basic-material>
    </ngt-mesh>

    <flat-ui-button [text]="'click me'" [position]="[0, 0.5, 0]" (pressed)="color='blue'"></flat-ui-button>

    <ngt-stats></ngt-stats>
  </ngt-canvas>
</div>

Modify app.component.ts or component you added, add the following class variable

  color = 'red';

Finally, modify styles.css to remove the border around the canvas

body {
  margin: 0px;
}

Click the button to change the cube blue

image

Questions

Are you planning a version that works without angular-three

No. This would be a great student project.

Are you planning a version that works with react-fiber

No. This would be a great student project.

Roadmap

List of features that would be nice to add (in no particular order)

  • sizable multi-line text area
  • UI sounds
  • keyboard multi-language support (requires better default font)
  • text regular expression support
  • scrollbar (difficult without clipping support, so probably needs to be re-imagined)
  • date picker
  • time picker
  • chips - requires knowing text length to size the chip correctly
  • hand input