Git Product home page Git Product logo

keyfram's Introduction

Keyfram - Sass Keyframe Animation Library Build Status

Keyfram is a SCSS library which makes composing CSS keyframe-based animations simple.

Demo Animation as a GIF

A single @import away; Keyfram lets you define animations in a simple SCSS map format and then modify and compose your animations together using a collection of self-explanatory mixins. Keyfram takes care of the laborious work of translating your animation into CSS keyframes, freeing you up to focus on your animation itself.

You can use Keyfram for creating anything from simple button hovers to intricately timed and sequenced animations spanning over multiple elements (once only thought feasible by using javascript). Install via NPM or get the single-file import to get started.

Live demos available at:

Overview of Keyfram

  • Modular / composition-focused SCSS animation library
  • Available as a single SCSS file @import (no dependencies)
  • Great and simple for quickly for creating animations
  • Documented through examples at keyfram.milesalan.com
  • Well-thought out design (mixin-composability, animation-map flexibility etc.)
  • Small readable source-code & plently of unit tests

Installation & Basic Usage

Grab the single-file release or install via NPM:

npm install --save kf-sass

Next, include in your SCSS file:

@import 'relative/path-to/kf.scss';

From here the most basic example would look like:

.sliding-box {
  $animation-map: ('div': ( margin-left: ( 0ms: 0%, 300ms: 30%, 2000ms: 100% ) ));
  @include kf($animation-map);
}

Documentation

Learn more at the documentation site.

Available Mixins:

Mixin Purpose
kf Generate animation keyframes from an animation map.
kf-chain Run multiple animations in order sequentially
kf-ease Apply easing to an animation
kf-lag Add lag time at the end of an animation
kf-lead Add lead time before the start of an animation
kf-loop Loop an animation a given number of times
kf-mirror Run an animation sequentially forward and then in reverse
kf-parallel Run multiple animations in parallel
kf-reverse Run an animation in reverse
kf-sleep Add sleep (do nothing) time to an animation within a kf-chain
kf-stagger Run multiple animations sequentially staggering the start time of each
kf-stretch Stretch an animation's timing values over a given time or by a multiplier
kf-debug Visually debug an animation

keyfram's People

Contributors

mil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.