vp-sponsor-small.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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="[
  15. 'sponsor-item inline-flex items-center',
  16. item.isDark && isDark ? 'filter invert' : '',
  17. ]"
  18. :href="item.url"
  19. :title="`${item.name_cn || item.name} - ${item.slogan_cn || item.slogan}`"
  20. target="_blank"
  21. @click="onItemClick(item)"
  22. >
  23. <img :src="item.img" :alt="item.name" />
  24. </a>
  25. </div>
  26. </template>
  27. <style scoped lang="scss">
  28. @use '../styles/mixins' as *;
  29. div {
  30. display: flex;
  31. align-items: center;
  32. .sponsor-item {
  33. margin-right: 4px;
  34. height: 36px;
  35. width: 36px;
  36. @include respond-to('max') {
  37. height: 44px;
  38. width: 44px;
  39. }
  40. @media (max-width: 767px) {
  41. width: 44px;
  42. height: 44px;
  43. }
  44. img {
  45. height: 100%;
  46. width: 100%;
  47. }
  48. }
  49. @include respond-to('xs') {
  50. width: 196px;
  51. }
  52. }
  53. </style>