跳过导航
A really cool feature of the View Transitions API (available now in stable Chrome!) is that videos…
0:00 / 0:32

A really cool feature of the View Transitions API (available now in stable Chrome!) is that videos…

Maxi Ferreira

@charca4501 位关注者

在 X 上查看
2,662 个赞下载原帖

351,335 次观看

A really cool feature of the View Transitions API (available now in stable Chrome!) is that videos and animations on the new view continue to play smoothly while transitioning. With a bit of extra JavaScript, you can even do this with elements shared across different routes ✨

10 条评论

评论来自 X (Twitter) 上的原帖

  • Maxi Ferreira 的头像

    @charca

    Like previous demos, this is an @astrodotbuild site using the Navigation API as a client-side router. On non-Chrome browsers it works as a regular MPA. Demo and source 👉🏽 Big thanks to @jaffathecake for the tip on how to do the smooth video transition.

    51 个赞

  • Maxi Ferreira 的头像

    @charca

    Full credits for the UI go to designer Ehsan Rahimi 🙏 Their wonderful Dribbble shot was what inspired this demo

    19 个赞

  • Jake Archibald 的头像

    @jaffathecake

    For folks following along, here's how to do it:

    57 个赞

  • Joe Previte 的头像

    @jsjoeio

    holy cow, this is so smooth! is this repo open source?

    18 个赞

  • Maxi Ferreira 的头像

    @charca

    Yes! You can play with the demo here as well (need to use latest Chrome)

    109 个赞

  • Jake Ruesink 的头像

    @_jakeCodes

    Would be really cool to see a demo video of how this API works. @wesbos or @stolinski maybe? Or a good segment for @syntaxfm at least. Who else does good demos that should see this?

    9 个赞

  • Steren 的头像

    @steren

    Wow, I thought the View Transition API was allowing to manipulate a *static screenshot* of the old and new view. But it's actually not static? Game changer.

    2 个赞

  • Una 🇺🇦 的头像

    @Una

    Nice demo!

    2 个赞

  • Maxi Ferreira 的头像

    @charca

    Thanks, Una! 🙌🏽

    3 个赞

  • Ben Holmes 的头像

    @BHolmesDev

    Your view transition demos keep getting cooler 😮

    2 个赞