|
|

楼主 |
发表于 2022-10-9 07:23
|
显示全部楼层
完整代码
- <style>
- #papa { left: -214px; width: 1024px; height: 640px; background: gray url('https://638183.freep.cn/638183/t22/webp/kongjing.webp') no-repeat center/cover; box-shadow: 3px 3px 20px #000; position: relative; z-index: 1; }
- #tit { position: absolute; left: 20px; top: 20px; font: bold 3em sans-serif; color: #ccc; text-shadow: 2px 2px 4px #fcfcfc; letter-spacing: 2px; }
- #btnplay { position: absolute; bottom: 40px; left: 100px; width: 100px; height: 100px; border-radius: 50%; box-shadow: 20px 15px 0 0 yellow; cursor: pointer; animation: swing 1s linear infinite alternate; }
- #btnplay::before { position: absolute; content: ''; left: 20px; top: 15px; width: 100%; height: 100%; }
- #btnplay::after { position: absolute; content: ''; left: 30px; top: 30px; width: 40%; height: 40%; border-radius: 50%; background: yellow; box-shadow: 0 0 30px 0px yellow, 0 0 100px 0 snow; }
- @keyframes swing { from { transform: rotate(0deg); } to { transform: rotate(30deg); } }
- </style>
- <div id="papa">
- <span id="tit">姬神·人静</span>
- <span id="btnplay" title="播放/暂停"></span>
- </div>
- <script>
- (function() {
- let aud = new Audio();
- aud.src = 'http://www.kumeiwp.com/sub/filestores/2022/03/21/147c882d5501cd40049e330dfcbb444f.mp3';
- aud.loop = true;
- aud.play();
- btnplay.style.animationPlayState = aud.paused ? 'paused' : 'running';
- btnplay.onclick = () => mplay();
- let mplay = () => aud.paused ? (aud.play(), btnplay.style.animationPlayState = 'running') : (aud.pause(), btnplay.style.animationPlayState = 'paused');
- }());
- </script>
复制代码
|
评分
-
| 参与人数 1 | 威望 +50 |
金钱 +100 |
经验 +50 |
收起
理由
|
红影
| + 50 |
+ 100 |
+ 50 |
赞一个! |
查看全部评分
|