@@ -350,6 +350,7 @@ const containerStyle = {
350
350
fontFamily : "sans-serif" ,
351
351
display : "flex" ,
352
352
flexDirection : "column" ,
353
+ minHeight : "100vh" ,
353
354
} ;
354
355
355
356
const headerStyle = {
@@ -360,41 +361,54 @@ const headerStyle = {
360
361
justifyContent : "space-between" ,
361
362
alignItems : "center" ,
362
363
boxShadow : "0 2px 4px rgba(0,0,0,0.3)" ,
364
+ flexShrink : 0 ,
365
+ flexWrap : "wrap" ,
366
+ gap : "10px" ,
367
+ minHeight : "60px" ,
363
368
} ;
364
369
365
370
const logoContainerStyle = {
366
371
display : "flex" ,
367
372
alignItems : "center" ,
368
373
gap : "15px" ,
374
+ flex : "1 1 auto" ,
375
+ minWidth : "200px" ,
376
+ overflow : "visible" ,
369
377
} ;
370
378
371
379
const titleStyle = {
372
- fontSize : "24px" ,
380
+ fontSize : "clamp(18px, 4vw, 24px) " ,
373
381
fontWeight : "normal" ,
374
382
margin : 0 ,
383
+ lineHeight : "1.2" ,
375
384
} ;
376
385
377
386
const navigationStyle = {
378
387
display : "flex" ,
379
388
alignItems : "center" ,
380
389
padding : "10px 20px" ,
381
- justifyContent : "flex-end " ,
390
+ justifyContent : "space-between " ,
382
391
gap : "10px" ,
383
392
backgroundColor : "transparent" ,
393
+ flexWrap : "wrap" ,
394
+ flexShrink : 0 ,
395
+ minHeight : "50px" ,
384
396
} ;
385
397
386
398
const navButtonStyle = {
387
- backgroundColor : "#3a3340 " ,
399
+ backgroundColor : "#27272A " ,
388
400
color : "white" ,
389
401
border : "none" ,
390
- padding : "6px 12px" ,
402
+ padding : "8px 12px" ,
391
403
cursor : "pointer" ,
392
404
borderRadius : "2px" ,
393
405
fontFamily : "sans-serif" ,
394
- fontSize : "14px" ,
406
+ fontSize : "clamp(12px, 3vw, 14px) " ,
395
407
display : "flex" ,
396
408
alignItems : "center" ,
397
409
gap : "5px" ,
410
+ minHeight : "36px" ,
411
+ whiteSpace : "nowrap" ,
398
412
} ;
399
413
400
414
const dismissButtonStyle = {
@@ -403,50 +417,78 @@ const dismissButtonStyle = {
403
417
cursor : "pointer" ,
404
418
backgroundColor : "transparent" ,
405
419
border : "none" ,
406
- fontSize : "14px" ,
420
+ fontSize : "clamp(12px, 3vw, 14px)" ,
421
+ fontWeight : "bold" ,
407
422
display : "flex" ,
408
423
alignItems : "center" ,
424
+ flexShrink : 0 ,
425
+ whiteSpace : "nowrap" ,
409
426
} ;
410
427
411
428
const keyboardShortcutStyle = {
412
- backgroundColor : "#555 " ,
413
- color : "white " ,
429
+ backgroundColor : "#B19DA3 " ,
430
+ color : "#8b1538 " ,
414
431
padding : "2px 5px" ,
415
432
borderRadius : "2px" ,
416
433
marginLeft : "5px" ,
417
- fontSize : "12px" ,
434
+ fontSize : "clamp(10px, 2.5vw, 12px)" ,
435
+ fontWeight : "bold" ,
436
+ } ;
437
+
438
+ const navKeyboardShortcutStyle = {
439
+ backgroundColor : "#3F3F46" ,
440
+ color : "white" ,
441
+ padding : "2px 6px" ,
442
+ borderRadius : "2px" ,
443
+ fontSize : "clamp(10px, 2.5vw, 12px)" ,
444
+ fontWeight : "normal" ,
418
445
} ;
419
446
420
447
const errorContentStyle = {
421
- padding : "20px" ,
422
- flex : 1 ,
448
+ padding : "15px 20px" ,
449
+ flex : "1 1 auto" ,
450
+ overflow : "auto" ,
451
+ minHeight : 0 ,
423
452
} ;
424
453
425
454
const errorTypeStyle = {
426
455
color : "#e83b46" ,
427
- fontSize : "1.2em " ,
428
- marginBottom : "20px " ,
456
+ fontSize : "clamp(16px, 4vw, 20px) " ,
457
+ marginBottom : "15px " ,
429
458
fontFamily : "sans-serif" ,
459
+ lineHeight : "1.3" ,
460
+ wordBreak : "break-word" ,
430
461
} ;
431
462
432
463
const errorMessageStyle = {
433
464
lineHeight : "1.5" ,
434
- fontSize : "1rem " ,
465
+ fontSize : "clamp(14px, 3.5vw, 16px) " ,
435
466
fontFamily : "Menlo, Consolas, monospace" ,
436
467
whiteSpace : "pre-wrap" ,
468
+ wordBreak : "break-word" ,
469
+ overflowWrap : "break-word" ,
437
470
} ;
438
471
439
472
const footerStyle = {
440
473
padding : "15px 20px" ,
441
474
color : "#aaa" ,
442
- fontSize : "12px" ,
475
+ fontSize : "clamp(10px, 2.5vw, 12px) " ,
443
476
borderTop : "1px solid #333" ,
477
+ flexShrink : 0 ,
478
+ lineHeight : "1.4" ,
444
479
} ;
445
480
446
481
const logoStyle = {
447
- width : "40px" ,
448
- height : "40px" ,
449
- marginRight : "10px" ,
482
+ width : "60px" ,
483
+ height : "60px" ,
484
+ marginRight : "15px" ,
485
+ flexShrink : 0 ,
486
+ } ;
487
+
488
+ const navButtonGroupStyle = {
489
+ display : "flex" ,
490
+ alignItems : "center" ,
491
+ gap : "10px" ,
450
492
} ;
451
493
452
494
// ANSI HTML
@@ -555,7 +597,7 @@ const createOverlay = (options) => {
555
597
*/
556
598
function createLogo ( ) {
557
599
const logoSvg = `
558
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 600">
600
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 600" style="width: 100%; height: 100%; display: block;" >
559
601
<path fill="#fff" d="M300 0l265 150v300L300 600 35 450V150z"/>
560
602
<path fill="#8ed6fb" d="M517.7 439.5L308.8 557.8v-92L439 394.1l78.7 45.4zm14.3-12.9V179.4l-76.4 44.1v159l76.4 44.1zM81.5 439.5l208.9 118.2v-92l-130.2-71.6-78.7 45.4zm-14.3-12.9V179.4l76.4 44.1v159l-76.4 44.1zm8.9-263.2L290.4 42.2v89l-137.3 75.5-1.1.6-75.9-43.9zm446.9 0L308.8 42.2v89L446 206.8l1.1.6 75.9-44z"/>
561
603
<path fill="#1c78c0" d="M290.4 444.8L162 374.1V234.2l128.4 74.1v136.5zm18.4 0l128.4-70.6v-140l-128.4 74.1v136.5zM299.6 303zm-129-85l129-70.9L428.5 218l-128.9 74.4-129-74.4z"/>
@@ -652,23 +694,35 @@ const createOverlay = (options) => {
652
694
navigationElement . appendChild ( currentErrorCountElement ) ;
653
695
654
696
const navButtonGroup = doc . createElement ( "div" ) ;
655
- applyStyle ( navButtonGroup , navigationStyle ) ;
697
+ applyStyle ( navButtonGroup , navButtonGroupStyle ) ;
698
+
699
+ // Previous button
656
700
const prevButton = doc . createElement ( "button" ) ;
657
- const prevButtonContent = `<span>⌘ + ←</span> PREV` ;
658
- prevButton . innerHTML = overlayTrustedTypesPolicy
659
- ? overlayTrustedTypesPolicy . createHTML ( prevButtonContent )
660
- : prevButtonContent ;
661
701
applyStyle ( prevButton , navButtonStyle ) ;
702
+
703
+ const prevShortcut = doc . createElement ( "span" ) ;
704
+ prevShortcut . textContent = "⌘ + ←" ;
705
+ applyStyle ( prevShortcut , navKeyboardShortcutStyle ) ;
706
+
707
+ prevButton . appendChild ( prevShortcut ) ;
708
+ prevButton . appendChild ( doc . createTextNode ( " PREV" ) ) ;
709
+
662
710
prevButton . addEventListener ( "click" , ( ) => {
663
711
overlayService . send ( { type : "NAVIGATE" , direction : "prev" } ) ;
664
712
} ) ;
665
713
714
+ // Next button
666
715
const nextButton = doc . createElement ( "button" ) ;
667
- const nextButtonContent = `NEXT <span>⌘ + →</span>` ;
668
- nextButton . innerHTML = overlayTrustedTypesPolicy
669
- ? overlayTrustedTypesPolicy . createHTML ( nextButtonContent )
670
- : nextButtonContent ;
671
716
applyStyle ( nextButton , navButtonStyle ) ;
717
+
718
+ nextButton . appendChild ( doc . createTextNode ( "NEXT " ) ) ;
719
+
720
+ const nextShortcut = doc . createElement ( "span" ) ;
721
+ nextShortcut . textContent = "⌘ + →" ;
722
+ applyStyle ( nextShortcut , navKeyboardShortcutStyle ) ;
723
+
724
+ nextButton . appendChild ( nextShortcut ) ;
725
+
672
726
nextButton . addEventListener ( "click" , ( ) => {
673
727
overlayService . send ( { type : "NAVIGATE" , direction : "next" } ) ;
674
728
} ) ;
@@ -846,6 +900,13 @@ const createOverlay = (options) => {
846
900
messageSource === "runtime" ? "#1a1117" : "#18181B" ;
847
901
containerElement . firstChild . style . backgroundColor =
848
902
messageSource === "runtime" ? "#8b1538" : "#18181B" ;
903
+
904
+ // Update ESC button color to match header background
905
+ const escElement = containerElement . querySelector ( "span" ) ;
906
+ if ( escElement && escElement . textContent === "ESC" ) {
907
+ escElement . style . color =
908
+ messageSource === "runtime" ? "#8b1538" : "#18181B" ;
909
+ }
849
910
}
850
911
}
851
912
0 commit comments