feat: 科技感图标重新设计
应用图标(assets/icon.ico + icon.png): - 深色渐变背景(#0F172A 深海蓝 → #1E1B4B 深紫) - 半透明科技网格线 - 蓝色发光圆环 - 四角蓝色光点装饰 - 带发光效果的白色 M 文字 - 蓝色渐变 ↓ 箭头 - 底部扫描线效果 - 右上角光标装饰 - 7 种尺寸(16~256px) Icons.tsx AppIcon 同步更新: - SVG 版本包含相同的科技感元素 - 使用 SVG filter 实现发光效果 - 使用 clipPath 实现圆角裁剪 - 使用 linearGradient 实现背景渐变
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 24 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 11 KiB |
@@ -9,26 +9,92 @@ interface IconProps {
|
||||
|
||||
const defaultProps: Partial<IconProps> = { size: 18 }
|
||||
|
||||
// ===== 应用图标 =====
|
||||
// ===== 应用图标(科技感风格) =====
|
||||
export function AppIcon({ size = 80 }: IconProps) {
|
||||
const s = size
|
||||
const margin = Math.max(1, s / 20)
|
||||
const radius = Math.max(3, s / 5)
|
||||
const gridStep = Math.max(4, s / 8)
|
||||
const ringR = s / 3
|
||||
const ringW = Math.max(1, s / 30)
|
||||
const dotR = Math.max(1, s / 24)
|
||||
const fontSize = Math.max(10, s * 45 / 100)
|
||||
const arrowSize = Math.max(3, s / 7)
|
||||
const arrowTop = s / 2 + Math.max(4, s / 8)
|
||||
const arrowBottom = arrowTop + arrowSize
|
||||
const lw = Math.max(1, s / 18)
|
||||
const scanY = s - margin - Math.max(3, s / 10)
|
||||
const scanLeft = margin + Math.max(3, s / 6)
|
||||
const scanRight = s - margin - Math.max(3, s / 6)
|
||||
const curX = s - margin - Math.max(3, s / 5)
|
||||
const curY = margin + Math.max(3, s / 5)
|
||||
const curSize = Math.max(2, s / 12)
|
||||
|
||||
return (
|
||||
<svg width={size} height={size} viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
{/* 背景圆角矩形 */}
|
||||
<rect x="4" y="4" width="72" height="72" rx="16" fill="url(#app-bg)" stroke="url(#app-stroke)" strokeWidth="2"/>
|
||||
{/* Markdown M↓ 符号 */}
|
||||
<path d="M22 28v24M22 52V40l8-8 8 8v12M46 28l6 12 6-12v24" stroke="white" strokeWidth="3.5" strokeLinecap="round" strokeLinejoin="round"/>
|
||||
{/* 底部装饰线 */}
|
||||
<rect x="16" y="60" width="48" height="3" rx="1.5" fill="rgba(255,255,255,0.3)"/>
|
||||
<svg width={s} height={s} viewBox={`0 0 ${s} ${s}`} fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<linearGradient id="app-bg" x1="4" y1="4" x2="76" y2="76" gradientUnits="userSpaceOnUse">
|
||||
<stop stopColor="#3B82F6"/>
|
||||
<stop offset="1" stopColor="#1D4ED8"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="app-stroke" x1="4" y1="4" x2="76" y2="76" gradientUnits="userSpaceOnUse">
|
||||
<stop stopColor="#60A5FA"/>
|
||||
<stop offset="1" stopColor="#2563EB"/>
|
||||
<linearGradient id="tech-bg" x1="0" y1="0" x2="0" y2="1">
|
||||
<stop offset="0%" stopColor="#0F172A"/>
|
||||
<stop offset="100%" stopColor="#1E1B4B"/>
|
||||
</linearGradient>
|
||||
<clipPath id="tech-clip">
|
||||
<rect x={margin} y={margin} width={s - 2*margin} height={s - 2*margin} rx={radius}/>
|
||||
</clipPath>
|
||||
<filter id="tech-glow">
|
||||
<feGaussianBlur stdDeviation="2" result="blur"/>
|
||||
<feMerge>
|
||||
<feMergeNode in="blur"/>
|
||||
<feMergeNode in="SourceGraphic"/>
|
||||
</feMerge>
|
||||
</filter>
|
||||
</defs>
|
||||
|
||||
{/* 背景 */}
|
||||
<rect x={margin} y={margin} width={s - 2*margin} height={s - 2*margin} rx={radius} fill="url(#tech-bg)"/>
|
||||
|
||||
<g clipPath="url(#tech-clip)">
|
||||
{/* 科技网格 */}
|
||||
{Array.from({length: Math.floor((s - 2*margin) / gridStep)}, (_, i) => {
|
||||
const x = margin + (i + 1) * gridStep
|
||||
return <line key={`gv${i}`} x1={x} y1={margin} x2={x} y2={s-margin} stroke="#3B82F6" strokeOpacity="0.08" strokeWidth="1"/>
|
||||
})}
|
||||
{Array.from({length: Math.floor((s - 2*margin) / gridStep)}, (_, i) => {
|
||||
const y = margin + (i + 1) * gridStep
|
||||
return <line key={`gh${i}`} x1={margin} y1={y} x2={s-margin} y2={y} stroke="#3B82F6" strokeOpacity="0.08" strokeWidth="1"/>
|
||||
})}
|
||||
|
||||
{/* 发光圆环 */}
|
||||
<circle cx={s/2} cy={s/2} r={ringR + 2} fill="none" stroke="#3B82F6" strokeOpacity="0.15" strokeWidth="1"/>
|
||||
<circle cx={s/2} cy={s/2} r={ringR} fill="none" stroke="#60A5FA" strokeOpacity="0.3" strokeWidth={ringW} filter="url(#tech-glow)"/>
|
||||
|
||||
{/* 四角光点 */}
|
||||
{[[margin + radius/2, margin + radius/2], [s - margin - radius/2, margin + radius/2],
|
||||
[margin + radius/2, s - margin - radius/2], [s - margin - radius/2, s - margin - radius/2]].map(([x, y], i) =>
|
||||
<circle key={`dot${i}`} cx={x} cy={y} r={dotR} fill="#60A5FA" fillOpacity="0.6"/>
|
||||
)}
|
||||
|
||||
{/* M 文字发光 */}
|
||||
<text x={s/2} y={s/2 - Math.max(2, s/15)} textAnchor="middle" dominantBaseline="central"
|
||||
fontFamily="system-ui, -apple-system, sans-serif" fontWeight="bold" fontSize={fontSize}
|
||||
fill="#60A5FA" fillOpacity="0.2" filter="url(#tech-glow)">M</text>
|
||||
{/* M 文字主体 */}
|
||||
<text x={s/2} y={s/2 - Math.max(2, s/15)} textAnchor="middle" dominantBaseline="central"
|
||||
fontFamily="system-ui, -apple-system, sans-serif" fontWeight="bold" fontSize={fontSize}
|
||||
fill="#DCEBFF">M</text>
|
||||
|
||||
{/* ↓ 箭头 */}
|
||||
<line x1={s/2} y1={arrowTop} x2={s/2} y2={arrowBottom} stroke="#93C5FD" strokeWidth={lw} strokeLinecap="round"/>
|
||||
<line x1={s/2 - arrowSize/2} y1={arrowBottom - arrowSize/2} x2={s/2} y2={arrowBottom} stroke="#93C5FD" strokeWidth={lw} strokeLinecap="round"/>
|
||||
<line x1={s/2 + arrowSize/2} y1={arrowBottom - arrowSize/2} x2={s/2} y2={arrowBottom} stroke="#93C5FD" strokeWidth={lw} strokeLinecap="round"/>
|
||||
|
||||
{/* 底部扫描线 */}
|
||||
<line x1={scanLeft} y1={scanY} x2={scanRight} y2={scanY} stroke="#38BDF8" strokeOpacity="0.2" strokeWidth="2"/>
|
||||
<line x1={scanLeft} y1={scanY + 2} x2={scanRight} y2={scanY + 2} stroke="#38BDF8" strokeOpacity="0.08" strokeWidth="1"/>
|
||||
|
||||
{/* 右上角光标 */}
|
||||
<line x1={curX} y1={curY} x2={curX + curSize} y2={curY} stroke="#38BDF8" strokeOpacity="0.5" strokeWidth="1.5"/>
|
||||
<line x1={curX + curSize} y1={curY} x2={curX + curSize} y2={curY + curSize} stroke="#38BDF8" strokeOpacity="0.5" strokeWidth="1.5"/>
|
||||
</g>
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user