Skip to content

Commit 97e9f40

Browse files
Merge pull request #1073 from adamvangrover/bolt-optimize-css-injections-5504699732228063706
⚡ Bolt: Remove inline style injections to prevent layout thrashing
2 parents 370b938 + 6978266 commit 97e9f40

5 files changed

Lines changed: 59 additions & 63 deletions

File tree

services/webapp/client/src/components/promptAlpha/NewsWire.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,6 @@ export const NewsWire: React.FC = () => {
9494
))}
9595
</div>
9696

97-
<style>{`
98-
.animate-spin-slow { animation: spin 4s linear infinite; }
99-
@keyframes spin { 100% { transform: rotate(360deg); } }
100-
@keyframes flash {
101-
0% { background-color: rgba(34, 211, 238, 0.2); }
102-
100% { background-color: transparent; }
103-
}
104-
.animate-flash { animation: flash 1s ease-out; }
105-
`}</style>
10697
</div>
10798
);
10899
};

services/webapp/client/src/components/promptAlpha/TickerTape.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,6 @@ export const TickerTape: React.FC = () => {
2929
))}
3030
{/* Duplicate for seamless loop if needed, simplified here */}
3131
</div>
32-
<style>{`
33-
@keyframes marquee {
34-
0% { transform: translateX(0); }
35-
100% { transform: translateX(-100%); }
36-
}
37-
.animate-marquee {
38-
animation: marquee 30s linear infinite;
39-
}
40-
`}</style>
4132
</div>
4233
);
4334
};

services/webapp/client/src/index.css

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,61 @@
5050
0% { transform: rotate(0deg); }
5151
100% { transform: rotate(360deg); }
5252
}
53+
54+
/* Extracted Animations to prevent layout thrashing */
55+
56+
.animate-spin-slow { animation: spin 4s linear infinite; }
57+
@keyframes flash {
58+
0% { background-color: rgba(34, 211, 238, 0.2); }
59+
100% { background-color: transparent; }
60+
}
61+
.animate-flash { animation: flash 1s ease-out; }
62+
63+
@keyframes marquee {
64+
0% { transform: translateX(0); }
65+
100% { transform: translateX(-100%); }
66+
}
67+
.animate-marquee {
68+
animation: marquee 30s linear infinite;
69+
}
70+
71+
@keyframes scan-synthesizer {
72+
0% { transform: translateY(-100%); opacity: 0; }
73+
50% { opacity: 1; }
74+
100% { transform: translateY(1000%); opacity: 0; }
75+
}
76+
77+
@keyframes scan-evolution {
78+
0% { top: 0%; }
79+
100% { top: 100%; }
80+
}
81+
.scan-line {
82+
width: 100%;
83+
height: 2px;
84+
background: rgba(168, 85, 247, 0.3);
85+
opacity: 0.5;
86+
animation: scan-evolution 4s linear infinite;
87+
position: fixed;
88+
top: 0;
89+
pointer-events: none;
90+
z-index: 50;
91+
}
92+
.glass-panel {
93+
background: rgba(13, 20, 31, 0.7);
94+
backdrop-filter: blur(12px);
95+
border: 1px solid rgba(59, 130, 246, 0.15);
96+
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
97+
}
98+
.glass-panel-active {
99+
border: 1px solid rgba(168, 85, 247, 0.4);
100+
box-shadow: 0 0 20px rgba(168, 85, 247, 0.15);
101+
}
102+
.text-glow {
103+
text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
104+
}
105+
106+
/* Scrollbar */
107+
::-webkit-scrollbar { width: 8px; }
108+
::-webkit-scrollbar-track { background: #0f172a; }
109+
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
110+
::-webkit-scrollbar-thumb:hover { background: #475569; }

services/webapp/client/src/pages/EvolutionHub.tsx

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -234,42 +234,6 @@ const EvolutionHub = () => {
234234

235235
return (
236236
<div className="min-h-screen bg-[#050b14] text-slate-200 font-mono relative overflow-hidden flex flex-col">
237-
{/* Custom CSS */}
238-
<style>{`
239-
@keyframes scan {
240-
0% { top: 0%; }
241-
100% { top: 100%; }
242-
}
243-
.scan-line {
244-
width: 100%;
245-
height: 2px;
246-
background: rgba(168, 85, 247, 0.3);
247-
opacity: 0.5;
248-
animation: scan 4s linear infinite;
249-
position: fixed;
250-
top: 0;
251-
pointer-events: none;
252-
z-index: 50;
253-
}
254-
.glass-panel {
255-
background: rgba(13, 20, 31, 0.7);
256-
backdrop-filter: blur(12px);
257-
border: 1px solid rgba(59, 130, 246, 0.15);
258-
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
259-
}
260-
.glass-panel-active {
261-
border: 1px solid rgba(168, 85, 247, 0.4);
262-
box-shadow: 0 0 20px rgba(168, 85, 247, 0.15);
263-
}
264-
.text-glow {
265-
text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
266-
}
267-
/* Scrollbar */
268-
::-webkit-scrollbar { width: 8px; }
269-
::-webkit-scrollbar-track { background: #0f172a; }
270-
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
271-
::-webkit-scrollbar-thumb:hover { background: #475569; }
272-
`}</style>
273237

274238
<div className="scan-line"></div>
275239

services/webapp/client/src/pages/Synthesizer.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -327,22 +327,14 @@ const Synthesizer: React.FC = () => {
327327
{Object.entries(conviction).map(([agent, val]) => (
328328
<div key={agent} style={{ textAlign: 'center', padding: '10px', background: `rgba(0, 255, 0, ${val * 0.3})`, border: `1px solid rgba(0,255,0,${val})`, borderRadius: '4px', position: 'relative', overflow: 'hidden' }}>
329329
{/* Animated scanning bar */}
330-
<div style={{ position: 'absolute', top: 0, left: 0, right: 0, height: '2px', background: 'rgba(255,255,255,0.5)', animation: 'scan 3s linear infinite' }}></div>
330+
<div style={{ position: 'absolute', top: 0, left: 0, right: 0, height: '2px', background: 'rgba(255,255,255,0.5)', animation: 'scan-synthesizer 3s linear infinite' }}></div>
331331
<div style={{ fontSize: '0.7rem', fontWeight: 'bold' }}>{agent}</div>
332332
<div style={{ fontSize: '1.2rem', color: '#fff' }}>{(val * 100).toFixed(0)}%</div>
333333
{val > 0.8 && <div style={{ fontSize: '0.55rem', color: '#000', background: '#0f0', padding: '2px', marginTop: '5px', borderRadius: '2px' }}>HIGH CONVICTION</div>}
334334
{val < 0.3 && <div style={{ fontSize: '0.55rem', color: '#000', background: '#f00', padding: '2px', marginTop: '5px', borderRadius: '2px' }}>LOW CONVICTION</div>}
335335
</div>
336336
))}
337337
</div>
338-
{/* Add keyframes globally for scanning bar */}
339-
<style>{`
340-
@keyframes scan {
341-
0% { transform: translateY(-100%); opacity: 0; }
342-
50% { opacity: 1; }
343-
100% { transform: translateY(1000%); opacity: 0; }
344-
}
345-
`}</style>
346338
</div>
347339

348340
{/* 7. Forecast Chart (SVG) */}

0 commit comments

Comments
 (0)