chore: initial commit - maqt-desktop v0.2
- Phase 1-5: UI framework, auth, weapon schemes, color filters, system optimization - Industrial/tech design style with Chinese localization - Points to gch3n.online/delta backend API - Hardware monitor, filter editor, and all module pages
This commit is contained in:
64
src/components/layout/DesktopIcon.tsx
Normal file
64
src/components/layout/DesktopIcon.tsx
Normal file
@@ -0,0 +1,64 @@
|
||||
import React from 'react';
|
||||
|
||||
interface DesktopIconProps {
|
||||
icon: string;
|
||||
label: string;
|
||||
onClick?: () => void;
|
||||
disabled?: boolean;
|
||||
locked?: boolean;
|
||||
vip?: boolean;
|
||||
index?: number;
|
||||
}
|
||||
|
||||
export default function DesktopIcon({ icon, label, onClick, disabled, locked, vip, index = 0 }: DesktopIconProps) {
|
||||
const isBlocked = locked || disabled;
|
||||
|
||||
return (
|
||||
<button
|
||||
onClick={onClick}
|
||||
disabled={disabled}
|
||||
className="relative flex flex-col items-center justify-center gap-1.5 py-5 border border-[#333]
|
||||
transition-colors duration-75 cursor-pointer disabled:cursor-not-allowed
|
||||
hover:bg-[#222] hover:border-[#555] group"
|
||||
>
|
||||
{/* 坐标标记 */}
|
||||
<span className="tech-sn absolute top-1 left-1 opacity-0 group-hover:opacity-100 transition-opacity">
|
||||
X{index % 4}Y{Math.floor(index / 4)}
|
||||
</span>
|
||||
|
||||
{/* 锁定遮罩 */}
|
||||
{isBlocked && (
|
||||
<div className="absolute inset-0 bg-[#1a1a1a]/80 flex items-center justify-center z-10">
|
||||
<div className="flex flex-col items-center gap-1">
|
||||
<span className="text-[#555] text-[12px]">🔒</span>
|
||||
<span className="text-[7px] font-mono text-[#444] tracking-wider">
|
||||
{vip ? 'VIP ONLY' : '需登录'}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 图标 */}
|
||||
<span className={`material-symbols-outlined text-[24px] transition-colors duration-75
|
||||
${isBlocked ? 'text-[#444]' : 'text-[#888] group-hover:text-[#ff4500]'}`}>
|
||||
{icon}
|
||||
</span>
|
||||
|
||||
{/* 标签 */}
|
||||
<span className={`text-[9px] font-semibold tracking-[0.12em] uppercase transition-colors duration-75
|
||||
${isBlocked ? 'text-[#444]' : 'text-[#555] group-hover:text-[#e0e0e0]'}`}>
|
||||
{label}
|
||||
</span>
|
||||
|
||||
{/* VIP 标记 */}
|
||||
{vip && !isBlocked && (
|
||||
<span className="absolute top-1.5 right-1.5 text-[7px] text-[#ff4500]">✦</span>
|
||||
)}
|
||||
|
||||
{/* 底部强调线 */}
|
||||
{!isBlocked && (
|
||||
<span className="absolute bottom-0 left-1/4 right-1/4 h-[1px] bg-[#ff4500] scale-x-0 group-hover:scale-x-100 transition-transform duration-75" />
|
||||
)}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user