GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Keyframes/Keyframes.Proximity: A plugin for Keyframes that plays animations based on mouse distance from an element.

BranchesTags
Open more actions menu

Latest commit

 

History

7 Commits
7 Commits

Folders and files

NameName
Last commit message
Last commit date
example
example
 
 
src
src
 
 
.babelrc
.babelrc
 
 
.eslintignore
.eslintignore
 
 
.eslintrc
.eslintrc
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 

Repository files navigation

Keyframes.Proximity

A plugin for Keyframes that plays animations based on mouse distance from an element.

Installation

import Proximity from '@keyframes/proximity';
Keyframes.plugin(Proximity);

Usage

const blockElem = document.getElementById('block');
const block = new Keyframes(blockElem);
block.proximity((obj) => {
  blockElem.style.boxShadow = `red 0 0 ${0.5 * obj.distancePercentage}px`;
});
{
  mouse, // Current mouse x and y.
  mouseDistance, // Distance from the element in pixels.
  viewPortDistance, // Distance from the edge of the viewport in pixels.
  distancePercentage, // Distance of the mouse from the target element as a percentage where zero is the viewport edge.
  targetEdge, // Closest point on the edge of the target object to the mouse.
  viewPortEdge, // Closest point on the edge of the viewport to the target edge.
  collision: !mouseDistance, // Boolean if the mouse is over the top of the element.
}

About

A plugin for Keyframes that plays animations based on mouse distance from an element.

Resources

Readme
MIT license
Activity
Custom properties

Stars

2 stars

Watchers

1 watching

Forks

2 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.