xh321 / LiteLoaderQQNT-Background-Plugin

LiteLoaderQQNT 插件 - QQNT自动轮换背景图
MIT License
79 stars 4 forks source link

[Enhancement] 希望增加背景切换过渡 #3

Closed festoney8 closed 1 year ago

festoney8 commented 1 year ago

https://github.com/xh321/BetterQQNT-Background-Plugin/blob/76f1356a8b4b4ef33ef7265f7017d3d600f45a2d/renderer.js#L136-L139

个人测试了如下transition,平滑切换的感觉不错

    document.documentElement.style.setProperty(
      "background",
      `url("appimg://${imgUrl}") no-repeat center / cover fixed`
    );
    document.documentElement.style.setProperty(
      "transition",
      "background-image 1.5s ease-in-out"
    );

ps. 项目源码中 --background-image-url 我不清楚是哪里的属性,无法给它添加transition,所以改用了标准background

xh321 commented 1 year ago

背景在下面css的#app::before里设置的,现已加上你提供的代码,效果不错,非常感谢。等下就推送。