Compare commits

..

3 Commits

Author SHA1 Message Date
xiaoxian521
98b863704a chore: update 2025-12-16 10:51:01 +08:00
xiaoxian521
cdd1b1270c chore: update 2025-12-16 10:07:11 +08:00
xiaoxian521
8bc3f5686c feat: layout右上角的操作按钮添加动效 2025-12-15 17:42:11 +08:00
12 changed files with 112 additions and 129 deletions

View File

@@ -55,9 +55,6 @@ panel:
pureTagsStyleCardTip: Card tags for efficient browsing
pureTagsStyleChrome: Chrome
pureTagsStyleChromeTip: Chrome style is classic and elegant
pureFullScreenWatermark: FullScreen Watermark
pureEnableWatermark: Watermark
pureWatermarkText: Text
pureInterfaceDisplay: Interface Display
pureGreyModel: Grey Model
pureWeakModel: Weak Model

View File

@@ -55,9 +55,6 @@ panel:
pureTagsStyleCardTip: 卡片标签,高效浏览
pureTagsStyleChrome: 谷歌
pureTagsStyleChromeTip: 谷歌风格,经典美观
pureFullScreenWatermark: 全屏水印
pureEnableWatermark: 水印
pureWatermarkText: 文本
pureInterfaceDisplay: 界面显示
pureGreyModel: 灰色模式
pureWeakModel: 色弱模式

View File

@@ -53,9 +53,11 @@ const { t, locale, translationCh, translationEn } = useTranslationLang();
<LaySearch id="header-search" />
<!-- 国际化 -->
<el-dropdown id="header-translation" trigger="click">
<GlobalizationIcon
class="navbar-bg-hover w-[40px] h-[48px] p-[11px] cursor-pointer outline-hidden"
/>
<div
class="globalization-icon navbar-bg-hover hover:[&>svg]:animate-scale-bounce"
>
<IconifyIconOffline :icon="GlobalizationIcon" />
</div>
<template #dropdown>
<el-dropdown-menu class="translation">
<el-dropdown-item
@@ -113,7 +115,7 @@ const { t, locale, translationCh, translationEn } = useTranslationLang();
</template>
</el-dropdown>
<span
class="set-icon navbar-bg-hover"
class="set-icon navbar-bg-hover hover:[&>svg]:animate-scale-bounce"
:title="t('buttons.pureOpenSystemSet')"
@click="onPanel"
>

View File

