All Projects → argyleink → Transition.css

argyleink / Transition.css

Licence: apache-2.0
Drop-in CSS transitions

Projects that are alternatives of or similar to Transition.css

Transition X
{ } Declarative Kotlin DSL for choreographing Android transitions
Stars: ✭ 514 (+158.29%)
Mutual labels:  animations, transitions
Rnal
Animations library for react-native
Stars: ✭ 54 (-72.86%)
Mutual labels:  animations, transitions
Swiftui Animation Library
SwiftUI Animation Library. Useful SwiftUI animations including Loading/progress, Looping, On-off, Enter, Exit, Fade, Spin and Background animations that you can directly implement in your next iOS application or project. The library also contains huge examples of spring animations such as Inertial Bounce, Shake, Twirl, Jelly, Jiggle, Rubber Band, Kitchen Sink and Wobble effects. Browse, find and download the animation that fits your needs.
Stars: ✭ 898 (+351.26%)
Mutual labels:  animations, transitions
Hamburger React
Animated hamburger menu icons for React (1.5 KB) 🍔
Stars: ✭ 391 (+96.48%)
Mutual labels:  animations, transitions
Redux Time
∞ High-performance declarative JS animation library for building games, data-viz experiences, and more w/ React, ThreeJS, Inferno, SnabbDOM and others...
Stars: ✭ 99 (-50.25%)
Mutual labels:  animations, transitions
React Burger Menu
🍔 An off-canvas sidebar component with a collection of effects and styles using CSS transitions and SVG path animations
Stars: ✭ 4,544 (+2183.42%)
Mutual labels:  animations, transitions
Animate Css Grid
Painless transitions for CSS Grid
Stars: ✭ 987 (+395.98%)
Mutual labels:  animations, transitions
ionic-modal-custom-transitions
Add Custom Transitions to Ionic Modals.
Stars: ✭ 22 (-88.94%)
Mutual labels:  animations, transitions
Sunset.css
This library offers a collection of different CSS-powered transitions.
Stars: ✭ 99 (-50.25%)
Mutual labels:  animations, transitions
React Native Fluid
Declarative animations for React Native and React Native Web.
Stars: ✭ 92 (-53.77%)
Mutual labels:  animations, transitions
Xamanimation
Xamarin Forms Animation Library
Stars: ✭ 389 (+95.48%)
Mutual labels:  animations, transitions
Animatable Component
Animate once, use Everywhere! 💫
Stars: ✭ 188 (-5.53%)
Mutual labels:  animations, transitions
Animatify Ios
Animation, Effects & Transitions for iOS
Stars: ✭ 350 (+75.88%)
Mutual labels:  animations, transitions
React Motion Layout
🦸 Beautiful immersive React hero animations.
Stars: ✭ 509 (+155.78%)
Mutual labels:  animations, transitions
React Overdrive
Super easy magic-move transitions for React apps
Stars: ✭ 3,001 (+1408.04%)
Mutual labels:  animations, transitions
Easytransform
Enhancing CSS transform with a little bit of JavaScript.
Stars: ✭ 10 (-94.97%)
Mutual labels:  animations, transitions
transitionable-routes
Perform transitions when changing routes with React Router
Stars: ✭ 26 (-86.93%)
Mutual labels:  animations, transitions
highway
Highway - A Modern Javascript Transitions Manager
Stars: ✭ 1,349 (+577.89%)
Mutual labels:  animations, transitions
Highway
Highway - A Modern Javascript Transitions Manager
Stars: ✭ 1,185 (+495.48%)
Mutual labels:  animations, transitions
Ui Motion
How to apply meaningful and delightful motion in a sample Android app
Stars: ✭ 165 (-17.09%)
Mutual labels:  animations, transitions

Total Downloads Latest Release License Netlify Status

46 pre-built transitions!

Hands on at Codepen or preview all @ transition.style



Basics

Import the CSS and set an attribute on some HTML: try on Codepen

<link rel="stylesheet" href="https://unpkg.com/transition-style">

<div transition-style="in:wipe:up">
  👍
</div>


Installation

NPM

  1. npm i transition-style
  2. import from CSS
@import "transition-style";
  1. or import from JS
import 'transition-style';

CDN

https://unpkg.com/transition-style


Individual Category Bundles

  • Circles https://unpkg.com/transition-style/transition.circles.min.css
  • Squares https://unpkg.com/transition-style/transition.squares.min.css
  • Polygons https://unpkg.com/transition-style/transition.polygons.min.css
  • Wipes https://unpkg.com/transition-style/transition.wipes.min.css

Import category bundles from NPM too import "transition-style/transition.circles.min.css"


👉 The Hackpack

https://unpkg.com/transition-style/transition.hackpack.min.css

More options, more control, smaller import
by importing only the custom properties and base styles:

  • compose custom transition combinations
  • create multi-part transitions
  • use classes or CSS-in-JS that leverage transition.css custom props

The Hackpack Sandbox

Custom properties ship with each .min.css as well




Usage

After transition.css has been added to your project, add an attribute to an element and watch the magic:

<div transition-style="in:circle:bottom-right">
  A transitioned IN element
</div>

<div transition-style="out:wipe:down">
  A transitioned OUT element
</div>

if nothing is happening when using the attributes, it's likely transition.css has not loaded


Attributes were chosen as the default so there's no question which transition is active. **There can be only 1 at a time.** With classes, for example, what happens when multiple "transition in" classes are applied to an element? Transition.css chooses to default with a state machine approach so things like a classname collision doesn't need solved. See the [custom](#custom) section below for ways to use classes and/or the shape custom properties so transition.css can fit into your development environment. The built in attribute based approach is very easy to hack, customize and escape.

Using @keyframes

Each bundle ships with the @keyframes declared, and you can use them as you see fit. You can use these to build your own animations or just hook into the presets in your own way:

.main--state-in {
  animation: wipe-in-left;
  animation-duration: 2s;
  animation-fill-mode: both;
}

Checkout the src to find the names of the @keyframe animations. They follow a pattern like the attributes, so you should be able to assume what they are with decent accuracy.


Using CSS Custom Properties

Each bundle ships with clearly named custom properties which contain the state and geometry needed to orchestrate custom transitions.

.overrides {
  --transition__duration: 1s;            /* default: 2.5s */
  --transition__easing: ease-in-out;     /* default: cubic-bezier(.25, 1, .30, 1) */
  --transition__delay: 1s;               /* default: 0 */
}

or target a specific transition and override it's defaults:

[transition="in:wipe:up"] {
  --transition__duration: 1s;
}

Custom

Go off the rails and build your own transitions with these variables. There's even the The Hackpack which is exclusively the custom props 🤘💀 Here's how you can compose a brand new transition from the custom property primitives:

@keyframes circle-swoop {
  from {
    clip-path: var(--circle-top-right-out);
  }
  to {
    clip-path: var(--circle-bottom-right-in);
  }
}

.--in-custom {
  --transition__duration: 1s;
  --transition__easing: ease-in-out;
  animation-name: circle-swoop;
}

Then, in the HTML:

<div transition-style class="--in-custom">
  A custom transitioned element
</div>

The only rule is that you must transition from the same type of shapes

At this point you're using Transition.css to it's maximum. You can reach a huge set of transitions by using the custom properties. Have fun!

Play

Play and experiment with this Codepen



Development

See the svelte branch.

Production

npm run bundle concurrently bundles and minifies.

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