|
|

楼主 |
发表于 2023-2-9 12:54
|
显示全部楼层
代码
- <style>
- #papa {
- margin: 0 0 0 calc(50% - 593px);
- width: 1024px;
- height: 640px;
- background: teal url('https://638183.freep.cn/638183/t23/webp/yiuiduli.webp') no-repeat center/cover;
- box-shadow: 8px 6px 18px rgba(0,0,0,.35);
- border-radius: 8px;
- position: relative;
- z-index: 1;
- }
- #mplayer {
- --state: paused;
- --angle: 360deg;
- width: 100px;
- height: 100px;
- top: 50px;
- left: 50px;
- background: url('https://638183.freep.cn/638183/t23/1/ub4.webp') no-repeat center/cover;
- border-radius: 50%;
- display: grid;
- place-items: center;
- cursor: pointer;
- position: absolute;
- }
- #circle {
- position: absolute;
- top: -6px; left: -6px; bottom: -6px; right: -6px;
- border: 4px dotted #eee;
- border-radius: 50%;
- display: grid;
- place-items: center;
- animation: rot infinite 10s linear;
- animation-play-state: var(--state);
- }
- #circle::before, #circle::after {
- position: absolute;
- content: '';
- top: -12px; left: -12px; bottom: -12px; right: -12px;
- border: 4px dotted #fff;
- border-radius: 50%;
- animation: rot infinite 5s linear;
- animation-play-state: var(--state);
- --angle: -360deg;
- }
- #circle::after {
- top: -20px; left: -20px; bottom: -20px; right: -20px;
- border-color: #ddd;
- animation-duration: 12s;
- --angle: 360deg;
- }
- @keyframes rot {
- from { transform: rotate(0); }
- to { transform: rotate(var(--angle)); }
- }
- </style>
- <div id="papa">
- <div id="mplayer">
- <span id="circle"></span>
- </div>
- </div>
- <audio id="aud" src="https://music.163.com/song/media/outer/url?id=1489883825.mp3" autoplay loop></audio>
- <script>
- (function(mkFS) {let setFullScreen = (user_set) => {let pa = user_set.pa;if(typeof(pa) !== 'object') return false;if(!user_set.set) user_set.set = 'color: snow; background: black; border: 2px solid snow; left: 40px; bottom: 40px;';btnMsg = document.createElement('span');btnMsg.style.cssText = `position: absolute; border-radius: 8px; padding: 4px; cursor: pointer; z-index:998; ${user_set.set}`;btnMsg.innerText = '全屏观赏';btnMsg.style.display = 'none';pa.appendChild(btnMsg);let timerId, fs = false;btnMsg.onclick = () => fs ? document.exitFullscreen() : pa.requestFullscreen();pa.addEventListener('mousemove', (e) => {clearTimeout(timerId);btnMsg.style.display = 'block';timerId = setTimeout('btnMsg.style.display = "none"', 3000);});document.addEventListener('fullscreenchange', () => {if (document.fullscreenElement !== null) {fs = true;btnMsg.innerText = '退出全屏';} else {fs = false;btnMsg.innerText = '全屏观赏';}});};mkFS.FS = setFullScreen;})(this);
- let mState = () => mplayer.style.setProperty('--state', aud.paused ? 'paused' : 'running');
- aud.addEventListener('play', () => mState());
- aud.addEventListener('pause', () => mState());
- mplayer.addEventListener('click', () => aud.paused ? aud.play() : aud.pause());
- FS({
- pa: papa,
- set: 'color: snow; background: transparent; border: 2px solid snow; top: 180px;left:60px',
- });
- </script>
复制代码
|
评分
-
| 参与人数 2 | 威望 +80 |
金钱 +160 |
经验 +80 |
收起
理由
|
雨中悄然
| + 30 |
+ 60 |
+ 30 |
赞一个! |
红影
| + 50 |
+ 100 |
+ 50 |
赞一个! |
查看全部评分
|