-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
84 lines (74 loc) · 2.86 KB
/
index.html
File metadata and controls
84 lines (74 loc) · 2.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Water Sort Screenshot Solver (WASM)</title>
<link rel="stylesheet" href="./styles.css" />
<!-- Tesseract.js (WASM OCR) -->
<script src="https://unpkg.com/tesseract.js@5.0.0/dist/tesseract.min.js"></script>
</head>
<body>
<header>
<h1>Water Sort Screenshot Solver (WASM)</h1>
<p class="subtle">
Client-side bottle parsing with OpenCV.js (WASM), then BFS solver. Code available on <a href="https://github.com/doublemover/WaterSortScreenshotSolver">Github</a>.
</p>
</header>
<main>
<section class="panel">
<div class="row wrap">
<label class="file">
<input id="file" type="file" accept="image/*" />
<span>Choose screenshot…</span>
</label>
<button id="btnAnalyze" disabled>Analyze</button>
<button id="btnSolve" disabled>Solve</button>
</div>
<div class="row wrap" style="margin-top:10px;">
<button id="btnEditBottles" disabled>Edit Bottles</button>
<button id="btnEditRocks" disabled>Edit Rocks</button>
<button id="btnResetBoxes" disabled>Reset Boxes</button>
<button id="btnClearRock" disabled>Clear Selected Rock</button>
<span id="boxHint" class="subtle" style="font-size:12px;"></span>
</div>
</section>
<section class="panel workspace">
<div class="statusLine" id="statusLine">(load an image)</div>
<div class="workspaceGrid">
<div class="pane leftPane">
<div class="canvasWrap">
<canvas id="canvas"></canvas>
<canvas id="overlay"></canvas>
</div>
<div class="detectedPane">
<div id="legendTitle" class="detectedSummary">Colors: — · Rock Bottles: —</div>
<div id="rockLegend" class="legend"></div>
<div id="legend" class="legend"></div>
<div id="boardDetected" class="board"></div>
</div>
</div>
<div class="pane middlePane">
<div class="paneTitleRow">
<h2 id="solverTitle">Solver</h2>
<div id="solverMeta" class="solverMeta subtle">(click Solve)</div>
</div>
<div id="moves" class="movesList"></div>
</div>
<div class="pane rightPane">
<h2>Solved State</h2>
<div id="boardFinal" class="board"></div>
</div>
</div>
</section>
</main>
<footer>
<p class="subtle">
Choose a screenshot, then hit analyze.<br />
Once analysis is complete you can press the solve button to try and automatically solve the puzzle.<br />
Was this useful to you? Consider <a href="https://github.com/sponsors/doublemover">sponsoring me on Github</a>!
</p>
</footer>
<script type="module" src="./main.js"></script>
</body>
</html>