Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

web-animation-club

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

web-animation-club - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

7

dist/web-animation-club.js

@@ -92,2 +92,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "beforeFutureCssLayout", function() { return beforeFutureCssLayout; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onceNextCssLayout", function() { return onceNextCssLayout; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onceTransitionEnd", function() { return onceTransitionEnd; });

@@ -154,2 +155,8 @@ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onceAnimationEnd", function() { return onceAnimationEnd; });

function onceNextCssLayout() {
return new Promise(resolve => {
beforeNextCssLayout(resolve);
});
}
function onceTransitionEnd(element, options = {}) {

@@ -156,0 +163,0 @@ return new Promise(resolve => {

2

package.json
{
"name": "web-animation-club",
"version": "0.1.0",
"version": "0.1.1",
"description": "Web Animation Club",

@@ -5,0 +5,0 @@ "repository": "rcaferati/web-animation-club",

# web-animation-club
#### Dist file
Just load directly in your `HTML` the `web-animation-club.min.js` javascript file located on the `dist` folder.
```html
...
<script src="/path/to/web-animation-club.min.js"></script>
...
```
### Installation
From the `NPM registry` using npm or yarn just install the `web-animation-club` package.
```

@@ -13,10 +22,45 @@ npm install --save web-animation-club

### Basic Usage
For all the following examples please consider the following HTML markup.
```html
<style>
.animated {
transition: transform 0.4s linear;
}
.move {
transform: translateX(100px);
}
</style>
<div class="container">
<div class="box"></div>
</div>
```
#### HTML with ES5
```html
<script src="/path/to/web-animation-club.min.js"></script>
<script>
var box = document.querySelector('.box');
box.classList.add('animated');
box.classList.add('move');
onceTransitionEnd(box).then(function() {
// ... do something
});
</script>
```
#### Javascript ES6
```jsx
import { onceTransitionEnd } from 'web-animation-club';
const element = document.querySelector('#html-element');
onceTransitionEnd(element).then(() => {
const element = document.querySelector('.box');
// here we're just simulating the addition of a class with some animation/transition
element.classList.add('animated');
element.classList.add('move');
// if you are using the transition css property
onceTransitionEnd(element).then((event) => {
// ... do something
});
```

@@ -60,2 +60,8 @@ function recursiveAnimationFrame(frames, callback) {

export function onceNextCssLayout() {
return new Promise((resolve) => {
beforeNextCssLayout(resolve);
});
}
export function onceTransitionEnd(element, options = {}) {

@@ -62,0 +68,0 @@ return new Promise((resolve) => {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc