vip贵宾
性别保密
威望 点
注册时间2015-10-6
最后登录1970-1-1
在线时间 小时
好友
UID40708
听众
阅读权限120
- 积分
- 62691
鲜花( 6274) 鸡蛋( 11)
|
楼主 |
发表于 2024-5-28 10:47
|
显示全部楼层
<div class="t_fsz">
<table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_2094875">
<br /><br /><style>
#papa { margin: 20px 0 20px calc(50% - 730.5px); width: 1299px; height: 727px; background: #f1f1f1 url('https://pic.imgdb.cn/item/66553e74d9c307b7e93f7f6f.jpg') no-repeat center/cover; box-shadow: 3px 4px 8px #000; overflow: hidden; z-index: 1; position: relative; --x: 0; --y: 0; }
#papa:hover #mplay { opacity: .7; }
#mplay { position: absolute; width: 120px; height: 120px; left: var(--x); top: var(--y); border: 1px solid #eee; border-radius: 50%; background: url('https://pic.imgdb.cn/item/66553e74d9c307b7e93f7f6f.jpg') no-repeat -10px -10px; opacity: 0; cursor: pointer; transition: 1s; animation: rot 5s linear infinite var(--state); }
#vid { position: absolute; left: 0; bottom: 0; width: 100%; height: calc(100% + 70px); object-fit: cover; mix-blend-mode: screen; pointer-events: none; }
@keyframes rot { to { transform: rotate(360deg); } }
</style>
<div id="papa">
<audio id="aud" src="https://music.163.com/song/media/outer/url?id=862099998" loop autoplay></audio>
<video id="vid" src="https://img.tukuppt.com/video_show/2916847/00/17/67/5ecc844c234cf.mp4" loop muted></video>
<div id="mplay"></div>
</div>
<script>
papa.onmousemove = (e) => {
if(e.target.id === 'mplay') return;
var x = e.offsetX, y = e.offsetY;
if(x < 60) x = 60;
if(x > papa.offsetWidth - 60) x = papa.offsetWidth - 60;
if(y < 60) y = 60;
if(y > papa.offsetHeight - 60) y = papa.offsetHeight - 60;
papa.style.setProperty('--x', `${x - 60}px`);
papa.style.setProperty('--y', `${y - 60}px`);
mplay.style.backgroundPosition = `-${x - 60}px -${y - 60}px`;
};
mplay.onclick = () => aud.paused ? aud.play() : aud.pause();
aud.onplaying = aud.onpause = () => mState();
var mState = () => aud.paused ?
(papa.style.setProperty('--state', 'paused'), vid.pause()) :
(papa.style.setProperty('--state', 'running'), vid.play());
</script>
</td></tr></table>
</div>
<div id="comment_2094875" class="cm">
</div> |
鲜花鸡蛋青石板 在2024-5-28 20:19 送朵鲜花 并说:我非常同意你的观点,送朵鲜花鼓励一下
|