All Projects → gibbok → keyframes-tool

gibbok / keyframes-tool

Licence: MIT license
Keyframes-tool is a NodeJs command-line tool which converts CSS Animations to keyframes object suitable for Web Animations API. Use this tool to move your animations from stylesheets to JavaScript.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to keyframes-tool

custom-easings-with-keyframes
🏃 Make custom non-cubic-bezier easings using keyframes and animations with this online css code generator.
Stars: ✭ 15 (-72.73%)
Mutual labels:  animations, keyframes
use-web-animation
Hooks to leverage the web-animations API in under a kb
Stars: ✭ 48 (-12.73%)
Mutual labels:  animations, web-animations-api
compose-actors
🤖 Android app built with jetpack 🚀 compose follows new revamped guide to app architecture. Implemented with State, Coroutines ➰, ViewModels, Repository pattern, Light/Dark theme 🌈 MD3, Animations, Draw on canvas, Custom layouts, UI state handling, 🌀 Image loading with coil, Palette 🎨 usage and dynamic theming etc.
Stars: ✭ 80 (+45.45%)
Mutual labels:  animations
CustomSwitch
Custom Switch package created in Flutter
Stars: ✭ 56 (+1.82%)
Mutual labels:  animations
animated
🌊 Implicit animations for JavaFX.
Stars: ✭ 79 (+43.64%)
Mutual labels:  animations
PygameWidgets
A module for use with Pygame. Includes fully customisable buttons, textboxes, sliders and many more, as well as the ability to create and run animations on these widgets.
Stars: ✭ 34 (-38.18%)
Mutual labels:  animations
Walk-Through-Screen
This library provides easy ways to add onboarding or pager screens with different animation and indicators.
Stars: ✭ 31 (-43.64%)
Mutual labels:  animations
CustomSegueDemo
Demonstrates encapsulation of a custom view controller transition into a UIStoryboardSegue subclass
Stars: ✭ 31 (-43.64%)
Mutual labels:  animations
transitionable-routes
Perform transitions when changing routes with React Router
Stars: ✭ 26 (-52.73%)
Mutual labels:  animations
blog-resources
✍🏻 Resources and samples for my blog
Stars: ✭ 21 (-61.82%)
Mutual labels:  animations
old-animations
Client-side modification for Fabric that allows users to restore animations from older versions.
Stars: ✭ 19 (-65.45%)
Mutual labels:  animations
LockerScreen
Android lock screen,slide to unlock ! 安卓锁屏,上滑解锁,效果酷炫,值得拥有!
Stars: ✭ 81 (+47.27%)
Mutual labels:  animations
minavdrawer
Easy to add different animations into standard NavigationDrawer.
Stars: ✭ 93 (+69.09%)
Mutual labels:  animations
vanilla-animated-landing
Responsive landing page with SVG animations using CSS3 and vanilla Javascript
Stars: ✭ 72 (+30.91%)
Mutual labels:  animations
Material-Design-Android
My stash for all things material, animations, typography, iconography, transitions, Animated VD, Color Palette API, UI design, and more.
Stars: ✭ 38 (-30.91%)
Mutual labels:  animations
react-native-swipe-cards-interaction
React native swipe cards interaction
Stars: ✭ 142 (+158.18%)
Mutual labels:  animations
ng-micro-interact
Micro Interaction Directive for Angular apps - based on native web animations and nothing more..
Stars: ✭ 24 (-56.36%)
Mutual labels:  animations
aholachek.github.io
My website
Stars: ✭ 53 (-3.64%)
Mutual labels:  animations
PastelXamarinIos
🌒 Gradient animations on Xamarin-iOS
Stars: ✭ 17 (-69.09%)
Mutual labels:  animations
flutter-animations
medium.com/flutter-jp/implicit-animation-b9d4b7358c28
Stars: ✭ 37 (-32.73%)
Mutual labels:  animations

keyframes-tool

Keyframes-tool is a NodeJs command line tool which convert CSS Animations to a keyframes object suitable for Web Animations API.

Use this tool to move your interactive animations from stylesheets to JavaScript.

Great! So how do I use it?

  • Install keyframes-tool using npm install keyframes-tool or adding it in your package.json as: "devDependencies": { "keyframes-tool": "^1.0.3" } and run npm install.
  • Run command line in your keyframes-tool directory and enter node keyframes-tool ./input.css ./output.json, where as first argument ./input.css is the CSS source file to process and the second argument ./output.json is the destination file with the converted result. Paths should be relative to keyframes-tool.js file location.
  • keyframes-tool will create a JSON file from your CSS where any CSS Animation declarations found will be added as a property, example:

Input file input.css:

@keyframes flash {
  from, 50%, to {
    opacity: 1;
  }

  25%, 75% {
    opacity: 0;
  }
}

@keyframes pulse {
  from {
    transform: scale3d(1, 1, 1);
  }

  50% {
    transform: scale3d(1.05, 1.05, 1.05);
  }

  to {
    transform: scale3d(1, 1, 1);
  }
}

Output file output.json:

{
    "flash": [
        {
            "opacity": "1",
            "offset": "0",
            "easing": "ease"
        },
        {
            "opacity": "0",
            "offset": "0.25",
            "easing": "ease"
        },
        {
            "opacity": "1",
            "offset": "0.5",
            "easing": "ease"
        },
        {
            "opacity": "0",
            "offset": "0.75",
            "easing": "ease"
        },
        {
            "opacity": "1",
            "offset": "1",
            "easing": "ease"
        }
    ],
    "pulse": [
        {
            "transform": "scale3d(1, 1, 1)",
            "offset": "0",
            "easing": "ease"
        },
        {
            "transform": "scale3d(1.05, 1.05, 1.05)",
            "offset": "0.5",
            "easing": "ease"
        },
        {
            "transform": "scale3d(1, 1, 1)",
            "offset": "1",
            "easing": "ease"
        }
    ]
}
  • Use the result as embedded data in your JavaScript as shown in this example, alternatively you could load the JSON data using Ajax.
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].