index.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <div class="tech-card">
  3. <div class="corner top-left"></div>
  4. <div class="corner top-right"></div>
  5. <div class="corner bottom-left"></div>
  6. <div class="corner bottom-right"></div>
  7. <div class="card-content">
  8. <slot />
  9. </div>
  10. </div>
  11. </template>
  12. <script lang="ts" setup>
  13. defineOptions({ name: 'TechCard' })
  14. </script>
  15. <style lang="less" scoped>
  16. .tech-card {
  17. position: relative;
  18. background: linear-gradient(135deg, #001f3f, #005f99, #00aaff);
  19. background: #0b173f;
  20. border-radius: 12px;
  21. padding: 24px;
  22. color: #fff;
  23. transition: box-shadow 0.3s ease;
  24. @media (max-width: 1200px) {
  25. padding: 20px;
  26. }
  27. @media (max-width: 768px) {
  28. padding: 15px;
  29. min-height: 180px;
  30. }
  31. &::before {
  32. content: '';
  33. position: absolute;
  34. inset: 0;
  35. border-radius: 12px;
  36. padding: 3px;
  37. background: linear-gradient(270deg, #ff00cc, #3333ff, #00ffee, #ffcc00);
  38. background-size: 600% 600%;
  39. animation: rainbowBorder 6s linear infinite;
  40. mask:
  41. linear-gradient(#fff 0 0) content-box,
  42. linear-gradient(#fff 0 0);
  43. -webkit-mask:
  44. linear-gradient(#fff 0 0) content-box,
  45. linear-gradient(#fff 0 0);
  46. mask-composite: exclude;
  47. -webkit-mask-composite: destination-out;
  48. opacity: 0.3;
  49. transition: opacity 0.4s ease;
  50. z-index: 10;
  51. pointer-events: none;
  52. }
  53. &:hover::before {
  54. opacity: 1;
  55. padding: 5px;
  56. animation: rainbowBorder 3s linear infinite;
  57. }
  58. .card-content {
  59. position: relative;
  60. z-index: 1;
  61. }
  62. .corner {
  63. position: absolute;
  64. width: 20px;
  65. height: 20px;
  66. z-index: 2;
  67. }
  68. .top-left {
  69. top: 3px;
  70. left: 3px;
  71. border-top: 2px solid #00f0ff;
  72. border-left: 2px solid #00f0ff;
  73. border-radius: 6px 0 0 0;
  74. }
  75. .top-right {
  76. top: 3px;
  77. right: 3px;
  78. border-top: 2px solid #00f0ff;
  79. border-right: 2px solid #00f0ff;
  80. border-radius: 0 6px 0 0;
  81. }
  82. .bottom-left {
  83. bottom: 3px;
  84. left: 3px;
  85. border-bottom: 2px solid #00f0ff;
  86. border-left: 2px solid #00f0ff;
  87. border-radius: 0 0 0 6px;
  88. }
  89. .bottom-right {
  90. bottom: 3px;
  91. right: 3px;
  92. border-bottom: 2px solid #00f0ff;
  93. border-right: 2px solid #00f0ff;
  94. border-radius: 0 0 6px 0;
  95. }
  96. }
  97. @keyframes rainbowBorder {
  98. 0% {
  99. background-position: 0% 50%;
  100. }
  101. 50% {
  102. background-position: 100% 50%;
  103. }
  104. 100% {
  105. background-position: 0% 50%;
  106. }
  107. }
  108. </style>