|
|
@@ -7,11 +7,12 @@
|
|
|
:aria-label="tip"
|
|
|
@click="switchMode"
|
|
|
>
|
|
|
- <Icon
|
|
|
- :icon="targetIcon"
|
|
|
- :size="targetMode === 'smart' ? 15 : 14"
|
|
|
- :class="{ 'jeesite-workbench-switch__star': targetMode === 'smart' }"
|
|
|
- />
|
|
|
+ <span
|
|
|
+ class="jeesite-workbench-switch__icon"
|
|
|
+ :class="{ 'jeesite-workbench-switch__ai': targetMode === 'smart' }"
|
|
|
+ >
|
|
|
+ <Icon :icon="targetIcon" :size="targetMode === 'smart' ? 16 : 14" />
|
|
|
+ </span>
|
|
|
<span>{{ targetLabel }}</span>
|
|
|
</button>
|
|
|
</Tooltip>
|
|
|
@@ -25,8 +26,8 @@
|
|
|
* - 主窗口(自主)里显示「智能工作台」,点击打开/聚焦独立工作台窗口;
|
|
|
* - 智能窗口(智能)里显示「自主」,点击写偏好并把主窗口拉到前台(不关闭自己)。
|
|
|
*
|
|
|
- * 智能工作台是重点推广的入口,所以只有「去智能」方向用主题色加粗文字 + 红色闪动星标,
|
|
|
- * 不铺背景也能从顶栏的搜索/下载/设置里区分出来;「回自主」是退路,仍保持灰色文字按钮,
|
|
|
+ * 智能工作台是重点推广的入口,所以只有「去智能」方向用实心主题色底 + AI 机器人图标,
|
|
|
+ * 在顶栏搜索/下载/设置等浅色图标之间一眼就能看到;「回自主」是退路,仍保持灰色文字按钮,
|
|
|
* 两个方向都强调会互相抢焦点。用途靠 Tooltip 说明,避免只看到一个模式名不知道点下去会发生什么。
|
|
|
*/
|
|
|
import { computed } from 'vue';
|
|
|
@@ -52,7 +53,7 @@
|
|
|
const targetMode = computed<WorkbenchMode>(() => (mode.value === 'smart' ? 'traditional' : 'smart'));
|
|
|
const targetLabel = computed(() => (targetMode.value === 'smart' ? '智能工作台' : '自主'));
|
|
|
const targetIcon = computed(() =>
|
|
|
- targetMode.value === 'smart' ? 'i-mdi:star-four-points' : 'i-mdi:view-dashboard-outline',
|
|
|
+ targetMode.value === 'smart' ? 'i-mdi:robot-outline' : 'i-mdi:view-dashboard-outline',
|
|
|
);
|
|
|
|
|
|
/** 提示写「点下去会发生什么」,而不是重复按钮上的模式名 */
|
|
|
@@ -77,6 +78,7 @@
|
|
|
padding: 0 8px;
|
|
|
font-size: 12.5px;
|
|
|
font-weight: 500;
|
|
|
+
|
|
|
/* 显式取文字色:布局壳给顶栏设过 color:#fff,继承下来会白字白底看不见 */
|
|
|
color: @text-color-secondary;
|
|
|
white-space: nowrap;
|
|
|
@@ -90,131 +92,153 @@
|
|
|
|
|
|
&:hover {
|
|
|
color: @text-color-base;
|
|
|
- background: rgba(0, 0, 0, 0.045);
|
|
|
+ background: rgb(0 0 0 / 4.5%);
|
|
|
}
|
|
|
|
|
|
&:active {
|
|
|
- background: rgba(0, 0, 0, 0.065);
|
|
|
+ background: rgb(0 0 0 / 6.5%);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/* 顶栏主题为深色(菜单配色选择深色)时反白 */
|
|
|
.app-topbar--dark .@{prefix-cls} {
|
|
|
- color: rgba(255, 255, 255, 0.75);
|
|
|
+ color: rgb(255 255 255 / 75%);
|
|
|
|
|
|
&:hover {
|
|
|
color: #fff;
|
|
|
- background: rgba(255, 255, 255, 0.1);
|
|
|
+ background: rgb(255 255 255 / 10%);
|
|
|
}
|
|
|
|
|
|
&:active {
|
|
|
- background: rgba(255, 255, 255, 0.14);
|
|
|
+ background: rgb(255 255 255 / 14%);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
html[data-theme='dark'] .@{prefix-cls} {
|
|
|
- color: rgba(255, 255, 255, 0.72);
|
|
|
+ color: rgb(255 255 255 / 72%);
|
|
|
|
|
|
&:hover {
|
|
|
color: #fff;
|
|
|
- background: rgba(255, 255, 255, 0.1);
|
|
|
+ background: rgb(255 255 255 / 10%);
|
|
|
}
|
|
|
|
|
|
&:active {
|
|
|
- background: rgba(255, 255, 255, 0.14);
|
|
|
+ background: rgb(255 255 255 / 14%);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/* ===== 重点入口:去「智能工作台」方向 =====
|
|
|
- 描边按钮:不铺底色(顶栏保持干净),靠主题色文字/描边 + 红色闪动星标拉出层次;
|
|
|
- 微动画只做「悬停轻抬 + 投影、按下回弹、星标加速闪烁」,不改变布局。
|
|
|
+ 实心主题色按钮:顶栏其余动作都是浅色图标/文字,只有它铺满主题色 + 白色 AI 图标与加粗文字。
|
|
|
+ 动效只做一件事:机器人图标无规律地轻微跳动,像在「待命」,不铺任何外发光或光晕;
|
|
|
+ 悬停轻抬增亮,按下回弹。prefers-reduced-motion 下停用图标动画。
|
|
|
放在深色/暗色规则之后,靠源码顺序覆盖它们(同特异性后者生效),
|
|
|
- 深色场景单独补一遍 hover/active 选择器,保证特异性不输给上面的反白规则。 */
|
|
|
+ 深色场景单独补一遍 hover/active,保证特异性不输给上面的反白规则。 */
|
|
|
.@{prefix-cls}--primary {
|
|
|
+ gap: 6px;
|
|
|
padding: 0 12px;
|
|
|
font-size: 13px;
|
|
|
font-weight: 600;
|
|
|
- color: @primary-color;
|
|
|
- background: transparent;
|
|
|
- border: 1px solid fade(@primary-color, 45%);
|
|
|
- border-radius: 6px;
|
|
|
+ letter-spacing: 0.02em;
|
|
|
+ color: #fff;
|
|
|
+ background: @primary-color;
|
|
|
+ border: none;
|
|
|
+ border-radius: 7px;
|
|
|
+ box-shadow: 0 2px 8px fade(@primary-color, 34%);
|
|
|
transition:
|
|
|
- color 0.2s ease-out,
|
|
|
- border-color 0.2s ease-out,
|
|
|
+ background 0.15s ease-out,
|
|
|
box-shadow 0.2s ease-out,
|
|
|
transform 0.2s ease-out;
|
|
|
|
|
|
&:hover {
|
|
|
- color: darken(@primary-color, 8%);
|
|
|
- background: transparent;
|
|
|
- border-color: @primary-color;
|
|
|
- box-shadow: 0 2px 8px fade(@primary-color, 20%);
|
|
|
+ color: #fff;
|
|
|
+ background: darken(@primary-color, 6%);
|
|
|
+ box-shadow: 0 4px 14px fade(@primary-color, 42%);
|
|
|
transform: translateY(-1px);
|
|
|
}
|
|
|
|
|
|
&:active {
|
|
|
- color: darken(@primary-color, 14%);
|
|
|
- background: transparent;
|
|
|
- box-shadow: none;
|
|
|
+ color: #fff;
|
|
|
+ background: darken(@primary-color, 10%);
|
|
|
+ box-shadow: 0 1px 4px fade(@primary-color, 35%);
|
|
|
transform: translateY(0) scale(0.98);
|
|
|
}
|
|
|
|
|
|
/* 键盘聚焦才出环,鼠标点击不出现,避免顶栏上留一圈蓝边 */
|
|
|
&:focus-visible {
|
|
|
- outline: 2px solid fade(@primary-color, 40%);
|
|
|
+ outline: 2px solid fade(@primary-color, 45%);
|
|
|
outline-offset: 2px;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /* 红色星标 + 缓速闪烁:页面静止时也能被余光扫到;悬停时闪得更快,给出"可点"的反馈 */
|
|
|
- .@{prefix-cls}__star {
|
|
|
- color: @error-color;
|
|
|
- transform-origin: center;
|
|
|
- animation: workbench-star-twinkle 2.4s ease-in-out infinite;
|
|
|
+ /* 机器人图标包裹层:inline-flex 保证 transform 生效(inline 元素不接受 transform) */
|
|
|
+ .@{prefix-cls}__icon {
|
|
|
+ display: inline-flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ line-height: 1;
|
|
|
}
|
|
|
|
|
|
- .@{prefix-cls}--primary:hover .@{prefix-cls}__star {
|
|
|
- animation-duration: 1.1s;
|
|
|
+ /* 机器人图标:慢速全方位漂浮,像在失重太空里持续漂着。
|
|
|
+ 两个动画作用于不同属性(translate 漂移 + rotate 摇摆),周期 3.8s 与 5.4s 互质,
|
|
|
+ 组合轨迹每次循环都不重样,不会有机械的「来回弹」感;悬停不改变节奏 */
|
|
|
+ .@{prefix-cls}__ai {
|
|
|
+ animation:
|
|
|
+ workbench-robot-drift 3.8s ease-in-out infinite,
|
|
|
+ workbench-robot-tilt 5.4s ease-in-out infinite;
|
|
|
}
|
|
|
|
|
|
- @keyframes workbench-star-twinkle {
|
|
|
+ /* 漂移路径:中心 → 右上 → 左上 → 左下 → 回中,每段 ease-in-out,转向柔和 */
|
|
|
+ @keyframes workbench-robot-drift {
|
|
|
0%,
|
|
|
100% {
|
|
|
- transform: scale(1) rotate(0deg);
|
|
|
- opacity: 0.9;
|
|
|
+ translate: 0 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ 25% {
|
|
|
+ translate: 2px -2.5px;
|
|
|
}
|
|
|
|
|
|
50% {
|
|
|
- transform: scale(1.18) rotate(12deg);
|
|
|
- opacity: 1;
|
|
|
+ translate: -1.5px -3px;
|
|
|
+ }
|
|
|
+
|
|
|
+ 75% {
|
|
|
+ translate: -2.5px -0.5px;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- .app-topbar--dark .@{prefix-cls}--primary {
|
|
|
- color: lighten(@primary-color, 22%);
|
|
|
- border-color: fade(lighten(@primary-color, 22%), 45%);
|
|
|
+ /* 摇摆:与漂移无关的慢速左右倾角,叠加出失重感 */
|
|
|
+ @keyframes workbench-robot-tilt {
|
|
|
+ 0%,
|
|
|
+ 100% {
|
|
|
+ rotate: 0deg;
|
|
|
+ }
|
|
|
|
|
|
- &:hover {
|
|
|
- color: lighten(@primary-color, 32%);
|
|
|
- border-color: lighten(@primary-color, 32%);
|
|
|
+ 33% {
|
|
|
+ rotate: 3deg;
|
|
|
}
|
|
|
|
|
|
- &:active {
|
|
|
- color: lighten(@primary-color, 38%);
|
|
|
+ 66% {
|
|
|
+ rotate: -2.5deg;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /* 深色顶栏 / 暗色主题:底色同样偏深,改用更亮的纯色蓝并加强外投影,避免按钮「沉」下去 */
|
|
|
+ .app-topbar--dark .@{prefix-cls}--primary,
|
|
|
html[data-theme='dark'] .@{prefix-cls}--primary {
|
|
|
- color: lighten(@primary-color, 22%);
|
|
|
- border-color: fade(lighten(@primary-color, 22%), 45%);
|
|
|
+ color: #fff;
|
|
|
+ background: #4a6cff;
|
|
|
+ box-shadow: 0 2px 12px rgb(0 0 0 / 38%);
|
|
|
|
|
|
&:hover {
|
|
|
- color: lighten(@primary-color, 32%);
|
|
|
- border-color: lighten(@primary-color, 32%);
|
|
|
+ color: #fff;
|
|
|
+ background: #5c7aff;
|
|
|
+ box-shadow: 0 4px 18px rgb(0 0 0 / 42%);
|
|
|
}
|
|
|
|
|
|
&:active {
|
|
|
- color: lighten(@primary-color, 38%);
|
|
|
+ color: #fff;
|
|
|
+ background: #3a5cf0;
|
|
|
}
|
|
|
}
|
|
|
</style>
|