mirror of
https://github.com/stardrophere/InsightRadar.git
synced 2026-06-05 23:07:51 +08:00
optimize
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="icon" href="/favicon.ico">
|
||||
<link rel="icon" href="/favicon.svg">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>InsightRadar - 全网热点监控中枢</title>
|
||||
<!-- Font Awesome 图标库 -->
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg" width="32" height="32">
|
||||
<style>
|
||||
/* 核心呼吸灯动画 */
|
||||
.ai-core-glow {
|
||||
transform-origin: center;
|
||||
animation: core-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
||||
}
|
||||
|
||||
/* 雷达圈旋转动画 */
|
||||
.radar-ring {
|
||||
transform-origin: center;
|
||||
}
|
||||
|
||||
.radar-ring.outer {
|
||||
animation: spin-reverse 20s linear infinite;
|
||||
}
|
||||
|
||||
.radar-ring.inner {
|
||||
animation: spin 12s linear infinite;
|
||||
}
|
||||
|
||||
/* 数据连线光流效果 */
|
||||
.data-link {
|
||||
stroke-dasharray: 4;
|
||||
animation: flow 3s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes core-pulse {
|
||||
0%,
|
||||
100% {
|
||||
transform: scale(1);
|
||||
opacity: 0.4;
|
||||
}
|
||||
50% {
|
||||
transform: scale(2.2);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
from { transform: rotate(0deg); }
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
@keyframes spin-reverse {
|
||||
from { transform: rotate(360deg); }
|
||||
to { transform: rotate(0deg); }
|
||||
}
|
||||
|
||||
@keyframes flow {
|
||||
from { stroke-dashoffset: 8; }
|
||||
to { stroke-dashoffset: 0; }
|
||||
}
|
||||
</style>
|
||||
|
||||
<circle class="radar-ring outer" cx="16" cy="16" r="14" stroke="#3b82f6" stroke-width="1" stroke-dasharray="4 8" opacity="0.4" />
|
||||
|
||||
<circle class="radar-ring inner" cx="16" cy="16" r="9" stroke="#3b82f6" stroke-width="1.5" stroke-dasharray="12 4" opacity="0.6" />
|
||||
|
||||
<path class="data-link" d="M16 16 L25 7 M16 16 L7 22 L5 20 M16 16 L23 25" stroke="#3b82f6" stroke-width="1" opacity="0.3" />
|
||||
|
||||
<circle class="data-node" cx="25" cy="7" r="1.5" fill="#3b82f6" opacity="0.7" />
|
||||
<circle class="data-node" cx="7" cy="22" r="1.5" fill="#3b82f6" opacity="0.7" />
|
||||
<circle class="data-node" cx="23" cy="25" r="1" fill="#3b82f6" opacity="0.5" />
|
||||
|
||||
<circle class="ai-core" cx="16" cy="16" r="3.5" fill="#3b82f6" />
|
||||
|
||||
<circle class="ai-core-glow" cx="16" cy="16" r="3.5" fill="#3b82f6" opacity="0.4" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
@@ -135,6 +135,9 @@ function getHotLevel(score: number): { label: string; color: string; bg: string
|
||||
}
|
||||
|
||||
function formatRelativeTime(dateStr: string): string {
|
||||
if (!dateStr.endsWith('Z') && !dateStr.includes('+')) {
|
||||
dateStr += 'Z' // 补偿 SQLite 丢失的 UTC 时区标识
|
||||
}
|
||||
const now = Date.now()
|
||||
const target = new Date(dateStr).getTime()
|
||||
const diff = now - target
|
||||
|
||||
@@ -47,8 +47,15 @@ function getPlatformIcon(name: string): string {
|
||||
}
|
||||
|
||||
/** 格式化时间 */
|
||||
function safeParseTime(dateStr: string): number {
|
||||
if (!dateStr.endsWith('Z') && !dateStr.includes('+')) {
|
||||
dateStr += 'Z'
|
||||
}
|
||||
return new Date(dateStr).getTime()
|
||||
}
|
||||
|
||||
function formatTime(dateStr: string): string {
|
||||
const d = new Date(dateStr)
|
||||
const d = new Date(safeParseTime(dateStr))
|
||||
const now = Date.now()
|
||||
const diff = now - d.getTime()
|
||||
const minutes = Math.floor(diff / 60000)
|
||||
@@ -75,7 +82,7 @@ const revisionChains = computed<RevisionChain[]>(() => {
|
||||
const chains: RevisionChain[] = []
|
||||
for (const [event_id, items] of groups) {
|
||||
// 组内按时间升序
|
||||
items.sort((a, b) => new Date(a.created_at).getTime() - new Date(b.created_at).getTime())
|
||||
items.sort((a, b) => safeParseTime(a.created_at) - safeParseTime(b.created_at))
|
||||
|
||||
// 拼接标题链,避免重复(相邻记录的 revised 与下一条 previous 通常相同)
|
||||
const titles: string[] = [items[0].previous_headline]
|
||||
@@ -102,7 +109,7 @@ const revisionChains = computed<RevisionChain[]>(() => {
|
||||
}
|
||||
|
||||
// 最终按最新修改时间降序
|
||||
chains.sort((a, b) => new Date(b.last_at).getTime() - new Date(a.last_at).getTime())
|
||||
chains.sort((a, b) => safeParseTime(b.last_at) - safeParseTime(a.last_at))
|
||||
return chains
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user