2024年9月8日 星期日
<style>
#tz {
margin: 30px 0 30px calc(50% - 602px);
width: 1024px;
height: 600px;
background: url('https://638183.freep.cn/638183/t24/4/ifgl.jpg') no-repeat center/cover;
box-shadow: 3px 3px 6px #333;
display: grid;
place-items: center;
position: relative;
}
#player {
--size: 120px;
--border: 10px;
position: absolute;;
top: 25%;
width: var(--size);
height: var(--size);
border-radius: 50%;
cursor: pointer;
animation: rot 8s linear infinite var(--state);
}
.infinity {
width: 100%;
height: 100%;
filter: drop-shadow(0 0 10px black);
position: absolute;
}
.infinity::before, .infinity::after {
position: absolute;
content: '';
width: calc(50% - var(--border) * 1.5);
height: calc(50% - var(--border) * 1.5);
border: var(--border) solid teal;
border-radius: 50% 50% 0 50%;
transform-origin: 100% 100%;
}
.infinity::after { transform: rotate(-180deg) translate(var(--border), var(--border)); }
#vid {
position: absolute;
right: 0;
top: 0;
width: 100%;
height: 20%;
object-fit: cover;
pointer-events: none;
mix-blend-mode: hard-light;
-webkit-mask: linear-gradient(red, transparent);
}
@keyframes rot { to { transform: rotate(1turn); } }
</style>
<div id="tz">
<audio id="aud" src="https://music.163.com/song/media/outer/url?id=132675" autoplay loop></audio>
<video id="vid" src="https://bpic.588ku.com/video_listen/588ku_preview/20/11/10/15/34/31/video5faa42876fc28.mp4" autoplay loop muted></video>
<div id="player"></div>
</div>
<script>
var draggable = false, offset = 80, time_delay = 0;
var sc = document.createElement('script');
sc.src = 'https://638183.freep.cn/638183/web/api/fullscreen.js';
sc.charset = 'utf-8';
document.body.appendChild(sc);
sc.onload = () => FS({
papa: '#tz',
css: 'bottom: 20px; --fsBg: transparent; --color: white;',
});
Array(total = 3).fill('').forEach((el,k) => {
el = document.createElement('div');
el.className = 'infinity';
el.style.transform = `rotate(${360 / total * k}deg)`;
player.appendChild(el);
});
aud.onplaying = aud.onpause = () => {
tz.style.setProperty('--state', aud.paused ? 'paused' : 'running');
aud.paused ? vid.pause() : vid.play();
}
player.onclick = () => aud.paused ? aud.play() : aud.pause();
</script>
|