heroSubTitle.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <div class="pure-nav">
  3. <span class="meta-title">
  4. <img :src="titleSrc" />
  5. </span>
  6. </div>
  7. </template>
  8. <script setup>
  9. import { computed } from "vue";
  10. import { computedAsync } from "@vueuse/core";
  11. defineOptions({
  12. name: "hero-sub-title",
  13. });
  14. const props = defineProps({
  15. type: {
  16. type: Number,
  17. default: () => 1,
  18. },
  19. });
  20. const titleSrc = computed(
  21. () => new URL(`../assets/subtitle_${props.type || 1}.png`, import.meta.url)
  22. );
  23. </script>
  24. <style lang="scss" scoped>
  25. .pure-nav {
  26. height: var(--main-sub-nav-height);
  27. width: calc(100% - var(--main-sub-menu-width));
  28. background-image: var(--main-sub-nav-background);
  29. background-repeat: no-repeat;
  30. background-size: cover;
  31. background-position: left center;
  32. padding-right: var(--main-sub-menu-width);
  33. display: block;
  34. flex: 0 0 var(--main-sub-nav-height);
  35. .meta-title {
  36. font-size: 1.375rem;
  37. text-align: center;
  38. width: var(--main-sub-nav-title-width);
  39. display: inline-flex;
  40. justify-content: center;
  41. align-items: center;
  42. img {
  43. width: auto;
  44. height: calc(var(--main-sub-nav-height) - 0.95rem);
  45. }
  46. }
  47. }
  48. </style>