Skip to content

Commit f0f74e7

Browse files
committed
Add Comments and Remove repetative code
1 parent 2f48bba commit f0f74e7

File tree

1 file changed

+31
-62
lines changed

1 file changed

+31
-62
lines changed

static/style.css

Lines changed: 31 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,34 @@
1+
/* General body styles */
12
body {
23
font-family: Arial, sans-serif;
34
background-color: #f4f4f4;
45
margin: 0;
56
padding: 0;
67
}
78

9+
/* Main container alignment */
810
.container {
911
text-align: center;
1012
padding: 20px;
1113
}
1214

15+
/* Layout for top control buttons */
1316
.controls-container {
1417
display: flex;
1518
justify-content: center;
1619
gap: 20px;
1720
margin-bottom: 20px;
1821
}
1922

23+
/* Styling for each set of control buttons */
2024
.controls {
2125
display: flex;
2226
flex-direction: column;
2327
align-items: center;
2428
gap: 10px;
2529
}
2630

31+
/* Gradient animated heading */
2732
.header h1 {
2833
font-size: 48px;
2934
font-weight: bold;
@@ -41,11 +46,13 @@ body {
4146
100% { background-position: 100% 50%; }
4247
}
4348

49+
/* Heart icon styling */
4450
.heart {
4551
color: #a855f7;
4652
font-size: 1.2em;
4753
}
4854

55+
/* Button styling in controls */
4956
.controls button {
5057
padding: 15px 30px;
5158
margin: 10px;
@@ -59,21 +66,25 @@ body {
5966
width: 250px;
6067
}
6168

69+
/* Style for active buttons */
6270
.controls button.running {
6371
background: rgb(105, 206, 105);
6472
cursor: not-allowed;
6573
}
6674

75+
/* Disabled button style */
6776
.controls button:disabled:not(.running) {
6877
background: linear-gradient(to right, #ec4899, #a855f7, #3b82f6);
6978
opacity: 1;
7079
cursor: not-allowed;
7180
}
7281

82+
/* Layout for app buttons section */
7383
.app-buttons {
7484
margin-top: 20px;
7585
}
7686

87+
/* Button rows with spacing */
7788
.row {
7889
display: flex;
7990
justify-content: center;
@@ -82,6 +93,7 @@ body {
8293
gap: 15px;
8394
}
8495

96+
/* Individual app button styling */
8597
.app-buttons button {
8698
white-space: nowrap;
8799
text-overflow: ellipsis;
@@ -99,17 +111,20 @@ body {
99111
transition: all 0.3s;
100112
}
101113

114+
/* Running app button appearance */
102115
.app-buttons button.running {
103116
background-color: rgb(105, 206, 105);
104117
color: white;
105118
cursor: not-allowed;
106119
}
107120

121+
/* Disabled app button style */
108122
.app-buttons button:disabled:not(.running) {
109123
opacity: 0.6;
110124
cursor: not-allowed;
111125
}
112126

127+
/* Generic popup box */
113128
.popup {
114129
position: fixed;
115130
top: 50%;
@@ -124,12 +139,14 @@ body {
124139
max-width: 90%;
125140
}
126141

142+
/* Popup title */
127143
.popup h3 {
128144
margin-top: 0;
129145
color: #a855f7;
130146
text-align: center;
131147
}
132148

149+
/* Popups initially hidden */
133150
#csvConfirmationPopup,
134151
#npgDevicePopup {
135152
animation: none; /* Disable fade-out */
@@ -138,29 +155,34 @@ body {
138155
display: none;
139156
}
140157

158+
/* Fade out other popups */
141159
.popup:not(#csvConfirmationPopup):not(#npgDevicePopup) {
142160
animation: fade-out 2s forwards;
143161
}
144162

163+
/* Higher z-index for priority popups */
145164
#csvConfirmationPopup,
146165
#npgDevicePopup {
147166
z-index: 1001; /* Higher than other popups */
148167
}
149168

169+
/* Popup content text */
150170
.popup p {
151171
font-size: 18px;
152172
margin-bottom: 20px;
153173
color: #333;
154174
text-align: center;
155175
}
156176

177+
/* Container for popup buttons */
157178
.popup-buttons {
158179
display: flex;
159180
justify-content: center;
160181
gap: 15px;
161182
margin-top: 20px;
162183
}
163184

185+
/* Common popup button style */
164186
.popup-button {
165187
padding: 10px 25px;
166188
font-size: 16px;
@@ -170,6 +192,7 @@ body {
170192
transition: all 0.2s;
171193
}
172194

195+
/* Yes and No buttons */
173196
.yes-button {
174197
background: linear-gradient(to right, #3b82f6, #a855f7);
175198
color: white;
@@ -180,6 +203,7 @@ body {
180203
color: white;
181204
}
182205

206+
/* Scrollable list of NPG devices */
183207
#npgDeviceList {
184208
max-height: 300px;
185209
overflow-y: auto;
@@ -189,6 +213,7 @@ body {
189213
padding: 10px;
190214
}
191215

216+
/* Each device item style */
192217
.npg-device-item {
193218
padding: 12px;
194219
margin: 8px 0;
@@ -207,6 +232,7 @@ body {
207232
color: white;
208233
}
209234

235+
/* Status display in popup */
210236
#npgPopupStatus {
211237
margin: 10px 0;
212238
min-height: 24px;
@@ -216,6 +242,7 @@ body {
216242
border-radius: 6px;
217243
}
218244

245+
/* Status color styles */
219246
.scanning-status {
220247
background: #dbeafe;
221248
color: #1d4ed8;
@@ -231,13 +258,15 @@ body {
231258
color: #b91c1c;
232259
}
233260

261+
/* Button row for NPG popup */
234262
.npg-popup-buttons {
235263
display: flex;
236264
justify-content: flex-end;
237265
gap: 10px;
238266
margin-top: 20px;
239267
}
240268

269+
/* NPG popup buttons */
241270
.npg-popup-btn {
242271
padding: 10px 20px;
243272
border: none;
@@ -291,69 +320,8 @@ body {
291320
color: #a855f7;
292321
text-align: center;
293322
}
294-
#npgDeviceList {
295-
max-height: 300px;
296-
overflow-y: auto;
297-
margin: 15px 0;
298-
border: 1px solid #eee;
299-
border-radius: 8px;
300-
padding: 10px;
301-
}
302-
.npg-device-item {
303-
padding: 12px;
304-
margin: 8px 0;
305-
background: #f8f9fa;
306-
border-radius: 6px;
307-
cursor: pointer;
308-
transition: all 0.2s;
309-
}
310-
.npg-device-item:hover {
311-
background: #e9ecef;
312-
}
313-
.npg-device-item.selected {
314-
background: #a855f7;
315-
color: white;
316-
}
317-
#npgPopupStatus {
318-
margin: 10px 0;
319-
min-height: 24px;
320-
font-weight: bold;
321-
text-align: center;
322-
}
323-
.scanning-status {
324-
color: #3b82f6;
325-
}
326-
.connected-status {
327-
color: #10b981;
328-
}
329-
.error-status {
330-
color: #ef4444;
331-
}
332-
.npg-popup-buttons {
333-
display: flex;
334-
justify-content: flex-end;
335-
gap: 10px;
336-
margin-top: 20px;
337-
}
338-
.npg-popup-btn {
339-
padding: 8px 20px;
340-
border: none;
341-
border-radius: 6px;
342-
cursor: pointer;
343-
font-weight: 500;
344-
}
345-
.npg-connect-btn {
346-
background: #10b981;
347-
color: white;
348-
}
349-
.npg-connect-btn:disabled {
350-
background: #a7f3d0;
351-
cursor: not-allowed;
352-
}
353-
.npg-cancel-btn {
354-
background: #f1f1f1;
355-
}
356323

324+
/* Bottom fixed text label */
357325
.bottom-text {
358326
position: fixed;
359327
bottom: 1px;
@@ -364,6 +332,7 @@ body {
364332
color: #666;
365333
}
366334

335+
/* Animation for fading out popups */
367336
@keyframes fade-out {
368337
0% { opacity: 1; }
369338
80% { opacity: 0.8; }

0 commit comments

Comments
 (0)