@@ -3,15 +3,12 @@ import { useI18n } from "vue-i18n";
import { ref, computed } from "vue";
import { noticesData } from "./data";
import NoticeList from "./components/NoticeList.vue";
import BellIcon from "~icons/ep/bell";
import BellIcon from "~icons/lucide/bell";
const { t } = useI18n();
const noticesNum = ref(0);
const notices = ref(noticesData);
const activeKey = ref(noticesData[0]?.key);
notices.value.map(v => (noticesNum.value += v.list.length));
const getLabel = computed(
() => item =>
t(item.name) + (item.list.length > 0 ? `(${item.list.length})` : "")
@@ -21,14 +18,9 @@ const getLabel = computed(
<template>
<el-dropdown trigger="click" placement="bottom-end">
<span
:class="[
'dropdown-badge',
'navbar-bg-hover',
'select-none',
Number(noticesNum) !== 0 && 'mr-[10px]'
]"
:class="['dropdown-badge', 'navbar-bg-hover', 'select-none', 'mr-[7px]']"
>
<el-badge :value="Number(noticesNum) === 0 ? '' : noticesNum" :max="99">
<el-badge is-dot>
<span class="header-notice-icon">
<IconifyIconOffline :icon="BellIcon" />
</span>
@@ -65,6 +57,34 @@ const getLabel = computed(
</template>
<style lang="scss" scoped>
/* ”铃铛“摇晃衰减动画 */
@keyframes pure-bell-ring {
0%,
100% {
transform-origin: top;
}
15% {
transform: rotateZ(10deg);
}
30% {
transform: rotateZ(-10deg);
}
45% {
transform: rotateZ(5deg);
}
60% {
transform: rotateZ(-5deg);
}
75% {
transform: rotateZ(2deg);
}
}
.dropdown-badge {
display: flex;
align-items: center;
@@ -74,7 +94,13 @@ const getLabel = computed(
cursor: pointer;
.header-notice-icon {
font-size: 18px;
font-size: 16px;
}
&:hover {
.header-notice-icon svg {
animation: pure-bell-ring 1s both;
}
}
}

View File

@@ -11,7 +11,7 @@ function handleSearch() {
<template>
<div>
<div
class="search-container w-[40px] h-[48px] flex-c cursor-pointer navbar-bg-hover"
class="search-container w-[40px] h-[48px] flex-c cursor-pointer navbar-bg-hover hover:[&>svg]:animate-scale-bounce"
@click="handleSearch"
>
<IconifyIconOffline icon="ri/search-line" />

View File

@@ -9,14 +9,6 @@ import {
onUnmounted,
onBeforeMount
} from "vue";
import {
useDark,
debounce,
isNumber,
useGlobal,
isAllEmpty,
useWatermark
} from "@pureadmin/utils";
import { useI18n } from "vue-i18n";
import { emitter } from "@/utils/mitt";
import LayPanel from "../lay-panel/index.vue";
@@ -25,6 +17,7 @@ import { useAppStoreHook } from "@/store/modules/app";
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
import Segmented, { type OptionsType } from "@/components/ReSegmented";
import { useDataThemeChange } from "@/layout/hooks/useDataThemeChange";
import { useDark, useGlobal, debounce, isNumber } from "@pureadmin/utils";
import Check from "~icons/ep/check";
import LeftArrow from "~icons/ri/arrow-left-s-line?width=20&height=20";
@@ -34,9 +27,8 @@ import DarkIcon from "@/assets/svg/dark.svg?component";
import SystemIcon from "@/assets/svg/system.svg?component";
const { t } = useI18n();
const { device } = useNav();
const { isDark } = useDark();
const { device, title } = useNav();
const { setWatermark, clear } = useWatermark();
const { $storage } = useGlobal<GlobalPropertiesApi>();
const mixRef = ref();
@@ -66,12 +58,6 @@ const markValue = ref($storage.configure?.showModel ?? "smart");
const logoVal = ref($storage.configure?.showLogo ?? true);
/** WIP... */
const watermarkConfigs = reactive({
enable: false,
text: null
});
const settings = reactive({
greyVal: $storage.configure.grey,
weakVal: $storage.configure.weak,
@@ -143,21 +129,6 @@ function onChange({ option }) {
emitter.emit("tagViewsShowModel", value);
}
function onWatermarkSwitchChange(value) {
const text = isAllEmpty(watermarkConfigs.text)
? title.value
: watermarkConfigs.text;
if (value) {
setWatermark(text);
} else {
clear();
}
}
function onWatermarkInputChange(value) {
setWatermark(value);
}
/** 侧边栏Logo */
function logoChange() {
unref(logoVal)
@@ -476,39 +447,30 @@ onUnmounted(() => removeMatchMedia);
@change="onChange"
/>
<p class="mt-5! font-medium text-sm dark:text-white">
{{ t("panel.pureFullScreenWatermark") }}
</p>
<ul class="setting">
<li>
<span class="dark:text-white">
{{ t("panel.pureEnableWatermark") }}
</span>
<el-switch
v-model="watermarkConfigs.enable"
inline-prompt
:active-text="t('buttons.pureOpenText')"
:inactive-text="t('buttons.pureCloseText')"
@change="onWatermarkSwitchChange"
/>
</li>
<li>
<span class="dark:text-white">
{{ t("panel.pureWatermarkText") }}
</span>
<el-input
v-model="watermarkConfigs.text"
class="w-[100px]!"
:placeholder="title"
@input="onWatermarkInputChange"
/>
</li>
</ul>
<p class="mt-5! font-medium text-sm dark:text-white">
{{ t("panel.pureInterfaceDisplay") }}
</p>
<ul class="setting">
<li>
<span class="dark:text-white">{{ t("panel.pureGreyModel") }}</span>
<el-switch
v-model="settings.greyVal"
inline-prompt
:active-text="t('buttons.pureOpenText')"
:inactive-text="t('buttons.pureCloseText')"
@change="greyChange"
/>
</li>
<li>
<span class="dark:text-white">{{ t("panel.pureWeakModel") }}</span>
<el-switch
v-model="settings.weakVal"
inline-prompt
:active-text="t('buttons.pureOpenText')"
:inactive-text="t('buttons.pureCloseText')"
@change="weekChange"
/>
</li>
<li>
<span class="dark:text-white">{{ t("panel.pureHiddenTags") }}</span>
<el-switch
@@ -529,18 +491,6 @@ onUnmounted(() => removeMatchMedia);
@change="hideFooterChange"
/>
</li>
<li>
<span class="dark:text-white">
{{ t("panel.pureMultiTagsCache") }}
</span>
<el-switch
v-model="settings.multiTagsCache"
inline-prompt
:active-text="t('buttons.pureOpenText')"
:inactive-text="t('buttons.pureCloseText')"
@change="multiTagsCacheChange"
/>
</li>
<li>
<span class="dark:text-white">Logo</span>
<el-switch
@@ -554,23 +504,15 @@ onUnmounted(() => removeMatchMedia);
/>
</li>
<li>
<span class="dark:text-white">{{ t("panel.pureGreyModel") }}</span>
<span class="dark:text-white">
{{ t("panel.pureMultiTagsCache") }}
</span>
<el-switch
v-model="settings.greyVal"
v-model="settings.multiTagsCache"
inline-prompt
:active-text="t('buttons.pureOpenText')"
:inactive-text="t('buttons.pureCloseText')"
@change="greyChange"
/>
</li>
<li>
<span class="dark:text-white">{{ t("panel.pureWeakModel") }}</span>
<el-switch
v-model="settings.weakVal"
inline-prompt
:active-text="t('buttons.pureOpenText')"
:inactive-text="t('buttons.pureCloseText')"
@change="weekChange"
@change="multiTagsCacheChange"
/>
</li>
</ul>

View File

@@ -83,9 +83,11 @@ onMounted(() => {
<LaySearch id="header-search" />
<!-- 国际化 -->
<el-dropdown id="header-translation" trigger="click">
<GlobalizationIcon
class="navbar-bg-hover w-[40px] h-[48px] p-[11px] cursor-pointer outline-hidden"
/>
<div
class="globalization-icon navbar-bg-hover hover:[&>svg]:animate-scale-bounce"
>
<IconifyIconOffline :icon="GlobalizationIcon" />
</div>
<template #dropdown>
<el-dropdown-menu class="translation">
<el-dropdown-item
@@ -141,7 +143,7 @@ onMounted(() => {
</template>
</el-dropdown>
<span
class="set-icon navbar-bg-hover"
class="set-icon navbar-bg-hover hover:[&>svg]:animate-scale-bounce"
:title="t('buttons.pureOpenSystemSet')"
@click="onPanel"
>

View File

@@ -104,9 +104,11 @@ watch(
<LaySearch id="header-search" />
<!-- 国际化 -->
<el-dropdown id="header-translation" trigger="click">
<GlobalizationIcon
class="navbar-bg-hover w-[40px] h-[48px] p-[11px] cursor-pointer outline-hidden"
/>
<div
class="globalization-icon navbar-bg-hover hover:[&>svg]:animate-scale-bounce"
>
<IconifyIconOffline :icon="GlobalizationIcon" />
</div>
<template #dropdown>
<el-dropdown-menu class="translation">
<el-dropdown-item
@@ -162,7 +164,7 @@ watch(
</template>
</el-dropdown>
<span
class="set-icon navbar-bg-hover"
class="set-icon navbar-bg-hover hover:[&>svg]:animate-scale-bounce"
:title="t('buttons.pureOpenSystemSet')"
@click="onPanel"
>

View File

@@ -24,7 +24,10 @@ watch(
</script>
<template>
<span class="fullscreen-icon navbar-bg-hover" @click="toggle">
<span
class="fullscreen-icon navbar-bg-hover hover:[&>svg]:animate-scale-bounce"
@click="toggle"
>
<IconifyIconOffline :icon="screenIcon" />
</span>
</template>

View File

@@ -35,3 +35,18 @@
.html-weakness {
filter: invert(80%);
}
/* 轻微缩小,再恢复原状的平滑缩放动画 */
@keyframes pure-scale-bounce {
0% {
transform: scale(1);
}
50% {
transform: scale(0.9);
}
100% {
transform: scale(1);
}
}

View File

@@ -34,12 +34,14 @@
}
.set-icon,
.fullscreen-icon {
.fullscreen-icon,
.globalization-icon {
display: flex;
align-items: center;
justify-content: center;
width: 40px;
height: 48px;
font-size: 16px;
cursor: pointer;
}
@@ -449,7 +451,7 @@
/* 搜索 */
.search-container,
/* 国际化 */
.globalization,
.globalization-icon,
/* 全屏 */
.fullscreen-icon,
/* 消息通知 */
@@ -468,15 +470,6 @@
color: var(--pure-theme-sub-menu-active-text);
}
.globalization {
width: 40px;
height: 48px;
padding: 11px;
color: var(--pure-theme-sub-menu-active-text);
cursor: pointer;
outline: none;
}
.el-dropdown-link {
display: flex;
align-items: center;
@@ -630,7 +623,7 @@ body[layout="vertical"] {
/* 搜索 */
.search-container,
/* 国际化 */
.globalization,
.globalization-icon,
/* 全屏 */
.fullscreen-icon,
/* 消息通知 */

View File

@@ -44,3 +44,7 @@
@utility navbar-bg-hover {
@apply dark:text-white dark:hover:bg-[#242424]!;
}
@utility animate-scale-bounce {
animation: pure-scale-bounce 0.3s ease-in-out;
}