Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'web/html/xui/component')
-rw-r--r--web/html/xui/component/themeSwitch.html9
1 files changed, 8 insertions, 1 deletions
diff --git a/web/html/xui/component/themeSwitch.html b/web/html/xui/component/themeSwitch.html
index 191632c1..28fe3e11 100644
--- a/web/html/xui/component/themeSwitch.html
+++ b/web/html/xui/component/themeSwitch.html
@@ -1,6 +1,6 @@
{{define "component/themeSwitchTemplate"}}
<template>
- <a-menu :theme="themeSwitcher.currentTheme" mode="inline" selected-keys="">
+ <a-menu class="change-theme" :theme="themeSwitcher.currentTheme" mode="inline" selected-keys="">
<a-menu-item mode="inline" class="ant-menu-theme-switch">
<a-icon type="bulb" :theme="themeSwitcher.isDarkTheme ? 'filled' : 'outlined'"></a-icon>
<a-switch size="small" :default-checked="themeSwitcher.isDarkTheme" @change="themeSwitcher.toggleTheme()"></a-switch>
@@ -57,6 +57,13 @@
getContainer: () => document.getElementById('message')
});
document.getElementById('message').className = themeSwitcher.currentTheme;
+ const themeAnimations = document.querySelector('.change-theme');
+ themeAnimations.addEventListener('mousedown', () => {
+ document.documentElement.setAttribute('data-theme-animations', 'off');
+ });
+ themeAnimations.addEventListener('mouseleave', () => {
+ document.documentElement.removeAttribute('data-theme-animations');
+ });
}
});
</script>