Skip to content

Commit ff269cc

Browse files
committed
feat(help): redesign help dialog with structured layout, inline icons and repo call-to-action
- Extract reusable inline SVG icons (github, star, keyboard, tip, mouse) into icon_utils.js - Replace text shortcuts with icon-enhanced grid table for better scannability - Improve overlay/dialog styling, typography and visual hierarchy - Add prominent 'star the repository' section with GitHub link - Update for improved UX and project visibility
1 parent f3a5bdc commit ff269cc

2 files changed

Lines changed: 99 additions & 24 deletions

File tree

js/interaction/resolution_master_interaction_methods.js

Lines changed: 71 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { createModuleLogger } from "../log_system/log_funcs.js";
2+
import { inlineSvgIcons } from "../utils/icon_utils.js";
23
import { performanceDiagnostics } from "../utils/performance_diagnostics.js";
34

45
const log = createModuleLogger('resolution_master_interaction_methods');
@@ -538,8 +539,9 @@ export const interactionMethods = {
538539
const overlay = document.createElement('div');
539540
this.helpDialogOverlay = overlay;
540541
overlay.style.cssText = `
541-
position: fixed; inset: 0; background: rgba(0,0,0,0.45);
542+
position: fixed; inset: 0; background: rgba(0,0,0,0.62);
542543
z-index: 9999; display: flex; align-items: center; justify-content: center;
544+
padding: 24px; box-sizing: border-box; backdrop-filter: blur(2px);
543545
`;
544546
overlay.addEventListener('mousedown', (e) => {
545547
if (e.target === overlay) this.closeHelpDialog();
@@ -549,34 +551,79 @@ export const interactionMethods = {
549551
this.helpDialog = dialog;
550552
dialog.addEventListener('mousedown', (e) => e.stopPropagation());
551553
dialog.style.cssText = `
552-
width: min(420px, calc(100vw - 40px));
553-
background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
554-
border: 1px solid rgba(160, 190, 255, 0.45);
555-
border-radius: 8px; box-shadow: 0 12px 36px rgba(0,0,0,0.75);
556-
color: #ddd; font-family: Arial, sans-serif; padding: 18px;
554+
width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 40px);
555+
overflow: auto; box-sizing: border-box;
556+
background: linear-gradient(135deg, rgba(37,37,37,0.98) 0%, rgba(20,20,20,0.98) 100%);
557+
border: 1px solid rgba(210, 220, 235, 0.28);
558+
border-radius: 14px; box-shadow: 0 24px 70px rgba(0,0,0,0.82), inset 0 1px 0 rgba(255,255,255,0.05);
559+
color: #ddd; font-family: Arial, sans-serif; padding: 0;
557560
`;
558561

559562
dialog.innerHTML = `
560-
<div style="display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px;">
561-
<div style="font-size:16px; font-weight:700; color:#fff;">Resolution Master Help</div>
562-
<button type="button" data-close style="width:28px; height:28px; border-radius:5px; border:1px solid #555; background:#333; color:#ddd; cursor:pointer; font-size:16px; line-height:1;">&times;</button>
563+
<div style="padding:28px 40px 22px;">
564+
<div style="display:flex; align-items:center; justify-content:space-between; gap:18px; margin-bottom:30px;">
565+
<div style="font-size:36px; line-height:1.1; font-weight:800; color:#e9e9e9; letter-spacing:0; text-shadow:0 2px 18px rgba(255,255,255,0.13);">Resolution Master Help</div>
566+
<button type="button" data-close aria-label="Close" style="width:50px; height:50px; border-radius:9px; border:1px solid rgba(210,220,235,0.25); background:linear-gradient(180deg, rgba(80,80,80,0.85), rgba(45,45,45,0.9)); color:#eee; cursor:pointer; font-size:28px; line-height:1; box-shadow:inset 0 1px 0 rgba(255,255,255,0.08), 0 8px 18px rgba(0,0,0,0.35);">&times;</button>
567+
</div>
568+
569+
<section style="margin-bottom:30px;">
570+
<div style="display:grid; grid-template-columns:26px minmax(0, 1fr); align-items:center; column-gap:10px; margin-bottom:14px; color:#d9d9d9;">
571+
<span style="display:flex; align-items:center; justify-content:center; width:26px; color:#bfc3c7;">${inlineSvgIcons.keyboard}</span>
572+
<div style="font-size:24px; line-height:1.2; font-weight:800; color:#e4e4e4;">2D Canvas Shortcuts</div>
573+
</div>
574+
<div style="border:1px solid rgba(210,220,235,0.16); border-radius:8px; overflow:hidden; background:rgba(10,10,10,0.17);">
575+
<div style="display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1.15fr); align-items:center; min-height:60px; border-bottom:1px solid rgba(210,220,235,0.12);">
576+
<div style="display:flex; align-items:center; flex-wrap:wrap; gap:8px; min-width:0; padding:10px 24px;">
577+
<span style="display:inline-flex; align-items:center; gap:8px; min-height:36px; padding:0 13px; border:1px solid rgba(210,220,235,0.17); border-radius:6px; background:linear-gradient(180deg, rgba(78,78,78,0.78), rgba(40,40,40,0.8)); box-shadow:inset 0 1px 0 rgba(255,255,255,0.08); color:#f0f0f0; font-size:18px; white-space:nowrap;">${inlineSvgIcons.mouse}<span>Drag</span></span>
578+
</div>
579+
<div style="padding:10px 22px; color:#e2e2e2; font-size:18px; line-height:1.35; border-left:1px solid rgba(210,220,235,0.08);">Set width and height</div>
580+
</div>
581+
<div style="display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1.15fr); align-items:center; min-height:60px; border-bottom:1px solid rgba(210,220,235,0.12);">
582+
<div style="display:flex; align-items:center; flex-wrap:wrap; gap:8px; min-width:0; padding:10px 24px;">
583+
<span style="display:inline-flex; align-items:center; min-height:36px; padding:0 13px; border:1px solid rgba(210,220,235,0.17); border-radius:6px; background:linear-gradient(180deg, rgba(78,78,78,0.78), rgba(40,40,40,0.8)); box-shadow:inset 0 1px 0 rgba(255,255,255,0.08); color:#f0f0f0; font-size:18px; white-space:nowrap;">Shift</span>
584+
<span style="color:#f0f0f0; font-weight:700;">+</span>
585+
<span style="display:inline-flex; align-items:center; gap:8px; min-height:36px; padding:0 13px; border:1px solid rgba(210,220,235,0.17); border-radius:6px; background:linear-gradient(180deg, rgba(78,78,78,0.78), rgba(40,40,40,0.8)); box-shadow:inset 0 1px 0 rgba(255,255,255,0.08); color:#f0f0f0; font-size:18px; white-space:nowrap;">${inlineSvgIcons.mouse}<span>Drag</span></span>
586+
</div>
587+
<div style="padding:10px 22px; color:#e2e2e2; font-size:18px; line-height:1.35; border-left:1px solid rgba(210,220,235,0.08);">Keep aspect ratio</div>
588+
</div>
589+
<div style="display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1.15fr); align-items:center; min-height:60px; border-bottom:1px solid rgba(210,220,235,0.12);">
590+
<div style="display:flex; align-items:center; flex-wrap:wrap; gap:8px; min-width:0; padding:10px 24px;">
591+
<span style="display:inline-flex; align-items:center; min-height:36px; padding:0 13px; border:1px solid rgba(210,220,235,0.17); border-radius:6px; background:linear-gradient(180deg, rgba(78,78,78,0.78), rgba(40,40,40,0.8)); box-shadow:inset 0 1px 0 rgba(255,255,255,0.08); color:#f0f0f0; font-size:18px; white-space:nowrap;">Ctrl</span>
592+
<span style="color:#f0f0f0; font-weight:700;">+</span>
593+
<span style="display:inline-flex; align-items:center; gap:8px; min-height:36px; padding:0 13px; border:1px solid rgba(210,220,235,0.17); border-radius:6px; background:linear-gradient(180deg, rgba(78,78,78,0.78), rgba(40,40,40,0.8)); box-shadow:inset 0 1px 0 rgba(255,255,255,0.08); color:#f0f0f0; font-size:18px; white-space:nowrap;">${inlineSvgIcons.mouse}<span>Drag</span></span>
594+
</div>
595+
<div style="padding:10px 22px; color:#e2e2e2; font-size:18px; line-height:1.35; border-left:1px solid rgba(210,220,235,0.08);">Disable canvas snap</div>
596+
</div>
597+
<div style="display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1.15fr); align-items:center; min-height:60px;">
598+
<div style="display:flex; align-items:center; flex-wrap:wrap; gap:8px; min-width:0; padding:10px 24px;">
599+
<span style="display:inline-flex; align-items:center; min-height:36px; padding:0 13px; border:1px solid rgba(210,220,235,0.17); border-radius:6px; background:linear-gradient(180deg, rgba(78,78,78,0.78), rgba(40,40,40,0.8)); box-shadow:inset 0 1px 0 rgba(255,255,255,0.08); color:#f0f0f0; font-size:18px; white-space:nowrap;">Ctrl</span>
600+
<span style="color:#f0f0f0; font-weight:700;">+</span>
601+
<span style="display:inline-flex; align-items:center; min-height:36px; padding:0 13px; border:1px solid rgba(210,220,235,0.17); border-radius:6px; background:linear-gradient(180deg, rgba(78,78,78,0.78), rgba(40,40,40,0.8)); box-shadow:inset 0 1px 0 rgba(255,255,255,0.08); color:#f0f0f0; font-size:18px; white-space:nowrap;">Shift</span>
602+
<span style="color:#f0f0f0; font-weight:700;">+</span>
603+
<span style="display:inline-flex; align-items:center; gap:8px; min-height:36px; padding:0 13px; border:1px solid rgba(210,220,235,0.17); border-radius:6px; background:linear-gradient(180deg, rgba(78,78,78,0.78), rgba(40,40,40,0.8)); box-shadow:inset 0 1px 0 rgba(255,255,255,0.08); color:#f0f0f0; font-size:18px; white-space:nowrap;">${inlineSvgIcons.mouse}<span>Drag</span></span>
604+
</div>
605+
<div style="padding:10px 22px; color:#e2e2e2; font-size:18px; line-height:1.35; border-left:1px solid rgba(210,220,235,0.08);">Keep aspect ratio with canvas snap disabled</div>
606+
</div>
607+
</div>
608+
</section>
609+
610+
<section>
611+
<div style="display:grid; grid-template-columns:26px minmax(0, 1fr); align-items:center; column-gap:10px; color:#d9d9d9;">
612+
<span style="display:flex; align-items:center; justify-content:center; width:26px; color:#bfc3c7;">${inlineSvgIcons.tip}</span>
613+
<div style="font-size:24px; line-height:1.2; font-weight:800; color:#e4e4e4;">Tip</div>
614+
</div>
615+
<div style="margin:13px 0 0 36px; color:#b9b9b9; font-size:18px; line-height:1.45;">Click most numeric values to enter a custom value.</div>
616+
</section>
563617
</div>
564-
<div style="font-size:12px; line-height:1.55; color:#cfcfcf;">
565-
<div style="font-weight:700; color:#fff; margin-bottom:4px;">2D Canvas shortcuts</div>
566-
<div>Drag: set width and height</div>
567-
<div>Shift + drag: keep aspect ratio</div>
568-
<div>Ctrl + drag: disable canvas snap</div>
569-
<div>Ctrl + Shift + drag: keep exact aspect ratio</div>
570-
<div style="font-weight:700; color:#fff; margin:14px 0 4px;">Tip</div>
571-
<div>Most text values can be clicked to set a custom value.</div>
572-
<div style="font-weight:700; color:#fff; margin:14px 0 4px;">Project</div>
573-
<a href="https://github.com/Azornes/Comfyui-Resolution-Master" target="_blank" rel="noopener noreferrer" style="display:inline-flex; align-items:center; gap:6px; max-width:100%; color:#8fc7ff; text-decoration:none;">
574-
<span style="min-width:0; overflow-wrap:anywhere;">Azornes/Comfyui-Resolution-Master</span>
575-
<svg aria-hidden="true" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="flex:0 0 auto;">
576-
<path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82A7.57 7.57 0 0 1 8 3.86c.68 0 1.36.09 2 .27 1.53-1.03 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.28.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.45.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z"></path>
577-
</svg>
618+
<div style="display:flex; align-items:center; justify-content:space-between; gap:18px; flex-wrap:wrap; padding:20px 40px 24px; border-top:1px solid rgba(210,220,235,0.18); background:rgba(255,255,255,0.02);">
619+
<div style="display:flex; align-items:center; gap:14px; min-width:0; color:#bdbdbd; font-size:18px; line-height:1.4;">
620+
<span style="display:inline-flex; align-items:center; justify-content:center; width:40px; height:40px; border-radius:50%; color:#f2cc60; background:rgba(242,204,96,0.14); border:1px solid rgba(242,204,96,0.42); box-shadow:0 0 20px rgba(242,204,96,0.12);">${inlineSvgIcons.star}</span>
621+
<span>If this node helps you, please consider <span style="color:#f2cc60; font-weight:700;">starring</span> the repository.</span>
622+
</div>
623+
<a href="https://github.com/Azornes/Comfyui-Resolution-Master" target="_blank" rel="noopener noreferrer" style="display:inline-flex; align-items:center; justify-content:center; gap:10px; min-height:44px; padding:0 18px; border:1px solid rgba(210,220,235,0.18); border-radius:7px; color:#f2f2f2; background:linear-gradient(180deg, rgba(48,48,48,0.72), rgba(26,26,26,0.88)); box-shadow:inset 0 1px 0 rgba(255,255,255,0.06), 0 6px 16px rgba(0,0,0,0.25); text-decoration:none; font-size:18px; white-space:nowrap;">
624+
<span style="color:#f2f2f2;">${inlineSvgIcons.github}</span>
625+
<span>Go to GitHub</span>
578626
</a>
579-
<div style="margin-top:10px; color:#aaa;">If this node helps you, please consider <span style="display:inline-flex; align-items:center; gap:4px;">starring <svg aria-hidden="true" viewBox="0 0 16 16" width="14" height="14" fill="currentColor" style="flex:0 0 auto; color:#f2cc60; transform:translateY(-1px);"><path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Z"></path></svg></span> the repository.</div>
580627
</div>
581628
`;
582629

js/utils/icon_utils.js

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)