removed JS from footer, now pinned to bottom w/ pure css

This commit is contained in:
worktop 2024-02-22 16:04:54 -05:00
parent 9e5d95551b
commit 9969b19f99
2 changed files with 9 additions and 16 deletions

View File

@ -2,18 +2,5 @@
<hr/>
<a href="/{{ .Language.LanguageCode }}">{{ .Site.Title }}</a><br/>
</footer>
<script>
// JavaScript to check if content is shorter than the screen
// and add fixed class to footer if needed
window.addEventListener('DOMContentLoaded', function() {
var content = document.querySelector('.content');
var footer = document.querySelector('footer');
if (content.offsetHeight < window.innerHeight) {
footer.classList.add('fixed');
}
});
</script>
</body>
</html>

View File

@ -17,6 +17,9 @@ body{
line-height: 1.5;
background-color: var(--bg);
color: var(--fg);
display: flex;
flex-direction: column;
min-height: 100vh;
}
a{
@ -26,7 +29,11 @@ a{
/* Main Body */
.content { margin: 5em 5% auto 5%; }
.content {
margin: 5em 5% auto 5%;
flex: 1;
}
footer {
width: calc(100% - 40px);
@ -428,4 +435,3 @@ blockquote.location p { padding: inherit; }
}