|
| 1 | +.text-animate { |
| 2 | + display: inline-block; |
| 3 | + opacity: 0; |
| 4 | + animation: bounce-in; |
| 5 | + animation-duration: 1s; |
| 6 | + animation-delay: 1s; |
| 7 | + animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); |
| 8 | + animation-fill-mode: forwards; |
| 9 | + min-width: 10px; |
| 10 | +} |
| 11 | + |
| 12 | +.text-animate-hover { |
| 13 | + --delay: 0; |
| 14 | + |
| 15 | + min-width: 10px; |
| 16 | + display: inline-block; |
| 17 | + animation: rubber-band 1s; |
| 18 | + animation-fill-mode: both; |
| 19 | + animation-delay: var(--delay) s; |
| 20 | + |
| 21 | + &:hover { |
| 22 | + animation: none; |
| 23 | + color: #ff4500; |
| 24 | + } |
| 25 | +} |
| 26 | + |
| 27 | +@keyframes bounce-in { |
| 28 | + 0% { |
| 29 | + opacity: 0; |
| 30 | + transform: scale3d(0.3, 0.3, 0.3); |
| 31 | + } |
| 32 | + |
| 33 | + 20% { |
| 34 | + transform: scale3d(1.1, 1.1, 1.1); |
| 35 | + } |
| 36 | + |
| 37 | + 40% { |
| 38 | + transform: scale3d(0.9, 0.9, 0.9); |
| 39 | + } |
| 40 | + |
| 41 | + 60% { |
| 42 | + opacity: 1; |
| 43 | + transform: scale3d(1.03, 1.03, 1.03); |
| 44 | + } |
| 45 | + |
| 46 | + 80% { |
| 47 | + transform: scale3d(0.97, 0.97, 0.97); |
| 48 | + } |
| 49 | + |
| 50 | + 100% { |
| 51 | + opacity: 1; |
| 52 | + transform: scale3d(1, 1, 1); |
| 53 | + } |
| 54 | +} |
| 55 | + |
| 56 | +@keyframes rubber-band { |
| 57 | + 0% { |
| 58 | + transform: scale3d(1, 1, 1); |
| 59 | + } |
| 60 | + |
| 61 | + 30% { |
| 62 | + transform: scale3d(1.25, 0.75, 1); |
| 63 | + } |
| 64 | + |
| 65 | + 40% { |
| 66 | + transform: scale3d(0.75, 1.25, 1); |
| 67 | + } |
| 68 | + |
| 69 | + 50% { |
| 70 | + transform: scale3d(1.15, 0.85, 1); |
| 71 | + } |
| 72 | + |
| 73 | + 65% { |
| 74 | + transform: scale3d(0.95, 1.05, 1); |
| 75 | + } |
| 76 | + |
| 77 | + 75% { |
| 78 | + transform: scale3d(1.05, 0.95, 1); |
| 79 | + } |
| 80 | + |
| 81 | + 100% { |
| 82 | + transform: scale3d(1, 1, 1); |
| 83 | + } |
| 84 | +} |
0 commit comments