Skip to content
Closed
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ debug-output

# Snapshot diff files
*.diff.png
.vercel
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@
"test:update-snapshots": "BUN_UPDATE_SNAPSHOTS=1 bun test",
"build": "tsup-node ./lib/index.ts --format esm --dts",
"format": "biome format --write .",
"format:check": "biome format ."
"format:check": "biome format .",
"start": "bun site/index.html",
"build:site": "bun build site/index.html --outdir=site-export"
},
"devDependencies": {
"@biomejs/biome": "^2.3.8",
"@resvg/resvg-js": "^2.6.2",
"@resvg/resvg-wasm": "^2.6.2",
"@types/bun": "latest",
"circuit-json": "^0.0.286",
"looks-same": "^10.0.1",
Expand Down
253 changes: 253 additions & 0 deletions site/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,253 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Circuit JSON to STEP Converter</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
padding: 20px;
}

.container {
background: white;
border-radius: 12px;
padding: 40px;
max-width: 600px;
width: 100%;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

h1 {
color: #333;
margin-bottom: 10px;
font-size: 28px;
}

.subtitle {
color: #666;
margin-bottom: 30px;
font-size: 14px;
}

.upload-area {
border: 3px dashed #2ecc71;
border-radius: 8px;
padding: 60px 40px;
text-align: center;
cursor: pointer;
transition: all 0.3s ease;
background: #f8fff9;
}

.upload-area:hover {
border-color: #27ae60;
background: #f0fff2;
}

.upload-area.dragover {
border-color: #27ae60;
background: #e8ffeb;
transform: scale(1.02);
}

.upload-icon {
font-size: 48px;
margin-bottom: 20px;
}

.upload-text {
color: #333;
font-size: 18px;
margin-bottom: 10px;
}

.upload-hint {
color: #999;
font-size: 14px;
}

input[type="file"] {
display: none;
}

.file-info {
margin-top: 20px;
padding: 15px;
background: #f0fff2;
border-radius: 6px;
display: none;
}

.file-info.visible {
display: block;
}

.file-name {
color: #333;
font-weight: 600;
margin-bottom: 5px;
}

.file-size {
color: #666;
font-size: 14px;
}

.options {
margin-top: 20px;
padding: 15px;
background: #f8f9fa;
border-radius: 6px;
}

.options h3 {
font-size: 14px;
color: #333;
margin-bottom: 12px;
}

.option-row {
display: flex;
align-items: center;
margin-bottom: 8px;
}

.option-row:last-child {
margin-bottom: 0;
}

.option-row input[type="checkbox"] {
margin-right: 8px;
}

.option-row label {
font-size: 14px;
color: #555;
cursor: pointer;
}

.actions {
margin-top: 20px;
display: flex;
gap: 10px;
}

button {
flex: 1;
padding: 12px 24px;
border: none;
border-radius: 6px;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: all 0.2s ease;
}

.btn-convert {
background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
color: white;
}

.btn-convert:hover:not(:disabled) {
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
}

.btn-convert:disabled {
opacity: 0.5;
cursor: not-allowed;
}

.btn-clear {
background: #e0e0e0;
color: #666;
}

.btn-clear:hover {
background: #d0d0d0;
}

.status {
margin-top: 20px;
padding: 15px;
border-radius: 6px;
display: none;
}

.status.visible {
display: block;
}

.status.success {
background: #d4edda;
color: #155724;
border: 1px solid #c3e6cb;
}

.status.error {
background: #f8d7da;
color: #721c24;
border: 1px solid #f5c6cb;
}

.status.processing {
background: #d1ecf1;
color: #0c5460;
border: 1px solid #bee5eb;
}
</style>
</head>
<body>
<div class="container">
<h1>Circuit JSON to STEP Converter</h1>
<p class="subtitle">Convert your Circuit JSON files to STEP format for 3D CAD software</p>

<div class="upload-area" id="uploadArea">
<div class="upload-icon">📁</div>
<div class="upload-text">Drag & Drop your Circuit JSON file here</div>
<div class="upload-hint">or click to browse</div>
</div>

<input type="file" id="fileInput" accept=".json,application/json">

<div class="file-info" id="fileInfo">
<div class="file-name" id="fileName"></div>
<div class="file-size" id="fileSize"></div>
</div>

<div class="options">
<h3>Options</h3>
<div class="option-row">
<input type="checkbox" id="includeComponents">
<label for="includeComponents">Include components</label>
</div>
<div class="option-row">
<input type="checkbox" id="includeExternalMeshes">
<label for="includeExternalMeshes">Include external STEP models (requires Include components)</label>
</div>
</div>

<div class="actions">
<button class="btn-convert" id="convertBtn" disabled>Convert to STEP</button>
<button class="btn-clear" id="clearBtn">Clear</button>
</div>

<div class="status" id="status"></div>
</div>

<script type="module" src="main.tsx"></script>
</body>
</html>
Loading