vp-sponsor-small.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <script setup lang="ts">
  2. import { isDark } from '../composables/dark'
  3. import { leftLogoSponsors } from '../../config/sponsors'
  4. import { sendEvent } from '../../config/analytics'
  5. const onItemClick = (item: any) => {
  6. sendEvent('sp_click', item.name, 'left_small_img')
  7. }
  8. </script>
  9. <template>
  10. <div>
  11. <a
  12. v-for="item in leftLogoSponsors"
  13. :key="item.name"
  14. :class="['sponsor-item inline-flex items-center', item.isDark && isDark ? 'filter invert' : '']"
  15. :href="item.url"
  16. :title="`${item.name_cn || item.name} - ${item.slogan_cn || item.slogan}`"
  17. target="_blank"
  18. @click="onItemClick(item)"
  19. >
  20. <img :src="item.img" :alt="item.name" />
  21. </a>
  22. </div>
  23. </template>
  24. <style scoped lang="scss">
  25. @use '../styles/mixins' as *;
  26. div {
  27. display: flex;
  28. align-items: center;
  29. .sponsor-item {
  30. margin-right: 4px;
  31. height: 36px;
  32. width: 36px;
  33. @include respond-to('max') {
  34. height: 44px;
  35. width: 44px;
  36. }
  37. @media (max-width: 767px) {
  38. width: 44px;
  39. height: 44px;
  40. }
  41. img {
  42. height: 100%;
  43. width: 100%;
  44. }
  45. }
  46. @include respond-to('xs') {
  47. width: 196px;
  48. }
  49. }
  50. </style>