Enhance App.vue and ImageViewer.vue for improved styling and animation handling

- Added a custom variant for dark mode in App.vue to support Tailwind v4 features.
- Simplified the onEnter function in ImageViewer.vue by removing the done parameter, allowing Vue to manage CSS animation completion automatically.
This commit is contained in:
AdingApkgg
2025-12-27 00:13:16 +08:00
parent cc4def8b64
commit b8756fc09a
2 changed files with 5 additions and 2 deletions

View File

@@ -555,6 +555,9 @@ function saveSettings(customApi: string, newCustomCSS: string) {
<style>
@import "tailwindcss";
/* Tailwind v4: 配置 dark 变体使用 .dark 类 */
@custom-variant dark (&:where(.dark, .dark *));
/* Ken Burns 动画效果 - 使用 CSS 动画实现更流畅的背景切换 */
.ken-burns {
/* 初始状态 - 稍微放大以便动画有空间 */

View File

@@ -68,9 +68,9 @@ const imageStyle = computed(() => {
})
// 进入动画时播放音效
function onEnter(_el: Element, done: () => void) {
// 不声明 done 参数,让 Vue 自动等待 CSS 动画完成
function onEnter() {
playTransitionUp()
done()
}
// 监听图片切换