All Projects → brunnolou → keyframe

brunnolou / keyframe

Licence: MIT license
A simple keyframe utility for custom animation

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to keyframe

laravel-quasar
⏰📊✨Laravel Time Series - Provides an API to create and maintain data projections (statistics, aggregates, etc.) from your Eloquent models, and convert them to time series.
Stars: ✭ 78 (+387.5%)
Mutual labels:  timeline
Timeline
AS2 & AS3 CPPS Emulator, written in Python. (Club Penguin Private Server Emulator)
Stars: ✭ 49 (+206.25%)
Mutual labels:  timeline
LineTimeline
Line Timeline API
Stars: ✭ 12 (-25%)
Mutual labels:  timeline
scenejs-timeline
🎬 @scenejs/timeline is a component that represents the timeline of Scene.js. You can control time, properties, and items.
Stars: ✭ 148 (+825%)
Mutual labels:  timeline
Automotive-Security-Timeline
汽车信息安全事件时间轴
Stars: ✭ 45 (+181.25%)
Mutual labels:  timeline
react-native-timeline-feed
Customisable timeline for react native (using FlatList). Docs: https://johan-dutoit.github.io/react-native-timeline-feed/
Stars: ✭ 43 (+168.75%)
Mutual labels:  timeline
react-timeline-9000
React Timeline
Stars: ✭ 259 (+1518.75%)
Mutual labels:  timeline
react-gantt-schedule-timeline-calendar
React Gantt Schedule Timeline Calendar component wrapper for gantt-schedule-timeline-calendar [ react gantt, gantt, react gantt chart, react schedule, react timeline, react calendar, gantt, schedule, scheduler, timeline, calendar, react gantt chart ]
Stars: ✭ 47 (+193.75%)
Mutual labels:  timeline
stream-python
Python Client - Build Activity Feeds & Streams with GetStream.io
Stars: ✭ 134 (+737.5%)
Mutual labels:  timeline
timeline-vuejs
Minimalist Timeline ⏳ with VueJS 💚
Stars: ✭ 116 (+625%)
Mutual labels:  timeline
Qt-Timeline-Widget
[Qt控件] 时间轴列表控件
Stars: ✭ 43 (+168.75%)
Mutual labels:  timeline
Timespace
A jQuery plugin to handle displaying of time events
Stars: ✭ 27 (+68.75%)
Mutual labels:  timeline
TTTTRPG
Timeline Tree of Tabletop Role-Playing Games, celebrating more than 40 years game design innovations
Stars: ✭ 34 (+112.5%)
Mutual labels:  timeline
UnityUIPlayables
Tracks and Clips for controlling the Unity UI (uGUI) with Timeline.
Stars: ✭ 277 (+1631.25%)
Mutual labels:  timeline
jquery-linechart
JQuery plugin for creating charts
Stars: ✭ 42 (+162.5%)
Mutual labels:  timeline
SwiftTweener
A pure Swift animation engine.
Stars: ✭ 74 (+362.5%)
Mutual labels:  timeline
stream-net
NET Client - Build Activity Feeds & Streams with GetStream.io
Stars: ✭ 28 (+75%)
Mutual labels:  timeline
timeline
Timeline - A photo organizer
Stars: ✭ 39 (+143.75%)
Mutual labels:  timeline
chartjs-chart-timeline
Google-like timeline chart for Chart.js.
Stars: ✭ 44 (+175%)
Mutual labels:  timeline
timeline-component-lwc
This component enables timeline view for Salesforce Record history.
Stars: ✭ 18 (+12.5%)
Mutual labels:  timeline

Keyframe

A simple tiny keyframe utility for custom animation.

npm version 0 dependencies

Install

npm install --save keyframe

or

yarn add keyframe

Usage

Pass an object witch every key is the keyframe from 0 to 100.

Each keyframe is a function that will be called during the keyframe interval. Each passed function is cached and runs only once when the value is the same.

And will return a function to run through the keyframes progress.

const run = keyframe({
  50: (d) => update(d),
  100: (d) => update(d),
});

run(0);    // 0
run(0.25); // 0.5
run(0.5);  // 1
run(0.75); // 0.5
run(1);    // 1

Example

import keyframe from 'keyframe';

...

const moveTo = (x, y) => {
  div.style.transform = `translate(${x}px, ${y}px)`;
};

// From (0% -> 50%) move the div left 150px
// then from (50% -> 100%) move the div up 50px.
const onSliderUpdate = keyframe({
  // d is the duration between 0% -> 50%.
  50: d => moveTo(d * 150, 0),

  // d is the duration between 50% -> 100%.
  100: d => moveTo(150, d * -50),
});

// Return range between 0 and 1.
DOMslider.addEventListener('input', () => onSliderUpdate(slider.value / 100), true);

Check the examples/ folder to see full examples.

Or check out the DEMO page

Development

yarn install

yarn run dev

Test

yarn test

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].