78c341c9ba9b0b1076c5326490b42f33c985a4f6.svn-base 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <a :class="className" class="link--mallki" href="#">
  3. {{ text }}
  4. <span :data-letters="text" />
  5. <span :data-letters="text" />
  6. </a>
  7. </template>
  8. <script>
  9. export default {
  10. props: {
  11. className: {
  12. type: String,
  13. default: ''
  14. },
  15. text: {
  16. type: String,
  17. default: 'vue-element-admin'
  18. }
  19. }
  20. }
  21. </script>
  22. <style>
  23. /* Mallki */
  24. .link--mallki {
  25. font-weight: 800;
  26. color: #4dd9d5;
  27. font-family: 'Dosis', sans-serif;
  28. -webkit-transition: color 0.5s 0.25s;
  29. transition: color 0.5s 0.25s;
  30. overflow: hidden;
  31. position: relative;
  32. display: inline-block;
  33. line-height: 1;
  34. outline: none;
  35. text-decoration: none;
  36. }
  37. .link--mallki:hover {
  38. -webkit-transition: none;
  39. transition: none;
  40. color: transparent;
  41. }
  42. .link--mallki::before {
  43. content: '';
  44. width: 100%;
  45. height: 6px;
  46. margin: -3px 0 0 0;
  47. background: #3888fa;
  48. position: absolute;
  49. left: 0;
  50. top: 50%;
  51. -webkit-transform: translate3d(-100%, 0, 0);
  52. transform: translate3d(-100%, 0, 0);
  53. -webkit-transition: -webkit-transform 0.4s;
  54. transition: transform 0.4s;
  55. -webkit-transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
  56. transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
  57. }
  58. .link--mallki:hover::before {
  59. -webkit-transform: translate3d(100%, 0, 0);
  60. transform: translate3d(100%, 0, 0);
  61. }
  62. .link--mallki span {
  63. position: absolute;
  64. height: 50%;
  65. width: 100%;
  66. left: 0;
  67. top: 0;
  68. overflow: hidden;
  69. }
  70. .link--mallki span::before {
  71. content: attr(data-letters);
  72. color: red;
  73. position: absolute;
  74. left: 0;
  75. width: 100%;
  76. color: #3888fa;
  77. -webkit-transition: -webkit-transform 0.5s;
  78. transition: transform 0.5s;
  79. }
  80. .link--mallki span:nth-child(2) {
  81. top: 50%;
  82. }
  83. .link--mallki span:first-child::before {
  84. top: 0;
  85. -webkit-transform: translate3d(0, 100%, 0);
  86. transform: translate3d(0, 100%, 0);
  87. }
  88. .link--mallki span:nth-child(2)::before {
  89. bottom: 0;
  90. -webkit-transform: translate3d(0, -100%, 0);
  91. transform: translate3d(0, -100%, 0);
  92. }
  93. .link--mallki:hover span::before {
  94. -webkit-transition-delay: 0.3s;
  95. transition-delay: 0.3s;
  96. -webkit-transform: translate3d(0, 0, 0);
  97. transform: translate3d(0, 0, 0);
  98. -webkit-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
  99. transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
  100. }
  101. </style>