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

gulp-path-to-animation

v0.1.1

Published

Predefine CSS keyframe animations by interpolating array of points

Downloads

12

Readme

#gulp-path-to-animation

Synopsis

Use to generate scss files with predefined @keyframes animations by reading configuration of paths to be interpolated.

Why would you need this?

  • Do you want to have smooth css animations you don't want to handle by java script?
  • Do you need to pause them?
  • Do you need to resize and keep the animated element's position?
  • Do you want to write such animation manually? And rewrite them every time the client changes the design?
  • Animations using translate instead of top/left positioning are considered as better performance and calculating translate movement manually could be painfully sometimes.

path-to-animation needs just a JSON file with animations paths you would need and it will interpolate them and create the file with predefined @keyframes animations you need.

Installation

npm install gulp-path-to-animation

Usage

var gulp = require('gulp');

// this module is for the sake of the example in order to rename the file we will create
var rename = require('gulp-rename');

var pathToAnimation = require('gulp-path-to-animation');

gulp.task('default', function() {
  // define which is your paths configuration file
  gulp.src('./animation-paths.json')
    // get the css content after some calculations
    .pipe(pathToAnimation({
      namespace: 'my-namespace',
      elementWidth: 100,
      elementHeight: 100
    }))
    // use gulp-rename to specify the name of the output file
    .pipe(rename({
      basename: 'output-file',
      extname: '.scss'
    }))
    // write it wherever you like
    .pipe(gulp.dest('./dist'));
});

pathToAnimation(options)

options

  • Type: Object

options.namespace

  • Description: The namespace is used to generate the @keyframes and css class name. It is also a guidance to specify which property of the JSON content to read the animations from.
  • Type: String

options.elementWidth

  • Description: Animated element's width. It's needed in order to calculate the path related to its size in percentages.
  • Type: Number|String

options.elementHeight

  • Description: Animated element's height. It's needed in order to calculate the path related to its size in percentages.
  • Type: Number|String

options.sassMixin

  • Description: The name of the sass mixin to be used for the generated css class.
  • optional
  • Type: String
  • Default: curved-animation

Dependancies

We depend on SASS. We expect the developers to use SASS in the project they plan to use path-to-animation

We will generate sass file and you will be able to import it into your project. We expect you to have defined sass mixin which name you could provide via the arguments described above. The default is mixin name is curved-animation.

Test

In order to asure everything works as expected, run:

npm install
npm test

Other tools:

Changelog

  • 0.1.1 - Synchronize version numbers between the path-to-animation modules
  • 0.0.1 - Initial version

Contributions

If you have any suggestions or the tool doesn't cover your needs, don't hasitate to fork us or send us an email [email protected]. Every comment or contribution will be very appreciated.

MIT License

Copyright (c) 2016 Mobile Wave Solutions ([email protected])

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.