帖子代码
<style>
#pa { margin: 30px 0 30px calc(50% - 681px); width: 1200px; height: 802px; background: url('https://638183.freep.cn/638183/t24/4/sky1.jpg') no-repeat center/cover; filter: url(#f1); box-shadow: 4px 4px 8px #333; z-index: 1; position: relative; --state: running; }
#msvg { position: absolute;display: none; }
.vid { position: absolute; object-fit: cover; mix-blend-mode: normal; }
.vid:nth-of-type(1) { width: 100%; height: 100%; -webkit-mask: radial-gradient(transparent 20%, red); pointer-events: none; }
.vid:nth-of-type(2) { left: 18%; bottom: 0; width: 200px; height: 200px; border-radius: 50%; cursor: pointer; animation: rot 10s linear infinite var(--state); }
@keyframes rot { to { transform: rotate(360deg); } }
</style>
<div id="pa">
<audio id="aud" src="https://music.163.com/song/media/outer/url?id=407007278" autoplay loop disablePictureInPicture></audio>
<svg id="msvg" width="400" height="400" xmlns="http://www.w3.org/2000/svg"></svg>
<video class="vid" src="https://bpic.588ku.com/video_listen/588ku_video/23/09/15/18/10/16/video65042d88783fd.mp4" autoplay loop muted></video>
<video class="vid" src="https://img.tukuppt.com/video_show/2402760/00/01/48/5b441035c5496.mp4" autoplay loop muted disablePictureInPicture></video>
</div>
<script type="module">
import Dr from 'https://638183.freep.cn/638183/web/mod/svgdr.js';
var vids = pa.querySelectorAll('.vid');
var dr = Dr.dr('msvg');
dr.draw('filter', {id: 'f1'});
dr.draw('feImage', {
href: 'https://638183.freep.cn/638183/t24/4/sky2.jpg',
x: '20%',
y: 0,
width: 602,
height: 720,
result: 'img1',
}).addTo('f1');
dr.draw('feBlend', {
in: 'img1',
in2: 'SourceGraphic',
mode: 'screen',
}).addTo('f1');
vids[1].onclick = () => {
aud.paused ? aud.play() : aud.pause();
vids.forEach(vid => aud.paused ? vid.pause() : vid.play());
pa.style.setProperty('--state', aud.paused ? 'paused' : 'running');
};
</script>
|