Footer.vue 1.2 KB
Newer Older
L
LeoKu 已提交
1 2
<template>
  <footer class="footer">
L
LeoKu 已提交
3 4 5
    <div
      data-message="If you are deploying to your own public website, please do not modify it unless you have permission from the original author."
    >
L
LeoKu 已提交
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
      Made by
      <a
        class="link"
        href="https://leoku.top"
        target="_blank"
        rel="nofollow noopener noreferrer"
      >
        LeoKu
      </a>
    </div>

    <div class="divider">|</div>

    <div class="locale" @click="switchLocale">
      {{ locale === Locale.EN ? '简体中文' : 'English' }}
    </div>
  </footer>
</template>

<script lang="ts" setup>
import { useI18n } from 'vue-i18n'

import { Locale } from '@/enums'

const { locale } = useI18n()

function switchLocale() {
  locale.value = locale.value === Locale.EN ? Locale.ZH : Locale.EN
}
</script>

<style lang="scss" scoped>
38 39
@use 'src/styles/var';

L
LeoKu 已提交
40 41 42 43
.footer {
  display: flex;
  align-items: center;
  justify-content: center;
44
  height: var.$layout-footer-height;
L
LeoKu 已提交
45
  padding: 0.8rem 0;
46
  color: rgba(var.$color-text, 0.4);
L
LeoKu 已提交
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
  font-weight: bold;
  font-size: 0.8rem;

  .divider {
    padding: 0 1rem;
  }

  .locale {
    cursor: pointer;
  }

  .link,
  .locale {
    transition: color 0.2s;

    &:hover {
63
      color: var.$color-text;
L
LeoKu 已提交
64 65 66 67
    }
  }
}
</style>