Giter VIP home page Giter VIP logo

Comments (8)

mattaningram avatar mattaningram commented on September 2, 2024

That's strange. My initial guess is it has something to do with the statically generated site being hydrated after the static HTML and CSS renders.

Where/when is the animxyz CSS being loaded when the site loads? If you can include it with the rest of the styling CSS that loads with the initial site load, then the elements with xyz="fade ..." should be automatically hidden due to animxyz setting the animation-fill-mode to both.

If the animxyz CSS is being loaded only when the page hydrates with Vue then that would explain what you are seeing.

from animxyz.

Sananes avatar Sananes commented on September 2, 2024

@mattaningram that's basically what I think is also happening. Do you think this is also related to: #38?

Thanks in advance!

from animxyz.

Sananes avatar Sananes commented on September 2, 2024

I've tried a brand new nuxt project to see if I did something incorrectly, but it looks to me that on statically generated sites it only loads once page hydrates...

from animxyz.

mattaningram avatar mattaningram commented on September 2, 2024

Where in your Nuxt setup is the actual CSS for animxyz being loaded? Ideally you would load the CSS prior to the JS rather than with it. Is it included in the CSS sent to the client pre-hydration?

from animxyz.

Sananes avatar Sananes commented on September 2, 2024

Hey @mattaningram thanks for getting back to me! I've tried both manually adding a link to the <head> as well as a couple of other solutions and site renders everything first, then animation kicks in. It's very strange. Something I've noticed though, the animxyz css doesn't currently include the animation-fill-mode: both?

from animxyz.

mattaningram avatar mattaningram commented on September 2, 2024

It's definitely in there, if you manually inspect animated elements that have the xyz classes active you can see it set on the animation property, and you can see it in the code here: https://github.com/ingram-projects/animxyz/blob/master/packages/core/src/_functions.scss

Another thing I'm noticing on your site is the xyz classes aren't being removed when the animation is over they way they should be. Probably also related to the static site HTML being hydrated.

Hmmm just looked at your <head> element and it appears to have a few <style> tags with AnimXYZ compiled CSS but strangely not all the CSS? Is your Nuxt build trying to optimize loaded CSS to only show "above the fold" styles and asynchronously load the rest after?

from animxyz.

Sananes avatar Sananes commented on September 2, 2024

@mattaningram so I disabled ssr globally on my build and that seems to have fixed the issue. Although, i don't particularily want to disable ssr for it to work. It would be great to have it work with ssr set to true. I'm not too sure how I would go about that. Whe n I set ssr to false i get the same issue found here:

Hello, when I compile my Nuxt app in static mode (nuxt generate), the XyzTransition and XyzTransitionGroup elements are compiled to xyztransition and xyztransitiongroup, which are not valid HTML, causing an hydration error in dev mode and a "Failed to execute 'appendChild' on 'Node'" error when serving the compiled project with a static web server.
#38

from animxyz.

Sananes avatar Sananes commented on September 2, 2024

Here's some context too:
image

from animxyz.

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.