Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions public/llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ CAD Viewer is an open-source, in-browser CAD file viewer built on the OpenCascad
Free to use, no subscription required.

## Guides
- How to Split a STEP Assembly Into Separate Part Files (Free, Online): https://cadviewer.xyz/guides/split-step-assembly
- [How to Split a STEP Assembly Into Separate Part Files (Free, Online)](https://cadviewer.xyz/guides/split-step-assembly)

## Live app
https://cadviewer.xyz/
[CAD Viewer](https://cadviewer.xyz/)
30 changes: 28 additions & 2 deletions src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
import { lazy, Suspense } from "react";
import { ClientOnly, Head, ViteReactSSG } from "vite-react-ssg";
import type { RouteRecord } from "vite-react-ssg";
import App from "./ui/App";
import Landing from "./pages/Landing";
import SplitStepAssembly from "./pages/guides/SplitStepAssembly";

const App = lazy(() => import("./ui/App"));

function ViewerLoading() {
return (
<div
style={{
background: "#e2e8f0",
height: "100vh",
display: "flex",
alignItems: "center",
justifyContent: "center",
fontFamily: "monospace",
color: "#64748b",
}}
>
Loading viewer…
</div>
);
}

function NotFound() {
return (
<div
Expand Down Expand Up @@ -37,7 +57,13 @@ export const routes: RouteRecord[] = [
<Head>
<title>CAD Viewer — 3D Viewer</title>
</Head>
<ClientOnly>{() => <App />}</ClientOnly>
<ClientOnly>
{() => (
<Suspense fallback={<ViewerLoading />}>
<App />
</Suspense>
)}
</ClientOnly>
</>
),
},
Expand Down
10 changes: 5 additions & 5 deletions src/pages/Landing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default function Landing() {
/>

{/* LAYER 2: hero content — must be above canvas and fog */}
<div
<main
style={{
position: "relative",
zIndex: 2,
Expand Down Expand Up @@ -144,7 +144,7 @@ export default function Landing() {
type="button"
onClick={() => fileInputRef.current?.click()}
style={{
background: "#3b82f6",
background: "#2563eb",
color: "#ffffff",
border: "none",
borderRadius: "8px",
Expand All @@ -156,13 +156,13 @@ export default function Landing() {
}}
onMouseEnter={(e) => {
(e.currentTarget as HTMLButtonElement).style.background =
"#2563eb";
"#1d4ed8";
(e.currentTarget as HTMLButtonElement).style.transform =
"translateY(-1px)";
}}
onMouseLeave={(e) => {
(e.currentTarget as HTMLButtonElement).style.background =
"#3b82f6";
"#2563eb";
(e.currentTarget as HTMLButtonElement).style.transform =
"translateY(0)";
}}
Expand All @@ -182,7 +182,7 @@ export default function Landing() {
Supported: STEP · IGES · STL · OBJ · 3MF · BREP · GLB · DXF
</p>
</motion.section>
</div>
</main>
</div>
</>
);
Expand Down
4 changes: 2 additions & 2 deletions src/pages/guides/SplitStepAssembly.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export default function SplitStepAssembly() {
{JSON.stringify(FAQ_JSON_LD)}
</script>
</Head>
<div className={styles.page}>
<main className={styles.page}>
<article className={styles.article}>
<section className={styles.section}>
<Link to="/" className={styles.breadcrumb}>
Expand Down Expand Up @@ -303,7 +303,7 @@ export default function SplitStepAssembly() {
</div>
</section>
</article>
</div>
</main>
</>
);
}
4 changes: 2 additions & 2 deletions src/ui/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -448,12 +448,12 @@ a {
font-weight: 600;
color: #ffffff;
border: none;
background: #3b82f6;
background: #2563eb;
cursor: pointer;
}

.cad-app__upload-btn:hover {
background: #2563eb;
background: #1d4ed8;
}

.cad-app__upload-btn input {
Expand Down
Loading