架构 重构样式系统:采用 Windows 11 Fluent Design 规范

This commit is contained in:
2026-04-18 18:55:06 +08:00
parent cf1070a279
commit 20b065af5b
15 changed files with 1031 additions and 701 deletions

View File

@@ -135,47 +135,56 @@ defineEmits([
</script>
<style lang="less" scoped>
// Windows 11 Style API Edit Dialog - Fluent Design
.api-edit-dialog {
min-width: 480px;
max-width: 520px;
padding: 0;
overflow: hidden;
border-radius: var(--radius-xl);
}
.api-edit-dialog .dialog-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20px 24px;
border-bottom: 1px solid var(--border);
background: var(--bg-tertiary);
padding: var(--space-lg) var(--space-xl);
border-bottom: 1px solid var(--border-light);
background: var(--control-fill);
}
.api-edit-dialog .dialog-title {
font-size: 15px;
font-size: var(--font-size-base);
font-weight: 600;
display: flex;
align-items: center;
gap: 10px;
gap: var(--space-sm);
color: var(--text-primary);
margin-bottom: 0;
.iconpark-icon {
color: var(--accent);
}
}
.api-edit-dialog .dialog-title .iconpark-icon {
color: var(--accent);
}
.api-edit-dialog .dialog-body {
padding: 24px;
padding: var(--space-xl);
max-height: 60vh;
overflow-y: auto;
.form-group {
margin-bottom: var(--space-lg);
&:last-child {
margin-bottom: 0;
}
}
}
.api-edit-dialog .dialog-body .form-group {
margin-bottom: 18px;
}
.api-edit-dialog .dialog-body .form-group:last-child {
margin-bottom: 0;
}
.api-edit-dialog .dialog-actions {
padding: 16px 24px;
border-top: 1px solid var(--border);
background: var(--bg-tertiary);
padding: var(--space-lg) var(--space-xl);
border-top: 1px solid var(--border-light);
background: var(--control-fill);
margin-top: 0;
}
</style>

View File

@@ -17,27 +17,31 @@ defineProps({
</script>
<style lang="less" scoped>
// Windows 11 Style Footer - Fluent Design
.footer {
height: 28px;
height: 26px;
background: var(--bg-secondary);
border-top: 1px solid var(--border);
border-top: 1px solid var(--border-light);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 16px;
flex-shrink: 0;
}
.footer-status {
display: flex;
align-items: center;
gap: 8px;
font-size: 12px;
font-size: 11px;
color: var(--text-tertiary);
}
.footer-status-dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--success);
box-shadow: 0 0 4px rgba(16, 185, 129, 0.4);
}
</style>

View File

@@ -42,53 +42,61 @@ watch(() => props.dialog.show, (show) => {
</script>
<style lang="less" scoped>
// Windows 11 Style Input Dialog - Fluent Design
.dialog-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(15, 23, 42, 0.6);
backdrop-filter: blur(4px);
background: rgba(0, 0, 0, 0.4);
backdrop-filter: blur(2px);
display: flex;
align-items: center;
justify-content: center;
z-index: 1300;
animation: fadeIn 0.15s ease;
}
.dialog {
background: var(--bg-secondary);
border-radius: var(--radius-lg);
padding: 24px;
background: var(--bg-elevated);
border-radius: var(--radius-xl);
padding: var(--space-xl);
min-width: 360px;
max-width: 480px;
box-shadow: var(--shadow-lg);
animation: slideUp 0.2s ease;
box-shadow: var(--shadow-xl);
animation: scaleIn 0.2s ease;
}
.dialog-title {
font-size: 15px;
font-size: var(--font-size-lg);
font-weight: 600;
margin-bottom: 18px;
margin-bottom: var(--space-md);
color: var(--text-primary);
letter-spacing: -0.01em;
}
.dialog-confirm-text {
font-size: 14px;
font-size: var(--font-size-sm);
color: var(--text-secondary);
margin-bottom: 8px;
margin-bottom: var(--space-md);
line-height: 1.5;
}
.dialog-actions {
display: flex;
justify-content: flex-end;
gap: 10px;
margin-top: 22px;
gap: var(--space-sm);
margin-top: var(--space-xl);
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes slideUp {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
@keyframes scaleIn {
from { opacity: 0; transform: scale(0.96); }
to { opacity: 1; transform: scale(1); }
}
</style>

View File

@@ -42,72 +42,93 @@ defineEmits(['close'])
</script>
<style lang="less" scoped>
// Windows 11 Style Message Dialog - Fluent Design
.dialog-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(15, 23, 42, 0.6);
backdrop-filter: blur(4px);
background: rgba(0, 0, 0, 0.4);
backdrop-filter: blur(2px);
display: flex;
align-items: center;
justify-content: center;
z-index: 1300;
animation: fadeIn 0.15s ease;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
.message-dialog {
position: relative;
text-align: center;
padding: 32px 24px;
z-index: 1400;
padding: var(--space-2xl) var(--space-xl);
animation: scaleIn 0.2s ease;
}
.message-dialog-icon {
width: 48px;
height: 48px;
margin: 0 auto 16px;
margin: 0 auto var(--space-md);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
svg {
width: 24px;
height: 24px;
}
}
.message-dialog-icon svg {
width: 24px;
height: 24px;
}
.message-dialog-icon-info {
background: rgba(59, 130, 246, 0.1);
color: var(--accent);
background: var(--info-bg);
color: var(--info);
}
.message-dialog-icon-success {
background: rgba(16, 185, 129, 0.1);
background: var(--success-bg);
color: var(--success);
}
.message-dialog-icon-warning {
background: rgba(245, 158, 11, 0.1);
color: #f59e0b;
background: var(--warning-bg);
color: var(--warning);
}
.message-dialog-icon-error {
background: rgba(239, 68, 68, 0.1);
background: var(--danger-bg);
color: var(--danger);
}
.message-dialog-title {
font-size: 16px;
font-size: var(--font-size-lg);
font-weight: 600;
margin-bottom: 8px;
margin-bottom: var(--space-xs);
color: var(--text-primary);
}
.message-dialog-message {
font-size: 14px;
font-size: var(--font-size-sm);
color: var(--text-secondary);
line-height: 1.5;
}
.message-dialog .dialog-actions {
justify-content: center;
margin-top: 24px;
margin-top: var(--space-xl);
.btn {
min-width: 100px;
}
}
@keyframes scaleIn {
from { opacity: 0; transform: scale(0.96); }
to { opacity: 1; transform: scale(1); }
}
</style>

View File

@@ -93,17 +93,19 @@ watch(() => props.data, (val) => {
</script>
<style lang="less" scoped>
// Windows 11 Style Side Panel - Fluent Design
.side-panel-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(15, 23, 42, 0.5);
backdrop-filter: blur(2px);
background: rgba(0, 0, 0, 0.32);
backdrop-filter: blur(4px);
z-index: 1000;
animation: fadeIn 0.2s ease;
animation: fadeIn 0.15s ease;
}
.side-panel {
position: absolute;
right: 0;
@@ -111,32 +113,36 @@ watch(() => props.data, (val) => {
bottom: 0;
width: 420px;
max-width: 100%;
background: var(--bg-secondary);
box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
background: var(--bg-elevated);
border-left: 1px solid var(--border);
box-shadow: var(--shadow-xl);
display: flex;
flex-direction: column;
animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
animation: slideInFromRight 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.side-panel-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20px 24px;
border-bottom: 1px solid var(--border);
background: var(--bg-tertiary);
padding: var(--space-lg) var(--space-xl);
border-bottom: 1px solid var(--border-light);
background: var(--control-fill);
}
.side-panel-title {
font-size: 15px;
font-size: var(--font-size-base);
font-weight: 600;
display: flex;
align-items: center;
gap: 10px;
gap: var(--space-sm);
color: var(--text-primary);
letter-spacing: -0.01em;
}
.side-panel-title .iconpark-icon {
color: var(--accent);
.iconpark-icon {
color: var(--accent);
}
}
.side-panel-close {
width: 32px;
height: 32px;
@@ -147,53 +153,58 @@ watch(() => props.data, (val) => {
background: transparent;
color: var(--text-tertiary);
cursor: pointer;
border-radius: var(--radius);
transition: all 0.2s ease;
}
.side-panel-close:hover {
background: var(--bg-hover);
color: var(--text-primary);
}
.side-panel-close svg {
width: 14px;
height: 14px;
stroke: currentColor;
stroke-width: 1.5;
fill: none;
border-radius: var(--radius-sm);
transition: all var(--transition);
&:hover {
background: var(--control-fill-hover);
color: var(--text-primary);
}
svg {
width: 12px;
height: 12px;
stroke: currentColor;
stroke-width: 1.5;
fill: none;
}
}
.side-panel-body {
flex: 1;
padding: 24px;
padding: var(--space-xl);
overflow-y: auto;
.form-group {
margin-bottom: var(--space-lg);
&:last-child {
margin-bottom: 0;
}
}
}
.side-panel-body .form-group {
margin-bottom: 20px;
}
.side-panel-body .form-group:last-child {
margin-bottom: 0;
}
.form-required {
color: var(--danger);
font-weight: 500;
}
.side-panel-footer {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px 24px;
border-top: 1px solid var(--border);
background: var(--bg-tertiary);
padding: var(--space-lg) var(--space-xl);
border-top: 1px solid var(--border-light);
background: var(--control-fill);
}
.side-panel-footer-right {
display: flex;
gap: 10px;
gap: var(--space-sm);
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes slideInRight {
from { transform: translateX(100%); opacity: 0; }
to { transform: translateX(0); opacity: 1; }
@keyframes slideInFromRight {
from { transform: translateX(100%); }
to { transform: translateX(0); }
}
</style>

View File

@@ -40,58 +40,76 @@ defineEmits(['navigate'])
</script>
<style lang="less" scoped>
// Windows 11 Style Sidebar - Fluent Design
.sidebar {
width: 240px;
width: 220px;
background: var(--bg-secondary);
border-right: 1px solid var(--border);
padding: 24px 20px;
border-right: 1px solid var(--border-light);
padding: 16px 12px;
display: flex;
flex-direction: column;
gap: 28px;
gap: 24px;
flex-shrink: 0;
overflow-y: auto;
}
.sidebar-section {
display: flex;
flex-direction: column;
gap: 6px;
gap: 2px;
}
.sidebar-title {
font-size: 11px;
font-size: 10px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.06em;
letter-spacing: 0.05em;
color: var(--text-tertiary);
padding: 0 14px;
margin-bottom: 8px;
padding: 0 12px;
margin-bottom: 6px;
}
.nav-item {
display: flex;
align-items: center;
padding: 12px 14px;
padding: 10px 12px;
border-radius: var(--radius);
cursor: pointer;
transition: all 0.2s ease;
transition: all 0.15s ease;
color: var(--text-secondary);
font-size: 13px;
font-weight: 500;
gap: 5px;
font-weight: 400;
gap: 10px;
&:hover {
background: var(--control-fill);
color: var(--text-primary);
}
&.active {
background: var(--accent-light);
color: var(--accent);
font-weight: 500;
.iconpark-icon {
color: var(--accent);
}
}
}
.nav-item:hover {
background: var(--bg-hover);
color: var(--text-primary);
}
.nav-item.active {
background: var(--accent-light);
color: var(--accent);
.nav-item-text {
flex: 1;
}
.nav-item-badge {
margin-left: auto;
background: var(--bg-tertiary);
background: var(--control-fill);
color: var(--text-tertiary);
padding: 2px 8px;
padding: 1px 8px;
border-radius: 10px;
font-size: 11px;
font-weight: 600;
font-weight: 500;
min-width: 24px;
text-align: center;
}
</style>

View File

@@ -27,37 +27,41 @@ const close = () => window.electronAPI.close()
</script>
<style lang="less" scoped>
// Windows 11 Style Title Bar - Fluent Design
.titlebar {
height: 32px;
background: var(--bg-secondary);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 8px;
padding: 0 4px 0 12px;
-webkit-app-region: drag;
border-bottom: 1px solid var(--border);
border-bottom: 1px solid var(--border-light);
flex-shrink: 0;
}
.titlebar-left {
display: flex;
align-items: center;
gap: 8px;
gap: 10px;
}
.titlebar-title {
font-size: 13px;
font-size: 12px;
font-weight: 600;
color: var(--text-primary);
letter-spacing: -0.01em;
}
.titlebar-controls {
display: flex;
align-items: center;
gap: 4px;
-webkit-app-region: no-drag;
}
.titlebar-btn {
width: 32px;
height: 24px;
width: 46px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
@@ -65,22 +69,32 @@ const close = () => window.electronAPI.close()
background: transparent;
color: var(--text-secondary);
cursor: pointer;
border-radius: 4px;
transition: all 0.15s ease;
}
.titlebar-btn:hover {
background: var(--bg-hover);
color: var(--text-primary);
}
.titlebar-btn.close:hover {
background: var(--danger);
color: white;
}
.titlebar-btn svg {
width: 10px;
height: 10px;
stroke: currentColor;
stroke-width: 1.5;
fill: none;
transition: background 0.1s ease;
&:hover {
background: var(--control-fill-hover);
color: var(--text-primary);
}
&:active {
background: var(--control-fill-pressed);
}
&.close:hover {
background: #c42b1c;
color: #ffffff;
}
&.close:active {
background: #a72b1c;
}
svg {
width: 10px;
height: 10px;
stroke: currentColor;
stroke-width: 1.5;
fill: none;
}
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -100,116 +100,119 @@ const getProfileIconStyle = name => {
</script>
<style lang="less" scoped>
// Windows 11 Style Profile List - Fluent Design
.profile-list {
display: flex;
flex-direction: column;
gap: 10px;
gap: 8px;
}
.profile-item {
display: flex;
align-items: center;
padding: 14px 16px;
padding: 12px 14px;
background: var(--bg-secondary);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
border-radius: var(--radius);
cursor: pointer;
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
transition: all 0.15s ease;
animation: fadeIn 0.3s ease backwards;
&:nth-child(1) { animation-delay: 0.02s; }
&:nth-child(2) { animation-delay: 0.04s; }
&:nth-child(3) { animation-delay: 0.06s; }
&:nth-child(4) { animation-delay: 0.08s; }
&:nth-child(5) { animation-delay: 0.1s; }
&:hover {
background: var(--control-fill);
border-color: var(--border);
transform: translateX(2px);
}
&.active {
background: var(--accent-light);
border-color: var(--accent);
box-shadow: var(--shadow-sm);
}
}
.profile-item:nth-child(1) {
animation-delay: 0.02s;
}
.profile-item:nth-child(2) {
animation-delay: 0.04s;
}
.profile-item:nth-child(3) {
animation-delay: 0.06s;
}
.profile-item:nth-child(4) {
animation-delay: 0.08s;
}
.profile-item:nth-child(5) {
animation-delay: 0.1s;
}
.profile-item:hover {
background: var(--bg-tertiary);
border-color: var(--text-tertiary);
transform: translateX(4px);
}
.profile-item.active {
background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
box-shadow:
0 0 0 1px var(--accent),
0 4px 12px rgba(59, 130, 246, 0.15);
}
.profile-icon {
width: 40px;
height: 40px;
border-radius: 12px;
width: 36px;
height: 36px;
border-radius: var(--radius);
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.profile-icon-text {
font-size: 16px;
font-weight: 700;
font-size: 14px;
font-weight: 600;
color: white;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.profile-info {
flex: 1;
min-width: 0;
margin-left: 14px;
margin-left: 12px;
}
.profile-name {
font-size: 14px;
font-weight: 600;
font-size: 13px;
font-weight: 500;
color: var(--text-primary);
letter-spacing: -0.01em;
}
.profile-url {
font-size: 12px;
font-size: 11px;
color: var(--text-tertiary);
margin-top: 3px;
margin-top: 2px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.profile-status {
margin-left: 12px;
margin-left: 10px;
}
.status-badge {
display: inline-flex;
align-items: center;
gap: 5px;
padding: 5px 10px;
background: rgba(59, 130, 246, 0.1);
color: var(--accent);
border-radius: 16px;
font-size: 12px;
gap: 4px;
padding: 3px 8px;
background: var(--accent);
color: white;
border-radius: var(--radius);
font-size: 11px;
font-weight: 500;
svg {
width: 10px;
height: 10px;
}
}
.status-badge svg {
width: 12px;
height: 12px;
}
.profile-actions {
display: flex;
align-items: center;
gap: 4px;
margin-left: 12px;
gap: 2px;
margin-left: 8px;
opacity: 0;
transition: opacity 0.2s ease;
}
.profile-item:hover .profile-actions,
.profile-item.active .profile-actions {
opacity: 1;
transition: opacity 0.15s ease;
.profile-item:hover &,
.profile-item.active & {
opacity: 1;
}
}
.action-btn {
width: 32px;
height: 32px;
width: 28px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
@@ -218,28 +221,32 @@ const getProfileIconStyle = name => {
color: var(--text-tertiary);
cursor: pointer;
border-radius: var(--radius);
transition: all 0.2s ease;
}
.action-btn:hover {
background: var(--bg-hover);
color: var(--text-primary);
}
.action-btn.action-btn-danger:hover {
background: rgba(239, 68, 68, 0.1);
color: var(--danger);
transition: all 0.1s ease;
&:hover {
background: var(--control-fill);
color: var(--text-primary);
}
&.action-btn-danger:hover {
background: rgba(239, 68, 68, 0.1);
color: var(--danger);
}
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(8px);
transform: translateY(6px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.btn-sm {
padding: 6px 12px;
padding: 5px 10px;
font-size: 12px;
align-self: flex-end;
}

View File

@@ -60,97 +60,109 @@ defineEmits(['add-server', 'select-server'])
</script>
<style lang="less" scoped>
// Windows 11 Style Server List - Fluent Design
.server-list {
border: 1px solid var(--border);
border-radius: var(--radius-lg);
border-radius: var(--radius);
overflow: hidden;
background: var(--bg-secondary);
}
.server-item {
display: flex;
align-items: center;
padding: 14px 18px;
padding: 12px 14px;
border-bottom: 1px solid var(--border-light);
cursor: pointer;
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
transition: all 0.15s ease;
animation: fadeIn 0.3s ease backwards;
&:nth-child(1) { animation-delay: 0.02s; }
&:nth-child(2) { animation-delay: 0.04s; }
&:nth-child(3) { animation-delay: 0.06s; }
&:nth-child(4) { animation-delay: 0.08s; }
&:nth-child(5) { animation-delay: 0.1s; }
&:nth-child(6) { animation-delay: 0.12s; }
&:nth-child(7) { animation-delay: 0.14s; }
&:nth-child(8) { animation-delay: 0.16s; }
&:last-child {
border-bottom: none;
}
&:hover {
background: var(--control-fill);
transform: translateX(2px);
}
&.selected {
background: var(--accent-light);
border-left: 2px solid var(--accent);
padding-left: 12px;
}
}
.server-item:nth-child(1) { animation-delay: 0.02s; }
.server-item:nth-child(2) { animation-delay: 0.04s; }
.server-item:nth-child(3) { animation-delay: 0.06s; }
.server-item:nth-child(4) { animation-delay: 0.08s; }
.server-item:nth-child(5) { animation-delay: 0.1s; }
.server-item:nth-child(6) { animation-delay: 0.12s; }
.server-item:nth-child(7) { animation-delay: 0.14s; }
.server-item:nth-child(8) { animation-delay: 0.16s; }
.server-item:last-child { border-bottom: none; }
.server-item:hover {
background: var(--bg-tertiary);
transform: translateX(4px);
}
.server-item.selected {
background: var(--accent-light);
border-left: 3px solid var(--accent);
padding-left: 15px;
}
.server-info {
flex: 1;
min-width: 0;
}
.server-name {
font-size: 13px;
font-weight: 500;
letter-spacing: -0.01em;
color: var(--text-primary);
}
.server-desc {
font-size: 12px;
font-size: 11px;
color: var(--text-tertiary);
margin-top: 3px;
margin-top: 2px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.server-status {
width: 8px;
height: 8px;
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--success);
box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
animation: pulse 2s ease-in-out infinite;
box-shadow: 0 0 4px rgba(16, 185, 129, 0.4);
}
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 48px 24px;
padding: 40px 24px;
text-align: center;
background: var(--bg-tertiary);
border-radius: var(--radius-lg);
border-radius: var(--radius);
}
.empty-state-icon {
font-size: 48px;
margin-bottom: 16px;
opacity: 0.3;
font-size: 40px;
margin-bottom: 12px;
opacity: 0.4;
color: var(--text-tertiary);
}
.empty-state-title {
font-size: 15px;
font-size: 14px;
font-weight: 500;
margin-bottom: 6px;
margin-bottom: 4px;
color: var(--text-secondary);
}
.empty-state-desc {
font-size: 13px;
font-size: 12px;
color: var(--text-tertiary);
margin-bottom: 20px;
margin-bottom: 16px;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(8px); }
from { opacity: 0; transform: translateY(6px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.6; }
}
</style>