Coder Social home page Coder Social logo

swup / route-name-plugin Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 662 KB

A swup plugin for named routes and route-based animation 🧭

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

License: MIT License

TypeScript 100.00%
page-transitions plugin router routes swup

route-name-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.

route-name-plugin's People

Contributors

daun avatar gmrchk avatar hirasso avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

route-name-plugin's Issues

Using CDN minified version of RouteNamePlugin doesnt work.

I'm not using a bundler in my project and am currenlty trying to upgrade Swup form v2 to v3. I need to use the RouteNamePlugin but including the CDN link <script src="https://unpkg.com/@swup/route-name-plugin@2"></script> results in js errors.

Uncaught ReferenceError: exports is not defined`
Uncaught TypeError: SwupRouteNamePlugin is not a constructor

Looking at the source of the CDN link, it doesnt appear to be a minified version and is still reliant on imports.

Help with route plugin

Hi @gmrchk hoping you can help me.

I'm using wordpress.

My URL structure is :
http://localhost:8888/cdw/work/telesign/
http://localhost:8888/cdw/work/foo/
http://localhost:8888/cdw/work/bar/
http://localhost:8888/cdw/work/etc/

I just want to assign the route name "work" to any URL containing work.
image

None of these are working though:

			routes: [
				{ name: 'work', path: '/work/:slug' },
			]

not working:

			routes: [
				{ name: 'work', path: '/work/(.*)' },
			]

Please help! thanks

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.