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.Spritesheet: Keyframes.Spritesheet easily generates css3 keyframes for elements using animated spritesheets.

This repository was archived by the owner on Sep 15, 2025. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

29 Commits
29 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.Spritesheet

Keyframes.Spritesheet is a plugin for Keyframes that easily generates css3 keyframes for elements using animated spritesheets.

Installation

import Spritesheet from '@keyframes/spritesheet';
Keyframes.plugin(Spritesheet);

Usage

Defining spritesheet keyframes.

var keyframes = Keyframes.spriteSheet({
  name: 'gem', // Name of the spritesheet
  rows: 6, // Number of rows
  cols: 7, // Number of columns
  width: 210, // Width of the spritesheet in pixels
  height: 180, // Height of the spritesheet in pixels
  offsetX: 0, // [Optional] When you have multiple spritesheets in one -
  offsetY: 0, // - image use these to define their offset. 
  count: 39 // [Optional] Define the number of sprites in total
});

Applying them to an element

const item = new Keyframes(document.getElementById('item'));
item.playSpriteSheet(name, time, loop, keyframes);
  • name - name of the spritesheet.
  • time - time for the animation to complete.
  • loop - [optional] number of times to repeat the animation (-1 for infinite)
  • keyframes - [optional] pass keyframes to get them defined

For example

const item = new Keyframes(document.getElementById('item'));
item.playSpriteSheet('gem', '3s', -1, keyframes);

Example

http://jsfiddle.net/22Hyq/

Credits

"Gems" Image created by Lokiare. Image is subject to the creative commons license: http://creativecommons.org/licenses/by/3.0/

About

Keyframes.Spritesheet easily generates css3 keyframes for elements using animated spritesheets.

jsfiddle.net/22Hyq/

Resources

Readme
MIT license
Activity
Custom properties

Stars

8 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — 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.