Coder Social home page Coder Social logo

swup / parallel-plugin Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 1.0 668 KB

A swup plugin for animating the previous and next page in parallel  🎏

Home Page: https://swup.js.org/plugins/parallel-plugin

License: MIT License

TypeScript 100.00%
animation page-transitions parallel plugin swup sync

parallel-plugin's Introduction

swup 4 is released  🎉  Check out the release notes and upgrade guide.


swup

npm version Bundle size npm downloads Test status License


Swup

Versatile and extensible page transition library for server-rendered websites.

FeaturesDemosPluginsThemesDocumentationDiscussions

Overview

Swup adds page transitions to server-rendered websites. It manages the complete page load lifecycle and smoothly animates between the current and next page. In addition, it offers many other quality-of-life improvements like caching, smart preloading, native browser history and enhanced accessibility.

Make your site feel like a snappy single-page app — without any of the complexity.

Features

  • ✏️ Works out of the box with minimal markup
  • ✨ Auto-detects CSS transitions & animations for perfect timing
  • 🔗 Updates URLs and preserves native browser history
  • 🏓 Manages the scroll position between pages and anchor links
  • 🚀 Uses a cache to speed up subsequent page loads
  • 📡 Offers hooks to customize and extend the page load lifecycle
  • 🔌 Has a powerful plugin system and many official and third-party plugins
  • 🎨 Provides ready-to-go themes to get started quickly

Demos

Explore our interactive demos to see swup in action.

Documentation

Visit our official documentation to learn more.

Plugins

Swup is small by design. Extended features can be added via plugins:

Check out the list of official plugins and third-party integrations.

Themes

Get started quickly with one of three official themes: fade, slide, and overlay.

Examples

Take a look at the interactive demos and sites using swup for more examples.

Having trouble?

If you're having trouble implementing swup, check out the Common Issues section of the docs, look at closed issues or create a new discussion.

Want to Contribute?

We're looking for maintainers!   👀

Become a sponsor on Open Collective or support development through GitHub sponsors.

This project is tested with BrowserStack.

parallel-plugin's People

Contributors

daun avatar hirasso avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

parallel-plugin's Issues

[Bug]: sometimes styles are not applied to .is-next-container

What did you expect? 🧐

Styles to apply to .is-next-container before class is removed

What actually happened? 😵‍💫

Styles are not applyed to .is-next-container before class is removed.

This issue only occurs when plugin is included from a CDN as UMD module (as it is suggested in documentation). It took me a while to figure out that forceReflow function is not included in output file - class is applied and then immediately removed:

Screenshot 2024-01-24 211447

Although it is included in module file, that's why it works correctly in your demo (it uses CDN link with module), but have inconsistent behavior in this demo (same code, but uses CDN UMD link)

Swup and plugin versions 📝

  • swup: 4.5.1
  • parallel-plugin: 0.3.0

What browsers are you seeing the problem on? 🧭

Firefox, Chrome, Safari, Microsoft Edge

Relevant log output 🤓

No response

URL to minimal reproduction 🔗

https://stackblitz.com/edit/web-platform-bmtpwk?file=index.html,page-2.html,page-3.html,page-4.html,base.css,pages.css,transitions.css,swup.js

Checked all these? 📚

Add `content:insert` and `content:remove` hooks

Describe the problem

  • There's currently no way of accessing the new container before it's inserted into the dom
  • This makes debugging and adding initial styles to containers harder than necessary
  • Discussed in #8

Describe the proposed solution

  • Create a new hook content:insert
  • Create a new hook content:remove
  • Or maybe content:enter and content:leave

Alternatives considered

  • Modify the HTML with initial styles

How important is this feature to you?

  • Nice to have
  • Would make my life a lot easier
  • I cannot use swup without it

Clarify lifecycle documentation

The docs are a bit unclear about when exactly the is-next-container class is added, and when it is removed. Also, the description of the styles is misleading in defining them as the style of the next container when done — they're actually the styles when starting the animation.

Allow keeping the previous container indefinitely

Describe the problem

  • Currently, the plugin discards the previous content after the animation
  • Some layouts require keeping a copy of the previous content indefinitely
  • Stacked layouts, multi-column slideshows, etc.

Describe the proposed solution

  • Add an option to keep X previous content containers around
  • Think about browser history visits

Alternatives considered

  • Create a project-specific plugin or use hooks with custom logic

How important is this feature to you?

  • Nice to have
  • Would make my life a lot easier
  • I cannot use swup without it

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.