|
|

楼主 |
发表于 2024-9-25 07:58
|
显示全部楼层
帖子代码
- <style>
- #tz { margin: 30px 0 30px calc(50% - 721px); width: 1280px; height: 720px; background: url('https://638183.freep.cn/638183/t24/webp2/uuvi.webp') no-repeat 0 0 / 612px 408px, url('https://638183.freep.cn/638183/t24/4/gg.jpg') no-repeat center/cover; box-shadow: 0 0 4px #111; z-index: 1; animation: bgmove 3s linear infinite alternate var(--state); position: relative; }
- #player { position: absolute; right: 10px; bottom: 10px; cursor: pointer; filter: drop-shadow(2px 1px 4px #000); }
- @keyframes bgmove { to { background-position: -10px -5px, center }; }
- </style>
- <div id="tz">
- <audio id="aud" src="https://music.163.com/song/media/outer/url?id=498210" autoplay loop></audio>
- <svg id="player" width="400" height="40" viewBox="-50 -5 100 10" style="">
- <g style="fill="none" stroke="green" stroke-width="10" stroke-dasharray="4" >
- <line x1="-50" y1="0" x2="50" y2="0"></line>
- <line x1="-50" y1="0" x2="50" y2="0" stroke="lightgreen">
- <animate attributeName="stroke-dashoffset" values="0;2;0;-2;0" dur="1.5s" repeatCount="indefinite"></animate>
- </line>
- </g>
- </svg>
- </div>
- <script>
- mState = () => aud.paused ? (tz.style.setProperty('--state', 'paused'), player.pauseAnimations()) : (tz.style.setProperty('--state', 'running'), player.unpauseAnimations());
- aud.onplaying = aud.onpause = () => mState();
- player.onclick = () => aud.paused ? aud.play() : aud.pause();
- </script>
复制代码
|
评分
-
| 参与人数 1 | 威望 +30 |
金钱 +60 |
经验 +30 |
收起
理由
|
花飞飞
| + 30 |
+ 60 |
+ 30 |
很给力! |
查看全部评分
|