MainFooter.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <script setup lang="ts">
  2. import { computed } from "vue";
  3. import { useConfigStore } from "@/stores/config";
  4. const configStore = useConfigStore();
  5. const filteredFooterLinks = computed(() =>
  6. Object.fromEntries(
  7. Object.entries(configStore.get("footerLinks")).filter(
  8. url => !(typeof url[1] === "boolean")
  9. )
  10. )
  11. );
  12. const getLink = title =>
  13. configStore.get("footerLinks")[
  14. Object.keys(configStore.get("footerLinks")).find(
  15. key => key.toLowerCase() === title
  16. )
  17. ];
  18. </script>
  19. <template>
  20. <footer class="footer">
  21. <div class="container">
  22. <div class="footer-content">
  23. <div id="footer-copyright">
  24. <p>© Copyright Musare 2015 - 2023</p>
  25. </div>
  26. <router-link id="footer-logo" to="/">
  27. <img
  28. v-if="configStore.get('sitename') === 'Musare'"
  29. src="/assets/blue_wordmark.png"
  30. :alt="configStore.get('sitename')"
  31. />
  32. <span v-else>{{ configStore.get("sitename") }}</span>
  33. </router-link>
  34. <div id="footer-links">
  35. <a
  36. v-for="(url, title, index) in filteredFooterLinks"
  37. :key="`footer-link-${index}`"
  38. :href="`${url}`"
  39. target="_blank"
  40. :title="`${title}`"
  41. >
  42. {{ title }}
  43. </a>
  44. <router-link
  45. v-if="getLink('about') === true"
  46. title="About Musare"
  47. to="/about"
  48. >About</router-link
  49. >
  50. <router-link
  51. v-if="getLink('team') === true"
  52. title="Musare Team"
  53. to="/team"
  54. >Team</router-link
  55. >
  56. <router-link
  57. v-if="getLink('news') === true"
  58. title="News"
  59. to="/news"
  60. >News</router-link
  61. >
  62. </div>
  63. </div>
  64. </div>
  65. </footer>
  66. </template>
  67. <style lang="less" scoped>
  68. .night-mode {
  69. footer.footer,
  70. footer.footer .container,
  71. footer.footer .container .footer-content {
  72. background-color: var(--dark-grey-3);
  73. }
  74. }
  75. .footer {
  76. position: relative;
  77. bottom: 0;
  78. flex-shrink: 0;
  79. height: auto;
  80. padding: 20px;
  81. box-shadow: @box-shadow;
  82. background-color: var(--white);
  83. width: 100%;
  84. height: 160px;
  85. font-size: 16px;
  86. .container {
  87. position: relative;
  88. }
  89. .footer-content {
  90. display: flex;
  91. align-items: center;
  92. flex-direction: column;
  93. text-align: center;
  94. & > * {
  95. margin: 5px 0;
  96. }
  97. a:not(.button) {
  98. border: 0;
  99. }
  100. }
  101. #footer-logo {
  102. display: block;
  103. margin-left: auto;
  104. margin-right: auto;
  105. width: 160px;
  106. order: 1;
  107. user-select: none;
  108. font-size: 2.5rem !important;
  109. line-height: 50px !important;
  110. font-family: Pacifico, cursive;
  111. color: var(--primary-color);
  112. white-space: nowrap;
  113. img {
  114. max-width: 100%;
  115. color: var(--primary-color);
  116. user-select: none;
  117. -webkit-user-drag: none;
  118. }
  119. }
  120. #footer-links {
  121. order: 2;
  122. :not(:last-child) {
  123. border-right: solid 1px var(--primary-color);
  124. }
  125. a {
  126. padding: 0 5px;
  127. color: var(--primary-color);
  128. &:first-of-type {
  129. padding: 0 5px 0 0;
  130. }
  131. &:last-of-type {
  132. padding: 0 0 0 5px;
  133. }
  134. &:hover {
  135. color: var(--primary-color);
  136. text-decoration: underline;
  137. }
  138. }
  139. }
  140. #footer-copyright {
  141. order: 3;
  142. }
  143. }
  144. @media only screen and (min-width: 990px) {
  145. .footer {
  146. height: 100px;
  147. #footer-copyright {
  148. left: 0;
  149. top: 0;
  150. position: absolute;
  151. line-height: 50px;
  152. }
  153. #footer-links {
  154. right: 0;
  155. top: 0;
  156. position: absolute;
  157. line-height: 50px;
  158. }
  159. }
  160. }
  161. </style>