Skip to content

armgit / dashy

Public Imported from GitHub
0

πŸš€ A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!

#42 Footer is now only position-fixed when window is not scrollable

Alicia Sykes4bf557875bda
diff --git a/src/components/PageStrcture/Footer.vue b/src/components/PageStrcture/Footer.vue
index 2f97d23e..56596ff4 100644
--- a/src/components/PageStrcture/Footer.vue
+++ b/src/components/PageStrcture/Footer.vue
@@ -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{