HotspotForHomepage.vue 887 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <template>
  2. <div class="hotspot animation-show-hide-for-home-hotspot">
  3. <img
  4. class=""
  5. src="@/assets/images/icon_hotspot.png"
  6. alt=""
  7. draggable="false"
  8. >
  9. </div>
  10. </template>
  11. <script setup>
  12. import { useWindowSize } from "@vueuse/core"
  13. const windowHeightDesign = 1080 - 71 - 37 // 设计稿里视口高度。注意要减去上下边栏
  14. const { width: windowWidth, height: windowHeight } = useWindowSize()
  15. </script>
  16. <style lang="less" scoped>
  17. .hotspot{
  18. width: calc(48px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  19. height: calc(48px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  20. >img{
  21. width: 100%;
  22. height: 100%;
  23. }
  24. }
  25. .animation-show-hide-for-home-hotspot {
  26. animation: show-hide 2.5s infinite;
  27. }
  28. @keyframes show-hide {
  29. 0% {
  30. opacity: 0;
  31. }
  32. 50% {
  33. opacity: 1;
  34. }
  35. 100% {
  36. opacity: 0;
  37. }
  38. }
  39. </style>