mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-05-25 15:03:46 +00:00
feat(pwa-loader): add in-browser RVF seed decoder PWA
Build a minimal zero-dependency PWA under examples/pwa-loader/ that decodes RVQS cognitive seeds and .rvf files in the browser: - index.html: single-page app with file input, QR scanner button, decoded seed info display, evidence viewer, and dark/light theme - app.js: WASM module loading with JS fallback, RVQS 64-byte header parsing (matching rvf-types binary layout), TLV manifest decoder, RVF segment parser using WASM exports, QR camera scanner via getUserMedia + BarcodeDetector API, file drag-and-drop handler - style.css: CSS variables for dark/light themes, mobile-first responsive layout, monospace hex display - manifest.json: PWA manifest for standalone install - sw.js: cache-first service worker for offline support The WASM path is configurable via window.RVF_WASM_PATH (default ./rvf_wasm_bg.wasm). Gracefully falls back to pure JS parsing when WASM is unavailable. No external CDN dependencies. https://claude.ai/code/session_01RnwD4x5cbpB7FPvoyYQz8G
This commit is contained in:
parent
509987ad1c
commit
cbc3fb6e01
2 changed files with 1256 additions and 0 deletions
1210
examples/pwa-loader/app.js
Normal file
1210
examples/pwa-loader/app.js
Normal file
File diff suppressed because it is too large
Load diff
46
examples/pwa-loader/index.html
Normal file
46
examples/pwa-loader/index.html
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en" data-theme="dark">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="Decode RVF cognitive seeds and witness bundles in-browser using WASM">
|
||||
<meta name="theme-color" content="#6c8cff">
|
||||
<title>RVF Seed Decoder</title>
|
||||
<link rel="manifest" href="./manifest.json">
|
||||
<link rel="stylesheet" href="./style.css">
|
||||
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'><rect width='64' height='64' rx='12' fill='%230f1117'/><text x='32' y='42' font-size='28' text-anchor='middle' fill='%236c8cff' font-family='monospace' font-weight='bold'>RV</text></svg>">
|
||||
</head>
|
||||
<body>
|
||||
<div class="app">
|
||||
<header>
|
||||
<h1><span>RVF</span> Seed Decoder</h1>
|
||||
<button id="btn-theme" class="theme-toggle" type="button">Light Mode</button>
|
||||
</header>
|
||||
|
||||
<div id="drop-zone" class="drop-zone">
|
||||
<p>Drop an .rvf, seed binary, or witness bundle here</p>
|
||||
<div class="btn-row">
|
||||
<button id="btn-browse" class="btn btn-primary" type="button">Browse Files</button>
|
||||
<button id="btn-scan" class="btn" type="button">Scan QR Code</button>
|
||||
</div>
|
||||
<input id="file-input" type="file" accept=".rvf,.bin,.rvqs,.seed,*/*">
|
||||
</div>
|
||||
|
||||
<div id="status" class="status-bar">Initializing...</div>
|
||||
|
||||
<div id="scanner" class="scanner-container">
|
||||
<div class="scanner-video-wrap">
|
||||
<video id="scanner-video" playsinline muted></video>
|
||||
<canvas id="scanner-canvas"></canvas>
|
||||
</div>
|
||||
<div class="scanner-controls">
|
||||
<button id="btn-scan-stop" class="btn" type="button">Stop Scanner</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="results" class="results"></div>
|
||||
</div>
|
||||
|
||||
<script src="./app.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue