Astro View Transitions (3.0 Release!)

Поделиться
HTML-код
  • Опубликовано: 16 дек 2024

Комментарии • 42

  • @GeorgeDonnelly
    @GeorgeDonnelly Год назад +3

    Thanks for demoing this, good stuff!

  • @gabrielkime6597
    @gabrielkime6597 Год назад +2

    You skipped over the animation customization options, but do you know how you would define your own keyframes for you own custom animations? In the view transitions api its done in css, but I'm not seeing it explained in the astro docs how it should be done here.

    • @CodinginPublic
      @CodinginPublic  Год назад +1

      Yes! Just standard CSS animations. That’s what the browser does. Astro just gives you a few presets to make it easier, but there are a few examples in the docs I scrolled through that should help.

  • @MrJfergs
    @MrJfergs 6 месяцев назад

    Considering this feature is only supported by chromium browsers, wpuld it be worth it to use this in prod or just use js libraries to do route transitions still?

    • @CodinginPublic
      @CodinginPublic  6 месяцев назад

      Astro has fallbacks for the other browsers, so you can use it in production! Other browsers will get a normal transition.

  • @sergi3629
    @sergi3629 Год назад +1

    What could cause my image to not transition like in the video? I am doing exactly the same on a very simple page, yet the image just fades like the rest of the content.

    • @sergi3629
      @sergi3629 Год назад

      For anyone having the same issue, for some reason, in my case, this just works using a regular img tag, not the Image component.

    • @CodinginPublic
      @CodinginPublic  Год назад

      Hmm. Not sure? I’d have to see the code. You’ve added transition names for both?

    • @sergi3629
      @sergi3629 Год назад

      @@CodinginPublic Yea, it just works on a regular img tag not the Image component. Also just on Chrome, not Firefox. Last version of Astro, could be an outdated browser maybe...

    • @user1-hb7hm
      @user1-hb7hm Год назад

      Hello, i have the same problem. Did you maybe find the solution ? @@sergi3629

  • @ivanzar7
    @ivanzar7 Год назад

    i already have a template, this one use wow, is there anyway to made this cool transitions works on this case? Thanks!

    • @CodinginPublic
      @CodinginPublic  11 месяцев назад

      Yep! Just add that ViewTransitions component to a shared head!

  • @TheDonHatim
    @TheDonHatim Год назад +1

    Is it possible to work with Astro for e-commerce apps? Can the framework handle functionalities like upselling and cross-selling, or should I stick with Next.js?

    • @CodinginPublic
      @CodinginPublic  Год назад

      It’s definitely possible, but IMO, I think you’ll have a smoother experience with Next right now still. That being said, there are some theme examples in Astro built for e-commerce that you can check out. Depending on your needs, I think Astro could meet your needs? But thinking Next would edge out Astro for more complex e-commerce because the ecosystem around next is built out a lot more for that kind of stuff.

  • @KokaSnow
    @KokaSnow 8 месяцев назад

    Thanks man, for the issue with the dark mode, i wasted a lot of time triying to fixing.

  • @ycemilk
    @ycemilk Год назад +5

    Unremarkable content! Thank ya, you're fast as light in space

    • @CodinginPublic
      @CodinginPublic  Год назад +1

      So glad you found it useful!

    • @ycemilk
      @ycemilk Год назад

      @@CodinginPublic please how can I find your contents useless

    • @Trazynn
      @Trazynn 9 месяцев назад

      You just said it was unremarkable.

  • @IainSimmons
    @IainSimmons Год назад +1

    Great stuff! Excited to try this out.
    Just curious, can you force the full page reload for, say, all links ending in .pdf or something like that?

    • @CodinginPublic
      @CodinginPublic  Год назад +1

      Thanks, Iain! I don’t think so? I wonder if it's possible for Astro to always do a full page reload for anything at the root of your site? That way you don't have to remember to do that? But I'm sure it's edge-cases all the way down and making universal choices like that would cause a bunch of problems.

    • @IainSimmons
      @IainSimmons Год назад

      @@CodinginPublic maybe I should try make an extension or a PR to configure it, but it would probably take some thorough knowledge of the source code

  • @johanedlund5642
    @johanedlund5642 8 часов назад

    Safari 18.2 adds support for cross-document View Transitions.

  • @OverSimplifiedHQ
    @OverSimplifiedHQ Год назад

    I use Astrowind with V3 but can't seem to find where to fix the set theme do you know?

    • @CodinginPublic
      @CodinginPublic  Год назад

      Looking quickly at the code, looks like it's in the BasicScripts.astro file here: github.com/onwidget/astrowind/blob/main/src/components/common/BasicScripts.astro

  • @LukaszAdamOfficial
    @LukaszAdamOfficial Год назад +1

    Any idea if this has any bad effect on SEO?

    • @CodinginPublic
      @CodinginPublic  Год назад

      Someone smarter than me could tell you, but I can’t imagine it would. Each page you land on is a full page refresh the first time and that’s all crawlers would be doing.

    • @LukaszAdamOfficial
      @LukaszAdamOfficial Год назад

      Gotcha, thank you! @@CodinginPublic

    • @dandogamer
      @dandogamer Год назад

      I don't think so, if you use the astro component as well it prevents cumulative layout shift

    • @BobbyBundlez
      @BobbyBundlez 9 месяцев назад

      how would it? def wouldn't effect the ability for google to scrape since the html is still sent to the browser at the same speed. its just an animation bruh.... static is static

  • @xorkingsupernova
    @xorkingsupernova Год назад

    What's the best way to maintain state across routes? Say the count state of a simple React Counter component?

    • @CodinginPublic
      @CodinginPublic  Год назад

      docs.astro.build/en/guides/view-transitions/#maintaining-state

    • @xorkingsupernova
      @xorkingsupernova Год назад

      @@CodinginPublic Didn't work with a React component. Works with video though.

  • @taggosaurus
    @taggosaurus Год назад

    I can't seem to get it work from the first step. It just doesn't animate and my browser supports it as well. Not sure what I'm doing wrong.

    • @CodinginPublic
      @CodinginPublic  Год назад

      Hmm. Here are a few things to check:
      - are you on Astro 3+?
      - is the ViewTransition component in the head of BOTH pages?
      - did you check other browsers to see if it works there?

    • @taggosaurus
      @taggosaurus Год назад

      @@CodinginPublic Yup. Did all of those. Doesn't work for any browser. Found out that my application is still in MPA mode. By default those two lines of change should put me into SPA mode but it doesn't for some reason. Browser refreshes on route change in MPA mode.

    • @taggosaurus
      @taggosaurus Год назад

      @@CodinginPublic I made a layout component and put ViewTransitions inside head of that layout component and shared it to both of those pages.

    • @taggosaurus
      @taggosaurus Год назад

      @@CodinginPublic I looked at your repo, it works fine with my browser. And then I tried a few things on my project. Turns out, simply importing and calling ViewTransitions is not enough - I have to add an anchor tag and click it as well to have it enabled. I cannot simply add two containers with a different color on two different pages and fade into another page with navigation buttons (even though I should) - but when I turn them into anchor tags and style them, with href pointing to each other - I get the desired behaviour. It's still unpredictable though.

  • @immaIz
    @immaIz 9 месяцев назад

    The transitions are very slow, does anyone else have this problem?

    • @CodinginPublic
      @CodinginPublic  9 месяцев назад

      Huh, I haven't experienced this? I'm wondering if the experience is affected by internet speed?