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

aframe-ui-components

v1.0.2

Published

UI components for A-Frame.

Downloads

4

Readme

aframe-ui-components

UI components for A-Frame.

Components

Demo

gmarty.github.io/aframe-ui-components

cursor-feedback

Add visual feedback to a cursor when hovering a clickable object.

API

| Property | Description | Default Value | | -------- | -------------------------------------- | ------------- | | property | The property of the cursor to animate. | scale | | dur | The duration of the animation in ms. | 300 | | to | Ending value of the property. | 2 2 2 |

Browser Installation

This component requires aframe-animation-component.

Install and use by directly including the browser files.

Create a cursor with a cursor-feedback attribute and tag all your interactive entities with data-interactive="true":

<head>
  <title>My A-Frame Scene</title>
  <script src="https://aframe.io/releases/0.3.0/aframe.min.js"></script>
  <script src="https://rawgit.com/ngokevin/aframe-animation-component/master/dist/aframe-animation-component.min.js"></script>
  <script src="https://rawgit.com/gmarty/aframe-ui-components/master/dist/aframe-ui-components.min.js"></script>
</head>

<body>
  <a-scene>
    <a-box position="0 2.5 -8"
           data-interactive="true"></a-box>
  
    <a-camera>
      <a-cursor fuse="false"
                cursor-feedback></a-cursor>
    </a-camera>
  </a-scene>
</body>

It's recommended to deactivate fuse mode when using this component.

If all your interactive objects have a data-interactive attribute, you can optimise the cursor raycasting this way:

<a-cursor fuse="false"
          objects="[data-interactive='true']"
          cursor-feedback></a-cursor>

target-indicator

Displays an arrow pointing at an object when it is out of sight.

API

| Property | Description | Default Value | | -------- | -------------------------------------- | ------------- | | target | A reference to the entity to target. | |

Browser Installation

Install and use by directly including the browser files.

<head>
  <title>My A-Frame Scene</title>
  <script src="https://aframe.io/releases/0.3.0/aframe.min.js"></script>
  <script src="https://rawgit.com/ngokevin/aframe-animation-component/master/dist/aframe-animation-component.min.js"></script>
  <script src="https://rawgit.com/gmarty/aframe-ui-components/master/dist/aframe-ui-components.min.js"></script>
</head>

<body>
  <a-scene>
    <a-box id="box"
           position="2 3 -10"></a-box>
  
    <a-camera target-indicator="target: #box;"></a-camera>
  </a-scene>
</body>

Volumetric Light

Material for spotlight, ideal to attract the user attention to an object.

API

| Property | Description | Default Value | | ------------ | -------------------------------------- | ------------- | | attenuation | The property of the cursor to animate. | 5 | | anglePower | The duration of the animation in ms. | 1.2 | | spotPosition | Ending value of the property. | 0 0 0 | | lightColor | Ending value of the property. | 1 1 1 |

Browser Installation

Install and use by directly including the browser files.

Create an <a-cone> with a material="shader: volumetric-light; attribute:

<head>
  <title>My A-Frame Scene</title>
  <script src="https://aframe.io/releases/0.3.0/aframe.min.js"></script>
  <script src="https://rawgit.com/gmarty/aframe-ui-components/master/dist/aframe-ui-components.min.js"></script>
</head>

<body>
  <a-scene>
    <a-cone height="5"
            radius-top="0.5"
            radius-bottom="1.5"
            open-ended="true"
            position="0 2.5 -5"
            material="shader: volumetric-light;"></a-cone>
  </a-scene>
</body>

Ideally set the spotPosition to the position of the entity.

The lightColor attribute requires a Vector3 notation. For example white is '1 1 1'.

You'll also probably want to use a <a-light type="spot"/> for an improved effect.

The original code for this shader can be found at github.com/jeromeetienne/threex.volumetricspotlight.

npm Installation

Install via npm:

npm install aframe-ui-components

Then register and use.

require('aframe');
require('aframe-ui-components');