mirror of
https://github.com/skoelle/PeopleCostCounter.git
synced 2026-09-17 20:00:25 +00:00
383 lines
17 KiB
HTML
383 lines
17 KiB
HTML
<!-- Copyright (c) 2026 Stefan Koelle (https://stefankoelle.de) -->
|
|
<!-- Licensed under the MIT License. See LICENSE file in project root for details. -->
|
|
<!DOCTYPE html>
|
|
<html lang="de" data-theme="dark">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Meeting Kostenuhr</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=Inter:wght@300..700&family=JetBrains+Mono:wght@400;700&display=swap" rel="stylesheet">
|
|
<style>
|
|
:root, [data-theme="light"] {
|
|
--color-bg: #f7f6f2; --color-surface: #f9f8f5; --color-surface-2: #fbfbf9;
|
|
--color-surface-offset: #f3f0ec; --color-divider: #dcd9d5; --color-border: #d4d1ca;
|
|
--color-text: #28251d; --color-text-muted: #7a7974; --color-text-faint: #bab9b4;
|
|
--color-primary: #01696f; --color-primary-hover: #0c4e54;
|
|
--color-warning: #964219; --color-error: #a12c7b;
|
|
--shadow-sm: 0 1px 2px oklch(0.2 0.01 80 / 0.06);
|
|
--shadow-md: 0 4px 12px oklch(0.2 0.01 80 / 0.08);
|
|
}
|
|
[data-theme="dark"] {
|
|
--color-bg: #0f0e0d; --color-surface: #161513; --color-surface-2: #1c1b19;
|
|
--color-surface-offset: #222120; --color-divider: #2a2927; --color-border: #333230;
|
|
--color-text: #cdccca; --color-text-muted: #797876; --color-text-faint: #4a4948;
|
|
--color-primary: #4f98a3; --color-primary-hover: #6ab8c3;
|
|
--color-warning: #e8954a; --color-error: #d163a7;
|
|
--shadow-sm: 0 1px 2px oklch(0 0 0 / 0.25);
|
|
--shadow-md: 0 4px 12px oklch(0 0 0 / 0.35);
|
|
}
|
|
@media (prefers-color-scheme: dark) {
|
|
:root:not([data-theme]) {
|
|
--color-bg:#0f0e0d; --color-surface:#161513; --color-surface-2:#1c1b19;
|
|
--color-surface-offset:#222120; --color-divider:#2a2927; --color-border:#333230;
|
|
--color-text:#cdccca; --color-text-muted:#797876; --color-text-faint:#4a4948;
|
|
--color-primary:#4f98a3; --color-primary-hover:#6ab8c3;
|
|
--color-warning:#e8954a; --color-error:#d163a7;
|
|
--shadow-sm: 0 1px 2px oklch(0 0 0 / 0.25);
|
|
--shadow-md: 0 4px 12px oklch(0 0 0 / 0.35);
|
|
}
|
|
}
|
|
:root {
|
|
--radius-sm: 0.375rem; --radius-md: 0.5rem; --radius-lg: 0.75rem;
|
|
--radius-xl: 1rem; --radius-full: 9999px;
|
|
--tr: 180ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
--text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
|
|
--text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
|
|
--text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
|
|
--font-body: 'Inter', 'Helvetica Neue', sans-serif;
|
|
--font-mono: 'JetBrains Mono', 'Fira Code', monospace;
|
|
}
|
|
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
|
|
body {
|
|
min-height: 100dvh;
|
|
font-family: var(--font-body); font-size: var(--text-base);
|
|
color: var(--color-text); background-color: var(--color-bg);
|
|
display: flex; flex-direction: column; align-items: center;
|
|
padding: 2rem 1rem;
|
|
transition: background-color var(--tr), color var(--tr);
|
|
}
|
|
input, button, select { font: inherit; color: inherit; }
|
|
button { cursor: pointer; background: none; border: none; }
|
|
|
|
.header {
|
|
width: 100%; max-width: 680px;
|
|
display: flex; align-items: center; justify-content: space-between;
|
|
margin-bottom: 2.5rem;
|
|
}
|
|
.logo { display: flex; align-items: center; gap: 0.75rem; }
|
|
.logo-icon { width: 32px; height: 32px; color: var(--color-primary); }
|
|
.logo-text { font-size: var(--text-base); font-weight: 600; letter-spacing: -0.01em; }
|
|
.theme-toggle {
|
|
width: 36px; height: 36px; border-radius: var(--radius-md);
|
|
display: flex; align-items: center; justify-content: center;
|
|
color: var(--color-text-muted);
|
|
transition: color var(--tr), background var(--tr);
|
|
}
|
|
.theme-toggle:hover { color: var(--color-text); background: var(--color-surface-offset); }
|
|
|
|
.card {
|
|
width: 100%; max-width: 680px;
|
|
background: var(--color-surface); border: 1px solid var(--color-border);
|
|
border-radius: var(--radius-xl); padding: 2rem;
|
|
box-shadow: var(--shadow-md);
|
|
transition: background var(--tr), border-color var(--tr);
|
|
}
|
|
|
|
.controls {
|
|
display: grid; grid-template-columns: 1fr 1fr auto;
|
|
gap: 1rem; align-items: flex-end; margin-bottom: 2rem;
|
|
}
|
|
@media (max-width: 540px) {
|
|
.controls { grid-template-columns: 1fr 1fr; }
|
|
.start-btn { grid-column: 1 / -1; }
|
|
}
|
|
.field { display: flex; flex-direction: column; gap: 0.5rem; }
|
|
label {
|
|
font-size: var(--text-xs); font-weight: 500;
|
|
text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-text-muted);
|
|
}
|
|
.input-wrapper { position: relative; }
|
|
.input-wrapper .unit {
|
|
position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
|
|
font-size: var(--text-sm); color: var(--color-text-muted); pointer-events: none;
|
|
}
|
|
input[type="number"] {
|
|
width: 100%; padding: 0.75rem 1rem;
|
|
background: var(--color-surface-2); border: 1px solid var(--color-border);
|
|
border-radius: var(--radius-md); font-size: var(--text-base); color: var(--color-text);
|
|
outline: none;
|
|
transition: border-color var(--tr), box-shadow var(--tr);
|
|
-moz-appearance: textfield; appearance: textfield;
|
|
}
|
|
input[type="number"]::-webkit-inner-spin-button,
|
|
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }
|
|
input[type="number"]:focus {
|
|
border-color: var(--color-primary);
|
|
box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-primary) 20%, transparent);
|
|
}
|
|
input[type="number"].has-unit { padding-right: 3rem; }
|
|
input:disabled { opacity: 0.5; }
|
|
|
|
.start-btn {
|
|
padding: 0.75rem 1.5rem;
|
|
background: var(--color-primary); color: #fff;
|
|
border-radius: var(--radius-md); font-size: var(--text-sm); font-weight: 600;
|
|
height: 44px; white-space: nowrap;
|
|
transition: background var(--tr), transform var(--tr);
|
|
box-shadow: var(--shadow-sm); border: 1px solid transparent;
|
|
}
|
|
.start-btn:hover { background: var(--color-primary-hover); }
|
|
.start-btn:active { transform: scale(0.98); }
|
|
.start-btn.running {
|
|
background: transparent; border-color: var(--color-error); color: var(--color-error);
|
|
}
|
|
.start-btn.running:hover { background: color-mix(in oklch, var(--color-error) 10%, transparent); }
|
|
|
|
.meta-row { display: flex; gap: 1.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
|
|
.meta-item { display: flex; flex-direction: column; gap: 0.25rem; }
|
|
.meta-label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-text-faint); font-weight: 500; }
|
|
.meta-value { font-size: var(--text-sm); font-family: var(--font-mono); color: var(--color-text-muted); }
|
|
|
|
.divider { height: 1px; background: var(--color-divider); margin-bottom: 2rem; }
|
|
|
|
.cost-display {
|
|
text-align: center; padding: 2.5rem 1.5rem;
|
|
background: var(--color-surface-2); border: 1px solid var(--color-border);
|
|
border-radius: var(--radius-lg); position: relative; overflow: hidden;
|
|
margin-bottom: 1.5rem; min-height: 180px;
|
|
display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.75rem;
|
|
transition: background var(--tr);
|
|
}
|
|
.cost-display::before {
|
|
content: ''; position: absolute; inset: 0;
|
|
background: radial-gradient(ellipse at 50% 0%, color-mix(in oklch, var(--color-primary) 8%, transparent) 0%, transparent 70%);
|
|
pointer-events: none; opacity: 0; transition: opacity 0.4s ease;
|
|
}
|
|
.cost-display.running::before { opacity: 1; }
|
|
|
|
.cost-label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.1em; color: var(--color-text-faint); font-weight: 500; }
|
|
.cost-amount {
|
|
font-family: var(--font-mono);
|
|
font-size: clamp(2.5rem, 5vw + 1rem, 5rem);
|
|
font-weight: 700; color: var(--color-text);
|
|
line-height: 1; letter-spacing: -0.02em;
|
|
transition: color 0.3s ease; font-variant-numeric: tabular-nums;
|
|
}
|
|
.cost-amount.running { color: var(--color-primary); }
|
|
.cost-amount .currency {
|
|
font-size: 0.45em; font-weight: 400; vertical-align: 0.15em;
|
|
color: var(--color-text-muted); margin-right: 0.1em;
|
|
}
|
|
.cost-sub { font-size: var(--text-xs); color: var(--color-text-faint); font-family: var(--font-mono); }
|
|
|
|
.idle-hint { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; color: var(--color-text-faint); }
|
|
.idle-hint svg { width: 32px; height: 32px; opacity: 0.4; }
|
|
.idle-hint p { font-size: var(--text-sm); max-width: 36ch; }
|
|
|
|
.rate-row {
|
|
display: flex; align-items: center; justify-content: center; gap: 0.75rem;
|
|
padding: 1rem 1.5rem;
|
|
background: var(--color-surface-offset); border: 1px solid var(--color-border);
|
|
border-radius: var(--radius-md);
|
|
}
|
|
.rate-label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-text-muted); font-weight: 500; }
|
|
.rate-value { font-family: var(--font-mono); font-size: var(--text-base); font-weight: 700; color: var(--color-warning); font-variant-numeric: tabular-nums; }
|
|
.rate-dot { width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--color-text-faint); flex-shrink: 0; }
|
|
.rate-dot.pulse { background: var(--color-warning); animation: pulse 1s ease-in-out infinite; }
|
|
@keyframes pulse {
|
|
0%, 100% { opacity: 1; transform: scale(1); }
|
|
50% { opacity: 0.5; transform: scale(0.7); }
|
|
}
|
|
|
|
.timer-row {
|
|
display: flex; justify-content: space-between; align-items: center;
|
|
margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--color-divider);
|
|
}
|
|
.timer-label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-text-faint); font-weight: 500; }
|
|
.timer-value { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
|
|
|
|
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; border-radius: var(--radius-sm); }
|
|
@media (prefers-reduced-motion: reduce) {
|
|
*, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<header class="header">
|
|
<div class="logo">
|
|
<svg class="logo-icon" viewBox="0 0 32 32" fill="none" aria-label="Meeting Kostenuhr">
|
|
<circle cx="16" cy="16" r="13" stroke="currentColor" stroke-width="1.5"/>
|
|
<path d="M16 8v8l5 3" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/>
|
|
</svg>
|
|
<span class="logo-text">Meeting Kostenuhr</span>
|
|
</div>
|
|
<button class="theme-toggle" data-theme-toggle aria-label="Erscheinungsbild wechseln">
|
|
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/>
|
|
</svg>
|
|
</button>
|
|
</header>
|
|
|
|
<main>
|
|
<div class="card">
|
|
<div class="controls">
|
|
<div class="field">
|
|
<label for="developers">Anwesende Entwickler</label>
|
|
<input type="number" id="developers" min="1" max="200" value="5" placeholder="z.B. 8">
|
|
</div>
|
|
<div class="field">
|
|
<label for="salary">Durchschnittsgehalt</label>
|
|
<div class="input-wrapper">
|
|
<input type="number" id="salary" min="1000" max="50000" value="5000" class="has-unit" placeholder="5000">
|
|
<span class="unit">€/Mo</span>
|
|
</div>
|
|
</div>
|
|
<button class="start-btn" id="startBtn" aria-label="Timer starten" onclick="toggleTimer()">
|
|
▶ Start
|
|
</button>
|
|
</div>
|
|
|
|
<div class="meta-row" id="metaRow" style="display:none">
|
|
<div class="meta-item">
|
|
<span class="meta-label">Jahresgehalt gesamt</span>
|
|
<span class="meta-value" id="metaJahres">-</span>
|
|
</div>
|
|
<div class="meta-item">
|
|
<span class="meta-label">inkl. Arbeitgeberanteil (×1,2)</span>
|
|
<span class="meta-value" id="metaAG">-</span>
|
|
</div>
|
|
<div class="meta-item">
|
|
<span class="meta-label">Gesamtkosten / Jahr</span>
|
|
<span class="meta-value" id="metaGesamt">-</span>
|
|
</div>
|
|
</div>
|
|
<div class="divider" id="metaDivider" style="display:none"></div>
|
|
|
|
<div class="cost-display" id="costDisplay">
|
|
<div class="idle-hint" id="idleHint">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
|
|
<circle cx="12" cy="12" r="10"/>
|
|
<path d="M12 6v6l4 2"/>
|
|
</svg>
|
|
<p>Entwickler-Anzahl und Gehalt eingeben, dann Start drücken</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="rate-row" id="rateRow" style="opacity:0.4; pointer-events:none">
|
|
<div class="rate-dot" id="rateDot"></div>
|
|
<span class="rate-label">Kosten pro Sekunde</span>
|
|
<span class="rate-value" id="rateValue">—</span>
|
|
</div>
|
|
|
|
<div class="timer-row" id="timerRow" style="display:none">
|
|
<span class="timer-label">Meeting-Dauer</span>
|
|
<span class="timer-value" id="timerValue">00:00:00</span>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
|
|
<script>
|
|
(function(){
|
|
var t = document.querySelector('[data-theme-toggle]');
|
|
var r = document.documentElement;
|
|
var d = matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
r.setAttribute('data-theme', d);
|
|
setIcon(t, d);
|
|
if(t) t.addEventListener('click', function(){
|
|
d = d==='dark' ? 'light' : 'dark';
|
|
r.setAttribute('data-theme', d);
|
|
setIcon(t, d);
|
|
});
|
|
function setIcon(b, mode){
|
|
if(!b) return;
|
|
if(mode==='dark'){
|
|
b.innerHTML='<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="5"/><path d="M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"/></svg>';
|
|
} else {
|
|
b.innerHTML='<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg>';
|
|
}
|
|
}
|
|
})();
|
|
|
|
var interval=null, startTime=null, elapsed=0, rate=0, running=false;
|
|
|
|
function fmt(v,d){ return v.toLocaleString('de-DE',{minimumFractionDigits:d,maximumFractionDigits:d}); }
|
|
function fmtT(s){ var h=Math.floor(s/3600),m=Math.floor(s%3600/60),ss=s%60; return [h,m,ss].map(function(v){return String(v).padStart(2,'0');}).join(':'); }
|
|
|
|
function calc(){
|
|
var dev=parseInt(document.getElementById('developers').value)||0;
|
|
var sal=parseFloat(document.getElementById('salary').value)||0;
|
|
var jg=sal*12, ag=jg*1.2, ges=ag*dev, ps=ges/220/8/3600;
|
|
return {dev:dev,sal:sal,jg:jg,ag:ag,ges:ges,ps:ps};
|
|
}
|
|
|
|
function render(cost){
|
|
var cd=document.getElementById('costDisplay');
|
|
var hint=document.getElementById('idleHint');
|
|
if(hint) hint.style.display='none';
|
|
var lbl=document.getElementById('cLbl'), amt=document.getElementById('cAmt'), sub=document.getElementById('cSub');
|
|
if(!amt){
|
|
lbl=document.createElement('span'); lbl.className='cost-label'; lbl.id='cLbl'; lbl.textContent='Bisher verbraucht';
|
|
amt=document.createElement('div'); amt.className='cost-amount'; amt.id='cAmt';
|
|
sub=document.createElement('span'); sub.className='cost-sub'; sub.id='cSub';
|
|
cd.appendChild(lbl); cd.appendChild(amt); cd.appendChild(sub);
|
|
}
|
|
amt.innerHTML='<span class="currency">\u20ac</span>'+fmt(cost,2);
|
|
amt.className='cost-amount'+(running?' running':'');
|
|
sub.textContent=elapsed+' Sek. \u00d7 '+fmt(rate,4)+' \u20ac/s';
|
|
}
|
|
|
|
function showMeta(c){
|
|
document.getElementById('metaRow').style.display='';
|
|
document.getElementById('metaDivider').style.display='';
|
|
document.getElementById('metaJahres').textContent=fmt(c.jg,0)+' \u20ac';
|
|
document.getElementById('metaAG').textContent=fmt(c.ag,0)+' \u20ac';
|
|
document.getElementById('metaGesamt').textContent=fmt(c.ges,0)+' \u20ac';
|
|
}
|
|
|
|
function toggleTimer(){ if(!running) startTimer(); else stopTimer(); }
|
|
|
|
function startTimer(){
|
|
var c=calc();
|
|
if(c.dev<1||c.sal<1){ alert('Bitte Werte eingeben.'); return; }
|
|
rate=c.ps; running=true; elapsed=0; startTime=Date.now();
|
|
var btn=document.getElementById('startBtn');
|
|
btn.innerHTML='\u23f9 Stop'; btn.classList.add('running');
|
|
document.getElementById('costDisplay').classList.add('running');
|
|
var rr=document.getElementById('rateRow');
|
|
rr.style.opacity='1'; rr.style.pointerEvents='';
|
|
document.getElementById('rateDot').classList.add('pulse');
|
|
document.getElementById('rateValue').textContent=fmt(c.ps,4)+' \u20ac';
|
|
document.getElementById('timerRow').style.display='';
|
|
document.getElementById('developers').disabled=true;
|
|
document.getElementById('salary').disabled=true;
|
|
showMeta(c); render(0);
|
|
interval=setInterval(function(){
|
|
elapsed=Math.floor((Date.now()-startTime)/1000);
|
|
render(rate*elapsed);
|
|
document.getElementById('timerValue').textContent=fmtT(elapsed);
|
|
},200);
|
|
}
|
|
|
|
function stopTimer(){
|
|
clearInterval(interval); interval=null; running=false;
|
|
var btn=document.getElementById('startBtn');
|
|
btn.innerHTML='\u25b6 Start'; btn.classList.remove('running');
|
|
document.getElementById('costDisplay').classList.remove('running');
|
|
document.getElementById('rateDot').classList.remove('pulse');
|
|
document.getElementById('developers').disabled=false;
|
|
document.getElementById('salary').disabled=false;
|
|
render(rate*elapsed);
|
|
}
|
|
|
|
['developers','salary'].forEach(function(id){
|
|
document.getElementById(id).addEventListener('input',function(){
|
|
if(!running){ var c=calc(); if(c.ps>0){ document.getElementById('rateValue').textContent=fmt(c.ps,4)+' \u20ac'; document.getElementById('rateRow').style.opacity='1'; } }
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |