style: standardize UI across tools, optimize QR layout, and configure Husky/ESLint

This commit is contained in:
2026-03-03 13:39:56 +00:00
parent b1cc8ab5a1
commit c5293ca9fe
13 changed files with 1220 additions and 582 deletions

View File

@@ -83,7 +83,7 @@
--button-bg: rgba(255, 255, 255, 0.7);
--button-border: rgba(255, 255, 255, 0.9);
--button-text: #0f172a;
--button-hover-bg: rgba(255, 255, 255, 1);
--button-hover-bg: rgba(15, 23, 42, 0.1);
--button-hover-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
--button-active-shadow: 0 0 18px rgba(14, 165, 233, 0.25);
--title-gradient: linear-gradient(45deg, #0ea5e9, #6366f1);
@@ -135,7 +135,7 @@ body {
display: flex;
justify-content: center;
width: 100%;
max-width: 800px;
max-width: 100%;
margin: 0 auto;
height: 100%;
padding: 0.5rem;
@@ -148,6 +148,7 @@ body {
display: flex;
flex-direction: column;
gap: 1.5rem;
height: 100%;
max-height: 100%;
overflow-y: auto;
background: var(--glass-bg);
@@ -178,7 +179,7 @@ body {
.tool-title {
margin: 0;
text-align: center;
text-align: left;
font-size: 1.5rem;
font-weight: 600;
background: var(--title-gradient);
@@ -194,14 +195,13 @@ body {
.tool-textarea,
.select-input {
width: 100%;
padding: 1rem;
padding: 0.75rem 1rem;
background-color: var(--toggle-bg);
border: 1px solid var(--toggle-border);
border-radius: 12px;
border-radius: 8px;
color: var(--text-color);
font-family: inherit;
font-size: 1rem;
line-height: 1.6;
font-size: 0.95rem;
transition: all 0.3s ease;
box-sizing: border-box;
}
@@ -216,10 +216,12 @@ body {
appearance: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'%3E%3C/path%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 1rem center;
background-size: 1.2rem;
padding-right: 3rem;
background-position: right 0.75rem center;
background-size: 1rem;
padding-right: 2.5rem;
height: 40px;
cursor: pointer;
line-height: 1;
}
.tool-textarea:focus,
@@ -265,9 +267,10 @@ body {
background: var(--button-bg);
border: 1px solid var(--button-border);
color: var(--button-text);
padding: 8px 16px;
padding: 0 1.25rem;
height: 40px;
border-radius: 8px;
font-weight: 600;
font-weight: 500;
cursor: pointer;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
@@ -355,10 +358,10 @@ button:focus {
outline: none;
}
/* Custom focus ring for all form elements */
input:focus,
select:focus,
textarea:focus {
textarea:focus,
.number-control:focus-within {
border-color: var(--primary-accent) !important;
box-shadow: 0 0 0 1px var(--primary-accent) !important;
}
@@ -433,3 +436,209 @@ textarea:focus {
border-color: white;
/* Keep checkmark white even in light mode if background is primary-accent */
}
/* --- Global Header/Action Patterns --- */
.panel-header {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 1rem;
width: 100%;
min-height: 40px;
}
.header-actions {
display: flex;
align-items: center;
gap: 0.8rem;
}
/* --- Global Icon Button Styles --- */
.icon-btn {
background: none;
border: none;
color: var(--text-secondary);
cursor: pointer;
padding: 0.5rem;
border-radius: 8px;
transition: all 0.2s;
display: flex;
align-items: center;
justify-content: center;
}
.icon-btn:hover {
color: var(--text-color);
background: var(--button-hover-bg);
}
.icon-btn.delete-btn:hover {
color: #ef4444;
background: rgba(239, 68, 68, 0.1);
}
:root[data-theme="light"] .icon-btn.delete-btn:hover {
color: #dc2626;
background: rgba(220, 38, 38, 0.05);
}
/* --- Component Specific Theme Overrides (Consolidated) --- */
:root[data-theme="light"] .settings-btn {
background: rgba(0, 0, 0, 0.03);
}
:root[data-theme="light"] .savings {
color: #16a34a;
font-weight: 500;
}
:root[data-theme="light"] .modal-overlay {
background: rgba(255, 255, 255, 0.3);
}
:root[data-theme="light"] .add-rule-form,
:root[data-theme="light"] .rule-item {
background: rgba(0, 0, 0, 0.04);
border: 1px solid rgba(0, 0, 0, 0.06);
}
/* --- Global Number Control Styles --- */
.number-control {
display: flex;
align-items: stretch;
background: var(--toggle-bg);
border: 1px solid var(--toggle-border);
border-radius: 8px;
overflow: hidden;
height: 40px;
}
.control-btn {
background: none;
border: none;
color: var(--text-color);
font-size: 0.9rem;
min-width: 40px;
padding: 0 0.5rem;
cursor: pointer;
transition: all 0.2s;
display: flex;
align-items: center;
justify-content: center;
font-weight: 400;
}
.control-btn:hover {
background: var(--button-hover-bg);
color: var(--primary-accent);
}
.number-input {
background: none;
border: none;
color: var(--text-color);
flex: 1;
min-width: 60px;
text-align: center;
font-size: 1rem;
font-weight: 400;
appearance: textfield;
}
.number-input::-webkit-outer-spin-button,
.number-input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
/* --- Global List/History Styles --- */
.results-section,
.history-section {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
background: var(--glass-bg);
border: 1px solid var(--glass-border);
border-radius: 12px;
}
.history-header,
.results-header {
padding: 1rem;
border-bottom: 1px solid var(--glass-border);
display: flex;
justify-content: space-between;
align-items: center;
}
.history-header h3,
.results-header h3 {
margin: 0;
font-size: 1.1rem;
color: var(--text-strong);
}
.history-list,
.codes-list {
flex: 1;
overflow-y: auto;
padding: 0;
}
.history-item,
.code-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem;
border-bottom: 1px solid var(--glass-border);
transition: background 0.2s;
}
.history-item:last-child,
.code-item:last-child {
border-bottom: none;
}
.history-item:hover,
.code-item:hover {
background: var(--list-hover-bg);
}
.item-info,
.code-content {
flex: 1;
overflow: hidden;
padding-right: 1rem;
}
.item-actions {
display: flex;
gap: 0.5rem;
align-items: center;
}
.status-dot {
width: 8px;
height: 8px;
border-radius: 50%;
background-color: #4ade80;
box-shadow: 0 0 8px #4ade80;
animation: pulse 2s infinite;
}
@keyframes pulse {
0% {
opacity: 1;
}
50% {
opacity: 0.5;
}
100% {
opacity: 1;
}
}