本帖最后由 花简静 于 2024-8-18 15:26 编辑
<style>
#papa { margin: 130px 0 20px calc(50% - 931px); width: 1700px; height: 900px; background: url('https://642303.freep.cn/642303/tu/0507kb02.webp') no-repeat center/cover; box-shadow: 3px 3px 6px gray; overflow: hidden; z-index: 1; position: relative; }
#player { position: absolute; width: 320px; right:240px;top:400px; cursor: pointer; pointer-events: auto; animation: rot 6s linear infinite var(--state);opacity: .0; }
/* 画布样式 */
#canv { position: absolute; display: block; right:-460px;top:100px;mix-blend-mode: screen; pointer-events: none;opacity: 0.5; }
/* 视频样式 */
.vid { position: absolute; bottom: 0; right:0px;width: 105%; height: calc(100% + 60px); object-fit: cover; mix-blend-mode: screen; opacity: 0.08; transform: rotateY(0deg);}
@keyframes rot { to { transform: rotate(360deg); } }
</style>
<div id="papa">
<audio id="aud" src="https://music.163.com/song/media/outer/url?id=31066775" autoplay loop></audio>
<!-- 支持多个视频 -->
<video class="vid" src="https://img.tukuppt.com/video_show/2629112/00/02/09/5b513c812e8de.mp4" loop muted></video>
<!-- 画布id="canv" -->
<canvas id="canv"></canvas>
<img id="player" src="https://642303.freep.cn/642303/tu/6ea104d529bc13fe.png" alt="" />
</div>
<script>
var pa = papa; //指定帖子元素id
//加载粒子特效资源
var sF = document.createElement('script');
sF.src = 'https://638183.freep.cn/638183/web/js/emmiter.js';
sF.charset = 'utf-8';
document.body.appendChild(sF);
//播放按钮点击事件
player.onclick = () => aud.paused ? aud.play() : aud.pause();
</script>
|