GithubHelp home page GithubHelp logo

Comments (8)

dylanfisher avatar dylanfisher commented on May 12, 2024 1

I don't mean to butt in but I like the convention of including the word swup in the animationSelector by default. I was just thinking about this as I noticed you updated the README with the latest animationSelector example.

from swup.

gmrchk avatar gmrchk commented on May 12, 2024 1

@thetoine No worries. I was just updating the docs, so I updated the default options in a process so it all fits. Thanks for making me do so!

@dylanfisher transition-* seems pretty descriptive to me, and in case it's overlapping with some internal classes, it's still a default setting that can be changed. Any suggestion including word swup tho? I like the idea, but swup-transition-* is unnecessarily long and versions like swup-a-* seems like something that could be confusing for people.

from swup.

andre94 avatar andre94 commented on May 12, 2024

Hi Thetoine,

For first question see this #4

For second question, and also the first, you can adjust manually the default option like this:

var options = {
    LINK_SELECTOR: 'a', //HERE
    FORM_SELECTOR: 'form[data-swup-form]',
    elements: [
        '#swup'
    ],
    animationSelector: '[class^="a-transition-"]', //HERE
    cache: true,
    pageClassPrefix: '',
    scroll: true,
    debugMode: false,
    preload: true,
    support: true,
    disableIE: false,
    skipPopStateHandling: function(event){
        if (event.state && event.state.source == "swup") {
            return false;
        }
        return true;
    },
}
var swup = new Swup(options) //HERE

Hope this help

from swup.

gmrchk avatar gmrchk commented on May 12, 2024

Hi @thetoine,

The LINK_SELECTOR default setting was once pointed out before. I'm all up for it.

I like the idea about animationSelector option. People are having a hard time understanding the meaning of class^=, or just miss it quite often. I was thinking about including the word swup in the selector, but I guess [class*="transition-"] would do just fine. After all, it's a setting that can be changed... It would be nice if you reflect your changes in the readme as well, but I will go through it when you're done anyway, so it's up to you.

Thanks!

from swup.

jcklpe avatar jcklpe commented on May 12, 2024

just wanted to thank @thetoine for his solution which worked great for me. Thanks!

from swup.

gmrchk avatar gmrchk commented on May 12, 2024

Hi @thetoine, any news on this?

from swup.

thetoine avatar thetoine commented on May 12, 2024

@gmrchk sorry, I was way too busy last week on clients job. So you did the change yourself, great !

from swup.

jcklpe avatar jcklpe commented on May 12, 2024

@andre94 @thetoine

Hey guys, wanted to check in with some other people who might have implemented this in WP.

I was looking at adding a Webpack plugin for in-lining my critical path CSS, and it was not able to work because it couldn't access any HTML files. I'm wondering if that means that the preload for swup isn't going to work for wp? I'm continuing to use it because I think the animation stuff is useful but I'm curious how useful it actually is for the actual preloading of data etc. Any thoughts?

from swup.

Related Issues (20)

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.