2024年7月10日 星期三
<style>
#mydiv {
--width: 1200px;
margin: 30px 0 30px calc(50% - (var(--width) / 2 + 90px));
width: var(--width);
height: 700px;
background:
linear-gradient(45deg, transparent 48%, rgba(0,128,0,.5) 48%, rgba(0,128,0,.5) 52%, transparent 52%, transparent 0) center/100%,
linear-gradient(-45deg, transparent 48%, rgba(0,128,0,.5) 48%, rgba(0,128,0,.5) 52%, transparent 52%, transparent 0) center/100%,
repeating-radial-gradient(circle, rgba(100,100,0,.2) 0, rgba(255,255,255,.2) 40%, transparent 60%) center/10% 25%,
conic-gradient(from 45deg at center, transparent, red, transparent,blue,transparent,green,transparent,purple), #fff;
border: 1px solid gray;
z-index: 1;
overflow: hidden;
position: relative;
}
#vid {
position: absolute;
bottom: 0; width: 100%;
height: calc(100% + 160px);
object-fit: conver;
mix-blend-mode: screen;
pointer-events: none;
}
#player {
position: absolute;
left: calc(50% - 200px);
top: calc(50% - 200px);
width: 400px;
height: 400px;
cursor: pointer;
animation: rot 8s linear infinite var(--state);
}
@keyframes rot { to {transform: rotate(360deg); } }
</style>
<div id="mydiv">
<audio id="aud" src="https://music.163.com/song/media/outer/url?id=562254568" autoplay loop></audio>
<video id="vid" src="https://img.tukuppt.com/video_show/15653652/01/31/09/62d0f6b234ec0.mp4" muted autoplay loop></video>
<svg id="player"><polygon id="poly" points="400.00 200.00, 6.81 251.76, 373.21 100.00, 58.58 341.42, 300.00 26.79, 148.24 393.19, 200.00 0.00, 251.76 393.19, 100.00 26.79, 341.42 341.42, 26.79 100.00, 393.19 251.76, 0.00 200.00, 393.19 148.24, 26.79 300.00, 341.42 58.58, 100.00 373.21, 251.76 6.81, 200.00 400.00, 148.24 6.81, 300.00 373.21, 58.58 58.58, 373.21 300.00, 6.81 148.24" fill="transparent" stroke="darkgreen" stroke-width="2"></polygon></svg>
</div>
<script>
var sF = document.createElement('script');
sF.src = 'https://638183.freep.cn/638183/web/api/fullscreen.js';
sF.charset = 'utf-8';
document.querySelector('body').appendChild(sF);
sF.onload = () => FS({
papa: '#mydiv',
css: 'bottom: 20px; left: 50%; transform: translate(-50%); --color: lightblue; --fsBg: transparent;',
});
var mState = () => {
mydiv.style.setProperty('--state',['running','paused'][+aud.paused]);
player.title = ['暂停','播放'][+aud.paused];
aud.paused ? vid.pause() : vid.play();
};
aud.oncanplay = aud.onplaying = aud.onpause = () => mState();
player.onclick = () => aud.paused ? aud.play() : aud.pause();
</script>
|