mirror of https://github.com/Lissy93/dashy.git
🔀 Merge pull request #44 from Lissy93/BUG-FIX_footer-position
Fixes #42 - Footer positioning bug
This commit is contained in:
commit
33197b7a18
|
@ -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{
|
||||
|
|
Loading…
Reference in New Issue