Git Product home page Git Product logo

astro'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.

astro's People

Contributors

daun avatar hirasso avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

astro's Issues

globalInstance window.swup is undefined

Description of the issue
When assigning globalInstance: true in the configuration, window.swup returns undefined.

How to reproduce the issue

Just start an astro project with the CLI, install swup with the CLI, and assign globalInstance to true in the config.

Context and environment

Happens in Firefox and Chrome, haven't checked others.
@swup/astro version is 1.0.2.

// astro.config.mjs
import { defineConfig } from "astro/config";
import swup from "@swup/astro";

export default defineConfig({
  integrations: [
    swup({
      globalInstance: true,
    }),
  ],
});
// script anywhere in the app
console.log(window.swup) // returns undefined

Before creating this issue...

  • Have you provided all helpful information available?
  • Have you checked closed issues for similar/related problems?
  • Have you considered creating a demo so we can help you better?

Check if types need to be exported

Describe the problem

Describe the proposed solution

  • Add a types key to the exports in package.json

How important is this feature to you?

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

Version 1.3.1 not working (1.3.0 works)

Hello!
First of all thanks for this package. i was already using swup with astro for an year but this make everything cleaner and easy.

I just wanted to warn you that with the last version of yesterday (1.3.1) there is something broken with the SwupA11yPlugin (maybe some versions?).

I also tryed with a clean astro project and same error.

The error is: Uncaught (in promise) TypeError: Cannot create property 'announcements' on boolean 'true'.

Am i doing something wrong? Thanks!

[Help]: How to redirect or navigate user in svelte astro component?

Describe the problem 🧐

How to redirect or navigate user in svelte astro component?

Describe the propsed solution 😎

import {navigate} from "@swup/astro"

Alternatives considered 🤔

None

How important is this feature to you? 🧭

Nice to have

Checked all these? 📚

Theme configuration object

Describe the problem

When using a built in theme, we cannot pass a configuration object. this makes it impossible to change the direction of the overlay theme easely.

Describe the proposed solution

adding a themeConfig object that can be passed to the new SwupOverlayTheme() class, like so :

SwupOverlayTheme({
  direction: 'to-right'
});

How important is this feature to you?

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

Add readme note about global instance availability

Describe the problem

  • The global instance window.swup is not available immediately: #6
  • Users might have to wait for the swup:enable event on the document before accessing it

Describe the proposed solution

  • We should add a note about this and an example:
<script>
  console.log('swup not yet enabled', window.swup);
  document.addEventListener('swup:enable', () => {
    console.log('swup enabled', window.swup);
  });
</script>

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.