2026-09-12 15:19:13 +08:00
|
|
|
|
<script setup lang="ts">
|
2026-09-12 08:41:08 +08:00
|
|
|
|
import { computed, onMounted, ref } from 'vue';
|
2026-09-12 13:57:46 +08:00
|
|
|
|
import {
|
2026-09-12 15:19:13 +08:00
|
|
|
|
DEFAULT_ISLAND_APPEARANCE,
|
|
|
|
|
|
type IslandAppearance,
|
2026-09-12 13:57:46 +08:00
|
|
|
|
PRIORITY_LABELS,
|
|
|
|
|
|
formatDate,
|
|
|
|
|
|
type IslandNotification,
|
|
|
|
|
|
type IslandNotificationKind,
|
|
|
|
|
|
type IslandState,
|
|
|
|
|
|
} from '@classhelper/shared';
|
2026-09-12 17:41:05 +08:00
|
|
|
|
import { squirclePath } from './squircle.js';
|
2026-09-12 08:41:08 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
2026-09-12 17:41:05 +08:00
|
|
|
|
* 灵动岛渲染进程 —— 视觉与排版参考 WinIsland(Rust/Direct2D 的 Windows 动态岛)。
|
2026-09-12 08:41:08 +08:00
|
|
|
|
*
|
2026-09-12 17:41:05 +08:00
|
|
|
|
* 对齐点(详见 docs/winisland-design-tokens.md):
|
|
|
|
|
|
* - 造型:**连续圆角(超椭圆 squircle)**而不是 border-radius(WinIsland `utils/shape.rs`);
|
|
|
|
|
|
* 展开卡半径取 `min(48 * 圆角系数, w/2, h/2)`,胶囊半径取 `h/2`(满圆角);
|
|
|
|
|
|
* - 底色:默认纯黑(WinIsland `default` 风格),可选亚克力毛玻璃(`glass` → 主进程
|
|
|
|
|
|
* `setBackgroundMaterial('acrylic')`,等价于 WinIsland 的 HostBackdropBrush);
|
|
|
|
|
|
* - 描边:1px 白、alpha 30(纯黑)/ 40(玻璃、主题色),与 WinIsland `BORDER_*_ALPHA` 同值;
|
|
|
|
|
|
* - 阴影:只在展开态,`0 2px 3px rgba(0,0,0,.11)`(WinIsland `draw_expanded_shadow`);
|
|
|
|
|
|
* - 排版:白字 + alpha 分级(.92/.72/.58),**所有文本 = 基础字号 × 排版系数**,
|
|
|
|
|
|
* 因此「字号」设置一改,岛内文字整体等比缩放(WinIsland `font_size` 模型);
|
|
|
|
|
|
* - 动效:单调缓动(无过冲、无回弹),只有淡入淡出与窗口形变,符合"开合不震动"。
|
|
|
|
|
|
*
|
|
|
|
|
|
* 窗口尺寸仍由主进程按状态缓动(见 src/main/island.ts),渲染进程负责形状、排版与交互回传。
|
2026-09-12 08:41:08 +08:00
|
|
|
|
*/
|
|
|
|
|
|
const state = ref<IslandState>({
|
|
|
|
|
|
mode: 'hidden',
|
|
|
|
|
|
active: null,
|
|
|
|
|
|
queued: [],
|
|
|
|
|
|
inClass: false,
|
|
|
|
|
|
currentPeriodEnd: null,
|
|
|
|
|
|
reason: null,
|
|
|
|
|
|
updatedAt: 0,
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const bridge = window.island;
|
|
|
|
|
|
|
|
|
|
|
|
const notification = computed<IslandNotification | null>(() => state.value.active);
|
|
|
|
|
|
const mode = computed(() => state.value.mode);
|
|
|
|
|
|
const isUrgent = computed(() => notification.value?.priority === 'URGENT');
|
2026-09-12 13:57:46 +08:00
|
|
|
|
const kind = computed<IslandNotificationKind>(() => notification.value?.kind ?? 'notification');
|
|
|
|
|
|
const isCall = computed(() => kind.value === 'call');
|
|
|
|
|
|
const isHomework = computed(() => kind.value === 'homework');
|
2026-09-12 08:41:08 +08:00
|
|
|
|
const queueCount = computed(() => state.value.queued.length);
|
|
|
|
|
|
|
2026-09-12 13:57:46 +08:00
|
|
|
|
/** 胶囊标题:按消息类型区分(新消息 / 新作业 / 叫人) */
|
|
|
|
|
|
const pillTitle = computed(() => {
|
|
|
|
|
|
if (isCall.value) return '老师叫你';
|
|
|
|
|
|
if (isHomework.value) return '新作业';
|
|
|
|
|
|
return isUrgent.value ? '紧急通知' : '新消息';
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
/** 展开态徽标:叫人 / 新作业 / 优先级文案 */
|
|
|
|
|
|
const badgeText = computed(() => {
|
|
|
|
|
|
if (isCall.value) return '叫人';
|
|
|
|
|
|
if (isHomework.value) return '新作业';
|
|
|
|
|
|
return priorityLabel.value;
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const badgeClass = computed(() => {
|
|
|
|
|
|
if (isCall.value) return 'badge-call';
|
|
|
|
|
|
if (isHomework.value) return 'badge-homework';
|
|
|
|
|
|
return `badge-${(notification.value?.priority ?? 'NORMAL').toLowerCase()}`;
|
|
|
|
|
|
});
|
|
|
|
|
|
|
2026-09-12 08:41:08 +08:00
|
|
|
|
const priorityLabel = computed(() =>
|
|
|
|
|
|
notification.value ? (PRIORITY_LABELS[notification.value.priority] ?? notification.value.priority) : '',
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
const subtitle = computed(() => {
|
|
|
|
|
|
if (!notification.value) return '';
|
|
|
|
|
|
const teacher = notification.value.teacherName ? `${notification.value.teacherName} · ` : '';
|
|
|
|
|
|
return `${teacher}${formatDate(notification.value.createdAt, true)}`;
|
|
|
|
|
|
});
|
|
|
|
|
|
|
2026-09-12 13:57:46 +08:00
|
|
|
|
/** 叫人消息下方的附加说明(例如"请到办公室找我") */
|
|
|
|
|
|
const callHint = computed(() => notification.value?.subtitle ?? '');
|
|
|
|
|
|
|
2026-09-12 08:41:08 +08:00
|
|
|
|
/** 下课补发时提示"其实上课期间就到了" */
|
|
|
|
|
|
const showAfterClassHint = computed(() => state.value.reason === 'after-class' && !state.value.inClass);
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
/** 状态色(WinIsland 资源占用色板同源):危险红 / 警告橙 / 强调蓝 */
|
|
|
|
|
|
const stateColor = computed(() => {
|
|
|
|
|
|
if (isUrgent.value) return '#ff453a';
|
|
|
|
|
|
if (isCall.value) return '#ff9f0a';
|
|
|
|
|
|
if (isHomework.value) return appearance.value.accent;
|
|
|
|
|
|
return '';
|
|
|
|
|
|
});
|
|
|
|
|
|
|
2026-09-12 09:39:33 +08:00
|
|
|
|
/**
|
2026-09-12 17:41:05 +08:00
|
|
|
|
* 入场动画:胶囊直接出现(WinIsland 的 compact 没有入场动画),
|
|
|
|
|
|
* 展开 / 紧急只用透明度淡入,形变完全交给窗口尺寸(因此不会出现缩放回弹)。
|
2026-09-12 09:39:33 +08:00
|
|
|
|
*/
|
2026-09-12 17:41:05 +08:00
|
|
|
|
const transitionName = computed(() => (mode.value === 'pill' ? 'island-instant' : 'island-fade'));
|
2026-09-12 09:39:33 +08:00
|
|
|
|
const transitionDuration = computed(() => ({
|
2026-09-12 17:41:05 +08:00
|
|
|
|
enter: mode.value === 'pill' ? 0 : Math.round(140 / appearance.value.speed),
|
|
|
|
|
|
leave: Math.round(90 / appearance.value.speed),
|
2026-09-12 09:39:33 +08:00
|
|
|
|
}));
|
|
|
|
|
|
|
2026-09-12 08:41:08 +08:00
|
|
|
|
function expand(): void {
|
|
|
|
|
|
bridge?.sendAction('expand');
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function collapse(): void {
|
|
|
|
|
|
bridge?.sendAction('collapse');
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 09:39:33 +08:00
|
|
|
|
/** 点击卡片空白处(非按钮、非选中文字)→ 回缩为灵动岛胶囊 */
|
|
|
|
|
|
function onCardClick(event: MouseEvent): void {
|
|
|
|
|
|
const target = event.target as HTMLElement | null;
|
|
|
|
|
|
if (target?.closest('button')) return;
|
|
|
|
|
|
if (window.getSelection()?.toString()) return;
|
|
|
|
|
|
collapse();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 08:41:08 +08:00
|
|
|
|
function dismiss(): void {
|
|
|
|
|
|
bridge?.sendAction('dismiss');
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function markRead(): void {
|
|
|
|
|
|
if (notification.value) bridge?.sendAction('mark-read', notification.value.id);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function openApp(): void {
|
|
|
|
|
|
bridge?.sendAction('open-app');
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
/** 个性化外观:主进程下发后写入 CSS 变量,形状/排版/配色立即变化(无需重启) */
|
2026-09-12 15:19:13 +08:00
|
|
|
|
const appearance = ref<IslandAppearance>({ ...DEFAULT_ISLAND_APPEARANCE });
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
/** 卡片与窗口的内边距(必须与主进程 CARD_PAD_X / CARD_PAD_Y 一致) */
|
|
|
|
|
|
const CARD_PAD_X = 5;
|
|
|
|
|
|
const CARD_PAD_Y = 5;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 各形态相对"胶囊窗口"的额外尺寸(必须与主进程 BASE.expanded/urgent/call 的增量一致):
|
|
|
|
|
|
* 卡片尺寸 = 窗口尺寸 - 内边距,因此卡片始终在窗口内居中、四周留白恒定。
|
|
|
|
|
|
*/
|
|
|
|
|
|
const EXTRA = {
|
|
|
|
|
|
expanded: { width: 156, height: 186 },
|
|
|
|
|
|
urgent: { width: 172, height: 202 },
|
|
|
|
|
|
call: { width: 188, height: 218 },
|
|
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
|
|
|
|
/** 当前形态的窗口尺寸(用于推出卡片尺寸) */
|
|
|
|
|
|
const windowSize = computed(() => {
|
|
|
|
|
|
const width = appearance.value.width;
|
|
|
|
|
|
const height = appearance.value.height;
|
|
|
|
|
|
if (mode.value !== 'expanded') return { width, height };
|
|
|
|
|
|
const extra = isCall.value ? EXTRA.call : isUrgent.value ? EXTRA.urgent : EXTRA.expanded;
|
|
|
|
|
|
return { width: width + extra.width, height: height + extra.height };
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
/** 卡片像素尺寸(= 窗口 - 内边距) */
|
|
|
|
|
|
const cardSize = computed(() => ({
|
|
|
|
|
|
width: Math.max(2, windowSize.value.width - CARD_PAD_X * 2),
|
|
|
|
|
|
height: Math.max(2, windowSize.value.height - CARD_PAD_Y * 2),
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
/** 圆角:胶囊取 h/2(满圆角),展开卡取 min(48*系数, w/2, h/2)(WinIsland expanded_island_radius) */
|
|
|
|
|
|
const cardRadius = computed(() => {
|
|
|
|
|
|
const { width, height } = cardSize.value;
|
|
|
|
|
|
if (mode.value !== 'expanded') return Math.min(appearance.value.radius, height / 2);
|
|
|
|
|
|
const scaled = (48 * appearance.value.radius) / 20;
|
|
|
|
|
|
return Math.max(0, Math.min(scaled, width / 2, height / 2));
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
/** 连续圆角路径(超椭圆角,见 squircle.ts) */
|
|
|
|
|
|
const cardPath = computed(() => squirclePath(cardSize.value.width, cardSize.value.height, cardRadius.value));
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 卡片内联样式:尺寸、形状、配色、排版全部由外观设置驱动。
|
|
|
|
|
|
*
|
|
|
|
|
|
* 注意 `left` 用 `calc(50% - 卡片宽/2)`(相对**当前窗口宽度**居中),而不是固定 padding:
|
|
|
|
|
|
* 窗口在形变过程中宽度由主进程逐帧插值,卡片只有居中才能保证"卡片中心全程不动"(实测 0.00px)。
|
|
|
|
|
|
*/
|
|
|
|
|
|
const cardStyle = computed(() => {
|
|
|
|
|
|
const card = cardSize.value;
|
|
|
|
|
|
return {
|
|
|
|
|
|
width: `${card.width}px`,
|
|
|
|
|
|
height: `${card.height}px`,
|
|
|
|
|
|
left: `calc(50% - ${card.width / 2}px)`,
|
|
|
|
|
|
top: `${CARD_PAD_Y}px`,
|
|
|
|
|
|
'--card-path': `path("${cardPath.value}")`,
|
|
|
|
|
|
'--card-r': `${cardRadius.value}px`,
|
|
|
|
|
|
'--state-color': stateColor.value || 'transparent',
|
|
|
|
|
|
};
|
|
|
|
|
|
});
|
|
|
|
|
|
|
2026-09-12 15:19:13 +08:00
|
|
|
|
function applyAppearance(next: IslandAppearance | null | undefined): void {
|
|
|
|
|
|
if (!next) return;
|
|
|
|
|
|
appearance.value = next;
|
|
|
|
|
|
const style = document.documentElement.style;
|
|
|
|
|
|
style.setProperty('--island-accent', next.accent);
|
|
|
|
|
|
style.setProperty('--island-radius', `${next.radius}px`);
|
|
|
|
|
|
style.setProperty('--island-font', `${next.fontSize}px`);
|
|
|
|
|
|
style.setProperty('--island-w', `${next.width}px`);
|
|
|
|
|
|
style.setProperty('--island-h', `${next.height}px`);
|
|
|
|
|
|
style.setProperty('--island-anim', next.animations ? '1' : '0');
|
2026-09-12 17:41:05 +08:00
|
|
|
|
// 形变时长(与主进程的缓动时长一致),用于内容淡入淡出的节奏对齐
|
|
|
|
|
|
const morph = next.style === 'glass' ? 320 : 320;
|
|
|
|
|
|
style.setProperty('--island-dur', `${Math.round(morph / Math.max(0.25, next.speed))}ms`);
|
2026-09-12 15:19:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 08:41:08 +08:00
|
|
|
|
onMounted(async () => {
|
|
|
|
|
|
bridge?.onState((next) => {
|
|
|
|
|
|
state.value = next;
|
|
|
|
|
|
});
|
|
|
|
|
|
const initial = await bridge?.getState();
|
|
|
|
|
|
if (initial) state.value = initial;
|
2026-09-12 17:41:05 +08:00
|
|
|
|
// 外观:先同步一次,再订阅后续改动(改设置立即生效)
|
2026-09-12 15:19:13 +08:00
|
|
|
|
bridge?.onAppearance((next) => applyAppearance(next));
|
|
|
|
|
|
const initialAppearance = await bridge?.getAppearance?.();
|
|
|
|
|
|
applyAppearance(initialAppearance);
|
2026-09-12 08:41:08 +08:00
|
|
|
|
});
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<template>
|
2026-09-12 17:41:05 +08:00
|
|
|
|
<div class="island-root">
|
2026-09-12 09:39:33 +08:00
|
|
|
|
<Transition :name="transitionName" :duration="transitionDuration">
|
2026-09-12 17:41:05 +08:00
|
|
|
|
<!-- 胶囊态:WinIsland compact —— 小尺寸、满圆角、图标 + 文本 + 提示箭头 -->
|
2026-09-12 08:41:08 +08:00
|
|
|
|
<button
|
|
|
|
|
|
v-if="mode === 'pill' && notification"
|
|
|
|
|
|
key="pill"
|
|
|
|
|
|
type="button"
|
|
|
|
|
|
class="island-card pill"
|
2026-09-12 13:57:46 +08:00
|
|
|
|
:class="{ urgent: isUrgent, call: isCall, homework: isHomework, 'after-class': showAfterClassHint }"
|
2026-09-12 17:41:05 +08:00
|
|
|
|
:data-style="appearance.style"
|
|
|
|
|
|
:style="cardStyle"
|
2026-09-12 08:41:08 +08:00
|
|
|
|
@click="expand"
|
|
|
|
|
|
>
|
2026-09-12 17:41:05 +08:00
|
|
|
|
<svg class="shape" :viewBox="`0 0 ${cardSize.width} ${cardSize.height}`" aria-hidden="true">
|
|
|
|
|
|
<path :d="cardPath" />
|
|
|
|
|
|
</svg>
|
|
|
|
|
|
<span class="content">
|
|
|
|
|
|
<span class="tint" aria-hidden="true"></span>
|
|
|
|
|
|
<span class="pill-icon" :class="{ urgent: isUrgent, call: isCall, homework: isHomework }">
|
|
|
|
|
|
<svg v-if="isHomework" viewBox="0 0 24 24" aria-hidden="true">
|
2026-09-12 13:57:46 +08:00
|
|
|
|
<path
|
|
|
|
|
|
fill="currentColor"
|
|
|
|
|
|
d="M6 3h9a3 3 0 0 1 3 3v13.5a.5.5 0 0 1-.75.43L15 18.5l-2.25 1.43a.5.5 0 0 1-.53 0L10 18.5l-2.25 1.43a.5.5 0 0 1-.53 0L5 18.5V5a2 2 0 0 1 1-2Zm2 4v1.6h7V7H8Zm0 3.4V12h7v-1.6H8Z"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</svg>
|
2026-09-12 17:41:05 +08:00
|
|
|
|
<svg v-else-if="isCall" viewBox="0 0 24 24" aria-hidden="true">
|
2026-09-12 13:57:46 +08:00
|
|
|
|
<path
|
|
|
|
|
|
fill="currentColor"
|
|
|
|
|
|
d="M4 10v4a1 1 0 0 0 1 1h2l4 3.5a1 1 0 0 0 1.65-.76V5.26A1 1 0 0 0 11 4.5L7 8H5a1 1 0 0 0-1 1Zm12.5-2.9a1 1 0 0 1 1.4.1 8 8 0 0 1 0 9.6 1 1 0 1 1-1.5-1.3 6 6 0 0 0 0-7 1 1 0 0 1 .1-1.4Z"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</svg>
|
2026-09-12 17:41:05 +08:00
|
|
|
|
<svg v-else viewBox="0 0 24 24" aria-hidden="true">
|
2026-09-12 08:41:08 +08:00
|
|
|
|
<path
|
|
|
|
|
|
fill="currentColor"
|
|
|
|
|
|
d="M12 2a6 6 0 0 0-6 6v3.1L4.6 14a1 1 0 0 0 .9 1.5h13a1 1 0 0 0 .9-1.5L18 11.1V8a6 6 0 0 0-6-6Zm0 20a3 3 0 0 0 3-2.6H9A3 3 0 0 0 12 22Z"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</svg>
|
|
|
|
|
|
</span>
|
2026-09-12 17:41:05 +08:00
|
|
|
|
<span class="pill-text">
|
|
|
|
|
|
<span class="pill-title">
|
|
|
|
|
|
{{ pillTitle }}
|
|
|
|
|
|
<template v-if="queueCount > 0">· 共 {{ queueCount + 1 }} 条</template>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<span class="pill-sub">{{ notification.teacherName || '老师' }} · 点击查看</span>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<span class="pill-chevron" aria-hidden="true">
|
|
|
|
|
|
<svg viewBox="0 0 24 24">
|
2026-09-12 08:41:08 +08:00
|
|
|
|
<path
|
|
|
|
|
|
fill="none"
|
|
|
|
|
|
stroke="currentColor"
|
2026-09-12 17:41:05 +08:00
|
|
|
|
stroke-width="2.6"
|
2026-09-12 08:41:08 +08:00
|
|
|
|
stroke-linecap="round"
|
2026-09-12 17:41:05 +08:00
|
|
|
|
d="m9 6 6 6-6 6"
|
2026-09-12 08:41:08 +08:00
|
|
|
|
/>
|
|
|
|
|
|
</svg>
|
|
|
|
|
|
</span>
|
2026-09-12 17:41:05 +08:00
|
|
|
|
</span>
|
|
|
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 展开态:WinIsland expanded —— 大圆角卡片、白字分级、底部胶囊按钮 -->
|
|
|
|
|
|
<section
|
|
|
|
|
|
v-else-if="mode === 'expanded' && notification"
|
|
|
|
|
|
key="expanded"
|
|
|
|
|
|
class="island-card expanded"
|
|
|
|
|
|
:class="{ urgent: isUrgent, call: isCall, homework: isHomework }"
|
|
|
|
|
|
:data-style="appearance.style"
|
|
|
|
|
|
:style="cardStyle"
|
|
|
|
|
|
@click="onCardClick"
|
|
|
|
|
|
>
|
|
|
|
|
|
<svg class="shape" :viewBox="`0 0 ${cardSize.width} ${cardSize.height}`" aria-hidden="true">
|
|
|
|
|
|
<path :d="cardPath" />
|
|
|
|
|
|
</svg>
|
|
|
|
|
|
<span class="content">
|
|
|
|
|
|
<span class="tint" aria-hidden="true"></span>
|
|
|
|
|
|
<header class="head">
|
|
|
|
|
|
<span class="head-icon" :class="{ urgent: isUrgent, call: isCall, homework: isHomework }">
|
|
|
|
|
|
<svg v-if="isHomework" viewBox="0 0 24 24" aria-hidden="true">
|
|
|
|
|
|
<path
|
|
|
|
|
|
fill="currentColor"
|
|
|
|
|
|
d="M6 3h9a3 3 0 0 1 3 3v13.5a.5.5 0 0 1-.75.43L15 18.5l-2.25 1.43a.5.5 0 0 1-.53 0L10 18.5l-2.25 1.43a.5.5 0 0 1-.53 0L5 18.5V5a2 2 0 0 1 1-2Zm2 4v1.6h7V7H8Zm0 3.4V12h7v-1.6H8Z"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</svg>
|
|
|
|
|
|
<svg v-else-if="isCall" viewBox="0 0 24 24" aria-hidden="true">
|
|
|
|
|
|
<path
|
|
|
|
|
|
fill="currentColor"
|
|
|
|
|
|
d="M4 10v4a1 1 0 0 0 1 1h2l4 3.5a1 1 0 0 0 1.65-.76V5.26A1 1 0 0 0 11 4.5L7 8H5a1 1 0 0 0-1 1Zm12.5-2.9a1 1 0 0 1 1.4.1 8 8 0 0 1 0 9.6 1 1 0 1 1-1.5-1.3 6 6 0 0 0 0-7 1 1 0 0 1 .1-1.4Z"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</svg>
|
|
|
|
|
|
<svg v-else viewBox="0 0 24 24" aria-hidden="true">
|
|
|
|
|
|
<path
|
|
|
|
|
|
fill="currentColor"
|
|
|
|
|
|
d="M12 2a6 6 0 0 0-6 6v3.1L4.6 14a1 1 0 0 0 .9 1.5h13a1 1 0 0 0 .9-1.5L18 11.1V8a6 6 0 0 0-6-6Zm0 20a3 3 0 0 0 3-2.6H9A3 3 0 0 0 12 22Z"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</svg>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<div class="head-meta">
|
|
|
|
|
|
<span class="badge" :class="badgeClass">{{ badgeText }}</span>
|
|
|
|
|
|
<span v-if="isCall" class="live-dot call">老师正在等你</span>
|
|
|
|
|
|
<span v-else-if="isUrgent" class="live-dot">需立即查看</span>
|
|
|
|
|
|
<span v-else-if="showAfterClassHint" class="live-dot muted">下课后补发</span>
|
|
|
|
|
|
<span class="head-sub">{{ subtitle }}</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<button type="button" class="icon-btn" title="收起" @click="collapse">
|
|
|
|
|
|
<svg viewBox="0 0 24 24" aria-hidden="true">
|
|
|
|
|
|
<path
|
|
|
|
|
|
fill="none"
|
|
|
|
|
|
stroke="currentColor"
|
|
|
|
|
|
stroke-width="2.4"
|
|
|
|
|
|
stroke-linecap="round"
|
|
|
|
|
|
d="m6 15 6-6 6 6"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</svg>
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</header>
|
|
|
|
|
|
|
|
|
|
|
|
<h3 class="title">{{ notification.title }}</h3>
|
|
|
|
|
|
<div class="body">
|
|
|
|
|
|
<p class="content-text">{{ notification.content }}</p>
|
|
|
|
|
|
<p v-if="callHint" class="call-hint">{{ callHint }}</p>
|
|
|
|
|
|
<p v-else-if="notification.subtitle" class="call-hint">{{ notification.subtitle }}</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<footer class="foot">
|
|
|
|
|
|
<span v-if="queueCount > 0" class="more">还有 {{ queueCount }} 条通知</span>
|
|
|
|
|
|
<span v-else class="more muted">来自班级小助手</span>
|
|
|
|
|
|
<span class="actions">
|
|
|
|
|
|
<button type="button" class="ghost-btn" @click="openApp">打开应用</button>
|
|
|
|
|
|
<button type="button" class="ghost-btn" @click="markRead">标为已读</button>
|
|
|
|
|
|
<button type="button" class="solid-btn" @click="dismiss">
|
|
|
|
|
|
{{ isCall ? '收到' : '知道了' }}
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</footer>
|
|
|
|
|
|
</span>
|
2026-09-12 08:41:08 +08:00
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 隐藏态占位(窗口不可见,仅保证 DOM 结构稳定) -->
|
|
|
|
|
|
<div v-else key="hidden" class="island-card hidden-placeholder"></div>
|
|
|
|
|
|
</Transition>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<style>
|
2026-09-12 17:41:05 +08:00
|
|
|
|
/*
|
|
|
|
|
|
* 排版系数(必须与 @classhelper/shared 的 ISLAND_TYPE_SCALE 保持一致):
|
|
|
|
|
|
* title 1.08 / body 0.95 / meta 0.78 / badge 0.76 / pillTitle 0.92 / pillSub 0.74
|
|
|
|
|
|
*
|
|
|
|
|
|
* 关键:所有文本尺寸都由 --island-font 通过 calc() 推导,所以「字号」设置一改,
|
|
|
|
|
|
* 岛内文字立即整体等比缩放(WinIsland 的 font_size 模型),不存在写死的字号。
|
|
|
|
|
|
*/
|
2026-09-12 08:41:08 +08:00
|
|
|
|
html,
|
|
|
|
|
|
body,
|
|
|
|
|
|
#app {
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
padding: 0;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
background: transparent;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
-webkit-user-select: none;
|
|
|
|
|
|
user-select: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
body {
|
|
|
|
|
|
font-family:
|
|
|
|
|
|
-apple-system, 'Segoe UI Variable Display', 'Segoe UI', 'Microsoft YaHei', 'PingFang SC',
|
|
|
|
|
|
'Helvetica Neue', sans-serif;
|
|
|
|
|
|
-webkit-font-smoothing: antialiased;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
* {
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 08:41:08 +08:00
|
|
|
|
.island-root {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 100%;
|
2026-09-12 17:41:05 +08:00
|
|
|
|
position: relative;
|
|
|
|
|
|
background: transparent;
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
/* ---------------------------------------------------------------- 卡片与形状 */
|
|
|
|
|
|
|
2026-09-12 08:41:08 +08:00
|
|
|
|
.island-card {
|
|
|
|
|
|
position: absolute;
|
2026-09-12 17:41:05 +08:00
|
|
|
|
display: block;
|
|
|
|
|
|
padding: 0;
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
border: none;
|
|
|
|
|
|
background: none;
|
|
|
|
|
|
color: rgba(255, 255, 255, 0.92);
|
|
|
|
|
|
font-size: var(--island-font, 13px);
|
|
|
|
|
|
text-align: left;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
/* 配色 token(默认:WinIsland 纯黑风格) */
|
|
|
|
|
|
--wn-bg: #000000;
|
|
|
|
|
|
--wn-border: rgba(255, 255, 255, 0.118);
|
|
|
|
|
|
--wn-text-1: rgba(255, 255, 255, 0.92);
|
|
|
|
|
|
--wn-text-2: rgba(255, 255, 255, 0.72);
|
|
|
|
|
|
--wn-text-3: rgba(255, 255, 255, 0.58);
|
|
|
|
|
|
--wn-surface: rgba(255, 255, 255, 0.1);
|
|
|
|
|
|
--wn-surface-hover: rgba(255, 255, 255, 0.18);
|
|
|
|
|
|
--wn-divider: rgba(255, 255, 255, 0.09);
|
2026-09-12 13:57:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
.island-card[data-style='glass'] {
|
|
|
|
|
|
--wn-bg: rgba(10, 10, 14, 0.588);
|
|
|
|
|
|
--wn-border: rgba(255, 255, 255, 0.157);
|
|
|
|
|
|
--wn-surface: rgba(255, 255, 255, 0.14);
|
|
|
|
|
|
--wn-surface-hover: rgba(255, 255, 255, 0.22);
|
2026-09-12 13:57:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
.island-card[data-style='tinted'] {
|
|
|
|
|
|
--wn-bg: #0b0b0f;
|
|
|
|
|
|
--wn-border: rgba(255, 255, 255, 0.14);
|
2026-09-12 13:57:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
.island-card.hidden-placeholder {
|
|
|
|
|
|
visibility: hidden;
|
2026-09-12 13:57:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
/* 连续圆角形状:填充 + 1px 描边(描边画在裁切之外,与 WinIsland 一致) */
|
|
|
|
|
|
.island-card .shape {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
inset: 0;
|
2026-09-12 13:57:46 +08:00
|
|
|
|
width: 100%;
|
2026-09-12 17:41:05 +08:00
|
|
|
|
height: 100%;
|
|
|
|
|
|
display: block;
|
2026-09-12 13:57:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
.island-card .shape path {
|
|
|
|
|
|
fill: var(--wn-bg);
|
|
|
|
|
|
stroke: var(--wn-border);
|
|
|
|
|
|
stroke-width: 1;
|
2026-09-12 13:57:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
/* 内容层裁切到同一形状内 */
|
|
|
|
|
|
.island-card .content {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
inset: 0;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
clip-path: var(--card-path);
|
|
|
|
|
|
overflow: hidden;
|
2026-09-12 13:57:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
/* 展开态投影(WinIsland: rgba(0,0,0,.11)、y+2、σ=3 → CSS 0 2px 3px) */
|
|
|
|
|
|
.island-card.expanded .shape path {
|
|
|
|
|
|
filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.11));
|
2026-09-12 13:57:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
/* 状态色:只做"内层微染 + 描边",不外溢(保持桌面干净,也不会有光晕硬边) */
|
|
|
|
|
|
.island-card.urgent .shape path,
|
|
|
|
|
|
.island-card.call .shape path {
|
|
|
|
|
|
stroke: color-mix(in srgb, var(--state-color) 62%, rgba(255, 255, 255, 0.2));
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
.island-card .tint {
|
2026-09-12 08:41:08 +08:00
|
|
|
|
position: absolute;
|
2026-09-12 09:39:33 +08:00
|
|
|
|
inset: 0;
|
2026-09-12 08:41:08 +08:00
|
|
|
|
pointer-events: none;
|
2026-09-12 17:41:05 +08:00
|
|
|
|
opacity: 0;
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
.island-card.urgent .tint {
|
|
|
|
|
|
opacity: 1;
|
|
|
|
|
|
background: radial-gradient(120% 90% at 50% 0%, rgba(255, 69, 58, 0.22), transparent 68%);
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
.island-card.call .tint {
|
|
|
|
|
|
opacity: 1;
|
|
|
|
|
|
background: radial-gradient(120% 90% at 50% 0%, rgba(255, 159, 10, 0.2), transparent 68%);
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
.island-card[data-style='tinted'] .tint {
|
|
|
|
|
|
opacity: 1;
|
|
|
|
|
|
background: linear-gradient(
|
|
|
|
|
|
135deg,
|
|
|
|
|
|
color-mix(in srgb, var(--island-accent) 30%, transparent),
|
|
|
|
|
|
transparent 62%
|
|
|
|
|
|
);
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
/* ---------------------------------------------------------------- 胶囊(compact) */
|
2026-09-12 08:41:08 +08:00
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
.island-card.pill .content {
|
|
|
|
|
|
flex-direction: row;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: calc(var(--island-font, 13px) * 0.62);
|
|
|
|
|
|
padding: 0 calc(var(--island-font, 13px) * 0.78);
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
.pill-icon {
|
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
flex: 0 0 auto;
|
|
|
|
|
|
width: calc(var(--island-font, 13px) * 1.24);
|
|
|
|
|
|
height: calc(var(--island-font, 13px) * 1.24);
|
2026-09-12 08:41:08 +08:00
|
|
|
|
border-radius: 50%;
|
2026-09-12 17:41:05 +08:00
|
|
|
|
background: var(--wn-surface);
|
|
|
|
|
|
color: var(--wn-text-1);
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
.pill-icon svg {
|
|
|
|
|
|
width: calc(var(--island-font, 13px) * 0.86);
|
|
|
|
|
|
height: calc(var(--island-font, 13px) * 0.86);
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
.pill-icon.call {
|
|
|
|
|
|
color: #ff9f0a;
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
.pill-icon.urgent {
|
|
|
|
|
|
color: #ff453a;
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
.pill-icon.homework {
|
|
|
|
|
|
color: var(--island-accent);
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.pill-text {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
2026-09-12 17:41:05 +08:00
|
|
|
|
justify-content: center;
|
2026-09-12 08:41:08 +08:00
|
|
|
|
min-width: 0;
|
2026-09-12 17:41:05 +08:00
|
|
|
|
flex: 1 1 auto;
|
|
|
|
|
|
gap: 1px;
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.pill-title {
|
2026-09-12 17:41:05 +08:00
|
|
|
|
font-size: calc(var(--island-font, 13px) * 0.92);
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
line-height: 1.15;
|
|
|
|
|
|
color: var(--wn-text-1);
|
2026-09-12 08:41:08 +08:00
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.pill-sub {
|
2026-09-12 17:41:05 +08:00
|
|
|
|
font-size: calc(var(--island-font, 13px) * 0.74);
|
|
|
|
|
|
line-height: 1.15;
|
|
|
|
|
|
color: var(--wn-text-3);
|
2026-09-12 08:41:08 +08:00
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.pill-chevron {
|
2026-09-12 17:41:05 +08:00
|
|
|
|
display: inline-flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
color: rgba(255, 255, 255, 0.34);
|
2026-09-12 08:41:08 +08:00
|
|
|
|
flex: 0 0 auto;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
.pill-chevron svg {
|
|
|
|
|
|
width: calc(var(--island-font, 13px) * 0.86);
|
|
|
|
|
|
height: calc(var(--island-font, 13px) * 0.86);
|
|
|
|
|
|
}
|
2026-09-12 08:41:08 +08:00
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
/* ---------------------------------------------------------------- 展开卡(expanded) */
|
|
|
|
|
|
|
|
|
|
|
|
.island-card.expanded .content {
|
|
|
|
|
|
padding: calc(var(--island-font, 13px) * 1.4) calc(var(--island-font, 13px) * 1.6);
|
|
|
|
|
|
gap: calc(var(--island-font, 13px) * 0.7);
|
|
|
|
|
|
/* 内容块整体垂直居中:卡片尺寸固定(锚点稳定),留白上下均分比"底部一大块空"更自然 */
|
|
|
|
|
|
justify-content: center;
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.head {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
2026-09-12 17:41:05 +08:00
|
|
|
|
gap: calc(var(--island-font, 13px) * 0.7);
|
|
|
|
|
|
flex: 0 0 auto;
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.head-icon {
|
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
2026-09-12 17:41:05 +08:00
|
|
|
|
width: calc(var(--island-font, 13px) * 1.62);
|
|
|
|
|
|
height: calc(var(--island-font, 13px) * 1.62);
|
|
|
|
|
|
border-radius: calc(var(--island-font, 13px) * 0.5);
|
|
|
|
|
|
background: var(--wn-surface);
|
|
|
|
|
|
color: var(--wn-text-1);
|
2026-09-12 08:41:08 +08:00
|
|
|
|
flex: 0 0 auto;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
.head-icon svg {
|
|
|
|
|
|
width: calc(var(--island-font, 13px) * 1.05);
|
|
|
|
|
|
height: calc(var(--island-font, 13px) * 1.05);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 08:41:08 +08:00
|
|
|
|
.head-icon.urgent {
|
2026-09-12 17:41:05 +08:00
|
|
|
|
background: rgba(255, 69, 58, 0.2);
|
|
|
|
|
|
color: #ff453a;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.head-icon.call {
|
|
|
|
|
|
background: rgba(255, 159, 10, 0.2);
|
|
|
|
|
|
color: #ff9f0a;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.head-icon.homework {
|
|
|
|
|
|
background: color-mix(in srgb, var(--island-accent) 22%, transparent);
|
|
|
|
|
|
color: var(--island-accent);
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.head-meta {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
2026-09-12 17:41:05 +08:00
|
|
|
|
gap: calc(var(--island-font, 13px) * 0.55);
|
2026-09-12 08:41:08 +08:00
|
|
|
|
min-width: 0;
|
2026-09-12 17:41:05 +08:00
|
|
|
|
flex: 1 1 auto;
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.badge {
|
2026-09-12 17:41:05 +08:00
|
|
|
|
display: inline-flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
height: calc(var(--island-font, 13px) * 1.5);
|
|
|
|
|
|
padding: 0 calc(var(--island-font, 13px) * 0.62);
|
2026-09-12 08:41:08 +08:00
|
|
|
|
border-radius: 999px;
|
2026-09-12 17:41:05 +08:00
|
|
|
|
font-size: calc(var(--island-font, 13px) * 0.76);
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
letter-spacing: 0.02em;
|
|
|
|
|
|
background: color-mix(in srgb, var(--island-accent) 26%, transparent);
|
|
|
|
|
|
color: color-mix(in srgb, var(--island-accent) 70%, #ffffff);
|
|
|
|
|
|
flex: 0 0 auto;
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.badge-urgent {
|
2026-09-12 17:41:05 +08:00
|
|
|
|
background: rgba(255, 69, 58, 0.24);
|
|
|
|
|
|
color: #ff6961;
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.badge-high {
|
2026-09-12 17:41:05 +08:00
|
|
|
|
background: rgba(255, 159, 10, 0.22);
|
|
|
|
|
|
color: #ffb340;
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
.badge-low,
|
2026-09-12 08:41:08 +08:00
|
|
|
|
.badge-normal {
|
2026-09-12 17:41:05 +08:00
|
|
|
|
background: rgba(255, 255, 255, 0.12);
|
|
|
|
|
|
color: rgba(255, 255, 255, 0.78);
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
.badge-call {
|
|
|
|
|
|
background: rgba(255, 159, 10, 0.24);
|
|
|
|
|
|
color: #ffb340;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.badge-homework {
|
|
|
|
|
|
background: color-mix(in srgb, var(--island-accent) 26%, transparent);
|
|
|
|
|
|
color: color-mix(in srgb, var(--island-accent) 72%, #ffffff);
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.live-dot {
|
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
|
align-items: center;
|
2026-09-12 17:41:05 +08:00
|
|
|
|
gap: calc(var(--island-font, 13px) * 0.32);
|
|
|
|
|
|
font-size: calc(var(--island-font, 13px) * 0.76);
|
|
|
|
|
|
color: #ff6961;
|
|
|
|
|
|
white-space: nowrap;
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
.live-dot.call {
|
|
|
|
|
|
color: #ffb340;
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.live-dot.muted {
|
2026-09-12 17:41:05 +08:00
|
|
|
|
color: var(--wn-text-3);
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.head-sub {
|
2026-09-12 17:41:05 +08:00
|
|
|
|
font-size: calc(var(--island-font, 13px) * 0.78);
|
|
|
|
|
|
color: var(--wn-text-3);
|
2026-09-12 08:41:08 +08:00
|
|
|
|
white-space: nowrap;
|
2026-09-12 17:41:05 +08:00
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
text-overflow: ellipsis;
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.icon-btn {
|
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
2026-09-12 17:41:05 +08:00
|
|
|
|
width: calc(var(--island-font, 13px) * 1.7);
|
|
|
|
|
|
height: calc(var(--island-font, 13px) * 1.7);
|
|
|
|
|
|
border: none;
|
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
|
background: var(--wn-surface);
|
|
|
|
|
|
color: rgba(255, 255, 255, 0.72);
|
|
|
|
|
|
cursor: pointer;
|
2026-09-12 08:41:08 +08:00
|
|
|
|
flex: 0 0 auto;
|
2026-09-12 17:41:05 +08:00
|
|
|
|
transition:
|
|
|
|
|
|
background 0.15s ease,
|
|
|
|
|
|
color 0.15s ease;
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.icon-btn:hover {
|
2026-09-12 17:41:05 +08:00
|
|
|
|
background: var(--wn-surface-hover);
|
|
|
|
|
|
color: #fff;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.icon-btn svg {
|
|
|
|
|
|
width: calc(var(--island-font, 13px) * 0.8);
|
|
|
|
|
|
height: calc(var(--island-font, 13px) * 0.8);
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.title {
|
|
|
|
|
|
margin: 0;
|
2026-09-12 17:41:05 +08:00
|
|
|
|
font-size: calc(var(--island-font, 13px) * 1.08);
|
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
|
line-height: 1.3;
|
|
|
|
|
|
color: #fff;
|
|
|
|
|
|
flex: 0 0 auto;
|
2026-09-12 08:41:08 +08:00
|
|
|
|
display: -webkit-box;
|
|
|
|
|
|
-webkit-line-clamp: 2;
|
|
|
|
|
|
-webkit-box-orient: vertical;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.body {
|
2026-09-12 17:41:05 +08:00
|
|
|
|
flex: 0 1 auto;
|
2026-09-12 08:41:08 +08:00
|
|
|
|
min-height: 0;
|
2026-09-12 17:41:05 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
gap: calc(var(--island-font, 13px) * 0.35);
|
|
|
|
|
|
overflow: hidden;
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
.content-text {
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
font-size: calc(var(--island-font, 13px) * 0.95);
|
|
|
|
|
|
line-height: 1.42;
|
|
|
|
|
|
color: var(--wn-text-2);
|
|
|
|
|
|
word-break: break-word;
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
.call-hint {
|
2026-09-12 08:41:08 +08:00
|
|
|
|
margin: 0;
|
2026-09-12 17:41:05 +08:00
|
|
|
|
font-size: calc(var(--island-font, 13px) * 0.85);
|
|
|
|
|
|
line-height: 1.4;
|
|
|
|
|
|
color: color-mix(in srgb, var(--state-color) 66%, #ffffff);
|
2026-09-12 08:41:08 +08:00
|
|
|
|
word-break: break-word;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.foot {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: space-between;
|
2026-09-12 17:41:05 +08:00
|
|
|
|
gap: calc(var(--island-font, 13px) * 0.7);
|
|
|
|
|
|
flex: 0 0 auto;
|
|
|
|
|
|
margin-top: calc(var(--island-font, 13px) * 0.5);
|
|
|
|
|
|
padding-top: calc(var(--island-font, 13px) * 0.7);
|
|
|
|
|
|
border-top: 1px solid var(--wn-divider);
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.more {
|
2026-09-12 17:41:05 +08:00
|
|
|
|
font-size: calc(var(--island-font, 13px) * 0.78);
|
|
|
|
|
|
color: var(--wn-text-2);
|
|
|
|
|
|
white-space: nowrap;
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.more.muted {
|
2026-09-12 17:41:05 +08:00
|
|
|
|
color: var(--wn-text-3);
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.actions {
|
2026-09-12 17:41:05 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: calc(var(--island-font, 13px) * 0.5);
|
|
|
|
|
|
flex: 0 0 auto;
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.ghost-btn,
|
|
|
|
|
|
.solid-btn {
|
2026-09-12 17:41:05 +08:00
|
|
|
|
height: calc(var(--island-font, 13px) * 2.05);
|
|
|
|
|
|
padding: 0 calc(var(--island-font, 13px) * 0.9);
|
|
|
|
|
|
border: none;
|
2026-09-12 08:41:08 +08:00
|
|
|
|
border-radius: 999px;
|
2026-09-12 17:41:05 +08:00
|
|
|
|
font-size: calc(var(--island-font, 13px) * 0.76);
|
|
|
|
|
|
font-weight: 600;
|
2026-09-12 08:41:08 +08:00
|
|
|
|
cursor: pointer;
|
2026-09-12 17:41:05 +08:00
|
|
|
|
white-space: nowrap;
|
2026-09-12 08:41:08 +08:00
|
|
|
|
transition:
|
2026-09-12 17:41:05 +08:00
|
|
|
|
background 0.15s ease,
|
|
|
|
|
|
transform 0.12s ease;
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.ghost-btn {
|
2026-09-12 17:41:05 +08:00
|
|
|
|
background: var(--wn-surface);
|
|
|
|
|
|
color: var(--wn-text-1);
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.ghost-btn:hover {
|
2026-09-12 17:41:05 +08:00
|
|
|
|
background: var(--wn-surface-hover);
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.solid-btn {
|
2026-09-12 17:41:05 +08:00
|
|
|
|
background: #ffffff;
|
|
|
|
|
|
color: #0b0b0f;
|
2026-09-12 13:57:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
.island-card.call .solid-btn {
|
|
|
|
|
|
background: #ff9f0a;
|
|
|
|
|
|
color: #1a1205;
|
2026-09-12 13:57:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
.island-card.urgent .solid-btn {
|
|
|
|
|
|
background: #ff453a;
|
|
|
|
|
|
color: #ffffff;
|
2026-09-12 13:57:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
.ghost-btn:active,
|
|
|
|
|
|
.solid-btn:active {
|
|
|
|
|
|
transform: scale(0.97);
|
2026-09-12 13:57:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
/* ---------------------------------------------------------------- 过渡(无缩放、无回弹) */
|
2026-09-12 08:41:08 +08:00
|
|
|
|
|
2026-09-12 09:39:33 +08:00
|
|
|
|
.island-instant-enter-active {
|
|
|
|
|
|
transition: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.island-instant-enter-from {
|
|
|
|
|
|
opacity: 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.island-instant-leave-active {
|
2026-09-12 17:41:05 +08:00
|
|
|
|
transition: opacity calc(var(--island-dur, 320ms) * 0.28) ease-out;
|
2026-09-12 09:39:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.island-instant-leave-to {
|
|
|
|
|
|
opacity: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
/* 展开 / 收回:只做淡入淡出,形变交给窗口尺寸(避免任何缩放回弹"震动") */
|
|
|
|
|
|
.island-fade-enter-active {
|
|
|
|
|
|
transition: opacity calc(var(--island-dur, 320ms) * 0.45) ease-out;
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
.island-fade-leave-active {
|
|
|
|
|
|
transition: opacity calc(var(--island-dur, 320ms) * 0.3) ease-out;
|
2026-09-12 08:41:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-12 17:41:05 +08:00
|
|
|
|
.island-fade-enter-from,
|
|
|
|
|
|
.island-fade-leave-to {
|
2026-09-12 08:41:08 +08:00
|
|
|
|
opacity: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|