diff --git a/docs/public-api.md b/docs/public-api.md index 761697a..3dfb7ab 100644 --- a/docs/public-api.md +++ b/docs/public-api.md @@ -117,6 +117,10 @@ The convenience methods register a test only after it completes. | `NwcDocument.SaveHtmlViewer` / `NwcAssembly.SaveHtmlViewer` | Interactive single-file 3D WebGL viewer exporter with 4D schedule playback (`NwcHtmlViewerExporter`, `NwcHtmlViewerOptions`). Frozen: bug fixes only. | | `NwcJsonExportOptions` | Indentation and content toggles for JSON export (`NwcDocument` and the CLI). | +In the HTML viewer, use Tab to reach the viewpoint, clash, hierarchy and set buttons, then Enter or +Space to activate them. With focus on the 3D model view, the arrow keys orbit, + and - zoom, and +Home resets the camera. Escape clears the current measurement while Measure is active. + GLB geometry export requires a writable system temporary directory for its BIN chunk. The exporter removes the temporary file when it closes. A path-based save replaces the destination after the export succeeds. The complete GLB is limited to 4,294,967,292 bytes, including its diff --git a/src/NwcIO/Compatibility/Viewer/NwcHtmlViewerExporter.cs b/src/NwcIO/Compatibility/Viewer/NwcHtmlViewerExporter.cs index 11842a2..aa76732 100644 --- a/src/NwcIO/Compatibility/Viewer/NwcHtmlViewerExporter.cs +++ b/src/NwcIO/Compatibility/Viewer/NwcHtmlViewerExporter.cs @@ -236,9 +236,12 @@ private static string GetCss() .tab-row { display: flex; border-bottom: 1px solid #333; background: #181818; } .tab-btn { flex: 1; padding: 8px; font-size: 11px; background: none; border: none; color: #888; cursor: pointer; text-align: center; border-bottom: 2px solid transparent; } .tab-btn.active { color: #fff; border-bottom: 2px solid #007acc; background: #222; } -.tree-item { padding: 6px 8px; font-size: 12px; cursor: pointer; border-radius: 3px; display: flex; align-items: center; gap: 6px; user-select: none; } +.tree-item { width: 100%; padding: 6px 8px; font: inherit; font-size: 12px; color: inherit; background: none; border: 0; border-radius: 3px; text-align: left; display: block; overflow-wrap: anywhere; cursor: pointer; user-select: none; } .tree-item:hover { background: #2c2c2c; } .tree-item.selected { background: #007acc; color: #fff; } +.tree-item:focus-visible, #measure-clear:focus-visible, #glcanvas:focus-visible { outline: 2px solid #70bbff; outline-offset: -2px; } +.camera-keys { display: none; position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 24px); padding: 6px 8px; border-radius: 4px; color: #e0e0e0; background: #222; font-size: 12px; pointer-events: none; } +#glcanvas:focus-visible + .camera-keys { display: block; } .prop-category { margin-bottom: 12px; } .prop-category-title { font-size: 11px; font-weight: 600; color: #888; text-transform: uppercase; margin-bottom: 4px; padding-bottom: 2px; border-bottom: 1px solid #333; } .prop-table { width: 100%; font-size: 11px; border-collapse: collapse; } @@ -254,6 +257,8 @@ private static string GetCss() .measure-panel .title { font-weight: 600; color: #4dabf7; margin-bottom: 4px; display: flex; justify-content: space-between; } .measure-panel .row { display: flex; justify-content: space-between; margin: 2px 0; color: #ccc; } .measure-panel .val { font-weight: 600; color: #fff; } +#measure-clear { background: none; border: 0; border-radius: 3px; padding: 0 4px; color: #aaa; font: inherit; cursor: pointer; } +#measure-clear:hover { color: #fff; } .timeliner-bar { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); background: rgba(25,25,25,0.94); border: 1px solid #007acc; border-radius: 6px; padding: 8px 16px; display: flex; gap: 12px; align-items: center; z-index: 6; box-shadow: 0 4px 14px rgba(0,0,0,0.5); min-width: 480px; } .timeliner-bar button { background: #2a2a2a; color: #fff; border: 1px solid #555; border-radius: 4px; padding: 4px 10px; cursor: pointer; font-size: 12px; } .timeliner-bar button:hover { background: #3a3a3a; } @@ -270,7 +275,7 @@ private static string GetHeaderAndLayout(string title)