请马上登录,朋友们都在花潮里等着你哦:)
您需要 登录 才可以下载或查看,没有账号?立即注册
x
<div class="codebox" data-prev="1">
<style>
.path1 {
fill: pink;
stroke: pink;
stroke-width: 6;
stroke-dasharray: 8 8;
stroke-dashoffset: 64;
cursor: pointer;
animation: move 1s linear infinite var(--state), jump 0.25s infinite alternate var(--state);
--state: running;
}
@keyframes move {
to { stroke-dashoffset: 0; }
}
@keyframes jump {
to { transform: scale(0.98); }
}
</style>
<svg id="msvg" width="300" height="300" xmlns="http://www.w3.org/2000/svg" viewBox="-200 -200 400 400">
<path d="M0 190 C-200 20,-300 -320,0 -100 C300 -320,200 20,0 190" class="path1" />
</svg>
<audio id="aud" src="https://music.163.com/song/media/outer/url?id=569587107" loop autoplay></audio>
<script>
var player = document.querySelector('.path1');
player.onclick = () => aud.paused ? aud.play() : aud.pause();
aud.onplaying = aud.onpause = () => player.style.setProperty('--state', aud.paused ? 'paused' : 'running');
</script>
|