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

wordsphere

v1.1.2

Published

a 3D rolling sphere of words following mouse movements

Downloads

2

Readme

wordsphere

NPM package: a 3D rolling sphere of words following your mouse movements.

Compatible with Vue JS.

PREVIEW

FEATURES

Words of your chosing are spread around a fully customizable sphere.
The sphere is activated when the user's mouse enters its bounding square, and will rotate towards the direction given by the mouse.
When the mouse leaves the component's bounding square, movement will gradually slow down.
You can also make the sphere move on its own with just a few tweaks (detailled below)

INSTALLATION

npm i wordsphere

(TODO: instructions for Nuxt JS)

HOW TO USE

BASICS

Add this code to the part of your Vue file

import WordSphere from 'wordsphere';

export default {
  components: {
    WordSphere
  }
}

And, in the HTML part, add it almost like any other Vue component, just with a few twists:

<WordSphere :items_list="['Your', 'words', 'here', 'make', 'that', 'list', 'long', 'if', 'you', 'want']"/>

We will discuss the input props of the component in more details below, but items_list is non-optional.

CUSTOMIZE WITH INPUT PROPERTIES / PROPS

Here is the full list of props you can customize:

1. items_list

Type: Array
Array of strings, the list of words you want to include in the sphere

2. radius

Type: Number
Unit: REM
Radius of the sphere

3. text_color

Type: String
Color of the words in the sphere

4. font_size_max

Type: Number
Unit: REM
Font size when a word is at the closest point to the user.
NOTE: the font size of words furthest behind will be half of that

5. blur_max

Type: Number
Unit: REM
Blur when a word is at the furthest point from user

6. update_interval

Type: Number
Unit: milliseconds
IMPORTANT: change THIS prop to modify movement speed. The lower the interval, the faster

7. extra_padding

Type: Number
Unit: REM
Padding around the sphere, in which mouse movement is still listened to

Overall, if you want to specify all props, this would be the result when calling the component:

<WordSphere 
	:items_list="['Your', 'words', 'here', 'make', 'that', 'list', 'long', 'if', 'you', 'want']"
	:radius="12
	:text_color="'#00FFEA'"
	:font_size_max="2"
	:blur_max="0.1"
	:update_interval="15"
	:extra_padding="2"
	/>

AUTONOMOUS MOVEMENT

You wish the sphere could move on its own when becoming visible?
Well my friend, wish no more! Here's how to do it:

STEP 1: Add an id and ref to the component

<WordSphere id="id_sphere_object" ref="ref_sphere_object"
      :items_list="['1', '2', '3', '4', '5', '6', '7', '8']"
      :radius="10"
      :text_color="'black'"
      :font_size_max="2"/>

STEP 2: Add this piece of script

Inside of export default within

mounted(){
	window.addEventListener("scroll", this.onScroll);
},
methods: {
	onScroll(e) {
		// if the sphere becomes visible
		if (document.getElementById("id_sphere_object").getBoundingClientRect().top <= window.innerHeight){
			this.$refs.ref_sphere_object.start_autonomous_move();
			window.removeEventListener("scroll", this.onScroll);
		}
	},
}

My code is based on scroll, but you can of course do your own tweaks to activate autonomous move based on another type of event!

LICENSE

Copyright 2022 Ilan Azoulay

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.