Skip to content

Commit b1e9134

Browse files
committed
feat: modified snapshots and correction to overlay styles and mobile UI
1 parent c17e643 commit b1e9134

File tree

2 files changed

+4927
-1388
lines changed

2 files changed

+4927
-1388
lines changed

client-src/overlay.js

Lines changed: 89 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ const containerStyle = {
350350
fontFamily: "sans-serif",
351351
display: "flex",
352352
flexDirection: "column",
353+
minHeight: "100vh",
353354
};
354355

355356
const headerStyle = {
@@ -360,41 +361,54 @@ const headerStyle = {
360361
justifyContent: "space-between",
361362
alignItems: "center",
362363
boxShadow: "0 2px 4px rgba(0,0,0,0.3)",
364+
flexShrink: 0,
365+
flexWrap: "wrap",
366+
gap: "10px",
367+
minHeight: "60px",
363368
};
364369

365370
const logoContainerStyle = {
366371
display: "flex",
367372
alignItems: "center",
368373
gap: "15px",
374+
flex: "1 1 auto",
375+
minWidth: "200px",
376+
overflow: "visible",
369377
};
370378

371379
const titleStyle = {
372-
fontSize: "24px",
380+
fontSize: "clamp(18px, 4vw, 24px)",
373381
fontWeight: "normal",
374382
margin: 0,
383+
lineHeight: "1.2",
375384
};
376385

377386
const navigationStyle = {
378387
display: "flex",
379388
alignItems: "center",
380389
padding: "10px 20px",
381-
justifyContent: "flex-end",
390+
justifyContent: "space-between",
382391
gap: "10px",
383392
backgroundColor: "transparent",
393+
flexWrap: "wrap",
394+
flexShrink: 0,
395+
minHeight: "50px",
384396
};
385397

386398
const navButtonStyle = {
387-
backgroundColor: "#3a3340",
399+
backgroundColor: "#27272A",
388400
color: "white",
389401
border: "none",
390-
padding: "6px 12px",
402+
padding: "8px 12px",
391403
cursor: "pointer",
392404
borderRadius: "2px",
393405
fontFamily: "sans-serif",
394-
fontSize: "14px",
406+
fontSize: "clamp(12px, 3vw, 14px)",
395407
display: "flex",
396408
alignItems: "center",
397409
gap: "5px",
410+
minHeight: "36px",
411+
whiteSpace: "nowrap",
398412
};
399413

400414
const dismissButtonStyle = {
@@ -403,50 +417,78 @@ const dismissButtonStyle = {
403417
cursor: "pointer",
404418
backgroundColor: "transparent",
405419
border: "none",
406-
fontSize: "14px",
420+
fontSize: "clamp(12px, 3vw, 14px)",
421+
fontWeight: "bold",
407422
display: "flex",
408423
alignItems: "center",
424+
flexShrink: 0,
425+
whiteSpace: "nowrap",
409426
};
410427

411428
const keyboardShortcutStyle = {
412-
backgroundColor: "#555",
413-
color: "white",
429+
backgroundColor: "#B19DA3",
430+
color: "#8b1538",
414431
padding: "2px 5px",
415432
borderRadius: "2px",
416433
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",
418445
};
419446

420447
const errorContentStyle = {
421-
padding: "20px",
422-
flex: 1,
448+
padding: "15px 20px",
449+
flex: "1 1 auto",
450+
overflow: "auto",
451+
minHeight: 0,
423452
};
424453

425454
const errorTypeStyle = {
426455
color: "#e83b46",
427-
fontSize: "1.2em",
428-
marginBottom: "20px",
456+
fontSize: "clamp(16px, 4vw, 20px)",
457+
marginBottom: "15px",
429458
fontFamily: "sans-serif",
459+
lineHeight: "1.3",
460+
wordBreak: "break-word",
430461
};
431462

432463
const errorMessageStyle = {
433464
lineHeight: "1.5",
434-
fontSize: "1rem",
465+
fontSize: "clamp(14px, 3.5vw, 16px)",
435466
fontFamily: "Menlo, Consolas, monospace",
436467
whiteSpace: "pre-wrap",
468+
wordBreak: "break-word",
469+
overflowWrap: "break-word",
437470
};
438471

439472
const footerStyle = {
440473
padding: "15px 20px",
441474
color: "#aaa",
442-
fontSize: "12px",
475+
fontSize: "clamp(10px, 2.5vw, 12px)",
443476
borderTop: "1px solid #333",
477+
flexShrink: 0,
478+
lineHeight: "1.4",
444479
};
445480

446481
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",
450492
};
451493

452494
// ANSI HTML
@@ -555,7 +597,7 @@ const createOverlay = (options) => {
555597
*/
556598
function createLogo() {
557599
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;">
559601
<path fill="#fff" d="M300 0l265 150v300L300 600 35 450V150z"/>
560602
<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"/>
561603
<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) => {
652694
navigationElement.appendChild(currentErrorCountElement);
653695

654696
const navButtonGroup = doc.createElement("div");
655-
applyStyle(navButtonGroup, navigationStyle);
697+
applyStyle(navButtonGroup, navButtonGroupStyle);
698+
699+
// Previous button
656700
const prevButton = doc.createElement("button");
657-
const prevButtonContent = `<span>⌘ + ←</span> PREV`;
658-
prevButton.innerHTML = overlayTrustedTypesPolicy
659-
? overlayTrustedTypesPolicy.createHTML(prevButtonContent)
660-
: prevButtonContent;
661701
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+
662710
prevButton.addEventListener("click", () => {
663711
overlayService.send({ type: "NAVIGATE", direction: "prev" });
664712
});
665713

714+
// Next button
666715
const nextButton = doc.createElement("button");
667-
const nextButtonContent = `NEXT <span>⌘ + →</span>`;
668-
nextButton.innerHTML = overlayTrustedTypesPolicy
669-
? overlayTrustedTypesPolicy.createHTML(nextButtonContent)
670-
: nextButtonContent;
671716
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+
672726
nextButton.addEventListener("click", () => {
673727
overlayService.send({ type: "NAVIGATE", direction: "next" });
674728
});
@@ -846,6 +900,13 @@ const createOverlay = (options) => {
846900
messageSource === "runtime" ? "#1a1117" : "#18181B";
847901
containerElement.firstChild.style.backgroundColor =
848902
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+
}
849910
}
850911
}
851912

0 commit comments

Comments
 (0)