本帖最后由 花简静 于 2024-8-18 15:44 编辑
<style>
#mydiv {
margin: 130px 0 30px calc(50% - 931px);
width: 1700px;
height: 900px;
background:
url('https://642303.freep.cn/642303/za/f6a91b6ff74d4b19be7a79f7a6fa5103.gif') no-repeat 830px 120px,
url('https://pic.imgdb.cn/item/668d3daad9c307b7e962dc2a.gif') no-repeat 790px 60px ,
url('https://pic.imgdb.cn/item/66b3718bd9c307b7e94967c0.webp') no-repeat 0/cover,
rgba(0,128,128,.0);
background-blend-mode: normal, screen, darken;
box-shadow: 0 0 8px rgba(0,0,0,.5);
z-index: 1;
pointer-events: none;
position: relative;
overflow: hidden;
}
#mydiv::before, #mydiv::after {
content: '';
position: absolute;
background: url('https://642303.freep.cn/642303/za/70ea16dce9f184a3.png') no-repeat center/cover;
filter: drop-shadow(0 0 20px snow);
border-radius: 50%;
animation: rot 10s linear infinite var(--state);
transition: .75s;
cursor: pointer;
pointer-events: auto;
}
#mydiv::before {
width: 230px;
height: 230px;
right: 440px;
top: 90px;
mix-blend-mode: lighten;
}
#mydiv::after {
width: 80px;
height: 80px;
left: 1140px;
top: 180px;
mix-blend-mode:lighten;
}
#mydiv:hover::before, #mydiv:hover::after {
filter: drop-shadow(0 0 80px teal);
}
@keyframes rot { to { transform: rotate(1turn); } }
#vid {
position: absolute;
width: 100%;
height: 110%;
object-fit: cover;
opacity: .69;
top:-80px;
mix-blend-mode: screen;
}
</style>
<div id="mydiv">
<video id="vid" src="https://img.tukuppt.com/video_show/15653652/01/59/07/63806a6eb7241.mp4" autoplay loop muted></video>
<audio id="aud" src="https://music.163.com/song/media/outer/url?id=1359121261" autoplay loop></audio>
</div>
<script>
var mState = () => {mydiv.style.setProperty('--state', aud.paused ? 'paused' : 'running');
aud.paused ? vid.pause() : vid.play();}
aud.oncanplay = aud.onplaying = aud.onpause = () => mState();
mydiv.onclick = () => aud.paused ? aud.play() : aud.pause();
</script>
|