Socket
Socket
Sign inDemoInstall

swup

Package Overview
Dependencies
Maintainers
1
Versions
142
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swup - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

2

package.json
{
"name": "swup",
"version": "0.1.3",
"version": "0.1.4",
"description": "Css animating between website pages.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -17,3 +17,3 @@ # swup

`is-animating` is the main class you should worry about, as it enables the animations. `is-leaving` and `is-rendering` can be used for defining different animations for animating the elements in/out. `is-changing` may be used for for displaying some kind of loading while the transition is being done.
`is-animating` is the main class you should worry about, as it enables the animations. `is-leaving` and `is-rendering` can be used for defining different animations for animating the elements in/out. `is-changing` may be used for displaying some kind of loading while the transition is being done.

@@ -155,3 +155,5 @@ ### Example

### Preload
Preload is an additional feature that can be used in combination with cache. When enabled, swup starts loading the page on hover of the link and does not wait for the user to click on the link. In case the page is not loaded at the time of clicking on the link, swup simply waits for the request to finish and does not create new request. If cache is disabled, swup still preloads pages of hovered links, but the contents of cache are removed after each page transition.
Preload is an additional feature that can be used in combination with cache. When enabled, swup starts loading the page on hover of the link and does not wait for the user to click on the link. In case the page is not loaded at the time of clicking on the link, swup simply waits for the request to finish and does not create new request. Also, swup only creates one request at the time, so don't worry, your server won't be overwhelmed by few people just passing their cursor through some grid of links.
If cache is disabled, swup still preloads pages of hovered links, but the contents of cache are removed after each page transition.
In case you want to preload some page automatically without any trigger by user, `data-swup-preload` on the link will do the trick.
```javascript

@@ -202,3 +204,3 @@ preload: true

document.addEventListener('swup:contentReplaced', event => {
swup.elements.forEach((element) => {
swup.options.elements.forEach((element) => {
loadComponents(document.querySelector(element))

@@ -226,7 +228,7 @@ })

```javascript
swup.elements.forEach((element) => {
swup.options.elements.forEach((element) => {
// do whatever for each replaced element
})
```
or possibly use built in function for your own functions
or possibly use built in function for your own purpose
```javascript

@@ -233,0 +235,0 @@ // navigates to /someRoute with the animations and all

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