<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Altersgrenzen heute</title>
<style>
body {
font-family: system-ui, sans-serif;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
margin: 0;
background-color: #f8f8f8;
}
h1 {
margin-bottom: 0.5em;
text-align: center;
}
.card {
background-color: white;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
padding: 2em;
margin: 1em;
text-align: center;
}
.age-label {
font-size: 1.2em;
margin-bottom: 0.5em;
font-weight: bold;
}
.date {
font-size: 2em;
color: #333;
}
</style>
</head>
<body>
<h1>Wer darf heute was trinken?</h1>
<div class="card">
<div class="age-label">Bier & Wein (ab 16):</div>
<div class="date" id="age16"></div>
</div>
<div class="card">
<div class="age-label">Harter Alkohol (ab 18):</div>
<div class="date" id="age18"></div>
</div>
<script>
function getFormattedDate(yearsAgo) {
const today = new Date();
today.setFullYear(today.getFullYear() - yearsAgo);
return today.toLocaleDateString("de-DE", {
year: "numeric",
month: "2-digit",
day: "2-digit"
});
}
document.getElementById("age16").textContent = getFormattedDate(16);
document.getElementById("age18").textContent = getFormattedDate(18);
</script>
</body>
</html>