lightButton.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <template>
  2. <div class="l-button">
  3. <span></span>
  4. <span></span>
  5. <span></span>
  6. <span></span>
  7. <slot></slot>
  8. </div>
  9. </template>
  10. <script>
  11. export default {
  12. name: "lightButton"
  13. }
  14. </script>
  15. <style scoped>
  16. .l-button {
  17. position: relative;
  18. display: inline-block;
  19. padding: 6px 20px;
  20. color: #03e9f4;
  21. font-size: 16px;
  22. text-decoration: none;
  23. text-transform: uppercase;
  24. overflow: hidden;
  25. transition: .5s;
  26. margin-top: 40px;
  27. letter-spacing: 4px;
  28. cursor: pointer;
  29. }
  30. .l-button:hover {
  31. background: #03e9f4;
  32. color: #fff;
  33. border-radius: 5px;
  34. box-shadow: 0 0 5px #03e9f4,
  35. 0 0 25px #03e9f4,
  36. 0 0 50px #03e9f4,
  37. 0 0 100px #03e9f4;
  38. }
  39. .l-button span {
  40. position: absolute;
  41. display: block;
  42. }
  43. .l-button span:nth-child(1) {
  44. top: 0;
  45. left: -100%;
  46. width: 100%;
  47. height: 2px;
  48. background: linear-gradient(90deg, transparent, #03e9f4);
  49. animation: btn-anim1 1s linear infinite;
  50. }
  51. @keyframes btn-anim1 {
  52. 0% {
  53. left: -100%;
  54. }
  55. 50%,100% {
  56. left: 100%;
  57. }
  58. }
  59. .l-button span:nth-child(2) {
  60. top: -100%;
  61. right: 0;
  62. width: 2px;
  63. height: 100%;
  64. background: linear-gradient(180deg, transparent, #03e9f4);
  65. animation: btn-anim2 1s linear infinite;
  66. animation-delay: .25s
  67. }
  68. @keyframes btn-anim2 {
  69. 0% {
  70. top: -100%;
  71. }
  72. 50%,100% {
  73. top: 100%;
  74. }
  75. }
  76. .l-button span:nth-child(3) {
  77. bottom: 0;
  78. right: -100%;
  79. width: 100%;
  80. height: 2px;
  81. background: linear-gradient(270deg, transparent, #03e9f4);
  82. animation: btn-anim3 1s linear infinite;
  83. animation-delay: .5s
  84. }
  85. @keyframes btn-anim3 {
  86. 0% {
  87. right: -100%;
  88. }
  89. 50%,100% {
  90. right: 100%;
  91. }
  92. }
  93. .l-button span:nth-child(4) {
  94. bottom: -100%;
  95. left: 0;
  96. width: 2px;
  97. height: 100%;
  98. background: linear-gradient(360deg, transparent, #03e9f4);
  99. animation: btn-anim4 1s linear infinite;
  100. animation-delay: .75s
  101. }
  102. @keyframes btn-anim4 {
  103. 0% {
  104. bottom: -100%;
  105. }
  106. 50%,100% {
  107. bottom: 100%;
  108. }
  109. }
  110. </style>