🔀 Merge pull request #44 from Lissy93/BUG-FIX_footer-position

Fixes #42 - Footer positioning bug
This commit is contained in:
Alicia Sykes 2021-06-21 14:37:38 +01:00 committed by GitHub
commit 33197b7a18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 4 deletions

View File

@ -1,8 +1,8 @@
<template>
<!-- User Footer -->
<footer v-if="text && text !== ''" v-html="text"></footer>
<footer v-if="text && text !== ''" v-html="text" :class="!scrollVisible ? 'fixed' : ''"></footer>
<!-- Default Footer -->
<footer v-else>
<footer v-else :class="!scrollVisible ? 'fixed' : ''">
Developed by <a :href="authorUrl">{{authorName}}</a>.
Licensed under <a :href="licenseUrl">{{license}}</a>
{{ showCopyright? '©': '' }} {{date}}.
@ -23,14 +23,19 @@ export default {
showCopyright: { type: Boolean, default: true },
repoUrl: { type: String, default: 'https://github.com/lissy93/dashy' },
},
data: () => ({
scrollVisible: false,
}),
mounted() {
this.scrollVisible = document.body.clientHeight > window.innerHeight;
},
};
</script>
<style scoped lang="scss">
footer {
position: fixed;
width: 100%;
width: calc(100% - 0.5rem);
bottom: 0;
padding: 0.25rem;
text-align: center;
@ -39,6 +44,7 @@ footer {
background: var(--background-darker);
margin-top: 1.5rem;
border-top: 1px solid var(--outline-color);
&.fixed { position: fixed; }
}
footer a{