44 lines
1 KiB
HTML
44 lines
1 KiB
HTML
|
<!DOCTYPE html>
|
||
|
<html>
|
||
|
<head>
|
||
|
<meta charset="utf-8">
|
||
|
<style>
|
||
|
body {
|
||
|
white-space: nowrap;
|
||
|
object-fit: contain;
|
||
|
text-align: center;
|
||
|
font-family: "Roboto Condensed";
|
||
|
}
|
||
|
|
||
|
.container {
|
||
|
position: absolute;
|
||
|
top: 50%;
|
||
|
left: 50%;
|
||
|
transform: translateX(-50%) translateY(-50%);
|
||
|
}
|
||
|
</style>
|
||
|
</head>
|
||
|
<body>
|
||
|
<div class="container">
|
||
|
<div id="name">Kein Name</div>
|
||
|
</div>
|
||
|
<script>
|
||
|
function setSize() {
|
||
|
el = document.getElementById('name')
|
||
|
elSize = {
|
||
|
width: el.offsetWidth,
|
||
|
height: el.offsetHeight
|
||
|
}
|
||
|
browserSize = {
|
||
|
width: 192,
|
||
|
height: 72
|
||
|
}
|
||
|
factor = Math.min(browserSize.height / elSize.height, browserSize.width / elSize.width)
|
||
|
el.style.transform = `scale(${factor})`
|
||
|
}
|
||
|
document.addEventListener('DOMContentLoaded', () => setSize())
|
||
|
window.addEventListener('resize', () => setSize())
|
||
|
</script>
|
||
|
</body>
|
||
|
</html>
|