All Projects → JoviDeCroock → use-web-animation

JoviDeCroock / use-web-animation

Licence: MIT License
Hooks to leverage the web-animations API in under a kb

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to use-web-animation

smoothr
A custom React router that leverages the Web Animations API and CSS animations.
Stars: ✭ 28 (-41.67%)
Mutual labels:  web-animations-api, web-animations
keyframes-tool
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.
Stars: ✭ 55 (+14.58%)
Mutual labels:  animations, web-animations-api
storify
Instagram/Whatsapp stories clone built on Web Components and Web Animations API. 🔥
Stars: ✭ 64 (+33.33%)
Mutual labels:  web-animations-api, web-animations
scrollxp
Alpine.js-esque library for scrolling animations on websites
Stars: ✭ 50 (+4.17%)
Mutual labels:  animations
highway
Highway - A Modern Javascript Transitions Manager
Stars: ✭ 1,349 (+2710.42%)
Mutual labels:  animations
flutteranimations
Flutter login and signup screen with animations.
Stars: ✭ 34 (-29.17%)
Mutual labels:  animations
animadio
Animadio CSS Framework
Stars: ✭ 24 (-50%)
Mutual labels:  animations
sticker-chat
Sticker chat is a messaging application built using Flutter, Stream, and Rive
Stars: ✭ 45 (-6.25%)
Mutual labels:  animations
ionic-modal-custom-transitions
Add Custom Transitions to Ionic Modals.
Stars: ✭ 22 (-54.17%)
Mutual labels:  animations
UWP-Flow-Frame
Flow Frame is a new and improved Frame control. This builds upon the default frame control by providing high-performance page transition animations powered by the composition layer. Fresh, new animations will be used by default, with options to configure the animations or even create your own custom animations (from scratch).
Stars: ✭ 14 (-70.83%)
Mutual labels:  animations
JDTextField
Animated UITextField enhance UX for the user by giving clarity that they are focused
Stars: ✭ 19 (-60.42%)
Mutual labels:  animations
learn-css-animation
Learn CSS animation with fun. It is simple, easy to use, and fun to learn.
Stars: ✭ 54 (+12.5%)
Mutual labels:  animations
AndTTT
🎲 Simple tic tac toe game for Android
Stars: ✭ 15 (-68.75%)
Mutual labels:  animations
Movie-ticket-App-UI
The movie ticket app contains three-screen.
Stars: ✭ 18 (-62.5%)
Mutual labels:  animations
vue-spinners-css
Amazing collection of Vue spinners components with pure css.
Stars: ✭ 50 (+4.17%)
Mutual labels:  animations
Coogle
A shot-for-shot remake of the Google Login Page.
Stars: ✭ 34 (-29.17%)
Mutual labels:  animations
Xamarin.Android.AVLoadingIndicatorView
🔰 AVLoadingIndicatorView is a collection of nice loading animations for Xamarin.Android.
Stars: ✭ 26 (-45.83%)
Mutual labels:  animations
ImageSwapper
🐣 Nice iOS animations for swapping images. In progress.
Stars: ✭ 28 (-41.67%)
Mutual labels:  animations
ConstraintLayoutAnimationDemo
A simple demo of using ConstraintLayout and animating between ConstraintSets
Stars: ✭ 23 (-52.08%)
Mutual labels:  animations
flutter circular animator
A pre-built Flutter circular animator can suit your new profile view or your any other widgets
Stars: ✭ 32 (-33.33%)
Mutual labels:  animations

use-web-animation

npm version Bundle size

This project aims to provide an API to use the web-animations API

This isn't supported in IE11 without a polyfill, in IE11 this library will just execute the ending value.

If you want to use "native-preact" you can import it with "use-web-animation/preact"

useWebAnimation

This package exports 1 function called useWebAnimation which allows you to manipulate stylistic properties.

import { useWebAnimation } from 'use-web-animation';

const RotatingAnimation = () => {
  const [ref] = useWebAnimation({
    from: 0,
    to: 180,
    property: "transform",
    infinite: true,
  });

  return (
    <div
      ref={ref}
      style={{
        backgroundColor: "red",
        width: 100,
        height: 100,
      }}
    />
  );
};

The second returned argument is a play function which can be used to imperatively start playing a paused animation. This function also accepts an onComplete callback which will be called when the animation completes.

Accepted properties:

type AnimationOptions = {
  duration?: number; // How long the animation should take
  infinite?: boolean; // Should the animation keep looping?
  pause?: boolean; // Start the animation out in a non-playing state
  delay?: number; // Delay before starting to animate
  easing?: string; // https://developer.mozilla.org/en-US/docs/Web/API/EffectTiming/easing
  from: string; // The starting value
  to: string; // The ending value
  property: string; // The property name
};

Examples

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].