Fix header and footer positioning
This commit is contained in:
parent
c343c5fcef
commit
f38f6cc33a
|
@ -1,3 +1,25 @@
|
||||||
|
const adjustFooterHeight = () => {
|
||||||
|
// If there is no footer on this page, do nothing
|
||||||
|
const footer = document.getElementById('island-footer');
|
||||||
|
if (!footer) { return; }
|
||||||
|
|
||||||
|
// If the body is taller than the window, also do nothing
|
||||||
|
if (document.body.offsetHeight > window.innerHeight) {
|
||||||
|
footer.style.marginTop = '0';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add a margin-top to the footer to position it at the bottom of the screen
|
||||||
|
const sibling = footer.previousElementSibling;
|
||||||
|
const margin = (window.innerHeight - sibling.offsetTop - sibling.offsetHeight - footer.offsetHeight);
|
||||||
|
if (margin < 1) {
|
||||||
|
footer.style.marginTop = '0';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
footer.style.marginTop = `${margin}px`;
|
||||||
|
};
|
||||||
|
|
||||||
window.addEventListener('load', () => {
|
window.addEventListener('load', () => {
|
||||||
// Animate the water by swapping out background images every few seconds, maybe?
|
adjustFooterHeight();
|
||||||
|
window.addEventListener('resize', adjustFooterHeight);
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
|
html{
|
||||||
|
padding-top: 110px;
|
||||||
|
}
|
||||||
|
|
||||||
#cloud-header{
|
#cloud-header{
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
background: url('../static/backgrounds/header/cloud-header.png') repeat-x;
|
background: url('../static/backgrounds/header/cloud-header.png') repeat-x;
|
||||||
background-size: auto 90px;
|
background-size: auto 90px;
|
||||||
width: 100%;
|
width: calc(100% - 20px);
|
||||||
height: 90px;
|
height: 90px;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
|
|
@ -7,7 +7,6 @@ html{
|
||||||
background-image: url('../static/backgrounds/oceans/oceans-0002.png');
|
background-image: url('../static/backgrounds/oceans/oceans-0002.png');
|
||||||
background-repeat: repeat;
|
background-repeat: repeat;
|
||||||
background-size: 250px 250px;
|
background-size: 250px 250px;
|
||||||
margin-top: 110px;
|
|
||||||
font-family: 'Jost', sans-serif;
|
font-family: 'Jost', sans-serif;
|
||||||
font-size: 1.1rem;
|
font-size: 1.1rem;
|
||||||
color: #000000;
|
color: #000000;
|
||||||
|
|
|
@ -7,9 +7,6 @@
|
||||||
width: calc(100% - 0.5rem);
|
width: calc(100% - 0.5rem);
|
||||||
padding-left: 0.5rem;
|
padding-left: 0.5rem;
|
||||||
padding-top: 50px;
|
padding-top: 50px;
|
||||||
position: fixed;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
color: #dfedc6
|
color: #dfedc6
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,9 @@
|
||||||
#landing-wrapper{
|
#landing-wrapper{
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
margin-top: 50px;
|
||||||
|
|
||||||
#landing{
|
|
||||||
width: 860px;
|
|
||||||
min-height: 320px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#landing-header{
|
#landing-header{
|
||||||
|
@ -31,20 +27,16 @@
|
||||||
font-kerning: none;
|
font-kerning: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#landing-header-links{
|
|
||||||
padding-bottom: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#landing-header-links a{
|
|
||||||
margin-bottom: 10px;
|
|
||||||
margin-left: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
#landing-buttons{
|
#landing-buttons{
|
||||||
display: flex;
|
margin-left: auto;
|
||||||
flex-direction: row;
|
margin-right: auto;
|
||||||
justify-content: center;
|
height: 50px;
|
||||||
flex-wrap: wrap;
|
|
||||||
margin-top: 1rem;
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#landing{
|
||||||
|
width: 860px;
|
||||||
|
min-height: 320px;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
{% block head %}
|
||||||
|
<link rel="stylesheet" type="text/css" href="{{ static_autoversion("styles/cloudHeader.css") }}" />
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block header %}
|
{% block header %}
|
||||||
<header id="cloud-header">
|
<header id="cloud-header">
|
||||||
<a href="/" id="site-title">
|
<a href="/" id="site-title">
|
||||||
|
@ -9,6 +13,6 @@
|
||||||
<a href="/uploads">host game</a>
|
<a href="/uploads">host game</a>
|
||||||
<a href="/tutorial">setup guide</a>
|
<a href="/tutorial">setup guide</a>
|
||||||
<a href="/player-settings">player settings</a>
|
<a href="/player-settings">player settings</a>
|
||||||
<a href="https://discord.com/8Z65BR2">discord</a>
|
<a href="https://discord.gg/8Z65BR2">discord</a>
|
||||||
</header>
|
</header>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -10,3 +10,7 @@
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block head %}
|
||||||
|
<link rel="stylesheet" type="text/css" href="{{ static_autoversion("styles/islandFooter.css") }}" />
|
||||||
|
{% endblock %}
|
||||||
|
|
|
@ -6,12 +6,14 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
{% include 'cloudHeader.html' %}
|
|
||||||
<div id="landing-wrapper">
|
<div id="landing-wrapper">
|
||||||
<div id="landing-header">
|
<div id="landing-header">
|
||||||
<h4>the legend of zelda: a link to the past</h4>
|
<h4>the legend of zelda: a link to the past</h4>
|
||||||
<h1>MULTIWORLD RANDOMIZER</h1>
|
<h1>MULTIWORLD RANDOMIZER</h1>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="landing-buttons">
|
||||||
|
Buttons here, eventually!
|
||||||
|
</div>
|
||||||
<div id="landing" class="grass-island">
|
<div id="landing" class="grass-island">
|
||||||
<div id="landing-body">
|
<div id="landing-body">
|
||||||
<p>This is a <span data-tooltip="Allegedly.">randomizer</span> for The Legend of Zelda: A
|
<p>This is a <span data-tooltip="Allegedly.">randomizer</span> for The Legend of Zelda: A
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
<link rel="stylesheet" type="text/css" href="{{ static_autoversion("styles/tooltip.css") }}" />
|
<link rel="stylesheet" type="text/css" href="{{ static_autoversion("styles/tooltip.css") }}" />
|
||||||
<link rel="stylesheet" type="text/css" href="{{ static_autoversion("styles/cookieNotice.css") }}" />
|
<link rel="stylesheet" type="text/css" href="{{ static_autoversion("styles/cookieNotice.css") }}" />
|
||||||
<link rel="stylesheet" type="text/css" href="{{ static_autoversion("styles/globalStyles.css") }}" />
|
<link rel="stylesheet" type="text/css" href="{{ static_autoversion("styles/globalStyles.css") }}" />
|
||||||
<link rel="stylesheet" type="text/css" href="{{ static_autoversion("styles/cloudHeader.css") }}" />
|
|
||||||
<link rel="stylesheet" type="text/css" href="{{ static_autoversion("styles/islandFooter.css") }}" />
|
|
||||||
<script type="application/ecmascript" src="{{ static_autoversion("assets/styleController.js") }}"></script>
|
<script type="application/ecmascript" src="{{ static_autoversion("assets/styleController.js") }}"></script>
|
||||||
<script type="application/ecmascript" src="{{ static_autoversion("assets/cookieNotice.js") }}"></script>
|
<script type="application/ecmascript" src="{{ static_autoversion("assets/cookieNotice.js") }}"></script>
|
||||||
{% block head %}
|
{% block head %}
|
||||||
|
|
Loading…
Reference in New Issue