MainFooter.vue 3.6 KB

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