Skip to content

Commit fd52172

Browse files
committed
Update
1 parent f0d9ab1 commit fd52172

4 files changed

Lines changed: 104 additions & 13 deletions

File tree

EzyCad/EzyCad.data

255 KB
Binary file not shown.

EzyCad/EzyCad.html

Lines changed: 103 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,16 @@
33
<head>
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"/>
6-
<title>EzyCad</title>
6+
<title>EzyCad — run in browser (WebAssembly)</title>
7+
<meta name="description" content="EzyCad — open-source hobbyist CAD using Open CASCADE (OCCT), Dear ImGui, and OpenGL. Run in your browser via WebAssembly or build from source on GitHub.">
8+
<meta name="keywords" content="EzyCad, CAD, Open CASCADE, OCCT, ImGui, OpenGL, WebAssembly, CNC, machining, STEP, STL">
9+
<link rel="canonical" href="https://trailcode.github.io/EzyCad/EzyCad.html">
10+
<meta property="og:title" content="EzyCad — open-source hobbyist CAD">
11+
<meta property="og:description" content="Design 2D and 3D parts in your browser. Built with OCCT, Dear ImGui, and OpenGL. Source: github.com/trailcode/EzyCad">
12+
<meta property="og:type" content="website">
13+
<meta property="og:url" content="https://trailcode.github.io/EzyCad/EzyCad.html">
14+
<meta property="og:image" content="https://raw.githubusercontent.com/trailcode/EzyCad/main/doc/gen/AI-gen-splashscreen_05_01_2026_512.png">
15+
<meta name="twitter:card" content="summary_large_image">
716
<style>
817
body { margin: 0; background-color: black }
918
.emscripten {
@@ -16,23 +25,96 @@
1625
height: 100%;
1726
overflow: hidden;
1827
display: block;
19-
image-rendering: optimizeSpeed;
20-
image-rendering: -moz-crisp-edges;
21-
image-rendering: -o-crisp-edges;
22-
image-rendering: -webkit-optimize-contrast;
23-
image-rendering: optimize-contrast;
24-
image-rendering: crisp-edges;
25-
image-rendering: pixelated;
26-
-ms-interpolation-mode: nearest-neighbor;
28+
/* Default (smooth) scaling. Do NOT use image-rendering: pixelated here:
29+
when the canvas backing-store size differs from CSS size (HiDPI), the
30+
browser upscales the WebGL surface with nearest-neighbor and ImGui text
31+
looks blocky. */
32+
}
33+
34+
/* Loading splash (Emscripten: wasm download + preloads + first frame) */
35+
#ezycad-splash {
36+
position: fixed;
37+
inset: 0;
38+
z-index: 20;
39+
display: flex;
40+
flex-direction: column;
41+
align-items: center;
42+
justify-content: center;
43+
gap: 1.25rem;
44+
background: #0a0a0c;
45+
color: #e8e8ec;
46+
font-family: system-ui, Segoe UI, Roboto, sans-serif;
47+
transition: opacity 0.35s ease, visibility 0.35s ease;
48+
}
49+
#ezycad-splash.ezycad-splash--hidden {
50+
opacity: 0;
51+
visibility: hidden;
52+
pointer-events: none;
53+
}
54+
#ezycad-splash h1 {
55+
margin: 0;
56+
font-size: 1.75rem;
57+
font-weight: 600;
58+
letter-spacing: 0.04em;
59+
}
60+
#ezycad-splash-status {
61+
margin: 0;
62+
min-height: 1.25em;
63+
font-size: 0.85rem;
64+
color: #9898a8;
65+
text-align: center;
66+
max-width: 90vw;
67+
}
68+
.ezycad-splash-spinner {
69+
width: 40px;
70+
height: 40px;
71+
border: 3px solid #2a2a32;
72+
border-top-color: #5a9fd4;
73+
border-radius: 50%;
74+
animation: ezycad-spin 0.85s linear infinite;
75+
}
76+
@keyframes ezycad-spin {
77+
to { transform: rotate(360deg); }
2778
}
2879
</style>
2980
</head>
3081
<body>
82+
<div id="ezycad-splash" aria-live="polite">
83+
<div class="ezycad-splash-spinner" role="status" aria-label="Loading"></div>
84+
<h1>EzyCad</h1>
85+
<p id="ezycad-splash-status"></p>
86+
</div>
3187
<canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas>
3288
<script type='text/javascript'>
33-
var Module = {
89+
(function() {
90+
var splash = document.getElementById('ezycad-splash');
91+
var statusEl = document.getElementById('ezycad-splash-status');
92+
93+
function setSplashStatus(text) {
94+
if (!statusEl) return;
95+
if (text == null || text === '') {
96+
statusEl.textContent = '';
97+
return;
98+
}
99+
var s = String(text).replace(/\s+/g, ' ').trim();
100+
statusEl.textContent = s;
101+
}
102+
103+
function hideSplash() {
104+
if (!splash) return;
105+
splash.classList.add('ezycad-splash--hidden');
106+
}
107+
108+
window.Module = {
34109
preRun: [],
35-
postRun: [],
110+
postRun: [
111+
function() {
112+
// Let WebGL + ImGui paint once before removing the overlay (avoids a black flash).
113+
requestAnimationFrame(function() {
114+
requestAnimationFrame(hideSplash);
115+
});
116+
}
117+
],
36118
print: (function() {
37119
return function(text) {
38120
text = Array.prototype.slice.call(arguments).join(' ');
@@ -52,11 +134,20 @@
52134
})(),
53135
setStatus: function(text) {
54136
console.log("status: " + text);
137+
setSplashStatus(text);
55138
},
56139
monitorRunDependencies: function(left) {
57-
// no run dependencies to log
140+
if (left > 0)
141+
setSplashStatus('Preparing assets… (' + left + ' remaining)');
142+
else
143+
setSplashStatus('Starting…');
144+
},
145+
onAbort: function(reason) {
146+
setSplashStatus(reason ? ('Load aborted: ' + reason) : 'Load aborted');
58147
}
59148
};
149+
})();
150+
60151
window.onerror = function() {
61152
console.log("onerror: " + event);
62153
};

EzyCad/EzyCad.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

EzyCad/EzyCad.wasm

10.9 MB
Binary file not shown.

0 commit comments

Comments
 (0)