Redesign UI with Baumann Works branding and logo

This commit is contained in:
2026-07-12 01:28:41 +02:00
parent ebba1ade5e
commit 71f4e65538
4 changed files with 256 additions and 129 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ spec:
spec:
containers:
- name: m1730-generator
image: git.baumann.gr/adebaumann/m1730-generator:0.3
image: git.baumann.gr/adebaumann/m1730-generator:0.4
imagePullPolicy: Always
ports:
- containerPort: 5000
+4 -1
View File
@@ -5,6 +5,9 @@ from html import escape
app = Flask(__name__)
_LOGO_PATH = pathlib.Path(__file__).parent / 'static' / 'logo.png'
_LOGO_B64 = base64.b64encode(_LOGO_PATH.read_bytes()).decode()
_FONT_PATH = pathlib.Path('/usr/local/share/fonts/г/ГОСТ_тип_А.ttf')
_FONT_B64 = base64.b64encode(_FONT_PATH.read_bytes()).decode()
_FONT_FACE = (
@@ -106,7 +109,7 @@ def generate_svg(unit, min_val, max_val, range_label, big_ticks, small_ticks, la
@app.route('/')
def index():
return render_template('index.html')
return render_template('index.html', logo_b64=_LOGO_B64)
@app.route('/generate', methods=['POST'])
Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

+238 -114
View File
@@ -3,172 +3,297 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>M1730 Scale Generator</title>
<title>M1730 Scale Generator — Baumann Works</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700&family=DM+Sans:wght@400;500&family=Space+Mono&display=swap" rel="stylesheet">
<style>
:root {
--bg: #f5f1ea;
--ink: #1c1814;
--accent: #c45c28;
--muted: #6b6159;
--rule: #ddd6cc;
--white: #ffffff;
--f-disp: 'Barlow Condensed', sans-serif;
--f-body: 'DM Sans', sans-serif;
--f-mono: 'Space Mono', monospace;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: system-ui, sans-serif;
background: #f4f4f5;
color: #222;
background: var(--bg);
color: var(--ink);
font-family: var(--f-body);
font-size: 15px;
min-height: 100vh;
padding: 2rem 1.5rem;
}
.container { max-width: 840px; margin: 0 auto; }
h1 { font-size: 1.3rem; font-weight: 600; margin-bottom: 1.5rem; }
.card {
background: #fff;
border: 1px solid #ddd;
border-radius: 8px;
padding: 1.5rem;
margin-bottom: 1.5rem;
/* ── Header ── */
header {
display: flex;
align-items: center;
gap: 1rem;
padding: 1.25rem 2.5rem;
border-bottom: 1px solid var(--rule);
background: var(--white);
}
.grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1rem 2rem;
header img {
height: 52px;
width: auto;
display: block;
}
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }
label {
.wordmark {
display: flex;
flex-direction: column;
gap: 0.3rem;
font-size: 0.88rem;
gap: 0.1rem;
}
.wordmark-name {
font-family: var(--f-disp);
font-weight: 700;
font-size: 1.45rem;
letter-spacing: 0.07em;
text-transform: uppercase;
line-height: 1;
color: var(--ink);
}
.wordmark-sub {
font-family: var(--f-body);
font-size: 0.75rem;
font-weight: 400;
color: var(--muted);
letter-spacing: 0.03em;
}
/* ── Layout ── */
main {
max-width: 900px;
margin: 0 auto;
padding: 2.5rem 2rem 4rem;
}
/* ── Form sections ── */
.section {
padding-bottom: 1.75rem;
margin-bottom: 1.75rem;
border-bottom: 1px solid var(--rule);
}
.section-eye {
font-family: var(--f-disp);
font-weight: 600;
font-size: 0.68rem;
letter-spacing: 0.18em;
text-transform: uppercase;
color: var(--accent);
margin-bottom: 0.9rem;
}
label small { font-weight: normal; color: #666; font-size: 0.8rem; }
.row {
display: grid;
gap: 1.25rem 2rem;
}
.row-2 { grid-template-columns: 1fr 1fr; }
.row-3 { grid-template-columns: 1fr 1fr 1fr; }
input[type="text"],
input[type="number"] {
padding: 0.4rem 0.65rem;
border: 1px solid #bbb;
border-radius: 4px;
font-size: 0.95rem;
/* ── Fields ── */
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field label {
font-size: 0.75rem;
font-weight: 500;
color: var(--muted);
letter-spacing: 0.025em;
}
.field input {
background: var(--white);
border: 1px solid var(--rule);
border-radius: 1px;
padding: 0.5rem 0.7rem;
font-family: var(--f-mono);
font-size: 0.875rem;
color: var(--ink);
width: 100%;
transition: border-color 0.15s;
transition: border-color 0.12s;
outline: none;
}
input:focus { outline: 2px solid #0070f3; outline-offset: 1px; border-color: transparent; }
.field input[type="text"] {
font-family: var(--f-body);
font-size: 0.925rem;
}
.field input:focus { border-color: var(--accent); }
/* ── Actions ── */
.actions {
grid-column: 1 / -1;
display: flex;
gap: 0.75rem;
align-items: center;
margin-top: 0.5rem;
padding-top: 1.75rem;
}
button {
padding: 0.45rem 1.2rem;
font-size: 0.9rem;
border: none;
border-radius: 4px;
cursor: pointer;
font-weight: 500;
}
#btn-generate { background: #0070f3; color: #fff; }
#btn-generate:hover { background: #005fd4; }
#btn-download { background: #e5e5e5; color: #222; }
#btn-download:hover:not(:disabled) { background: #d4d4d4; }
#btn-download:disabled { opacity: 0.45; cursor: not-allowed; }
#status { font-size: 0.82rem; color: #888; }
.preview-card {
background: #fff;
border: 1px solid #ddd;
border-radius: 8px;
padding: 1.5rem;
}
.preview-label {
font-size: 0.8rem;
.btn {
font-family: var(--f-disp);
font-weight: 600;
color: #888;
font-size: 0.9rem;
letter-spacing: 0.1em;
text-transform: uppercase;
letter-spacing: 0.05em;
margin-bottom: 1rem;
border-radius: 1px;
padding: 0.55rem 1.6rem;
cursor: pointer;
border: none;
transition: background 0.12s, color 0.12s, border-color 0.12s;
}
#preview svg { width: 100%; height: auto; display: block; }
.btn-primary {
background: var(--accent);
color: var(--white);
}
.btn-primary:hover { background: #a84d20; }
#preview-placeholder { font-size: 0.9rem; color: #aaa; }
.btn-outline {
background: transparent;
color: var(--ink);
border: 1px solid var(--rule);
}
.btn-outline:hover:not(:disabled) { border-color: var(--ink); }
.btn-outline:disabled { opacity: 0.35; cursor: not-allowed; }
#status {
font-family: var(--f-mono);
font-size: 0.75rem;
color: var(--muted);
}
/* ── Preview / light table ── */
.preview-eye {
font-family: var(--f-disp);
font-weight: 600;
font-size: 0.68rem;
letter-spacing: 0.18em;
text-transform: uppercase;
color: var(--muted);
margin-bottom: 0.9rem;
margin-top: 2.5rem;
}
.light-table {
background-color: #e8e3db;
background-image: radial-gradient(circle, #bfb8ae 1px, transparent 1px);
background-size: 18px 18px;
border-radius: 2px;
padding: 2.5rem 2rem;
display: flex;
align-items: center;
justify-content: center;
min-height: 120px;
}
.light-table svg {
width: 100%;
max-width: 740px;
height: auto;
display: block;
box-shadow: 0 1px 4px rgba(0,0,0,0.1), 0 4px 16px rgba(0,0,0,0.08);
}
#preview-placeholder {
font-family: var(--f-mono);
font-size: 0.8rem;
color: #a89e94;
}
/* ── Responsive ── */
@media (max-width: 600px) {
header { padding: 1rem 1.25rem; }
main { padding: 1.5rem 1.25rem 3rem; }
.row-2, .row-3 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
* { transition: none !important; }
}
</style>
</head>
<body>
<div class="container">
<h1>M1730 Scale Generator</h1>
<div class="card">
<form id="form" class="grid">
<header>
<img src="data:image/png;base64,{{ logo_b64 }}" alt="Baumann Works">
<div class="wordmark">
<span class="wordmark-name">Baumann Works</span>
<span class="wordmark-sub">M1730 Scale Generator</span>
</div>
</header>
<label>
Unit
<small>Large letter left of scale</small>
<main>
<form id="form">
<div class="section">
<div class="section-eye">Labels</div>
<div class="row row-2">
<div class="field">
<label>Unit</label>
<input name="unit" type="text" value="%" required>
</label>
<label>
Range label
<small>Small text in the strip (e.g. 5mA, 10V)</small>
</div>
<div class="field">
<label>Range label</label>
<input name="range_label" type="text" value="5mA" required>
</label>
</div>
</div>
</div>
<label>
Min value
<small>Value at the left (zero) end</small>
<div class="section">
<div class="section-eye">Scale range</div>
<div class="row row-2">
<div class="field">
<label>Min value</label>
<input name="min" type="number" step="any" value="0" required>
</label>
<label>
Max value
<small>Value at the right end</small>
</div>
<div class="field">
<label>Max value</label>
<input name="max" type="number" step="any" value="100" required>
</label>
</div>
</div>
</div>
<label>
Major tick intervals
<small>Number of divisions (e.g. 10 → 0, 10, 20 … 100)</small>
<div class="section">
<div class="section-eye">Tick marks</div>
<div class="row row-3">
<div class="field">
<label>Major intervals</label>
<input name="big_ticks" type="number" min="1" max="50" value="10" required>
</label>
<label>
Minor ticks per interval
<small>Small ticks between each major pair</small>
</div>
<div class="field">
<label>Minor per interval</label>
<input name="small_ticks" type="number" min="0" max="20" value="4" required>
</label>
<label>
Number of labels
<small>Numeric values to print; best when (count1) divides intervals</small>
</div>
<div class="field">
<label>Labels</label>
<input name="label_count" type="number" min="2" value="6" required>
</label>
</div>
</div>
</div>
<div class="actions">
<button type="submit" id="btn-generate">Generate</button>
<button type="button" id="btn-download" disabled>Download SVG</button>
<button type="submit" class="btn btn-primary">Generate</button>
<button type="button" id="btn-download" class="btn btn-outline" disabled>Download SVG</button>
<span id="status"></span>
</div>
</form>
</div>
<div class="preview-card">
<div class="preview-label">Preview</div>
<div id="preview">
<p id="preview-placeholder">Fill in the form and click Generate.</p>
</div>
</div>
<div class="preview-eye">Preview</div>
<div class="light-table" id="light-table">
<span id="preview-placeholder"></span>
</div>
</main>
<script>
let lastSvg = '';
@@ -184,7 +309,7 @@
});
if (!resp.ok) throw new Error(await resp.text());
lastSvg = await resp.text();
document.getElementById('preview').innerHTML = lastSvg;
document.getElementById('light-table').innerHTML = lastSvg;
document.getElementById('btn-download').disabled = false;
status.textContent = '';
} catch (err) {
@@ -207,7 +332,6 @@
URL.revokeObjectURL(a.href);
});
// Show default scale on load
doGenerate();
</script>
</body>