Repository navigation
Expand file tree
/
Copy pathtest.html
More file actions
256 lines (253 loc) · 7.03 KB
/
Copy pathtest.html
File metadata and controls
256 lines (253 loc) · 7.03 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<title>BREP Kernel Bundle Test</title>
<style>
:root {
color-scheme: light;
}
body {
margin: 0;
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
background: #f5f5f7;
color: #1b1b1f;
}
main {
max-width: 900px;
margin: 40px auto;
background: #ffffff;
border: 1px solid #e2e2e8;
border-radius: 12px;
padding: 24px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}
h1 {
margin: 0 0 8px;
font-size: 24px;
}
p {
margin: 0 0 16px;
color: #4b4b57;
}
code {
background: #f0f1f6;
padding: 2px 6px;
border-radius: 6px;
}
.status {
display: inline-block;
padding: 6px 12px;
border-radius: 999px;
font-weight: 600;
margin-bottom: 16px;
}
.status.pending {
background: #fff4cc;
color: #6f5600;
}
.status.ok {
background: #d6f7df;
color: #0b5d28;
}
.status.err {
background: #ffe1e1;
color: #7a0012;
}
pre {
background: #0f172a;
color: #e2e8f0;
padding: 16px;
border-radius: 10px;
min-height: 180px;
overflow: auto;
font-size: 13px;
line-height: 1.5;
}
.divider {
border: 0;
height: 1px;
background: #e6e6ef;
margin: 24px 0;
}
.row {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin: 12px 0;
}
button {
border: 1px solid #c8ccda;
border-radius: 8px;
background: #f7f8fc;
color: #1b1b1f;
font-weight: 600;
padding: 8px 12px;
cursor: pointer;
}
button:disabled {
opacity: 0.5;
cursor: default;
}
textarea {
width: 100%;
min-height: 120px;
box-sizing: border-box;
border: 1px solid #d5d9e6;
border-radius: 8px;
padding: 10px;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 12px;
}
#sketch-host {
margin-top: 12px;
border: 1px solid #dde1ee;
border-radius: 10px;
min-height: 520px;
overflow: hidden;
background: #ffffff;
}
#sketch-status {
margin-top: 10px;
font-size: 13px;
color: #3c4152;
}
#svg-preview {
margin-top: 12px;
border: 1px solid #d5d9e6;
border-radius: 8px;
min-height: 220px;
padding: 10px;
background: #fcfcff;
overflow: auto;
}
#svg-preview svg {
max-width: 100%;
display: block;
}
#path-output {
min-height: 130px;
}
#event-output {
min-height: 90px;
}
.control-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
gap: 10px;
margin: 12px 0;
}
.control-grid label {
font-size: 12px;
color: #4b4b57;
display: block;
}
.control-grid input[type="color"] {
width: 100%;
height: 36px;
border: 1px solid #d5d9e6;
border-radius: 8px;
background: #fff;
}
.control-grid input[type="number"] {
width: 100%;
height: 36px;
box-sizing: border-box;
border: 1px solid #d5d9e6;
border-radius: 8px;
background: #fff;
padding: 0 10px;
}
.control-grid .toggle {
display: flex;
align-items: center;
gap: 8px;
font-size: 13px;
}
</style>
</head>
<body>
<main>
<h1>BREP Kernel Bundle Test</h1>
<p>
This page imports the bundled kernel from
<code>/dist-kernel/brep-kernel.js</code> and runs a few headless
operations to verify the inline WASM bundle.
</p>
<div id="status" class="status pending">Loading bundle...</div>
<pre id="log"></pre>
<hr class="divider" />
<h1>Sketcher 2D Embed Test</h1>
<p>
This section mounts the new iframe-based 2D sketcher component and
exports SVG paths in the main page.
</p>
<div class="row">
<button id="btn-create">Create Sketcher Iframe</button>
<button id="btn-destroy" disabled>Destroy Sketcher</button>
<button id="btn-apply-css" disabled>Apply CSS</button>
<button id="btn-apply-theme" disabled>Apply Theme</button>
<button id="btn-export-svg" disabled>Export SVG Paths</button>
</div>
<div class="control-grid">
<div>
<label for="geometry-color">Geometry Color</label>
<input id="geometry-color" type="color" value="#d9f99d" />
</div>
<div>
<label for="point-color">Point Color</label>
<input id="point-color" type="color" value="#93c5fd" />
</div>
<div>
<label for="constraint-color">Constraint Color</label>
<input id="constraint-color" type="color" value="#60a5fa" />
</div>
<div>
<label for="background-color">Background Color</label>
<input id="background-color" type="color" value="#ffffff" />
</div>
<div>
<label for="point-size-px">Point Size (px)</label>
<input id="point-size-px" type="number" value="10" min="1" max="128" step="1" />
</div>
<div>
<label for="curve-thickness-px">Curve Thickness (px)</label>
<input id="curve-thickness-px" type="number" value="2" min="0.5" max="48" step="0.5" />
</div>
<label class="toggle" for="sidebar-expanded">
<input id="sidebar-expanded" type="checkbox" />
Sidebar Expanded
</label>
<label class="toggle" for="grid-visible">
<input id="grid-visible" type="checkbox" checked />
Show Grid
</label>
<div>
<label for="grid-spacing">Grid Spacing</label>
<input id="grid-spacing" type="number" value="1" min="0.0001" step="0.1" />
</div>
</div>
<label for="css-input">Custom CSS injected into iframe:</label>
<textarea id="css-input">.sketch-dims .dim-label {
background: rgba(10, 18, 32, 0.92) !important;
border-color: #4f8cff !important;
color: #dce9ff !important;
}
#main-toolbar {
background: rgba(12, 16, 24, 0.92) !important;
}
#main-toolbar .mtb-btn.is-active {
border-color: #0aa36c !important;
color: #e8fff6 !important;
}</textarea>
<div id="sketch-status">Sketcher not created.</div>
<div id="sketch-host"></div>
<pre id="event-output">(No sketch events yet)</pre>
<div id="svg-preview"></div>
<pre id="path-output"></pre>
</main>
<script type="module" src="./test.ts"></script>
</body>
</html>