Animation devtools for production code
- Animate existing sites from localhost using the devtools
- Build animations without thinking about specific frameworks
- Human readable code in HTML, JSON, and Fluent API
- Zero config
Power this project up with 🌟s, ^ star it please.
SteelScene has three important objects/concepts:
targets
to animatestates
to transition targets betweenscenes
to control groups of targets
There are three different ways to build out animations with SteelScene. Demo Project on CodePen
SteelScene automatically will try to load scenes in the body when the document is ready.
<s-scene name="boxes" duration="800" easing="Power1.easeOut">
<s-target select="#box1">
<s-state name="middle" x="0" easing="Power2.easeOut" />
<s-state name="right" x="100px" />
</s-target>
</s-scene>
You can load JSON, HTML, or provide a document selector to load after the document is loaded.
steel.load([
{
name: 'boxes',
duration: 800,
easing: 'Power1.easeOut',
targets: [
{
select: '#box1',
states: {
middle: { x: 0, easing: 'Power2.easeOut' },
right: { x: '100px' }
}
}
]
}
])
SteelScene also has a fluent API that is pretty simple.
const box1 = steel
.target('#box1')
.on('middle', { x: 0, easing: 'Power2.easeOut' })
.on('right', { x: '100px' })
const boxesScene = steel
.scene('boxes', { duration: 800, easing: 'Power1.easeOut' })
.add(box1)
Transition a scene
const boxScene = steel.scene('boxes')
boxScene.transition('right')
Sequence states in a scene
const boxScene = steel.scene('boxes')
boxScene.transition(['right', 'middle'])
Transition a specific target
const box1 = steel.target('#box1')
box1.transition('right')
Sequence states in a target
const box1 = steel.target('#box1')
box1.transition(['right', 'middle'])
Set the state of a scene immediately
const boxesScene = steel.scene('boxes')
boxesScene.set('right')
Set the state of a target immediately
const box1 = steel.target('#box1')
box1.set('right')
Include this script
<script src="https://unpkg.com/steel-scene/dist/steel-scene.min.js"></script>
npm install steel-scene --save
Instead of reinventing web animation, SteelScene works seamlessly with your existing animation library. We currently have plugins for the following animation libraries:
Your library isn't here? Put in an issue, so we can start writing a plugin
- Transitions must have a duration. (at this point)
- Properties cascade. State properties override target properties. Target properties override scene properties.
- SteelScene is not an animation engine, it will not work without also loading a plugin to an animation library.
Get a simple prototype UI working and posted. Stay tuned!
Contributions and issues are very welcome :) Make sure to put in an issue with your intent before doing a Pull Request.