🚚 Neaten footer code

This commit is contained in:
Alicia Sykes 2022-07-24 14:43:40 +01:00
parent d25de1147c
commit b0c52b53c9
1 changed files with 25 additions and 19 deletions

View File

@ -1,16 +1,17 @@
<template>
<!-- User Footer -->
<footer v-if="text && text !== '' && visible" v-html="text"></footer>
<!-- Default Footer -->
<footer v-else-if="visible">
<span v-if="$store.state.currentConfigInfo" class="path-to-config">
Using: {{ $store.state.currentConfigInfo.confPath }}
<footer v-if="visible">
<!-- User-defined footer -->
<span v-if="text" v-html="text"></span>
<!-- Default footer -->
<span v-else>
Developed by <a :href="defaultInfo.authorUrl">{{defaultInfo.authorName}}</a>.
Licensed under <a :href="defaultInfo.licenseUrl">{{defaultInfo.license}}</a>
© {{defaultInfo.date}}.
Get the <a :href="defaultInfo.repoUrl">Source Code</a>.
</span>
<span>
Developed by <a :href="authorUrl">{{authorName}}</a>.
Licensed under <a :href="licenseUrl">{{license}}</a>
{{ showCopyright? '©': '' }} {{date}}.
Get the <a :href="repoUrl">Source Code</a>.
<!-- Config info -->
<span class="path-to-config">
Using: {{ $store.state.currentConfigId || 'Default Config' }}
</span>
</footer>
</template>
@ -23,13 +24,18 @@ export default {
name: 'Footer',
props: {
text: String,
authorName: { type: String, default: 'Alicia Sykes' },
authorUrl: { type: String, default: 'https://aliciasykes.com' },
license: { type: String, default: 'MIT' },
licenseUrl: { type: String, default: 'https://gist.github.com/Lissy93/143d2ee01ccc5c052a17' },
date: { type: String, default: `${new Date().getFullYear()}` },
showCopyright: { type: Boolean, default: true },
repoUrl: { type: String, default: 'https://github.com/lissy93/dashy' },
},
data() {
return {
defaultInfo: {
authorName: 'Alicia Sykes',
authorUrl: 'https://github.com/lissy93',
license: 'MIT',
licenseUrl: 'https://gist.github.com/Lissy93/143d2ee01ccc5c052a17',
date: `${new Date().getFullYear()}`,
repoUrl: 'https://github.com/lissy93/dashy',
},
};
},
computed: {
visible() {
@ -56,7 +62,7 @@ footer {
display: none;
}
span.path-to-config {
float: right;
float: left;
font-size: 0.75rem;
margin: 0.1rem 0.5rem 0 0;
opacity: var(--dimming-factor);