mirror of
https://github.com/alexfoxy/lax.js.git
synced 2026-04-24 03:01:10 -04:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7e019fd335 | ||
|
|
7fc92ed6c9 | ||
|
|
38eddc7ab8 | ||
|
|
6d8b4ca9b3 | ||
|
|
938b1be1b8 | ||
|
|
69edd64243 | ||
|
|
1e1067f632 | ||
|
|
19df0b70c1 | ||
|
|
08bdf99fdd | ||
|
|
2ab2c5392c |
1
.npmignore
Normal file
1
.npmignore
Normal file
@@ -0,0 +1 @@
|
||||
.babelrc
|
||||
15
README.md
15
README.md
@@ -2,14 +2,21 @@
|
||||
|
||||
Simple & light weight (<3kb gzipped) vanilla javascript plugin to create *smooth* & beautiful animations when you scrolllll! Harness the power of the most intuitive interaction and make your websites come alive!
|
||||
|
||||
[>>> DEMO <<<](https://alexfox.dev/laxxx/)
|
||||
[>>> DEMO <<<](https://alexfox.dev/lax.js/)
|
||||
|
||||

|
||||
|
||||
[>>> MARIO DEMO <<<](https://alexfox.dev/laxxx/sprite.html)
|
||||
[>>> MARIO DEMO <<<](https://alexfox.dev/lax.js/sprite.html)
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
## lax 2.0
|
||||
For those daring enough ;) there is an alpha version of lax.js 2.0 available. Have a play: https://github.com/alexfoxy/lax.js/tree/version-2
|
||||
|
||||
---
|
||||
|
||||
## Getting Started
|
||||
|
||||
### NPM Setup
|
||||
@@ -27,7 +34,7 @@ import lax from 'lax.js'
|
||||
```html
|
||||
<script src="lib/lax.min.js" >
|
||||
<!-- or via CDN -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/lax.js" >
|
||||
<script src="https://cdn.jsdelivr.net/npm/lax.js" ></script>
|
||||
```
|
||||
|
||||
2) Initialize the plugin
|
||||
@@ -225,7 +232,7 @@ Other
|
||||
|
||||
|
||||
## Sprite Sheet Animations
|
||||
You can create animations using sprite sheets. See a demo [here](https://alexfox.dev/laxxx/sprite.html).
|
||||
You can create animations using sprite sheets. See a demo [here](https://alexfox.dev/lax.js/sprite.html).
|
||||
|
||||
The `data-lax-sprite-data` is required and formated like so `[frameWidth, frameHeight, frameCount, columnCount, scrollStep]`. You can either set the image using CSS or the `data-lax-sprite-image` attribute. e.g.
|
||||
|
||||
|
||||
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lax.js",
|
||||
"version": "1.2.4",
|
||||
"version": "1.2.5",
|
||||
"scripts": {
|
||||
"build": "babel src -d lib; uglifyjs lib/lax.js -o lib/lax.min.js -c -m; gzip < lib/lax.min.js > lib/lax.min.js.gz;"
|
||||
},
|
||||
|
||||
@@ -166,7 +166,7 @@
|
||||
}
|
||||
|
||||
lax.removeElement = (el) => {
|
||||
const i = lax.elements.findIndex(o => o.el = el)
|
||||
const i = lax.elements.findIndex(o => o.el === el)
|
||||
if(i > -1) {
|
||||
lax.elements.splice(i, 1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user