Skip to content

Commit c5ecd99

Browse files
NullskullsNeonGamerBot-QKCopilot
authored
Add lazy loading and sentiment graph instead of boolean plus fix styling (#1517)
* Add lazy loading and sentiment graph instead of boolean plus fix styling * Update app/javascript/controllers/lazy_load_controller.js Co-authored-by: Copilot <[email protected]> * Update app/javascript/controllers/lazy_load_controller.js Co-authored-by: Copilot <[email protected]> * Update app/controllers/admin/super_mega_dashboard_controller.rb Co-authored-by: Copilot <[email protected]> * Update app/assets/stylesheets/pages/admin/_super_mega_dashboard.scss Co-authored-by: Copilot <[email protected]> * Update app/controllers/admin/super_mega_dashboard_controller.rb Co-authored-by: Copilot <[email protected]> * Add shimmer and skeleton to indicate loading * forgot to add erb file * lint * lint? * lint?? * lint??! --------- Co-authored-by: Neon <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent 030f900 commit c5ecd99

File tree

7 files changed

+734
-772
lines changed

7 files changed

+734
-772
lines changed

app/assets/stylesheets/pages/admin/_super_mega_dashboard.scss

Lines changed: 134 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,107 @@
156156
text-align: right;
157157
}
158158

159+
&__placeholder-text {
160+
border-radius: 4px;
161+
background: linear-gradient(
162+
90deg,
163+
var(--color-tan-300) 25%,
164+
#e8dcc8 37%,
165+
var(--color-tan-300) 63%
166+
);
167+
background-size: 200% 100%;
168+
animation: smd-shimmer 1.4s ease-in-out infinite;
169+
170+
&--title {
171+
height: 1.5rem;
172+
width: 220px;
173+
}
174+
}
175+
176+
&__placeholder-card {
177+
background: linear-gradient(
178+
90deg,
179+
var(--color-tan-300) 25%,
180+
#e8dcc8 37%,
181+
var(--color-tan-300) 63%
182+
) !important;
183+
background-size: 200% 100% !important;
184+
animation: smd-shimmer 1.4s ease-in-out infinite;
185+
min-height: 180px;
186+
position: relative;
187+
188+
&.super-mega-dashboard__card--sw-graph {
189+
min-height: 260px;
190+
}
191+
}
192+
193+
@keyframes smd-shimmer {
194+
0% {
195+
background-position: 100% 0;
196+
}
197+
100% {
198+
background-position: -100% 0;
199+
}
200+
}
201+
202+
.smd-skeleton__line {
203+
height: 0.75rem;
204+
width: 100%;
205+
border-radius: 4px;
206+
margin-bottom: 0.6rem;
207+
background: linear-gradient(
208+
90deg,
209+
rgba(0, 0, 0, 0.06) 25%,
210+
rgba(0, 0, 0, 0.1) 37%,
211+
rgba(0, 0, 0, 0.06) 63%
212+
);
213+
background-size: 200% 100%;
214+
animation: smd-shimmer 1.4s ease-in-out infinite;
215+
216+
&--heading {
217+
height: 1rem;
218+
width: 50%;
219+
margin-bottom: 0.8rem;
220+
}
221+
222+
&--short {
223+
width: 40%;
224+
}
225+
226+
&--medium {
227+
width: 70%;
228+
}
229+
}
230+
231+
.smd-skeleton__badge {
232+
width: 60px;
233+
height: 1.8rem;
234+
border-radius: 0.5rem;
235+
margin: 0 auto 0.8rem;
236+
background: linear-gradient(
237+
90deg,
238+
rgba(0, 0, 0, 0.06) 25%,
239+
rgba(0, 0, 0, 0.1) 37%,
240+
rgba(0, 0, 0, 0.06) 63%
241+
);
242+
background-size: 200% 100%;
243+
animation: smd-shimmer 1.4s ease-in-out infinite;
244+
}
245+
246+
.smd-skeleton__chart {
247+
flex: 1;
248+
min-height: 160px;
249+
border-radius: 8px;
250+
background: linear-gradient(
251+
90deg,
252+
rgba(0, 0, 0, 0.04) 25%,
253+
rgba(0, 0, 0, 0.08) 37%,
254+
rgba(0, 0, 0, 0.04) 63%
255+
);
256+
background-size: 200% 100%;
257+
animation: smd-shimmer 1.4s ease-in-out infinite;
258+
}
259+
159260
&__cards--shipwrights {
160261
grid-template-columns: repeat(2, 1fr);
161262

@@ -191,7 +292,6 @@
191292
position: relative;
192293

193294
canvas {
194-
width: 100% !important;
195295
max-width: 100%;
196296
}
197297
}
@@ -449,6 +549,14 @@
449549
&--blue {
450550
color: #1e40af;
451551
}
552+
553+
&--green {
554+
color: #10b981;
555+
}
556+
557+
&--red {
558+
color: #ef4444;
559+
}
452560
}
453561
}
454562

@@ -461,24 +569,29 @@
461569
&__header-row {
462570
display: flex;
463571
align-items: center;
464-
justify-content: space-between;
465-
gap: 0.75rem;
466572
margin-bottom: 0.25rem;
467573

468574
h3 {
469575
margin: 0;
576+
flex: 1;
577+
text-align: center;
470578
}
471579
}
472580

581+
&__header-spacer {
582+
width: 52px;
583+
}
584+
473585
&__history-link {
474586
background: none;
475587
border: none;
476588
padding: 0;
477589
font: inherit;
478-
font-size: 0.95rem;
479-
color: #5c4033;
590+
font-size: 0.85rem;
591+
color: var(--color-brown-500);
480592
cursor: pointer;
481593
text-decoration: none;
594+
width: 52px;
482595

483596
&:hover {
484597
text-decoration: underline;
@@ -714,6 +827,18 @@
714827
}
715828
}
716829

830+
&__content--centered {
831+
text-align: center;
832+
833+
.sw-vibes-popup__reason-block {
834+
text-align: left;
835+
}
836+
837+
.sw-vibes-graph-wrap {
838+
text-align: left;
839+
}
840+
}
841+
717842
&__today-reason {
718843
margin-top: 0.75rem;
719844
padding: 0.75rem;
@@ -775,6 +900,10 @@
775900
height: 120px;
776901
margin: 0.5rem 0;
777902

903+
&--large {
904+
height: 200px;
905+
}
906+
778907
canvas {
779908
width: 100% !important;
780909
height: 100% !important;

0 commit comments

Comments
 (0)