mirror of
https://github.com/Moe-Sakura/frontend.git
synced 2026-05-07 00:15:56 +08:00
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:
@@ -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 {
|
||||
/* 初始状态 - 稍微放大以便动画有空间 */
|
||||
|
||||
@@ -68,9 +68,9 @@ const imageStyle = computed(() => {
|
||||
})
|
||||
|
||||
// 进入动画时播放音效
|
||||
function onEnter(_el: Element, done: () => void) {
|
||||
// 不声明 done 参数,让 Vue 自动等待 CSS 动画完成
|
||||
function onEnter() {
|
||||
playTransitionUp()
|
||||
done()
|
||||
}
|
||||
|
||||
// 监听图片切换
|
||||
|
||||
Reference in New Issue
Block a user