index.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <div class="welcome-container">
  3. <div class="welcome-text">
  4. <span v-for="(letter, index) in letters" :key="index" :style="getLetterStyle(index)" class="letter">
  5. {{ letter }}
  6. </span>
  7. </div>
  8. </div>
  9. </template>
  10. <script setup lang="ts">
  11. import { ref, onMounted } from 'vue';
  12. const letters = ref(['W', 'e', 'l', 'c', 'o', 'm', 'e']);
  13. const getLetterStyle = (index: number) => {
  14. return {
  15. animationDelay: `${index * 0.1}s`
  16. };
  17. };
  18. </script>
  19. <style lang="scss" scoped>
  20. .welcome-container {
  21. width: 100%;
  22. height: 100vh;
  23. background: #ffffff;
  24. display: flex;
  25. justify-content: center;
  26. align-items: center;
  27. }
  28. .welcome-text {
  29. display: flex;
  30. gap: 10px;
  31. }
  32. .letter {
  33. font-size: 80px;
  34. font-weight: bold;
  35. background: linear-gradient(45deg, #667eea, #764ba2, #f093fb, #4facfe);
  36. background-size: 300% 300%;
  37. -webkit-background-clip: text;
  38. -webkit-text-fill-color: transparent;
  39. background-clip: text;
  40. animation: wave 2s ease-in-out infinite, gradient 3s ease infinite;
  41. display: inline-block;
  42. }
  43. @keyframes wave {
  44. 0%, 100% {
  45. transform: translateY(0) scale(1);
  46. }
  47. 50% {
  48. transform: translateY(-20px) scale(1.1);
  49. }
  50. }
  51. @keyframes gradient {
  52. 0% {
  53. background-position: 0% 50%;
  54. }
  55. 50% {
  56. background-position: 100% 50%;
  57. }
  58. 100% {
  59. background-position: 0% 50%;
  60. }
  61. }
  62. </style>