← Parametric Adapter results

Parametric Adapter

Gemma 4 31b · composer

Reviews & generation details

Reviews

No human review yet. Unreviewed does not mean unsuccessful.

Generation context

Imported historical artifact. Its exact original instructions and lineage are not known.

Generation prompt · exact text unavailable

See the current prompt for reference. It may differ from the instructions used to generate this artifact.

Inspect original source 3,399 bytes · SHA-256 4bdcf3e3389f
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>OpenSCAD Adapter Generator (GHT to NPT)</title>
<style>
/* ── css: layout ── */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    display: flex;
    justify-content: center;
    padding: 20px;
    margin: 0;
}

#ui-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    max-width: 800px;
    width: 100%;
}

h1 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 1.5rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
}

p {
    color: #666;
    line-height: 1.5;
}

.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-group label {
    font-weight: 600;
    font-size: 0.9rem;
}

.control-group input {
    cursor: pointer;
}

#code-container {
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ddd;
}

.code-header {
    background: #2c3e50;
    color: white;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: bold;
}

#copy-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

#copy-btn:hover {
    background: #2980b9;
}

#code-output {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 15px;
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.instructions {
    margin-top: 20px;
    padding: 15px;
    background: #eef7ff;
    border-left: 4px solid #3498db;
    border-radius: 4px;
}

.instructions h3 {
    margin-top: 0;
    font-size: 1rem;
}

.instructions ol {
    margin: 0;
    padding-left: 20px;
    font-size: 0.9rem;
    color: #444;
}

.instructions li {
    margin-bottom: 5px;
}
</style>
</head>
<body>
<div id="app"></div>
<script>
'use strict';

// ── main ──
const wallInput = document.getElementById('wall-thickness');
const wallVal = document.getElementById('wall-val');
const nutInput = document.getElementById('nut-size');
const nutVal = document.getElementById('nut-val');
const codeOutput = document.getElementById('code-output');
const copyBtn = document.getElementById('copy-btn');

function update() {
    const wall = wallInput.value;
    const nut = nutInput.value;
    wallVal.innerText = wall;
    nutVal.innerText = nut;
    codeOutput.innerText = generateOpenSCADCode(wall, nut);
}

wallInput.addEventListener('input', update);
nutInput.addEventListener('input', update);

copyBtn.addEventListener('click', () => {
    navigator.clipboard.writeText(codeOutput.innerText);
    const originalText = copyBtn.innerText;
    copyBtn.innerText = 'Copied!';
    setTimeout(() => copyBtn.innerText = originalText, 2000);
});

update();
</script>
</body>
</html>