Spaces:
Sleeping
Sleeping
Kosala Nayanajith Deshapriya commited on
Commit ยท
6f78dda
1
Parent(s): 243de68
Add advanced UI modernizations: ambient background, glowing hover effects, custom loading UI
Browse files- dashboard.py +66 -18
dashboard.py
CHANGED
|
@@ -107,7 +107,36 @@ st.markdown("""
|
|
| 107 |
@keyframes ringPulse {
|
| 108 |
0%, 100% { filter: drop-shadow(0 0 3px rgba(99,102,241,0.3)); }
|
| 109 |
50% { filter: drop-shadow(0 0 8px rgba(99,102,241,0.6)); }
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
|
| 112 |
/* โโ Hero Title โโ */
|
| 113 |
.hero-title {
|
|
@@ -144,8 +173,9 @@ st.markdown("""
|
|
| 144 |
transition: transform var(--transition-fast), box-shadow var(--transition-fast);
|
| 145 |
}
|
| 146 |
.glass-card:hover {
|
| 147 |
-
transform: translateY(-
|
| 148 |
-
box-shadow: 0
|
|
|
|
| 149 |
}
|
| 150 |
|
| 151 |
/* โโ Metric Cards โโ */
|
|
@@ -169,8 +199,9 @@ st.markdown("""
|
|
| 169 |
background: linear-gradient(90deg, var(--accent-indigo), var(--accent-purple));
|
| 170 |
}
|
| 171 |
.metric-card:hover {
|
| 172 |
-
transform: translateY(-
|
| 173 |
-
box-shadow: 0
|
|
|
|
| 174 |
}
|
| 175 |
.metric-icon {
|
| 176 |
width: 42px; height: 42px; border-radius: 12px;
|
|
@@ -217,8 +248,9 @@ st.markdown("""
|
|
| 217 |
transition: transform var(--transition-fast), box-shadow var(--transition-fast);
|
| 218 |
}
|
| 219 |
.placement-card:hover {
|
| 220 |
-
transform: translateY(-
|
| 221 |
-
box-shadow: 0
|
|
|
|
| 222 |
}
|
| 223 |
.placement-card-warn {
|
| 224 |
background: var(--bg-card);
|
|
@@ -230,11 +262,12 @@ st.markdown("""
|
|
| 230 |
padding: 1.6rem;
|
| 231 |
margin-bottom: 1rem;
|
| 232 |
animation: fadeInUp 0.5s ease-out both;
|
| 233 |
-
transition:
|
| 234 |
}
|
| 235 |
.placement-card-warn:hover {
|
| 236 |
-
transform: translateY(-
|
| 237 |
-
box-shadow: 0
|
|
|
|
| 238 |
}
|
| 239 |
.placement-card-bad {
|
| 240 |
background: var(--bg-card);
|
|
@@ -246,11 +279,12 @@ st.markdown("""
|
|
| 246 |
padding: 1.6rem;
|
| 247 |
margin-bottom: 1rem;
|
| 248 |
animation: fadeInUp 0.5s ease-out both;
|
| 249 |
-
transition:
|
| 250 |
}
|
| 251 |
.placement-card-bad:hover {
|
| 252 |
-
transform: translateY(-
|
| 253 |
-
box-shadow: 0
|
|
|
|
| 254 |
}
|
| 255 |
.placement-header {
|
| 256 |
display: flex; justify-content: space-between;
|
|
@@ -724,20 +758,34 @@ if analyze_btn:
|
|
| 724 |
|
| 725 |
from pipeline import run_full_pipeline
|
| 726 |
|
| 727 |
-
|
| 728 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 729 |
steps_done = [0]
|
| 730 |
|
| 731 |
def on_progress(msg):
|
| 732 |
-
progress_box.info(msg)
|
| 733 |
steps_done[0] += 1
|
| 734 |
progress_bar.progress(min(steps_done[0] / 4, 1.0))
|
| 735 |
|
| 736 |
try:
|
| 737 |
-
|
| 738 |
-
run_full_pipeline(save_path, video_id, creds, progress_callback=on_progress)
|
| 739 |
progress_bar.progress(1.0)
|
| 740 |
-
|
| 741 |
st.session_state["analysis_done"] = True
|
| 742 |
st.rerun()
|
| 743 |
except Exception as e:
|
|
|
|
| 107 |
@keyframes ringPulse {
|
| 108 |
0%, 100% { filter: drop-shadow(0 0 3px rgba(99,102,241,0.3)); }
|
| 109 |
50% { filter: drop-shadow(0 0 8px rgba(99,102,241,0.6)); }
|
| 110 |
+
@keyframes orbFloat1 {
|
| 111 |
+
0% { transform: translate(0, 0) scale(1); }
|
| 112 |
+
50% { transform: translate(5vw, 10vh) scale(1.2); }
|
| 113 |
+
100% { transform: translate(-5vw, 5vh) scale(0.9); }
|
| 114 |
}
|
| 115 |
+
@keyframes orbFloat2 {
|
| 116 |
+
0% { transform: translate(0, 0) scale(1); }
|
| 117 |
+
50% { transform: translate(-10vw, -5vh) scale(1.1); }
|
| 118 |
+
100% { transform: translate(5vw, -10vh) scale(1); }
|
| 119 |
+
}
|
| 120 |
+
@keyframes progressPulse {
|
| 121 |
+
0% { opacity: 0.6; box-shadow: 0 0 10px rgba(99,102,241,0.2); }
|
| 122 |
+
50% { opacity: 1; box-shadow: 0 0 25px rgba(99,102,241,0.6); }
|
| 123 |
+
100% { opacity: 0.6; box-shadow: 0 0 10px rgba(99,102,241,0.2); }
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
/* โโ Ambient Background Orbs โโ */
|
| 127 |
+
[data-testid="stAppViewContainer"]::before {
|
| 128 |
+
content: ''; position: fixed; top: -10%; left: -10%; width: 40vw; height: 40vw;
|
| 129 |
+
background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, rgba(10,14,26,0) 70%);
|
| 130 |
+
border-radius: 50%; filter: blur(60px); z-index: 0; pointer-events: none;
|
| 131 |
+
animation: orbFloat1 25s infinite ease-in-out alternate;
|
| 132 |
+
}
|
| 133 |
+
[data-testid="stAppViewContainer"]::after {
|
| 134 |
+
content: ''; position: fixed; bottom: -10%; right: -10%; width: 50vw; height: 50vw;
|
| 135 |
+
background: radial-gradient(circle, rgba(34,211,238,0.05) 0%, rgba(10,14,26,0) 70%);
|
| 136 |
+
border-radius: 50%; filter: blur(80px); z-index: 0; pointer-events: none;
|
| 137 |
+
animation: orbFloat2 30s infinite ease-in-out alternate-reverse;
|
| 138 |
+
}
|
| 139 |
+
.main .block-container { z-index: 1; position: relative; }
|
| 140 |
|
| 141 |
/* โโ Hero Title โโ */
|
| 142 |
.hero-title {
|
|
|
|
| 173 |
transition: transform var(--transition-fast), box-shadow var(--transition-fast);
|
| 174 |
}
|
| 175 |
.glass-card:hover {
|
| 176 |
+
transform: translateY(-4px) scale(1.01);
|
| 177 |
+
box-shadow: 0 15px 40px rgba(99,102,241,0.15), 0 0 20px rgba(99,102,241,0.05) inset;
|
| 178 |
+
border-color: rgba(99,102,241,0.3);
|
| 179 |
}
|
| 180 |
|
| 181 |
/* โโ Metric Cards โโ */
|
|
|
|
| 199 |
background: linear-gradient(90deg, var(--accent-indigo), var(--accent-purple));
|
| 200 |
}
|
| 201 |
.metric-card:hover {
|
| 202 |
+
transform: translateY(-5px) scale(1.02);
|
| 203 |
+
box-shadow: 0 15px 45px rgba(139,92,246,0.15), 0 0 15px rgba(139,92,246,0.05) inset;
|
| 204 |
+
border-color: rgba(139,92,246,0.3);
|
| 205 |
}
|
| 206 |
.metric-icon {
|
| 207 |
width: 42px; height: 42px; border-radius: 12px;
|
|
|
|
| 248 |
transition: transform var(--transition-fast), box-shadow var(--transition-fast);
|
| 249 |
}
|
| 250 |
.placement-card:hover {
|
| 251 |
+
transform: translateY(-4px) scale(1.01);
|
| 252 |
+
box-shadow: 0 12px 35px var(--success-glow), 0 0 15px rgba(16,185,129,0.05) inset;
|
| 253 |
+
border-color: rgba(16,185,129,0.4);
|
| 254 |
}
|
| 255 |
.placement-card-warn {
|
| 256 |
background: var(--bg-card);
|
|
|
|
| 262 |
padding: 1.6rem;
|
| 263 |
margin-bottom: 1rem;
|
| 264 |
animation: fadeInUp 0.5s ease-out both;
|
| 265 |
+
transition: all var(--transition-smooth);
|
| 266 |
}
|
| 267 |
.placement-card-warn:hover {
|
| 268 |
+
transform: translateY(-4px) scale(1.01);
|
| 269 |
+
box-shadow: 0 12px 35px var(--warning-glow), 0 0 15px rgba(245,158,11,0.05) inset;
|
| 270 |
+
border-color: rgba(245,158,11,0.4);
|
| 271 |
}
|
| 272 |
.placement-card-bad {
|
| 273 |
background: var(--bg-card);
|
|
|
|
| 279 |
padding: 1.6rem;
|
| 280 |
margin-bottom: 1rem;
|
| 281 |
animation: fadeInUp 0.5s ease-out both;
|
| 282 |
+
transition: all var(--transition-smooth);
|
| 283 |
}
|
| 284 |
.placement-card-bad:hover {
|
| 285 |
+
transform: translateY(-4px) scale(1.01);
|
| 286 |
+
box-shadow: 0 12px 35px var(--danger-glow), 0 0 15px rgba(239,68,68,0.05) inset;
|
| 287 |
+
border-color: rgba(239,68,68,0.4);
|
| 288 |
}
|
| 289 |
.placement-header {
|
| 290 |
display: flex; justify-content: space-between;
|
|
|
|
| 758 |
|
| 759 |
from pipeline import run_full_pipeline
|
| 760 |
|
| 761 |
+
# Custom loading UI
|
| 762 |
+
loading_container = st.empty()
|
| 763 |
+
|
| 764 |
+
# Use columns to center the animation
|
| 765 |
+
with loading_container.container():
|
| 766 |
+
st.markdown("""
|
| 767 |
+
<div class="glass-card" style="text-align:center; padding:3rem; margin:2rem 0; animation: progressPulse 2s infinite;">
|
| 768 |
+
<div style="font-size:2.5rem; animation: float 3s infinite ease-in-out; margin-bottom:1rem;">๐ฎ</div>
|
| 769 |
+
<div style="font-size:1.3rem; font-weight:700; color:var(--text-primary); margin-bottom:0.5rem;">
|
| 770 |
+
Analyzing Video Content...
|
| 771 |
+
</div>
|
| 772 |
+
<div style="color:var(--accent-cyan); font-size:0.95rem; font-weight:600;" id="loading-msg">
|
| 773 |
+
Processing frames and audio
|
| 774 |
+
</div>
|
| 775 |
+
</div>
|
| 776 |
+
""", unsafe_allow_html=True)
|
| 777 |
+
progress_bar = st.progress(0)
|
| 778 |
+
|
| 779 |
steps_done = [0]
|
| 780 |
|
| 781 |
def on_progress(msg):
|
|
|
|
| 782 |
steps_done[0] += 1
|
| 783 |
progress_bar.progress(min(steps_done[0] / 4, 1.0))
|
| 784 |
|
| 785 |
try:
|
| 786 |
+
run_full_pipeline(save_path, video_id, creds, progress_callback=on_progress)
|
|
|
|
| 787 |
progress_bar.progress(1.0)
|
| 788 |
+
loading_container.empty()
|
| 789 |
st.session_state["analysis_done"] = True
|
| 790 |
st.rerun()
|
| 791 |
except Exception as e:
|