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 🙏

© 2026 – Pkg Stats / Ryan Hefner

proxemics

v0.3.1

Published

Javascript library for Progressive Hover Effects.

Readme

alt

A JavaScript library for Progressive Hover Effects.
「徐々にHover効果」を制御するJavaScriptライブラリです。

demo

Change Info

2018.08.27

  • Add browser library

Setup

yarn add proxemics

npm

import Proxemics from 'proxemics'

or

browser

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/proxemics.js"></script>

Usage

Simple case

Proxemics() function require QuerySelector and Option bracket.

Proxemics('.prox', {})

Proxemics objects holding distance, angle, radian values.
There can be controlling on callback function and if you want use to data-attributes.
Moreover, add/remove class at right timings.

Optional (demo) case

Callback mthods for Proxemics 3rd param.

Proxemics('.prox', {
    territory: 100,
    debuggable: true
}, (_, Styles) => {
    if(_.el.classList.contains('one')) {
        Styles({
            filter: `hue-rotate(${_.angle}deg) saturate(${1 - _.distance * .005})`
        })
    }

    if(_.el.classList.contains('two')) {
        Styles({
            boxShadow: `inset 0 0 0 3px hsla(200, 100%, 40%, ${1 - _.distance * .005}`
        })
    }

    if(_.el.classList.contains('three')) {
        Styles({
            transform: `rotate(${_.angle}deg)`
        })
    }

    if(_.el.classList.contains('four')) {
        let speed = Math.min((_.distance / 500) + .2, 1).toFixed(1) // from .2 to 1
        Proxemics.SpeedTune = () => _.el.style.setProperty('--speed', `${speed}s`)
        _.el.style.color = `black`
        _.el.addEventListener('animationiteration', Proxemics.SpeedTune)
        _.el.innerHTML = speed
    }
})
<div class="one prox"></div>
<div class="two prox"></div>
<div class="three prox"></div>
<div class="four prox"></div>

Options

| Option | Default | Description | | --------------------- | ---------------- | ----------------------------------------------------------------------- | | territory | 10 | radius of territory zone (px) / 半径 | | debuggable | false | display debug / デバッグを表示 | | defaultProxemityClass | 'is-public' | default permanence class / Proxemics要素に永続的に付与 | | activeProxemityClass | 'is-proxemity' | when if mousemove / カーソルがドキュメント上で移動している際に付与 | | intimateClass | 'is-intimate' | mousecursor reached territory / カーソルがterritoryに入った際に付与 | | leftProxemityClass | 'is-left' | when if mouseleave / カーソルがドキュメントから出た際に付与 | | dataDistance | false | inject distance value in data-distance/ data-distanceでdistance値を扱う | | dataAngle | false | inject angle value in data-angle / data-angleでangle値を扱う | | dataRadian | false | inject radian value in data-radian /data-radianでradian値を扱う |

Next

  • [ ] throttle option
  • [ ] inherit original style
  • [ ] destroy method

License

MIT © Pokkur