1
0

LoveVueThreeJS.vue 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <script setup lang="ts">
  2. ///<reference types="vite-svg-loader" />
  3. import Triangle from '../assets/triangle.svg'
  4. import SecondRow from '../assets/second-row.svg'
  5. import ThirdRow from '../assets/third-row.svg'
  6. import gsap from 'gsap'
  7. import { onMounted, ref } from 'vue'
  8. const triangleRef = ref()
  9. const secondRowRef = ref()
  10. const thirdRowRef = ref()
  11. onMounted(() => {
  12. const tl2r = gsap.timeline()
  13. const tl3r = gsap.timeline()
  14. tl2r.to(secondRowRef.value.$el, {
  15. delay: 1,
  16. duration: 2,
  17. y: -1253,
  18. ease: 'elastic.easeOut',
  19. })
  20. tl3r.to(thirdRowRef.value.$el, {
  21. delay: 1.25,
  22. duration: 2,
  23. y: -1253,
  24. ease: 'elastic.easeOut',
  25. })
  26. })
  27. </script>
  28. <template>
  29. <div class="grid items-center w-full min-w-370px -translate-x-20px md:translate-x-20px h-full scale-75">
  30. <div class="grid grid-cols-3 gap-8 overflow-hidden h-93px">
  31. <Triangle ref="triangleRef" />
  32. <SecondRow ref="secondRowRef" />
  33. <ThirdRow ref="thirdRowRef" />
  34. </div>
  35. </div>
  36. </template>
  37. <style scoped></style>