Skip to content

Commit

Permalink
🔀 Merge pull request #44 from Lissy93/BUG-FIX_footer-position
Browse files Browse the repository at this point in the history
Fixes #42 - Footer positioning bug
  • Loading branch information
Lissy93 authored Jun 21, 2021
2 parents 6e0449f + 4bf5578 commit 33197b7
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/components/PageStrcture/Footer.vue
Original file line number Diff line number Diff line change
@@ -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}}.
Expand All @@ -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;
Expand All @@ -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{
Expand Down

1 comment on commit 33197b7

@vercel
Copy link

@vercel vercel bot commented on 33197b7 Jun 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.