@djvlc/runtime-web 1.0.2 → 1.0.4

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.
@@ -0,0 +1,686 @@
1
+ /**
2
+ * DJV Runtime 基础样式
3
+ * 提供运行时渲染所需的基础样式
4
+ */
5
+
6
+ /* ==================== Reset & Base ==================== */
7
+
8
+ .djv-runtime {
9
+ box-sizing: border-box;
10
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
11
+ line-height: 1.5;
12
+ color: #333;
13
+ }
14
+
15
+ .djv-runtime *,
16
+ .djv-runtime *::before,
17
+ .djv-runtime *::after {
18
+ box-sizing: inherit;
19
+ }
20
+
21
+ /* ==================== Loading States ==================== */
22
+
23
+ .djv-loading {
24
+ display: flex;
25
+ align-items: center;
26
+ justify-content: center;
27
+ min-height: 200px;
28
+ color: #666;
29
+ }
30
+
31
+ .djv-loading-spinner {
32
+ width: 32px;
33
+ height: 32px;
34
+ border: 3px solid #e5e5e5;
35
+ border-top-color: #007bff;
36
+ border-radius: 50%;
37
+ animation: djv-spin 0.8s linear infinite;
38
+ }
39
+
40
+ @keyframes djv-spin {
41
+ to {
42
+ transform: rotate(360deg);
43
+ }
44
+ }
45
+
46
+ /* ==================== Error States ==================== */
47
+
48
+ .djv-error {
49
+ padding: 16px;
50
+ background-color: #fff5f5;
51
+ border: 1px solid #fed7d7;
52
+ border-radius: 8px;
53
+ color: #c53030;
54
+ }
55
+
56
+ .djv-error-title {
57
+ font-weight: 600;
58
+ margin-bottom: 8px;
59
+ }
60
+
61
+ .djv-error-message {
62
+ font-size: 14px;
63
+ opacity: 0.9;
64
+ }
65
+
66
+ .djv-error-retry {
67
+ margin-top: 12px;
68
+ padding: 8px 16px;
69
+ background-color: #c53030;
70
+ color: white;
71
+ border: none;
72
+ border-radius: 4px;
73
+ cursor: pointer;
74
+ font-size: 14px;
75
+ }
76
+
77
+ .djv-error-retry:hover {
78
+ background-color: #9b2c2c;
79
+ }
80
+
81
+ /* ==================== Fallback Component ==================== */
82
+
83
+ .djv-fallback {
84
+ padding: 16px;
85
+ background-color: #f7fafc;
86
+ border: 1px dashed #cbd5e0;
87
+ border-radius: 8px;
88
+ color: #718096;
89
+ text-align: center;
90
+ }
91
+
92
+ .djv-fallback-icon {
93
+ font-size: 24px;
94
+ margin-bottom: 8px;
95
+ }
96
+
97
+ .djv-fallback-message {
98
+ font-size: 14px;
99
+ }
100
+
101
+ /* ==================== Component Container ==================== */
102
+
103
+ .djv-component {
104
+ position: relative;
105
+ }
106
+
107
+ .djv-component[data-loading="true"]::after {
108
+ content: '';
109
+ position: absolute;
110
+ inset: 0;
111
+ background-color: rgba(255, 255, 255, 0.7);
112
+ display: flex;
113
+ align-items: center;
114
+ justify-content: center;
115
+ }
116
+
117
+ /* ==================== Toast Messages ==================== */
118
+
119
+ .djv-toast-container {
120
+ position: fixed;
121
+ top: 16px;
122
+ right: 16px;
123
+ z-index: 9999;
124
+ display: flex;
125
+ flex-direction: column;
126
+ gap: 8px;
127
+ }
128
+
129
+ .djv-toast {
130
+ padding: 12px 16px;
131
+ border-radius: 8px;
132
+ color: white;
133
+ font-size: 14px;
134
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
135
+ animation: djv-toast-in 0.3s ease-out;
136
+ }
137
+
138
+ .djv-toast--success {
139
+ background-color: #38a169;
140
+ }
141
+
142
+ .djv-toast--error {
143
+ background-color: #e53e3e;
144
+ }
145
+
146
+ .djv-toast--warning {
147
+ background-color: #d69e2e;
148
+ }
149
+
150
+ .djv-toast--info {
151
+ background-color: #3182ce;
152
+ }
153
+
154
+ @keyframes djv-toast-in {
155
+ from {
156
+ opacity: 0;
157
+ transform: translateX(100%);
158
+ }
159
+ to {
160
+ opacity: 1;
161
+ transform: translateX(0);
162
+ }
163
+ }
164
+
165
+ /* ==================== Dialog/Modal ==================== */
166
+
167
+ .djv-dialog-overlay {
168
+ position: fixed;
169
+ inset: 0;
170
+ background-color: rgba(0, 0, 0, 0.5);
171
+ display: flex;
172
+ align-items: center;
173
+ justify-content: center;
174
+ z-index: 9998;
175
+ animation: djv-fade-in 0.2s ease-out;
176
+ }
177
+
178
+ .djv-dialog {
179
+ background-color: white;
180
+ border-radius: 12px;
181
+ padding: 24px;
182
+ max-width: 90vw;
183
+ max-height: 90vh;
184
+ overflow: auto;
185
+ box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
186
+ animation: djv-scale-in 0.2s ease-out;
187
+ }
188
+
189
+ @keyframes djv-fade-in {
190
+ from {
191
+ opacity: 0;
192
+ }
193
+ to {
194
+ opacity: 1;
195
+ }
196
+ }
197
+
198
+ @keyframes djv-scale-in {
199
+ from {
200
+ opacity: 0;
201
+ transform: scale(0.95);
202
+ }
203
+ to {
204
+ opacity: 1;
205
+ transform: scale(1);
206
+ }
207
+ }
208
+
209
+ /* ==================== Loading Overlay ==================== */
210
+
211
+ .djv-loading-overlay {
212
+ position: fixed;
213
+ inset: 0;
214
+ background-color: rgba(255, 255, 255, 0.9);
215
+ display: flex;
216
+ flex-direction: column;
217
+ align-items: center;
218
+ justify-content: center;
219
+ z-index: 9997;
220
+ }
221
+
222
+ .djv-loading-overlay-text {
223
+ margin-top: 16px;
224
+ color: #666;
225
+ font-size: 14px;
226
+ }
227
+
228
+ /* ==================== Skeleton Loading ==================== */
229
+
230
+ .djv-skeleton {
231
+ background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
232
+ background-size: 200% 100%;
233
+ animation: djv-skeleton-loading 1.5s infinite;
234
+ border-radius: 4px;
235
+ }
236
+
237
+ .djv-skeleton-text {
238
+ height: 1em;
239
+ margin-bottom: 8px;
240
+ }
241
+
242
+ .djv-skeleton-text:last-child {
243
+ width: 60%;
244
+ }
245
+
246
+ .djv-skeleton-avatar {
247
+ width: 48px;
248
+ height: 48px;
249
+ border-radius: 50%;
250
+ }
251
+
252
+ .djv-skeleton-button {
253
+ width: 100px;
254
+ height: 36px;
255
+ border-radius: 4px;
256
+ }
257
+
258
+ .djv-skeleton-image {
259
+ width: 100%;
260
+ height: 200px;
261
+ border-radius: 8px;
262
+ }
263
+
264
+ .djv-skeleton-card {
265
+ padding: 16px;
266
+ border-radius: 8px;
267
+ background: #fff;
268
+ }
269
+
270
+ @keyframes djv-skeleton-loading {
271
+ 0% {
272
+ background-position: 200% 0;
273
+ }
274
+ 100% {
275
+ background-position: -200% 0;
276
+ }
277
+ }
278
+
279
+ /* ==================== Action Sheet ==================== */
280
+
281
+ .djv-action-sheet-overlay {
282
+ position: fixed;
283
+ inset: 0;
284
+ background-color: rgba(0, 0, 0, 0.5);
285
+ z-index: 9998;
286
+ animation: djv-fade-in 0.2s ease-out;
287
+ }
288
+
289
+ .djv-action-sheet {
290
+ position: fixed;
291
+ bottom: 0;
292
+ left: 0;
293
+ right: 0;
294
+ background-color: #f7f8fa;
295
+ border-radius: 16px 16px 0 0;
296
+ overflow: hidden;
297
+ z-index: 9999;
298
+ animation: djv-slide-up 0.3s ease-out;
299
+ padding-bottom: env(safe-area-inset-bottom, 0);
300
+ }
301
+
302
+ .djv-action-sheet-item {
303
+ display: flex;
304
+ align-items: center;
305
+ justify-content: center;
306
+ padding: 14px 16px;
307
+ font-size: 16px;
308
+ color: #333;
309
+ background-color: #fff;
310
+ border: none;
311
+ width: 100%;
312
+ cursor: pointer;
313
+ }
314
+
315
+ .djv-action-sheet-item:not(:last-child) {
316
+ border-bottom: 1px solid #eee;
317
+ }
318
+
319
+ .djv-action-sheet-item:active {
320
+ background-color: #f5f5f5;
321
+ }
322
+
323
+ .djv-action-sheet-item--destructive {
324
+ color: #e53e3e;
325
+ }
326
+
327
+ .djv-action-sheet-cancel {
328
+ margin-top: 8px;
329
+ font-weight: 500;
330
+ }
331
+
332
+ @keyframes djv-slide-up {
333
+ from {
334
+ transform: translateY(100%);
335
+ }
336
+ to {
337
+ transform: translateY(0);
338
+ }
339
+ }
340
+
341
+ /* ==================== Image Preview ==================== */
342
+
343
+ .djv-image-preview-overlay {
344
+ position: fixed;
345
+ inset: 0;
346
+ background-color: rgba(0, 0, 0, 0.9);
347
+ z-index: 9999;
348
+ display: flex;
349
+ align-items: center;
350
+ justify-content: center;
351
+ animation: djv-fade-in 0.2s ease-out;
352
+ }
353
+
354
+ .djv-image-preview-container {
355
+ width: 100%;
356
+ height: 100%;
357
+ display: flex;
358
+ align-items: center;
359
+ justify-content: center;
360
+ overflow: hidden;
361
+ }
362
+
363
+ .djv-image-preview-img {
364
+ max-width: 100%;
365
+ max-height: 100%;
366
+ object-fit: contain;
367
+ user-select: none;
368
+ }
369
+
370
+ .djv-image-preview-close {
371
+ position: absolute;
372
+ top: 16px;
373
+ right: 16px;
374
+ width: 40px;
375
+ height: 40px;
376
+ border: none;
377
+ background: rgba(255, 255, 255, 0.2);
378
+ border-radius: 50%;
379
+ color: white;
380
+ font-size: 24px;
381
+ cursor: pointer;
382
+ display: flex;
383
+ align-items: center;
384
+ justify-content: center;
385
+ }
386
+
387
+ .djv-image-preview-close:hover {
388
+ background: rgba(255, 255, 255, 0.3);
389
+ }
390
+
391
+ .djv-image-preview-nav {
392
+ position: absolute;
393
+ top: 50%;
394
+ transform: translateY(-50%);
395
+ width: 48px;
396
+ height: 48px;
397
+ border: none;
398
+ background: rgba(255, 255, 255, 0.2);
399
+ border-radius: 50%;
400
+ color: white;
401
+ font-size: 20px;
402
+ cursor: pointer;
403
+ display: flex;
404
+ align-items: center;
405
+ justify-content: center;
406
+ }
407
+
408
+ .djv-image-preview-nav:hover {
409
+ background: rgba(255, 255, 255, 0.3);
410
+ }
411
+
412
+ .djv-image-preview-prev {
413
+ left: 16px;
414
+ }
415
+
416
+ .djv-image-preview-next {
417
+ right: 16px;
418
+ }
419
+
420
+ .djv-image-preview-counter {
421
+ position: absolute;
422
+ bottom: 24px;
423
+ left: 50%;
424
+ transform: translateX(-50%);
425
+ color: white;
426
+ font-size: 14px;
427
+ background: rgba(0, 0, 0, 0.5);
428
+ padding: 4px 12px;
429
+ border-radius: 16px;
430
+ }
431
+
432
+ /* ==================== Confirm Dialog ==================== */
433
+
434
+ .djv-confirm {
435
+ background: white;
436
+ border-radius: 12px;
437
+ width: 280px;
438
+ max-width: 90vw;
439
+ overflow: hidden;
440
+ animation: djv-scale-in 0.2s ease-out;
441
+ }
442
+
443
+ .djv-confirm-header {
444
+ padding: 20px 16px 12px;
445
+ text-align: center;
446
+ }
447
+
448
+ .djv-confirm-title {
449
+ font-size: 17px;
450
+ font-weight: 600;
451
+ color: #333;
452
+ margin: 0;
453
+ }
454
+
455
+ .djv-confirm-message {
456
+ font-size: 14px;
457
+ color: #666;
458
+ margin: 8px 0 0;
459
+ line-height: 1.5;
460
+ }
461
+
462
+ .djv-confirm-footer {
463
+ display: flex;
464
+ border-top: 1px solid #eee;
465
+ }
466
+
467
+ .djv-confirm-btn {
468
+ flex: 1;
469
+ padding: 12px;
470
+ font-size: 16px;
471
+ border: none;
472
+ background: none;
473
+ cursor: pointer;
474
+ }
475
+
476
+ .djv-confirm-btn:not(:last-child) {
477
+ border-right: 1px solid #eee;
478
+ }
479
+
480
+ .djv-confirm-btn--cancel {
481
+ color: #666;
482
+ }
483
+
484
+ .djv-confirm-btn--confirm {
485
+ color: #007bff;
486
+ font-weight: 500;
487
+ }
488
+
489
+ .djv-confirm-btn--danger {
490
+ color: #e53e3e;
491
+ font-weight: 500;
492
+ }
493
+
494
+ .djv-confirm-btn:active {
495
+ background-color: #f5f5f5;
496
+ }
497
+
498
+ /* ==================== Progress Bar ==================== */
499
+
500
+ .djv-progress {
501
+ width: 100%;
502
+ height: 4px;
503
+ background-color: #e5e5e5;
504
+ border-radius: 2px;
505
+ overflow: hidden;
506
+ }
507
+
508
+ .djv-progress-bar {
509
+ height: 100%;
510
+ background-color: #007bff;
511
+ border-radius: 2px;
512
+ transition: width 0.3s ease;
513
+ }
514
+
515
+ .djv-progress--indeterminate .djv-progress-bar {
516
+ width: 30%;
517
+ animation: djv-progress-indeterminate 1.5s infinite ease-in-out;
518
+ }
519
+
520
+ @keyframes djv-progress-indeterminate {
521
+ 0% {
522
+ transform: translateX(-100%);
523
+ }
524
+ 100% {
525
+ transform: translateX(400%);
526
+ }
527
+ }
528
+
529
+ /* ==================== Badge ==================== */
530
+
531
+ .djv-badge {
532
+ display: inline-flex;
533
+ align-items: center;
534
+ justify-content: center;
535
+ min-width: 18px;
536
+ height: 18px;
537
+ padding: 0 6px;
538
+ font-size: 12px;
539
+ font-weight: 500;
540
+ color: white;
541
+ background-color: #e53e3e;
542
+ border-radius: 9px;
543
+ }
544
+
545
+ .djv-badge--dot {
546
+ min-width: 8px;
547
+ width: 8px;
548
+ height: 8px;
549
+ padding: 0;
550
+ border-radius: 50%;
551
+ }
552
+
553
+ /* ==================== Dark Theme ==================== */
554
+
555
+ @media (prefers-color-scheme: dark) {
556
+ .djv-runtime {
557
+ color: #e5e5e5;
558
+ background-color: #1a1a1a;
559
+ }
560
+
561
+ .djv-loading {
562
+ color: #999;
563
+ }
564
+
565
+ .djv-loading-spinner {
566
+ border-color: #333;
567
+ border-top-color: #007bff;
568
+ }
569
+
570
+ .djv-error {
571
+ background-color: #2d1f1f;
572
+ border-color: #5c2626;
573
+ color: #fc8181;
574
+ }
575
+
576
+ .djv-error-retry {
577
+ background-color: #c53030;
578
+ }
579
+
580
+ .djv-error-retry:hover {
581
+ background-color: #9b2c2c;
582
+ }
583
+
584
+ .djv-fallback {
585
+ background-color: #1e1e1e;
586
+ border-color: #333;
587
+ color: #888;
588
+ }
589
+
590
+ .djv-dialog {
591
+ background-color: #2d2d2d;
592
+ color: #e5e5e5;
593
+ }
594
+
595
+ .djv-loading-overlay {
596
+ background-color: rgba(0, 0, 0, 0.9);
597
+ }
598
+
599
+ .djv-skeleton {
600
+ background: linear-gradient(90deg, #2d2d2d 25%, #3d3d3d 50%, #2d2d2d 75%);
601
+ background-size: 200% 100%;
602
+ }
603
+
604
+ .djv-action-sheet {
605
+ background-color: #1a1a1a;
606
+ }
607
+
608
+ .djv-action-sheet-item {
609
+ background-color: #2d2d2d;
610
+ color: #e5e5e5;
611
+ border-bottom-color: #333;
612
+ }
613
+
614
+ .djv-action-sheet-item:active {
615
+ background-color: #333;
616
+ }
617
+
618
+ .djv-confirm {
619
+ background-color: #2d2d2d;
620
+ }
621
+
622
+ .djv-confirm-title {
623
+ color: #e5e5e5;
624
+ }
625
+
626
+ .djv-confirm-message {
627
+ color: #999;
628
+ }
629
+
630
+ .djv-confirm-footer {
631
+ border-top-color: #333;
632
+ }
633
+
634
+ .djv-confirm-btn:not(:last-child) {
635
+ border-right-color: #333;
636
+ }
637
+
638
+ .djv-confirm-btn--cancel {
639
+ color: #999;
640
+ }
641
+
642
+ .djv-confirm-btn:active {
643
+ background-color: #333;
644
+ }
645
+
646
+ .djv-progress {
647
+ background-color: #333;
648
+ }
649
+ }
650
+
651
+ /* ==================== Responsive ==================== */
652
+
653
+ @media (max-width: 640px) {
654
+ .djv-toast-container {
655
+ top: auto;
656
+ bottom: 16px;
657
+ left: 16px;
658
+ right: 16px;
659
+ }
660
+
661
+ .djv-toast {
662
+ width: 100%;
663
+ }
664
+
665
+ .djv-dialog {
666
+ margin: 16px;
667
+ max-width: calc(100vw - 32px);
668
+ }
669
+
670
+ .djv-confirm {
671
+ width: 90vw;
672
+ max-width: 320px;
673
+ }
674
+ }
675
+
676
+ /* ==================== Safe Area ==================== */
677
+
678
+ @supports (padding-bottom: env(safe-area-inset-bottom)) {
679
+ .djv-toast-container {
680
+ bottom: calc(16px + env(safe-area-inset-bottom));
681
+ }
682
+
683
+ .djv-action-sheet {
684
+ padding-bottom: env(safe-area-inset-bottom);
685
+ }
686
+ }