|
|

楼主 |
发表于 2023-5-21 07:28
|
显示全部楼层
帖子代码
- <css-doodle grid="1" id="mplayer">
- :doodle {
- @size: 1024px 640px;
- background: url('https://638183.freep.cn/638183/t23/2/200.jpg') no-repeat center/cover;
- box-shadow: 0 0 6px #000;
- position: relative;
- margin: 0 0 0 calc(50% - 593px);
- z-index: 1;
- --state: paused;
- }
- @size: 100px;
- clip-path: @shape(
- points: 200;
- scale: .3;
- x: 2 * cos(3t) + cos(t);
- y: 2 * sin(t) + sin(2t);
- );
- position: absolute;
- background: rgb(@m3(@r(255)));
- offset-path: path('M212 180a300 120 0 1 0 600 0a300 120 0 1 0 -600 0z');
- animation: move 40s infinite linear var(--state);
- cursor: pointer;
- @keyframes move { to { offset-distance: 100%; } }
- </css-doodle>
- <audio id="aud" src="https://music.163.com/song/media/outer/url?id=2021178386" autoplay="autoplay" loop="loop"></audio>
- <script>
- (function() {
- let script = document.createElement('script');
- script.src = '/css-doodle.min.js';
- document.head.appendChild(script);
- let mState = () => mplayer.style.setProperty('--state', aud.paused ? 'paused' : 'running');
- aud.addEventListener('play', mState, false);
- aud.addEventListener('pause', mState, false);
- mplayer.onclick = () => aud.paused ? aud.play() : aud.pause();
- })();
- </script>
复制代码
|
评分
-
| 参与人数 1 | 威望 +50 |
金钱 +100 |
经验 +50 |
收起
理由
|
红影
| + 50 |
+ 100 |
+ 50 |
赞一个! |
查看全部评分
|