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: spec:
containers: containers:
- name: m1730-generator - name: m1730-generator
image: git.baumann.gr/adebaumann/m1730-generator:0.3 image: git.baumann.gr/adebaumann/m1730-generator:0.4
imagePullPolicy: Always imagePullPolicy: Always
ports: ports:
- containerPort: 5000 - containerPort: 5000
+4 -1
View File
@@ -5,6 +5,9 @@ from html import escape
app = Flask(__name__) 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_PATH = pathlib.Path('/usr/local/share/fonts/г/ГОСТ_тип_А.ttf')
_FONT_B64 = base64.b64encode(_FONT_PATH.read_bytes()).decode() _FONT_B64 = base64.b64encode(_FONT_PATH.read_bytes()).decode()
_FONT_FACE = ( _FONT_FACE = (
@@ -106,7 +109,7 @@ def generate_svg(unit, min_val, max_val, range_label, big_ticks, small_ticks, la
@app.route('/') @app.route('/')
def index(): def index():
return render_template('index.html') return render_template('index.html', logo_b64=_LOGO_B64)
@app.route('/generate', methods=['POST']) @app.route('/generate', methods=['POST'])
Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

+238 -114
View File
@@ -3,172 +3,297 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <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> <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; } *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { body {
font-family: system-ui, sans-serif; background: var(--bg);
background: #f4f4f5; color: var(--ink);
color: #222; font-family: var(--f-body);
font-size: 15px;
min-height: 100vh; min-height: 100vh;
padding: 2rem 1.5rem;
} }
.container { max-width: 840px; margin: 0 auto; } /* ── Header ── */
header {
h1 { font-size: 1.3rem; font-weight: 600; margin-bottom: 1.5rem; } display: flex;
align-items: center;
.card { gap: 1rem;
background: #fff; padding: 1.25rem 2.5rem;
border: 1px solid #ddd; border-bottom: 1px solid var(--rule);
border-radius: 8px; background: var(--white);
padding: 1.5rem;
margin-bottom: 1.5rem;
} }
.grid { header img {
display: grid; height: 52px;
grid-template-columns: 1fr 1fr; width: auto;
gap: 1rem 2rem; display: block;
} }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } } .wordmark {
label {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 0.3rem; gap: 0.1rem;
font-size: 0.88rem; }
.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-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"], /* ── Fields ── */
input[type="number"] { .field { display: flex; flex-direction: column; gap: 0.35rem; }
padding: 0.4rem 0.65rem;
border: 1px solid #bbb; .field label {
border-radius: 4px; font-size: 0.75rem;
font-size: 0.95rem; 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%; 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 { .actions {
grid-column: 1 / -1;
display: flex; display: flex;
gap: 0.75rem; gap: 0.75rem;
align-items: center; align-items: center;
margin-top: 0.5rem; padding-top: 1.75rem;
} }
button { .btn {
padding: 0.45rem 1.2rem; font-family: var(--f-disp);
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;
font-weight: 600; font-weight: 600;
color: #888; font-size: 0.9rem;
letter-spacing: 0.1em;
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 0.05em; border-radius: 1px;
margin-bottom: 1rem; 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> </style>
</head> </head>
<body> <body>
<div class="container">
<h1>M1730 Scale Generator</h1>
<div class="card"> <header>
<form id="form" class="grid"> <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> <main>
Unit <form id="form">
<small>Large letter left of scale</small>
<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> <input name="unit" type="text" value="%" required>
</label> </div>
<div class="field">
<label> <label>Range label</label>
Range label
<small>Small text in the strip (e.g. 5mA, 10V)</small>
<input name="range_label" type="text" value="5mA" required> <input name="range_label" type="text" value="5mA" required>
</label> </div>
</div>
</div>
<label> <div class="section">
Min value <div class="section-eye">Scale range</div>
<small>Value at the left (zero) end</small> <div class="row row-2">
<div class="field">
<label>Min value</label>
<input name="min" type="number" step="any" value="0" required> <input name="min" type="number" step="any" value="0" required>
</label> </div>
<div class="field">
<label> <label>Max value</label>
Max value
<small>Value at the right end</small>
<input name="max" type="number" step="any" value="100" required> <input name="max" type="number" step="any" value="100" required>
</label> </div>
</div>
</div>
<label> <div class="section">
Major tick intervals <div class="section-eye">Tick marks</div>
<small>Number of divisions (e.g. 10 → 0, 10, 20 … 100)</small> <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> <input name="big_ticks" type="number" min="1" max="50" value="10" required>
</label> </div>
<div class="field">
<label> <label>Minor per interval</label>
Minor ticks per interval
<small>Small ticks between each major pair</small>
<input name="small_ticks" type="number" min="0" max="20" value="4" required> <input name="small_ticks" type="number" min="0" max="20" value="4" required>
</label> </div>
<div class="field">
<label> <label>Labels</label>
Number of labels
<small>Numeric values to print; best when (count1) divides intervals</small>
<input name="label_count" type="number" min="2" value="6" required> <input name="label_count" type="number" min="2" value="6" required>
</label> </div>
</div>
</div>
<div class="actions"> <div class="actions">
<button type="submit" id="btn-generate">Generate</button> <button type="submit" class="btn btn-primary">Generate</button>
<button type="button" id="btn-download" disabled>Download SVG</button> <button type="button" id="btn-download" class="btn btn-outline" disabled>Download SVG</button>
<span id="status"></span> <span id="status"></span>
</div> </div>
</form> </form>
</div>
<div class="preview-card"> <div class="preview-eye">Preview</div>
<div class="preview-label">Preview</div> <div class="light-table" id="light-table">
<div id="preview"> <span id="preview-placeholder"></span>
<p id="preview-placeholder">Fill in the form and click Generate.</p>
</div>
</div>
</div> </div>
</main>
<script> <script>
let lastSvg = ''; let lastSvg = '';
@@ -184,7 +309,7 @@
}); });
if (!resp.ok) throw new Error(await resp.text()); if (!resp.ok) throw new Error(await resp.text());
lastSvg = await resp.text(); lastSvg = await resp.text();
document.getElementById('preview').innerHTML = lastSvg; document.getElementById('light-table').innerHTML = lastSvg;
document.getElementById('btn-download').disabled = false; document.getElementById('btn-download').disabled = false;
status.textContent = ''; status.textContent = '';
} catch (err) { } catch (err) {
@@ -207,7 +332,6 @@
URL.revokeObjectURL(a.href); URL.revokeObjectURL(a.href);
}); });
// Show default scale on load
doGenerate(); doGenerate();
</script> </script>
</body> </body>