Skip to content

Commit

Permalink
✨ Switch to Vite + fix bug with options not being reset properly betw…
Browse files Browse the repository at this point in the history
…een different cartapus elements
  • Loading branch information
thiervoj committed Feb 16, 2024
1 parent d03744c commit 786e100
Show file tree
Hide file tree
Showing 27 changed files with 3,072 additions and 15,042 deletions.
18 changes: 18 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* eslint-disable */
const standard = require('eslint-config-standard')

module.exports = {
...standard,
env: {
browser: true,
es2021: true
},
extends: ['eslint:recommended'],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module'
},
rules: {
"space-before-function-paren": "off"
}
}
18 changes: 0 additions & 18 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Jordan Thiervoz
Copyright (c) 2024 Jordan Thiervoz

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![bundlephobia](https://img.shields.io/bundlephobia/minzip/cartapus?label=bundle%20size)](https://bundlephobia.com/result?p=cartapus)
![NpmLicense](https://img.shields.io/npm/l/cartapus.svg)

Animate DOM elements as they appear in your window. A small `IntersectionObserver` wrapper and helper.
A small `IntersectionObserver` wrapper and helper to help detect easily DOM elements entering or leaving the viewport.

## What is cartapus ?

Expand Down Expand Up @@ -135,8 +135,8 @@ Some additional attributes are available to allow both of those cases, overridin
```

- `data-cartapus-threshold` : overrides the `threshold` option. *Ie : this element will be visible when 50% of its height is visible.*
- `data-cartapus-root-margin` : overrides the `rootMargin` option. *Ie : the bottom bounding box of this element will be shrunk by 200px.*
- `data-cartapus-once` : overrides the `once` option. *Ie : this element will switch to `visible`, then never switch back to `hidden` again.* To turn off the `once` option, use it like this : `data-cartapus-once="false"`.
- `data-cartapus-root-margin` : overrides the `rootMargin` option. *Ie : the bottom bounding box of the viewport will be shrunk by 200px on the bottom, as if the viewport was smaller.*
- `data-cartapus-once` : overrides the `once` option. *Ie : this element will switch to `visible`, then never switch back to `hidden` again.* To explicitly turn off the `once` option, use it like this : `data-cartapus-once="false"`.

---

Expand All @@ -146,7 +146,7 @@ Some methods are available, to turn on/off Cartapus programmatically :

### `.add(el)`

Cartapus watches DOM changes and observes automatically appended elements. But in some cases you may need to start observing an element manually (when a `data-cartapus` attribute has been added after the element being appended,etc).
Cartapus watches DOM changes and observes automatically appended elements. But in some cases you may need to start observing an element manually (when a `data-cartapus` attribute has been added after the element being appended, etc).

This method returns `true` if the element is now being watched, `false` if not.

Expand Down
1 change: 0 additions & 1 deletion bundled/cartapus.js

This file was deleted.

Loading

0 comments on commit 786e100

Please sign in to comment.