nwb-video-widgets 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nwb_video_widgets/__init__.py +16 -0
- nwb_video_widgets/_utils.py +328 -0
- nwb_video_widgets/dandi_pose_widget.py +356 -0
- nwb_video_widgets/dandi_video_widget.py +155 -0
- nwb_video_widgets/local_pose_widget.py +334 -0
- nwb_video_widgets/local_video_widget.py +130 -0
- nwb_video_widgets/pose_widget.css +624 -0
- nwb_video_widgets/pose_widget.js +798 -0
- nwb_video_widgets/video_widget.css +484 -0
- nwb_video_widgets/video_widget.js +566 -0
- nwb_video_widgets/video_widget.py +170 -0
- nwb_video_widgets-0.1.0.dist-info/METADATA +174 -0
- nwb_video_widgets-0.1.0.dist-info/RECORD +15 -0
- nwb_video_widgets-0.1.0.dist-info/WHEEL +4 -0
- nwb_video_widgets-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,484 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Video Widget Styles
|
|
3
|
+
*
|
|
4
|
+
* Modern styling for the NWB multi-camera video player widget.
|
|
5
|
+
* Uses BEM naming convention to avoid global scope conflicts.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/* ==========================================================================
|
|
9
|
+
CSS Custom Properties
|
|
10
|
+
========================================================================== */
|
|
11
|
+
|
|
12
|
+
.video-widget {
|
|
13
|
+
/* Spacing */
|
|
14
|
+
--spacing-xs: 4px;
|
|
15
|
+
--spacing-sm: 8px;
|
|
16
|
+
--spacing-md: 12px;
|
|
17
|
+
--spacing-lg: 16px;
|
|
18
|
+
--spacing-xl: 24px;
|
|
19
|
+
|
|
20
|
+
/* Colors - Tailwind-inspired neutral palette */
|
|
21
|
+
--color-bg: #f7fafc;
|
|
22
|
+
--color-surface: #ffffff;
|
|
23
|
+
--color-border: #e2e8f0;
|
|
24
|
+
--color-border-hover: #cbd5e0;
|
|
25
|
+
--color-text-primary: #2d3748;
|
|
26
|
+
--color-text-secondary: #718096;
|
|
27
|
+
--color-text-muted: #a0aec0;
|
|
28
|
+
--color-accent: #4299e1;
|
|
29
|
+
--color-accent-dark: #3182ce;
|
|
30
|
+
--color-dark-surface: #4a5568;
|
|
31
|
+
--color-dark-hover: #2d3748;
|
|
32
|
+
--color-video-bg: #1a1a1a;
|
|
33
|
+
|
|
34
|
+
/* Shadows */
|
|
35
|
+
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.07);
|
|
36
|
+
--shadow-md:
|
|
37
|
+
0 1px 2px rgba(0, 0, 0, 0.07),
|
|
38
|
+
0 2px 4px rgba(0, 0, 0, 0.07),
|
|
39
|
+
0 4px 8px rgba(0, 0, 0, 0.07);
|
|
40
|
+
--shadow-lg:
|
|
41
|
+
0 2px 4px rgba(0, 0, 0, 0.1),
|
|
42
|
+
0 4px 8px rgba(0, 0, 0, 0.1),
|
|
43
|
+
0 8px 16px rgba(0, 0, 0, 0.1);
|
|
44
|
+
--shadow-focus: 0 0 0 3px rgba(66, 153, 225, 0.5);
|
|
45
|
+
|
|
46
|
+
/* Transitions */
|
|
47
|
+
--transition-fast: 150ms ease;
|
|
48
|
+
--transition-normal: 180ms ease-out;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* ==========================================================================
|
|
52
|
+
Root Wrapper
|
|
53
|
+
========================================================================== */
|
|
54
|
+
|
|
55
|
+
.video-widget {
|
|
56
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
57
|
+
padding: var(--spacing-lg);
|
|
58
|
+
background: var(--color-bg);
|
|
59
|
+
border-radius: 12px;
|
|
60
|
+
color: var(--color-text-primary);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* ==========================================================================
|
|
64
|
+
Playback Controls
|
|
65
|
+
========================================================================== */
|
|
66
|
+
|
|
67
|
+
.video-widget__controls {
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
gap: var(--spacing-md);
|
|
71
|
+
padding: var(--spacing-sm);
|
|
72
|
+
background: var(--color-surface);
|
|
73
|
+
border-radius: 8px;
|
|
74
|
+
border: 1px solid var(--color-border);
|
|
75
|
+
margin-top: var(--spacing-md);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* ==========================================================================
|
|
79
|
+
Button Styling
|
|
80
|
+
========================================================================== */
|
|
81
|
+
|
|
82
|
+
.video-widget__button {
|
|
83
|
+
/* Reset browser defaults */
|
|
84
|
+
border: none;
|
|
85
|
+
background-color: transparent;
|
|
86
|
+
font-family: inherit;
|
|
87
|
+
cursor: pointer;
|
|
88
|
+
|
|
89
|
+
/* Flexbox for icon + text alignment */
|
|
90
|
+
display: inline-flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
justify-content: center;
|
|
93
|
+
gap: 6px;
|
|
94
|
+
|
|
95
|
+
/* Visual styling */
|
|
96
|
+
background-color: var(--color-dark-surface);
|
|
97
|
+
color: #fff;
|
|
98
|
+
border-radius: 8px;
|
|
99
|
+
padding: 0.5em 1em;
|
|
100
|
+
min-height: 44px;
|
|
101
|
+
min-width: 44px;
|
|
102
|
+
font-size: 14px;
|
|
103
|
+
font-weight: 500;
|
|
104
|
+
|
|
105
|
+
/* Layered shadows for realistic depth */
|
|
106
|
+
box-shadow: var(--shadow-md);
|
|
107
|
+
transition: all var(--transition-normal);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.video-widget__button:hover {
|
|
111
|
+
background-color: var(--color-dark-hover);
|
|
112
|
+
transform: translateY(-1px);
|
|
113
|
+
box-shadow: var(--shadow-lg);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.video-widget__button:active {
|
|
117
|
+
transform: translateY(0);
|
|
118
|
+
box-shadow: var(--shadow-sm);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* Accessible focus state */
|
|
122
|
+
.video-widget__button:focus {
|
|
123
|
+
outline: none;
|
|
124
|
+
box-shadow: var(--shadow-focus), var(--shadow-sm);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* ==========================================================================
|
|
128
|
+
Seek Bar (Cross-Browser)
|
|
129
|
+
========================================================================== */
|
|
130
|
+
|
|
131
|
+
.video-widget__seekbar {
|
|
132
|
+
-webkit-appearance: none;
|
|
133
|
+
appearance: none;
|
|
134
|
+
flex: 1;
|
|
135
|
+
height: 6px;
|
|
136
|
+
border-radius: 3px;
|
|
137
|
+
background: var(--color-border);
|
|
138
|
+
cursor: pointer;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* Thumb - WebKit (Chrome, Safari, Edge) */
|
|
142
|
+
.video-widget__seekbar::-webkit-slider-thumb {
|
|
143
|
+
-webkit-appearance: none;
|
|
144
|
+
width: 16px;
|
|
145
|
+
height: 16px;
|
|
146
|
+
border-radius: 50%;
|
|
147
|
+
background: var(--color-dark-surface);
|
|
148
|
+
border: 2px solid var(--color-surface);
|
|
149
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
|
|
150
|
+
cursor: grab;
|
|
151
|
+
transition: transform var(--transition-fast);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.video-widget__seekbar::-webkit-slider-thumb:hover {
|
|
155
|
+
transform: scale(1.15);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.video-widget__seekbar::-webkit-slider-thumb:active {
|
|
159
|
+
cursor: grabbing;
|
|
160
|
+
transform: scale(1.1);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* Thumb - Firefox */
|
|
164
|
+
.video-widget__seekbar::-moz-range-thumb {
|
|
165
|
+
width: 16px;
|
|
166
|
+
height: 16px;
|
|
167
|
+
border-radius: 50%;
|
|
168
|
+
background: var(--color-dark-surface);
|
|
169
|
+
border: 2px solid var(--color-surface);
|
|
170
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
|
|
171
|
+
cursor: grab;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/* Track - Firefox */
|
|
175
|
+
.video-widget__seekbar::-moz-range-track {
|
|
176
|
+
height: 6px;
|
|
177
|
+
border-radius: 3px;
|
|
178
|
+
background: var(--color-border);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/* Focus state */
|
|
182
|
+
.video-widget__seekbar:focus {
|
|
183
|
+
outline: none;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.video-widget__seekbar:focus::-webkit-slider-thumb {
|
|
187
|
+
box-shadow: var(--shadow-focus);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.video-widget__seekbar:focus::-moz-range-thumb {
|
|
191
|
+
box-shadow: var(--shadow-focus);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/* ==========================================================================
|
|
195
|
+
Time Label
|
|
196
|
+
========================================================================== */
|
|
197
|
+
|
|
198
|
+
.video-widget__time-label {
|
|
199
|
+
font-family: "SF Mono", "Cascadia Code", "Fira Code", Consolas, monospace;
|
|
200
|
+
font-size: 12px;
|
|
201
|
+
color: var(--color-text-secondary);
|
|
202
|
+
min-width: 100px;
|
|
203
|
+
text-align: right;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/* ==========================================================================
|
|
207
|
+
Video Grid
|
|
208
|
+
========================================================================== */
|
|
209
|
+
|
|
210
|
+
.video-widget__grid {
|
|
211
|
+
display: grid;
|
|
212
|
+
gap: var(--spacing-md);
|
|
213
|
+
justify-content: center;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.video-widget__video-cell {
|
|
217
|
+
text-align: center;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.video-widget__video-container {
|
|
221
|
+
position: relative;
|
|
222
|
+
border-radius: 8px;
|
|
223
|
+
border: 1px solid var(--color-border);
|
|
224
|
+
overflow: hidden;
|
|
225
|
+
background: var(--color-video-bg);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.video-widget__video {
|
|
229
|
+
display: block;
|
|
230
|
+
width: 320px;
|
|
231
|
+
height: 240px;
|
|
232
|
+
object-fit: fill;
|
|
233
|
+
background-color: var(--color-video-bg);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.video-widget__video-label {
|
|
237
|
+
font-weight: 600;
|
|
238
|
+
font-size: 14px;
|
|
239
|
+
margin: var(--spacing-sm) 0 0 0;
|
|
240
|
+
color: var(--color-text-primary);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/* ==========================================================================
|
|
244
|
+
Loading State
|
|
245
|
+
========================================================================== */
|
|
246
|
+
|
|
247
|
+
.video-widget__loading {
|
|
248
|
+
position: absolute;
|
|
249
|
+
top: 50%;
|
|
250
|
+
left: 50%;
|
|
251
|
+
transform: translate(-50%, -50%);
|
|
252
|
+
display: none;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.video-widget__video-container--loading .video-widget__loading {
|
|
256
|
+
display: block;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.video-widget__spinner {
|
|
260
|
+
width: 32px;
|
|
261
|
+
height: 32px;
|
|
262
|
+
border: 3px solid var(--color-border);
|
|
263
|
+
border-top-color: var(--color-accent);
|
|
264
|
+
border-radius: 50%;
|
|
265
|
+
animation: video-widget-spin 0.8s linear infinite;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
@keyframes video-widget-spin {
|
|
269
|
+
to {
|
|
270
|
+
transform: rotate(360deg);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/* ==========================================================================
|
|
275
|
+
Settings Button
|
|
276
|
+
========================================================================== */
|
|
277
|
+
|
|
278
|
+
.video-widget__settings-btn {
|
|
279
|
+
padding: 0.5em;
|
|
280
|
+
min-width: 44px;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/* ==========================================================================
|
|
284
|
+
Settings Panel
|
|
285
|
+
========================================================================== */
|
|
286
|
+
|
|
287
|
+
.video-widget__settings-panel {
|
|
288
|
+
max-height: 0;
|
|
289
|
+
overflow: hidden;
|
|
290
|
+
transition: max-height var(--transition-normal), padding var(--transition-normal);
|
|
291
|
+
background: var(--color-surface);
|
|
292
|
+
border-radius: 8px;
|
|
293
|
+
border: 1px solid var(--color-border);
|
|
294
|
+
margin-bottom: 0;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.video-widget__settings-panel--open {
|
|
298
|
+
max-height: 500px;
|
|
299
|
+
padding: var(--spacing-md);
|
|
300
|
+
margin-bottom: var(--spacing-md);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.video-widget__settings-header {
|
|
304
|
+
display: flex;
|
|
305
|
+
justify-content: space-between;
|
|
306
|
+
align-items: center;
|
|
307
|
+
margin-bottom: var(--spacing-md);
|
|
308
|
+
padding-bottom: var(--spacing-sm);
|
|
309
|
+
border-bottom: 1px solid var(--color-border);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.video-widget__settings-title {
|
|
313
|
+
font-weight: 600;
|
|
314
|
+
font-size: 14px;
|
|
315
|
+
color: var(--color-text-primary);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.video-widget__close-btn {
|
|
319
|
+
border: none;
|
|
320
|
+
background: transparent;
|
|
321
|
+
color: var(--color-text-secondary);
|
|
322
|
+
cursor: pointer;
|
|
323
|
+
font-size: 12px;
|
|
324
|
+
padding: var(--spacing-xs) var(--spacing-sm);
|
|
325
|
+
border-radius: 4px;
|
|
326
|
+
transition: background var(--transition-fast), color var(--transition-fast);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.video-widget__close-btn:hover {
|
|
330
|
+
background: var(--color-border);
|
|
331
|
+
color: var(--color-text-primary);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/* ==========================================================================
|
|
335
|
+
Section Titles
|
|
336
|
+
========================================================================== */
|
|
337
|
+
|
|
338
|
+
.video-widget__section-title {
|
|
339
|
+
display: block;
|
|
340
|
+
font-weight: 600;
|
|
341
|
+
font-size: 13px;
|
|
342
|
+
color: var(--color-text-primary);
|
|
343
|
+
margin-bottom: var(--spacing-xs);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.video-widget__section-hint {
|
|
347
|
+
font-size: 12px;
|
|
348
|
+
color: var(--color-text-secondary);
|
|
349
|
+
margin: 0 0 var(--spacing-sm) 0;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/* ==========================================================================
|
|
353
|
+
Video Selection Section
|
|
354
|
+
========================================================================== */
|
|
355
|
+
|
|
356
|
+
.video-widget__video-selection-section {
|
|
357
|
+
margin-bottom: var(--spacing-md);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/* ==========================================================================
|
|
361
|
+
Video List
|
|
362
|
+
========================================================================== */
|
|
363
|
+
|
|
364
|
+
.video-widget__video-list {
|
|
365
|
+
margin-bottom: 0;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.video-widget__video-item {
|
|
369
|
+
display: flex;
|
|
370
|
+
align-items: center;
|
|
371
|
+
gap: var(--spacing-sm);
|
|
372
|
+
padding: var(--spacing-sm);
|
|
373
|
+
border-radius: 4px;
|
|
374
|
+
transition: background var(--transition-fast);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
.video-widget__video-item:hover {
|
|
378
|
+
background: var(--color-bg);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.video-widget__video-item--incompatible {
|
|
382
|
+
opacity: 0.5;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.video-widget__video-item--incompatible .video-widget__video-item-label {
|
|
386
|
+
color: var(--color-text-muted);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
.video-widget__video-item input[type="checkbox"] {
|
|
390
|
+
width: 16px;
|
|
391
|
+
height: 16px;
|
|
392
|
+
cursor: pointer;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.video-widget__video-item input[type="checkbox"]:disabled {
|
|
396
|
+
cursor: not-allowed;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.video-widget__video-item-label {
|
|
400
|
+
flex: 1;
|
|
401
|
+
font-size: 13px;
|
|
402
|
+
color: var(--color-text-primary);
|
|
403
|
+
cursor: pointer;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
.video-widget__video-item-time {
|
|
407
|
+
font-family: "SF Mono", "Cascadia Code", "Fira Code", Consolas, monospace;
|
|
408
|
+
font-size: 11px;
|
|
409
|
+
color: var(--color-text-secondary);
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
.video-widget__warning-icon {
|
|
413
|
+
color: #e53e3e;
|
|
414
|
+
display: flex;
|
|
415
|
+
align-items: center;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
.video-widget__warning-icon svg {
|
|
419
|
+
width: 14px;
|
|
420
|
+
height: 14px;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
.video-widget__empty-msg {
|
|
424
|
+
color: var(--color-text-muted);
|
|
425
|
+
font-size: 13px;
|
|
426
|
+
padding: var(--spacing-sm);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
/* ==========================================================================
|
|
430
|
+
Layout Section
|
|
431
|
+
========================================================================== */
|
|
432
|
+
|
|
433
|
+
.video-widget__layout-section {
|
|
434
|
+
padding-top: var(--spacing-md);
|
|
435
|
+
border-top: 1px solid var(--color-border);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.video-widget__layout-options {
|
|
439
|
+
display: flex;
|
|
440
|
+
align-items: center;
|
|
441
|
+
gap: var(--spacing-md);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.video-widget__layout-option {
|
|
445
|
+
display: flex;
|
|
446
|
+
align-items: center;
|
|
447
|
+
gap: var(--spacing-xs);
|
|
448
|
+
cursor: pointer;
|
|
449
|
+
font-size: 13px;
|
|
450
|
+
color: var(--color-text-secondary);
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
.video-widget__layout-option input[type="radio"] {
|
|
454
|
+
cursor: pointer;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
.video-widget__layout-option:hover {
|
|
458
|
+
color: var(--color-text-primary);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
/* ==========================================================================
|
|
462
|
+
Empty Grid Message
|
|
463
|
+
========================================================================== */
|
|
464
|
+
|
|
465
|
+
.video-widget__empty-grid-msg {
|
|
466
|
+
text-align: center;
|
|
467
|
+
padding: var(--spacing-xl);
|
|
468
|
+
color: var(--color-text-muted);
|
|
469
|
+
font-size: 14px;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/* ==========================================================================
|
|
473
|
+
Accessibility - High Contrast Mode
|
|
474
|
+
========================================================================== */
|
|
475
|
+
|
|
476
|
+
@media (forced-colors: active) {
|
|
477
|
+
.video-widget__button {
|
|
478
|
+
border: 2px solid currentColor;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
.video-widget__video-container {
|
|
482
|
+
border: 2px solid currentColor;
|
|
483
|
+
}
|
|
484
|
+
}
|