
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
ac·tu·ate /ˈak(t)SHəˌwāt/ : cause (a machine or device) to operate.
A shiny new (~500b) vanilla implementation of what was previously A tiny jQuery wrapper for animate.css which allows for one line easy actuation of CSS animation sequences with thenable chaining.
Check out the codepen examples.
Note: this library uses promises for which you might need a polyfill
Directly in the head
of your document from the CDN
<script src='https://unpkg.com/actuatejs'></script>
or require it in your source files after npm install actuatejs
import Actuate from 'actuatejs' // ES6
You can define your own or employ a library like animate.css
@keyframes pulse {
from { transform: scale(1) }
50% { transform: scale(1.05) }
to { transform: scale(1) }
}
.pulse {
animation-name: pulse;
}
In a script tag before the closing body
tag
Actuate('pulse')(document.body)
.then($ => console.log('Finished animating', $))
.catch($ => console.log($, 'was already animating'))
The API is intended to be as simple as possible providing low overhead syntax for animation sequencing, chaining of sequences and animationEnd
detection.
To animate an HTML element, first pass the actuate
function the name of the CSS animation
you would like to apply. This primes the animation ready to be bound to a target
element passed as the second argument:
Actuate('tada')(document.body)
Once the function has received both arguments, the animation will be applied.
Often it is desirable to run animations one after another. There is no native method that assists this behavior. The Actuate function accepts a space delimited list of named CSS animations as the first argument and handles this complexity for you:
Actuate('rollIn tada rollOut')(document.body)
You can also pass in an array of named animations if you prefer:
Actuate(['rollIn', 'tada', 'rollOut'])(document.body)
When one animation finishes the next one will start until there are no more to apply.
The actuate function returns a promise which means you can easily declare a then
function which is guaranteed to execute once all the animations in a sequence have been applied.
Actuate('tada fadeOut')(document.body)
.then($ => console.log('Finished Animating', $))
The then
function gets passed the target
element. In the above case $ === document.body
.
The only time the actuate with throw an error is if you try animate an element that is already animating:
addEventListener('click', () =>
Actuate('tada')(document.body)
.then($ => console.log('Finished'))
.catch($ => console.log('Already Animating'))
)
The actuate function takes advantage of partial appliction which means that animation sequences can be defined without having to immediately specify a target
element.
var intro = Actuate('rollIn')
var showoff = Actuate('bounce tada bounce')
var outro = Actuate('rollOut')
You can then provide a target
element and let it flow through a chain of predefined animation sequences:
Promise.resolve(document.body)
.then(intro)
.then(showoff)
.then(outro)
FAQs
One line easy actuation of CSS animation sequences.
The npm package actuatejs receives a total of 2 weekly downloads. As such, actuatejs popularity was classified as not popular.
We found that actuatejs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.