|
|

楼主 |
发表于 2023-4-29 07:40
|
显示全部楼层
帖子代码
- <css-doodle grid="1x3" id="mplayer">
- :doodle {
- @size: 1024px 640px;
- background: url('https://638183.freep.cn/638183/t23/1/4000_3.jpg') no-repeat center/cover;
- pointer-events: none;
- margin: -80px 0 0 calc(50% - 593px);
- box-shadow: 0 0 8px #000;
- --state: paused;
- }
- @size: 200px;
- @place: center 120px;
- cursor: pointer;
- pointer-events: auto;
- @at(1,1) {
- background: gray linear-gradient(red,green,red);
- clip-path: @shape(
- points: 300;
- frame: 60;
- scale: .65;
- r: abs.cos(9t) ^ cos(9t);
- );
- animation: rot 6s infinite linear var(--state);
- }
- @at(1,2) {
- @size: 100px;
- @place: 360px 420px;
- background: linear-gradient(silver,lightgreen);
- clip-path: @shape(
- points: 720;
- scale: .4 .3;
- -y: cos(5t) + cos(3t) + cos(5t);
- x: sin(3t) + sin(3/t) + sin(2t);
- );
- transform-origin: bottom bottom;
- animation: swing .5s infinite alternate linear var(--state);
- }
- @keyframes rot { to { transform: rotate(1turn); } }
- @keyframes swing { from { transform: rotate(-2deg); } to { transform: rotate(2deg); } }
- </css-doodle>
- <audio id="aud" src="https://music.163.com/song/media/outer/url?id=2017510419" autoplay loop></audio>
- <script>
- (function() {
- let script = document.createElement('script');
- script.src = 'https://unpkg.com/css-doodle@0.34.9/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 |
赞一个! |
查看全部评分
|