Removed offset script

It kinda looks like it; but the main content is actually not offset from the center.
This commit is contained in:
Victor Westerlund 2021-09-21 09:00:24 +02:00
parent 88414d897b
commit 04ccab7927

View file

@ -14,17 +14,5 @@
<p>victor westerlund</p>
<p><a href="https://github.com/VictorWesterlund">github</a></p>
</main>
<script>
// Compensate for native elements (like the brower navbar)
function updateOffset() {
const offset = (window.outerHeight - window.innerHeight) / 2;
if(offset > -1) {
const main = document.getElementsByTagName("main")[0];
main.style.setProperty("transform",`translateY(-${offset}px)`);
}
}
window.addEventListener("resize",() => updateOffset());
updateOffset();
</script>
</body>
</html>