lxchapu / astro-gyoza

A simple and cute static blog template built with Astro and React.🥟🥟🥟
https://gyoza.lxchapu.com
MIT License
73 stars 32 forks source link

建议:替代 `astro:transitions` 并更新主题设置脚本 #15

Closed EveSunMaple closed 1 month ago

EveSunMaple commented 2 months ago

在使用 astro:transitions 进行页面跳转时,鼠标指针会出现莫名的抽搐,具体详见:https://github.com/EveSunMaple/Frosti/issues/16

而且很明显的,在黑夜模式下刷新您的网站,会出现一瞬间白屏的闪烁。

建议:

  1. 不使用 astro:transitions 而是使用 'Swup' ,这个方案同时也被 fuwari 所采用
  2. 把设置主题的脚本设置为 inline ,避免闪烁

不仅我的主题遇到了此问题,使用 astro:transitions 的主题几乎(也许有些我没有看到)都存在鼠标指针抽搐的问题,这也许是一个比较好的解决方案,可以提供更好的路由切换效果

可能需要修改的文件:

  1. astro-gyoza/src/layouts /Layout.astro
  2. astro-gyoza/src/utils /theme.ts

最后,作者的主题很好看,希望更好 🎉

lxchapu commented 2 months ago

事实上这个问题也在困扰着我,我曾经做过这方面的工作,问题没有办法完美解决。

我会按照你的提议尝试进行修改,十分感谢你(^▽^)

lxchapu commented 1 month ago

已经使用 Swup 代替 astro:transitions