移动与水波的错觉
CSS模拟的波浪线
换个颜色再试试:
CSS代码:
.flow-wave { padding: 5px 0; } .flow-wave:hover, .flow-wave:focus { background: radial-gradient(circle at 10px -7px, transparent 8px, currentColor 8px, currentColor 9px, transparent 9px) repeat-x, radial-gradient(circle at 10px 27px, transparent 8px, currentColor 8px, currentColor 9px, transparent 9px) repeat-x; background-size: 20px 20px; background-position: -10px calc(100% + 16px), 0 calc(100% - 4px); animation: waveFlow 1s infinite linear; } @keyframes waveFlow { from { background-position-x: -10px, 0; } to { background-position-x: -30px, -20px; } }
HTML代码:
<a href="javascript:" class="flow-wave">hover我(移动端按下)</a>