Add smooth animations across WebUI for modern feel
- Tab panels: fade-in with subtle translateY on switch - Cards: hover lift (translateY -2px), staggered entrance animation - Modals: spring-curve entrance with backdrop blur - Buttons: press feedback (scale down on :active) - Toggle switches: spring overshoot on knob transition - Toast: smooth bounce-in replaces jarring shake - Sections: animated height collapse/expand with chevron rotation - Command palette: slide-down entrance animation - Theme switch: smooth color transitions on key elements - Dashboard: section collapse animation, target row hover - Respects prefers-reduced-motion globally Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -71,3 +71,23 @@ body.modal-open {
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
/* ── Smooth theme transitions ── */
|
||||
body,
|
||||
.card,
|
||||
.template-card,
|
||||
.modal-content,
|
||||
.dashboard-target,
|
||||
.perf-chart-card,
|
||||
header {
|
||||
transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
|
||||
}
|
||||
|
||||
/* ── Respect reduced motion preference ── */
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
*, *::before, *::after {
|
||||
animation-duration: 0.01ms !important;
|
||||
animation-iteration-count: 1 !important;
|
||||
transition-duration: 0.01ms !important;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,12 +23,13 @@ section {
|
||||
border: 2px dashed var(--border-color);
|
||||
background: transparent;
|
||||
min-height: 160px;
|
||||
transition: border-color 0.2s, background 0.2s;
|
||||
transition: border-color 0.25s ease, background 0.25s ease, transform 0.2s ease;
|
||||
}
|
||||
|
||||
.add-device-card:hover {
|
||||
border-color: var(--primary-color);
|
||||
background: rgba(33, 150, 243, 0.05);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.add-device-icon {
|
||||
@@ -55,13 +56,24 @@ section {
|
||||
border-radius: 8px;
|
||||
padding: 12px 20px 20px;
|
||||
position: relative;
|
||||
transition: transform 0.2s, box-shadow 0.2s;
|
||||
transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.card:hover {
|
||||
box-shadow: 0 4px 12px var(--shadow-color);
|
||||
box-shadow: 0 8px 24px var(--shadow-color);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
/* ── Card entrance animation ── */
|
||||
@keyframes cardEnter {
|
||||
from { opacity: 0; transform: translateY(12px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
|
||||
.card-enter {
|
||||
animation: cardEnter 0.25s ease-out both;
|
||||
}
|
||||
|
||||
.card-tutorial-btn {
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
cursor: pointer;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 600;
|
||||
transition: opacity 0.2s;
|
||||
transition: opacity 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
|
||||
flex: 1 1 auto;
|
||||
min-width: 100px;
|
||||
}
|
||||
@@ -68,6 +68,11 @@
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.btn:active:not(:disabled) {
|
||||
transform: scale(0.97);
|
||||
transition-duration: 0.06s;
|
||||
}
|
||||
|
||||
.btn:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
@@ -100,6 +105,11 @@
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.btn-icon:active:not(:disabled) {
|
||||
transform: scale(0.92);
|
||||
transition-duration: 0.06s;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
@@ -129,7 +139,7 @@
|
||||
inset: 0;
|
||||
background: var(--border-color);
|
||||
border-radius: 9px;
|
||||
transition: background 0.2s;
|
||||
transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
.settings-toggle-slider::after {
|
||||
@@ -141,7 +151,7 @@
|
||||
height: 14px;
|
||||
background: white;
|
||||
border-radius: 50%;
|
||||
transition: transform 0.2s;
|
||||
transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
|
||||
}
|
||||
|
||||
.settings-toggle input:checked + .settings-toggle-slider {
|
||||
@@ -172,7 +182,7 @@ select {
|
||||
color: var(--text-color);
|
||||
font-size: 1rem;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
||||
transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
|
||||
transition: border-color 0.25s ease, box-shadow 0.25s ease, opacity 0.2s ease;
|
||||
}
|
||||
|
||||
input[type="number"]:disabled,
|
||||
@@ -196,7 +206,7 @@ input:focus,
|
||||
select:focus {
|
||||
outline: none;
|
||||
border-color: var(--primary-color);
|
||||
box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
|
||||
box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
|
||||
}
|
||||
|
||||
/* Remove browser autofill styling */
|
||||
@@ -339,7 +349,7 @@ input:-webkit-autofill:focus {
|
||||
font-weight: 600;
|
||||
font-size: 15px;
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s, transform 0.3s;
|
||||
transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
|
||||
z-index: 2500;
|
||||
box-shadow: 0 4px 20px var(--shadow-color);
|
||||
min-width: 300px;
|
||||
@@ -349,13 +359,14 @@ input:-webkit-autofill:focus {
|
||||
.toast.show {
|
||||
opacity: 1;
|
||||
transform: translateX(-50%) translateY(0);
|
||||
animation: toastShake 0.5s ease-in-out;
|
||||
animation: toastBounceIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
|
||||
}
|
||||
|
||||
@keyframes toastShake {
|
||||
0%, 100% { transform: translateX(-50%) translateY(0); }
|
||||
10%, 30%, 50%, 70%, 90% { transform: translateX(-50%) translateY(-5px); }
|
||||
20%, 40%, 60%, 80% { transform: translateX(-50%) translateY(5px); }
|
||||
@keyframes toastBounceIn {
|
||||
0% { transform: translateX(-50%) translateY(60px); opacity: 0; }
|
||||
50% { transform: translateX(-50%) translateY(-4px); opacity: 1; }
|
||||
70% { transform: translateX(-50%) translateY(2px); }
|
||||
100% { transform: translateX(-50%) translateY(0); }
|
||||
}
|
||||
|
||||
.toast.success {
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
color: var(--text-secondary);
|
||||
width: 10px;
|
||||
display: inline-block;
|
||||
transition: transform 0.2s ease;
|
||||
}
|
||||
|
||||
.dashboard-section-count {
|
||||
@@ -80,6 +81,11 @@
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 6px;
|
||||
margin-bottom: 4px;
|
||||
transition: box-shadow 0.2s ease, transform 0.2s ease;
|
||||
}
|
||||
|
||||
.dashboard-target:hover {
|
||||
box-shadow: 0 2px 8px var(--shadow-color);
|
||||
}
|
||||
|
||||
.dashboard-target-info {
|
||||
|
||||
@@ -133,7 +133,7 @@ h2 {
|
||||
cursor: pointer;
|
||||
border-bottom: 2px solid transparent;
|
||||
margin-bottom: -2px;
|
||||
transition: color 0.2s, border-color 0.2s;
|
||||
transition: color 0.2s ease, border-color 0.25s ease;
|
||||
}
|
||||
|
||||
.tab-btn:hover {
|
||||
@@ -171,6 +171,12 @@ h2 {
|
||||
|
||||
.tab-panel.active {
|
||||
display: block;
|
||||
animation: tabFadeIn 0.25s ease-out;
|
||||
}
|
||||
|
||||
@keyframes tabFadeIn {
|
||||
from { opacity: 0; transform: translateY(8px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
|
||||
/* Thin animated bar at top of tab panel during data refresh */
|
||||
@@ -257,6 +263,7 @@ h2 {
|
||||
inset: 0;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
backdrop-filter: blur(2px);
|
||||
animation: fadeIn 0.15s ease-out;
|
||||
}
|
||||
|
||||
.cp-dialog {
|
||||
@@ -272,6 +279,12 @@ h2 {
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
align-self: flex-start;
|
||||
animation: cpSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
|
||||
}
|
||||
|
||||
@keyframes cpSlideDown {
|
||||
from { opacity: 0; transform: translateY(-12px) scale(0.98); }
|
||||
to { opacity: 1; transform: translateY(0) scale(1); }
|
||||
}
|
||||
|
||||
.cp-input {
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
animation: fadeIn 0.2s ease-out;
|
||||
backdrop-filter: blur(2px);
|
||||
}
|
||||
|
||||
/* Confirm dialog must stack above all other modals */
|
||||
@@ -132,7 +133,7 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
box-shadow: 0 8px 32px var(--shadow-color);
|
||||
animation: slideUp 0.3s ease-out;
|
||||
animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
|
||||
}
|
||||
|
||||
#template-modal .modal-content {
|
||||
@@ -146,11 +147,11 @@
|
||||
|
||||
@keyframes slideUp {
|
||||
from {
|
||||
transform: translateY(20px);
|
||||
transform: translateY(20px) scale(0.98);
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
transform: translateY(0);
|
||||
transform: translateY(0) scale(1);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@@ -479,7 +480,7 @@
|
||||
content: '▶';
|
||||
font-size: 0.6rem;
|
||||
opacity: 0.6;
|
||||
transition: transform 0.15s;
|
||||
transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,14 +13,15 @@
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 8px;
|
||||
padding: 16px;
|
||||
transition: box-shadow 0.2s;
|
||||
transition: box-shadow 0.2s ease, transform 0.2s ease;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.template-card:hover {
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.add-template-card {
|
||||
@@ -32,13 +33,14 @@
|
||||
cursor: pointer;
|
||||
border: 2px dashed var(--border-color);
|
||||
background: transparent;
|
||||
transition: border-color 0.2s, background 0.2s;
|
||||
transition: border-color 0.25s ease, background 0.25s ease, transform 0.2s ease;
|
||||
}
|
||||
|
||||
.add-template-card:hover {
|
||||
border-color: var(--primary-color);
|
||||
background: rgba(33, 150, 243, 0.05);
|
||||
box-shadow: none;
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.add-template-icon {
|
||||
@@ -550,7 +552,7 @@
|
||||
cursor: pointer;
|
||||
border-bottom: 2px solid transparent;
|
||||
margin-bottom: -2px;
|
||||
transition: color 0.2s, border-color 0.2s;
|
||||
transition: color 0.2s ease, border-color 0.25s ease;
|
||||
}
|
||||
|
||||
.stream-tab-btn:hover {
|
||||
@@ -610,6 +612,7 @@
|
||||
|
||||
.stream-tab-panel.active {
|
||||
display: block;
|
||||
animation: tabFadeIn 0.2s ease-out;
|
||||
}
|
||||
|
||||
/* Sub-tab content sections */
|
||||
@@ -649,12 +652,18 @@
|
||||
padding: 8px 0;
|
||||
}
|
||||
|
||||
/* Prevent sticky header from clipping cards that lift on hover */
|
||||
[data-cs-content] {
|
||||
padding-top: 4px;
|
||||
}
|
||||
|
||||
.cs-chevron {
|
||||
font-size: 0.65rem;
|
||||
color: var(--text-secondary);
|
||||
width: 12px;
|
||||
display: inline-block;
|
||||
flex-shrink: 0;
|
||||
transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
.cs-title {
|
||||
|
||||
Reference in New Issue
Block a user