MainFooter.vue 3.5 KB

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