mirror of
https://codeberg.org/vlw/victorwesterlund.com.git
synced 2025-09-14 03:23:41 +02:00
Removed offset script
It kinda looks like it; but the main content is actually not offset from the center.
This commit is contained in:
parent
88414d897b
commit
04ccab7927
1 changed files with 0 additions and 12 deletions
|
@ -14,17 +14,5 @@
|
||||||
<p>victor westerlund</p>
|
<p>victor westerlund</p>
|
||||||
<p><a href="https://github.com/VictorWesterlund">github</a></p>
|
<p><a href="https://github.com/VictorWesterlund">github</a></p>
|
||||||
</main>
|
</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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Add table
Reference in a new issue