BrandMark.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <script setup lang="ts">
  2. withDefaults(defineProps<{
  3. size?: number
  4. label?: boolean
  5. compact?: boolean
  6. bare?: boolean
  7. }>(), {
  8. size: 32,
  9. label: false,
  10. compact: false,
  11. bare: false,
  12. })
  13. </script>
  14. <template>
  15. <span class="brand-mark" :class="{ 'brand-mark--compact': compact, 'brand-mark--bare': bare }">
  16. <span class="brand-mark__plate" :style="{ width: `${size}px`, height: `${size}px` }">
  17. <img src="/brand/AppIcon-1024.png" alt="" aria-hidden="true" />
  18. </span>
  19. <span v-if="label" class="brand-mark__name">夭夭 Web</span>
  20. </span>
  21. </template>
  22. <style scoped>
  23. .brand-mark {
  24. display: inline-flex;
  25. align-items: center;
  26. gap: 12px;
  27. color: var(--text-primary);
  28. }
  29. .brand-mark__plate {
  30. display: inline-grid;
  31. place-items: center;
  32. flex: 0 0 auto;
  33. overflow: hidden;
  34. border-radius: 24%;
  35. background: #f1f1ef;
  36. }
  37. .brand-mark__plate img {
  38. display: block;
  39. width: 100%;
  40. height: 100%;
  41. object-fit: contain;
  42. }
  43. .brand-mark__name {
  44. font-size: 20px;
  45. font-weight: 650;
  46. letter-spacing: -.035em;
  47. }
  48. .brand-mark--compact { gap: 8px; }
  49. .brand-mark--compact .brand-mark__name { font-size: 16px; }
  50. .brand-mark--bare .brand-mark__plate { border-radius: 0; background: transparent; }
  51. </style>