@sveltejs/svelte-scroller
Advanced tools
Comparing version 2.0.6 to 2.0.7
# svelte-scroller changelog | ||
## 2.0.7 | ||
- Fix initial width ([#15](https://github.com/sveltejs/svelte-scroller/pull/15)) | ||
- Update `index` more conservatively ([#14](https://github.com/sveltejs/svelte-scroller/pull/14)) | ||
## 2.0.6 | ||
* Prevent offscreen scrollers from overflowing their containers | ||
- Prevent offscreen scrollers from overflowing their containers | ||
## 2.0.5 | ||
* Add `visible` binding | ||
- Add `visible` binding | ||
## 2.0.4 | ||
* Run handlers on window resize | ||
- Run handlers on window resize | ||
## 2.0.3 | ||
* Undo previous change 😬 | ||
- Undo previous change 😬 | ||
## 2.0.2 | ||
* Use dimension bindings rather than `resize` handler for better reliability | ||
- Use dimension bindings rather than `resize` handler for better reliability | ||
## 2.0.1 | ||
* Make `offset` continuous before and after foreground passes threshold | ||
- Make `offset` continuous before and after foreground passes threshold | ||
## 2.0.0 | ||
* Update for Svelte 3 | ||
- Update for Svelte 3 | ||
## 1.0.5 | ||
* Handle case where scroller abruptly disappears from viewport | ||
- Handle case where scroller abruptly disappears from viewport | ||
## 1.0.4 | ||
* Remove instance from scroll manager on destroy | ||
* Abort scroll handler if viewport is offscreen in browsers without IntersectionObserver | ||
- Remove instance from scroll manager on destroy | ||
- Abort scroll handler if viewport is offscreen in browsers without IntersectionObserver | ||
## 1.0.3 | ||
* Whoops | ||
- Whoops | ||
## 1.0.2 | ||
* Make SSR friendly | ||
- Make SSR friendly | ||
## 1.0.1 | ||
* Fix `pkg.svelte` | ||
- Fix `pkg.svelte` | ||
## 1.0.0 | ||
* First release | ||
- First release |
{ | ||
"name": "@sveltejs/svelte-scroller", | ||
"version": "2.0.6", | ||
"version": "2.0.7", | ||
"description": "A <Scroller> component for Svelte apps", | ||
@@ -16,13 +16,13 @@ "svelte": "Scroller.svelte", | ||
"faucet": "^0.0.1", | ||
"port-authority": "^1.0.5", | ||
"puppeteer": "^1.13.0", | ||
"rollup": "^1.7.3", | ||
"port-authority": "^1.1.2", | ||
"puppeteer": "^10.0.0", | ||
"rollup": "^2.51.1", | ||
"rollup-plugin-commonjs": "^9.2.2", | ||
"rollup-plugin-node-resolve": "^4.0.1", | ||
"rollup-plugin-svelte": "^5.0.3", | ||
"sirv": "^0.2.2", | ||
"sirv-cli": "^0.2.3", | ||
"svelte": "^3.0.0-beta.21", | ||
"rollup-plugin-svelte": "^7.1.0", | ||
"sirv": "^1.0.12", | ||
"sirv-cli": "^1.0.12", | ||
"svelte": "^3.38.2", | ||
"tap-dot": "^2.0.0", | ||
"tape-modern": "^1.1.1" | ||
"tape-modern": "^1.1.2" | ||
}, | ||
@@ -29,0 +29,0 @@ "repository": "https://github.com/sveltejs/svelte-scroller", |
@@ -11,3 +11,2 @@ # svelte-scroller ([demo](https://svelte.dev/repl/76846b7ae27b3a21becb64ffd6e9d4a6?version=3)) | ||
## Usage | ||
@@ -17,14 +16,18 @@ | ||
<script> | ||
import Scroller from '@sveltejs/svelte-scroller'; | ||
import Scroller from "@sveltejs/svelte-scroller"; | ||
let index, offset, progress; | ||
</script> | ||
<style> | ||
section { height: 80vh; } | ||
section { | ||
height: 80vh; | ||
} | ||
</style> | ||
<Scroller top={0.2} bottom={0.8} bind:index bind:offset bind:progress> | ||
<Scroller top="{0.2}" bottom="{0.8}" bind:index bind:offset bind:progress> | ||
<div slot="background"> | ||
<p> | ||
This is the background content. It will stay fixed | ||
in place while the foreground scrolls over the top. | ||
This is the background content. It will stay fixed in place while the | ||
foreground scrolls over the top. | ||
</p> | ||
@@ -45,3 +48,2 @@ | ||
## Parameters | ||
@@ -52,3 +54,3 @@ | ||
| parameter | default | description | | ||
|-----------|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| --------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| top | 0 | The vertical position that the top of the foreground must scroll past before the background becomes fixed, as a proportion of window height | | ||
@@ -60,3 +62,2 @@ | bottom | 1 | The inverse of `top` — once the bottom of the foreground passes this point, the background becomes unfixed | | ||
## `index`, `offset`, `progress` and `count` | ||
@@ -66,11 +67,9 @@ | ||
* `index` — the currently active section | ||
* `offset` — how far the section has scrolled past the `threshold`, as a value between 0 and 1 | ||
* `progress` — how far the foreground has travelled, where 0 is the top of the foreground crossing `top`, and 1 is the bottom crossing `bottom` | ||
* `count` — the number of sections | ||
- `index` — the currently active section | ||
- `offset` — how far the section has scrolled past the `threshold`, as a value between 0 and 1 | ||
- `progress` — how far the foreground has travelled, where 0 is the top of the foreground crossing `top`, and 1 is the bottom crossing `bottom` | ||
- `count` — the number of sections | ||
You can rename them with e.g. `bind:index={i}`. | ||
## Configuring webpack | ||
@@ -82,6 +81,4 @@ | ||
## License | ||
[LIL](LICENSE) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11662
78