feat: 初始化 NFC 读卡器项目
- 添加 Electron 主进程和渲染进程 - 实现读卡器连接、断开和读取卡片 ID 功能 - 添加自定义窗口标题栏和窗口控制 - 实现简洁美观的用户界面 - 添加项目文档 README.md
This commit is contained in:
294
style.css
Normal file
294
style.css
Normal file
@@ -0,0 +1,294 @@
|
||||
@import url('https://fonts.googleapis.com/css2?family=Segoe+UI+Variable:wght@300;400;500;600;700&display=swap');
|
||||
|
||||
:root {
|
||||
--window-bg: #f9f9f9;
|
||||
--border-color: rgba(0, 0, 0, 0.08);
|
||||
--border-hover: rgba(0, 0, 0, 0.12);
|
||||
--text-primary: #1a1a1a;
|
||||
--text-secondary: #5c5c5c;
|
||||
--text-disabled: rgba(0, 0, 0, 0.4);
|
||||
--accent-color: #0067C0;
|
||||
--accent-hover: #005A9E;
|
||||
--success-color: #107C10;
|
||||
--danger-color: #E81123;
|
||||
--surface-bg: rgba(255, 255, 255, 0.6);
|
||||
--surface-hover: rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Segoe UI Variable', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
|
||||
background: var(--window-bg);
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
.titlebar {
|
||||
height: 32px;
|
||||
background: var(--window-bg);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
-webkit-app-region: drag;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.titlebar-drag-region {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 138px;
|
||||
height: 32px;
|
||||
-webkit-app-region: drag;
|
||||
}
|
||||
|
||||
.titlebar-title {
|
||||
flex: 1;
|
||||
padding-left: 16px;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
color: var(--text-primary);
|
||||
user-select: none;
|
||||
pointer-events: none;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.window-controls {
|
||||
display: flex;
|
||||
height: 32px;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.window-control {
|
||||
width: 46px;
|
||||
height: 32px;
|
||||
border: none;
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: var(--text-primary);
|
||||
transition: background-color 0.1s ease;
|
||||
-webkit-app-region: no-drag;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.window-control:hover {
|
||||
background-color: rgba(0, 0, 0, 0.04);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.window-control:active {
|
||||
background-color: rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
.window-control.close:hover {
|
||||
background-color: var(--danger-color);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.window-control svg {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.container {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 16px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: rgba(255, 255, 255, 0.6);
|
||||
border: 1px solid var(--border-color);
|
||||
box-shadow:
|
||||
0 2px 8px rgba(0, 0, 0, 0.04),
|
||||
0 0 0 1px rgba(255, 255, 255, 0.8) inset;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
max-width: 400px;
|
||||
}
|
||||
|
||||
.card-body {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.status-section {
|
||||
text-align: center;
|
||||
padding: 12px 16px;
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
border-radius: 6px;
|
||||
border: 1px solid var(--border-color);
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.status-indicator {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.status-dot {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.status-dot.connected {
|
||||
background-color: var(--success-color);
|
||||
box-shadow: 0 0 0 2px rgba(16, 124, 16, 0.2);
|
||||
}
|
||||
|
||||
.status-dot.disconnected {
|
||||
background-color: var(--danger-color);
|
||||
box-shadow: 0 0 0 2px rgba(232, 17, 35, 0.2);
|
||||
}
|
||||
|
||||
.status-dot.connecting {
|
||||
background-color: #FF8C00;
|
||||
box-shadow: 0 0 0 2px rgba(255, 140, 0, 0.2);
|
||||
animation: blink 1s infinite;
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
0%, 100% { opacity: 1; }
|
||||
50% { opacity: 0.4; }
|
||||
}
|
||||
|
||||
#statusText {
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.control-buttons {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
justify-content: center;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.control-buttons button {
|
||||
flex: 1;
|
||||
font-weight: 400;
|
||||
font-size: 13px;
|
||||
padding: 8px 14px;
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 4px;
|
||||
transition: all 0.1s ease;
|
||||
cursor: pointer;
|
||||
font-family: inherit;
|
||||
letter-spacing: 0.1px;
|
||||
background: var(--surface-bg);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.control-buttons button:hover:not(:disabled) {
|
||||
background: var(--surface-hover);
|
||||
border-color: var(--border-hover);
|
||||
}
|
||||
|
||||
.control-buttons button:active:not(:disabled) {
|
||||
background: rgba(0, 0, 0, 0.04);
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
.control-buttons button:disabled {
|
||||
opacity: 0.4;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: var(--accent-color);
|
||||
color: white;
|
||||
border-color: var(--accent-color);
|
||||
}
|
||||
|
||||
.btn-primary:hover:not(:disabled) {
|
||||
background: var(--accent-hover);
|
||||
border-color: var(--accent-hover);
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
background: var(--surface-bg);
|
||||
color: var(--text-primary);
|
||||
border-color: var(--border-color);
|
||||
}
|
||||
|
||||
.btn-secondary:hover:not(:disabled) {
|
||||
background: var(--surface-hover);
|
||||
border-color: var(--border-hover);
|
||||
}
|
||||
|
||||
.btn-success {
|
||||
background: var(--success-color);
|
||||
color: white;
|
||||
border-color: var(--success-color);
|
||||
}
|
||||
|
||||
.btn-success:hover:not(:disabled) {
|
||||
background: #0B5A0B;
|
||||
border-color: #0B5A0B;
|
||||
}
|
||||
|
||||
.result-section {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.result-section h4 {
|
||||
margin-bottom: 8px;
|
||||
color: var(--text-primary);
|
||||
font-weight: 600;
|
||||
font-size: 12px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.result-box {
|
||||
padding: 12px 16px;
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
border-radius: 6px;
|
||||
min-height: 60px;
|
||||
border: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.placeholder-text {
|
||||
color: var(--text-secondary);
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.result-content {
|
||||
word-break: break-all;
|
||||
font-family: 'Segoe UI Variable', 'Segoe UI', 'Consolas', monospace;
|
||||
font-size: 14px;
|
||||
color: var(--text-primary);
|
||||
font-weight: 400;
|
||||
text-align: center;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.error-message {
|
||||
color: var(--danger-color);
|
||||
font-weight: 500;
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
}
|
||||
Reference in New Issue
Block a user