feat: 新增 CommandPalette 和 HealthScoreModal 组件,优化应用布局并引入 Budget、Home 页面。
This commit is contained in:
204
src/components/common/CommandPalette/CommandPalette.css
Normal file
204
src/components/common/CommandPalette/CommandPalette.css
Normal file
@@ -0,0 +1,204 @@
|
||||
/* CommandPalette.css */
|
||||
.command-palette-overlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
backdrop-filter: blur(4px);
|
||||
z-index: 9999;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
padding-top: 20vh;
|
||||
opacity: 0;
|
||||
animation: fadeIn 0.2s ease-out forwards;
|
||||
}
|
||||
|
||||
.command-palette-modal {
|
||||
width: 100%;
|
||||
max-width: 600px;
|
||||
background: var(--glass-panel-bg);
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
border-radius: var(--radius-xl);
|
||||
border: 1px solid var(--glass-border);
|
||||
box-shadow: var(--shadow-2xl);
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
transform: translateY(-20px) scale(0.95);
|
||||
animation: slideIn 0.2s ease-out forwards;
|
||||
}
|
||||
|
||||
.command-palette-header {
|
||||
padding: var(--space-4);
|
||||
border-bottom: 1px solid var(--glass-border);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-3);
|
||||
}
|
||||
|
||||
.command-palette-search-icon {
|
||||
color: var(--text-secondary);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.command-palette-input {
|
||||
flex: 1;
|
||||
background: transparent;
|
||||
border: none;
|
||||
font-size: var(--text-lg);
|
||||
color: var(--text-primary);
|
||||
outline: none;
|
||||
font-family: var(--font-sans);
|
||||
}
|
||||
|
||||
.command-palette-input::placeholder {
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.command-palette-results {
|
||||
max-height: 400px;
|
||||
overflow-y: auto;
|
||||
padding: var(--space-2);
|
||||
}
|
||||
|
||||
/* Scrollbar styling */
|
||||
.command-palette-results::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
.command-palette-results::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.command-palette-results::-webkit-scrollbar-thumb {
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.command-palette-group-title {
|
||||
padding: var(--space-2) var(--space-3);
|
||||
font-size: var(--text-xs);
|
||||
font-weight: var(--font-medium);
|
||||
color: var(--text-muted);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
margin-top: var(--space-2);
|
||||
}
|
||||
|
||||
.command-palette-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-3);
|
||||
padding: var(--space-3);
|
||||
border-radius: var(--radius-md);
|
||||
cursor: pointer;
|
||||
transition: all 0.1s ease;
|
||||
color: var(--text-primary);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.command-palette-item:hover,
|
||||
.command-palette-item.active {
|
||||
background-color: var(--primary-light);
|
||||
/* Or a subtle background */
|
||||
background: rgba(var(--color-primary-rgb), 0.1);
|
||||
/* Fallback or specific opacity */
|
||||
}
|
||||
|
||||
/* Ensure we use defined variables */
|
||||
.command-palette-item:hover,
|
||||
.command-palette-item.active {
|
||||
background-color: var(--bg-hover);
|
||||
}
|
||||
|
||||
.command-palette-item.active {
|
||||
background-color: var(--primary-lighter);
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
|
||||
.command-palette-item-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.command-palette-item.active .command-palette-item-icon {
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.command-palette-item-content {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.command-palette-item-title {
|
||||
font-weight: var(--font-medium);
|
||||
font-size: var(--text-sm);
|
||||
display: block;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.command-palette-item-subtitle {
|
||||
font-size: var(--text-xs);
|
||||
color: var(--text-muted);
|
||||
display: block;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.command-palette-item-action {
|
||||
font-size: var(--text-xs);
|
||||
color: var(--text-muted);
|
||||
background: var(--bg-secondary);
|
||||
padding: 2px 6px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.command-palette-footer {
|
||||
padding: var(--space-2) var(--space-4);
|
||||
background: rgba(0, 0, 0, 0.02);
|
||||
border-top: 1px solid var(--glass-border);
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: var(--space-4);
|
||||
font-size: var(--text-xs);
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.command-palette-key {
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 3px;
|
||||
padding: 0 4px;
|
||||
font-family: var(--font-mono);
|
||||
box-shadow: 0 1px 0 var(--border-color);
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes slideIn {
|
||||
to {
|
||||
transform: translateY(0) scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
/* Empty state */
|
||||
.command-palette-empty {
|
||||
padding: var(--space-8);
|
||||
text-align: center;
|
||||
color: var(--text-muted);
|
||||
font-size: var(--text-sm);
|
||||
}
|
||||
Reference in New Issue
Block a user