|
|
视频在上层
<style>
@import 'https://638183.freep.cn/638183/web/tz/tz.v3.css';
.pa {
--offsetX: 81px;
--bg: beige url('https://cccimg.com/view.php/732b91b3b2043c7eefa3e8bfa095f8c7.jpg') no-repeat center/cover;
position: relative; /* 父容器相对定位,让子元素绝对定位生效 */
}
/* 视频层样式:在静态图上方,半透明不遮挡交互 */
.pd-vid {
opacity: 0.6; /* 0-1之间,数值越小越透明(根据需求调整) */
z-index: 10; /* 视频层层级:高于静态背景(默认z-index:0) */
position: absolute; /* 绝对定位,覆盖在背景上 */
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover; /* 视频自适应容器,保持比例不拉伸 */
pointer-events: none; /* 关键!让视频层不拦截点击事件,穿透到下方按钮 */
}
/* 交互元素层级提升:确保按钮、进度条在最上层 */
.tz-lrc, .tz-audio, .tz-bgprog, .tz-fs, .ma {
z-index: 20 !important; /* 高于视频层(z-index:10) */
position: relative; /* 让z-index生效 */
}
</style>
<div id="pa" class="pa"></div>
<script type="module">
import TZ from 'https://638183.freep.cn/638183/web/tz/tz.v3.js';
var tz = TZ.TZ('pa');
var lrcAr = [
[9.52, "飘雪的季节,", 1.88],
[11.68, "你轻轻走来,", 1.68],
[14.24, "静静落满我心怀,", 3.4],
[18.64, "银装素裹是你迷人姿态。", 4.16],
[23.44, "你的纯净让我心潮澎湃,", 4.04],
[28.08, "你是雪花飘落我的窗外,", 3.84],
[32.8, "你是精灵舞动洁白。", 3.6],
[37.44, "你是童话,", 1.48],
[39.2, "你是我梦的期待,", 2.8],
[42.16, "你让这世界变得更加精彩。", 4.12],
[46.88, "我心中的小雪,", 2.68],
[49.76, "你别离开,", 1.8],
[51.84, "多想感受你那梦幻的色彩,", 4.04],
[56.32, "多想与你相伴在这洁白世界聆听你那轻柔的天籁,", 9.12],
[65.68, "我心中的。", 1.36],
[67.28, "小雪你别离开,", 3],
[70.56, "多想陪你看那雪花飘下来,", 3.96],
[75.04, "有你的世界才是最浪漫的存在,", 5.36],
[80.56, "你是我永远的爱。", 3.56],
[103.36, "你是雪花飘落我的窗外,", 3.84],
[108, "你是精灵舞动洁白。", 3.68],
[112.72, "你是童话,", 1.56],
[114.56, "你是我梦的期待,", 2.72],
[117.52, "你让这世界变得更加精彩,", 4.08],
[122.16, "我心中的小雪,", 2.52],
[125.12, "你别离开,", 1.76],
[127.2, "多想感受你那梦幻的色彩,", 3.96],
[131.6, "多想与你相伴,", 2.72],
[134.56, "在这洁白世界聆听你那轻柔的天籁,", 6.2],
[141.04, "我心中的心。", 1.36],
[143.92, "你别离开,", 1.8],
[146, "多想陪你看那雪花飘下来,", 3.88],
[150.4, "有你的世界才是最浪漫的存在,", 5.36],
[156, "你是我永远的爱。", 3.6]
];
tz.lrc(lrcAr).style('top: 30px');
tz.add('audio', '', '', {src: 'https://cccimg.com/view.php/d849e51bac812f8582e7999fefb18c71.mp3'});
// 视频添加时无需额外修改,样式通过CSS类控制
tz.add('video', '', 'pd-vid', {
src: 'https://cccimg.com/view.php/8d0bdb3a49c3f61c69dd632996d7131e.mp4',
autoplay: true, // 自动播放(可选,根据需求添加)
loop: true, // 循环播放(烘托主题常用)
muted: true // 静音(避免音频冲突,可选)
});
tz.add('img', '', 'ma', {src: 'https://cccimg.com/view.php/3900cf91838bf25d715948bfa68c04f5.png'}).playmp3().style('bottom: 50px');
tz.bgprog().style('bottom: 20px; color: red');
tz.fs().style('right: 20px; bottom: 20px');
</script>
|
|