情人节快乐! 《老婆老婆我爱你》 - 火风
<style>
#papa {
margin-top: 120px;
left: calc(50% - 81px);
transform: translateX(-50%);
background:#800 url('https://imgbaofun.zhhainiao.com/pcwallpaper_ugc/scene/f1fc8549fd0ba423aaf4fe10f10cd611_preview.jpg')no-repeat center/cover;
width: 1164px;
height: 600px;
box-shadow: 3px 3px 6px gray;
border-radius: 22px;
border: thick double#88abfa;
background:#000;
overflow: hidden;
z-index: 1;
position: relative;
display: grid;
place-items: center;
}
#mdiv {z-index: 10;
--size: 90px;
position: relative;
top: 220px;
left: -450px;
width: var(--size);
height: var(--size);
display: grid;
background:url(https://s1.ax1x.com/2023/02/28/ppCT07F.png) no-repeat center/100% 100%;
place-items: center;
animation: rot 8s linear infinite ;
cursor: pointer;
}
#mdiv::after { transform: rotate(90deg) }
@keyframes rot { 100% { transform: rotate(-360deg);filter:hue-rotate(-360deg); } }
#vid {z-index: 2;
position: absolute;
width: 100%;
height: 100%;
object-fit: cover;
-webkit-mask-image: radial-gradient(black 10% ,transparent 90%);
}
#vido {z-index: 1;
position: absolute;
width: 100%;
height: 100%;
object-fit: cover;
}
#fullscreen { position: absolute; top: 30px; right:30px;font: normal 2em/0em 楷体;color:#000; opacity: 1; cursor: pointer; z-index: 111}
</style>
<div id="papa">
<div id="mdiv" title=""></div>
<div data-lrc="" id="lrc" title="歌词显示"></div>
<span id="fullscreen">全屏欣赏</span>
<audio id="aud" src="https://music.163.com/song/media/outer/url?id=2096901257.mp3" autoplay loop></audio>
<video id="vid" src="https://video-qn.51miz.com/preview/video/00/00/67/31/V-673176-748DD0E3.mp4" autoplay loop muted></video>
<video id="vido" src="https://video-qn.51miz.com/preview/video/00/00/16/53/V-165318-1D1F6794.mp4" autoplay loop muted></video>
</div>
<script>
mdiv.onclick = () => aud.paused ?( aud.play(),vid.play(),vido.play()):(aud.pause(),vid.pause(),vido.pause());
mdiv.style.animationPlayState = aud.paused ? 'paused' : 'running';
aud.addEventListener('playing', () =>mdiv.style.animationPlayState = 'running');
aud.addEventListener('pause', () =>mdiv.style.animationPlayState = 'paused');
let fs = true;
fullscreen.onclick = () => {
fs ? (fullscreen.innerText = '退出全屏', papa.requestFullscreen()) : (fullscreen.innerText = '全屏欣赏', document.exitFullscreen());
fs = !fs;
};
</script>
<style type="text/css">
#lrc {
--state: paused;
--motion: cover2;
--tt: 2s;
--bg: linear-gradient(120deg, #e71134, #f851cb, #c338f7, #389ff7,#c3f738,#fbc91d, #fb7b1d);
position: absolute;
z-index: 6;
left: 50%;
top: 85%;
transform: translate(-50%);
font:normal 3em 华文新魏;
font-weight:400;
color: #000080;
white-space: pre;
-webkit-background-clip: text;filter:drop-shadow(#FFFFFF 1px 0 0)drop-shadow(#FFFFFF 0 1px 0)drop-shadow(#FFFFFF -1px 0 0) drop-shadow(#FFFFFF 0 -1px0);
}
#lrc::before {
position: absolute;
content: attr(data-lrc);
width: 100%;
height: 100%;
color: transparent;
overflow: hidden;
white-space: pre;
background: var(--bg);
clip-path: inset(0 100% 0 0);
-webkit-background-clip: text;
animation: var(--motion) var(--tt) linear forwards;
animation-play-state: var(--state);
}
@keyframes cover1{ to { clip-path: inset(0 0 0 0); } }@keyframes cover2 { to { clip-path: inset(0 0 0 0); } }
</style>
<script >
(function() {
/*原始lrc歌词*/
let lrcStr = `《老婆老婆我爱你》
作词:火风
作曲:火风
演唱:火风
歌词编辑:亦是金
。。。。。。
我的爱
就是你
你知道我爱你
虽然你身体不好
怕我着急
我对你说 有我
你就没问题
家 是不富裕
可是我
有力气
我会让你笑
让你欢喜
只要你愿意
我陪你
老婆老婆我爱你
阿弥托佛保佑你
愿你有一个好身体
健康又美丽
老婆老婆我爱你
阿弥托佛保佑你
愿你事事都如意
我们不分离
。。。。。。
我的爱
就是你
你知道我爱你
虽然你身体不好
怕我着急
我对你说 有我
你就没问题
家 是不富裕
可是我
有力气
我会让你笑
让你欢喜
只要你愿意
我陪你
老婆老婆我爱你
阿弥托佛保佑你
愿你有一个好身体
健康又美丽
老婆老婆我爱你
阿弥托佛保佑你
愿你事事都如意
我们不分离
老婆老婆我爱你
阿弥托佛保佑你
愿你有一个好身体
健康又美丽
老婆老婆我爱你
阿弥托佛保佑你
愿你事事都如意
我们不分离
老婆
下辈子我陪陪陪陪
-- 情人节快乐 --
`;
/*变量 :mKey - 当前歌词索引;mFlag :调用关键帧动画索引;averAdd :平均值补偿*/
let mKey = 0, mFlag = true, averAdd = 0.3;
/*函数 :获取每句歌词用时,歌词用时若超过平均值则取平均值,最后一句歌词则取平均值*/
let lrcTime = (ar) => { let tmpAr = [];
for(j = 0; j <ar.length - 1; j ++) { if(j !== ar.length - 1) tmpAr = parseFloat((ar - ar).toFixed(1));}
let aver = parseInt(tmpAr.reduce((a,b) => a + b) / (tmpAr.length - 1)) + averAdd;
tmpAr.push(aver);
tmpAr.forEach((item,key) => {ar = item > aver ? aver : item; });
return ar;};
/*函数 :从原始lrc歌词获取信息并存入 n*3 数组*/
let getLrcAr = (text) => {
let lrcAr = [];
let calcRule = ;
for(x of text.split('\n')) {
let ar = [];
let re = /\d+[\.:]\d+([\.:]\d+)?/g;
let geci = x.replace(re,'');
if(geci) {
geci = geci.replace(/[\[\]\'\"\t,]s?/g,'');
let time = x.match(re);
if(time != null) {
for(y of time) {
let tmp = y.match(/\d+/g);
let sec = 0;
for(z in tmp) sec += tmp * calcRule;
ar = ;
lrcAr.push(ar);
}
}
}
}
lrcAr.sort((a,b)=> a - b);
return(lrcTime(lrcAr));
};
/*函数 :模拟显示同步歌词*/
let showLrc = (time) => {
let name = mFlag ? 'cover1' : 'cover2';
lrc.innerHTML = lrcAr;
lrc.dataset.lrc = lrcAr;
lrc.style.setProperty('--motion', name);
lrc.style.setProperty('--tt', time + 's');
lrc.style.setProperty('--state', 'running');
mKey += 1;
mFlag = !mFlag;
};
/*函数 :处理当前歌词索引 mKey*/
let calcKey = () => {
for (j = 0; j < lrcAr.length; j++) {
if (aud.currentTime <= lrcAr) {
mKey = j - 1;
break;
}
}
if (mKey < 0) mKey = 0;
if (mKey > lrcAr.length - 1) mKey = lrcAr.length - 1;
let time = lrcAr - (aud.currentTime - lrcAr);
showLrc(time);
};
/*格式化时间信息*/
let toMin = (val) => {
if (!val) return '00:00';
val = Math.floor(val);
let min = parseInt(val / 60),
sec = parseFloat(val % 60);
if (min < 10) min = '0' + min;
if (sec < 10) sec = '0' + sec;
return min + ':' + sec;
}
/*函数 :关键帧动画状态切换*/
let mState = () => aud.paused ? (lrc.style.setProperty('--state','paused'),mdiv.style.animationPlayState = 'paused') : (lrc.style.setProperty('--state','running'),mdiv.style.animationPlayState = 'running');
/*监听播放进度*/
aud.addEventListener('timeupdate', () => {
for (j = 0; j < lrcAr.length; j++) {
if (aud.currentTime >= lrcAr) {
cKey = j;
if (mKey === j) showLrc(lrcAr);
else continue;
}
}
});
aud.addEventListener('pause', () => mState());/*监听暂停事件*/
aud.addEventListener('play', () => mState());/*监听播放事件*/
aud.addEventListener('seeked', () => calcKey());/*监听查询事件*/
let lrcAr = getLrcAr(lrcStr); /*获得歌词数组*/
})();
</script>
很温馨的制作,欣赏亦是金老师好帖{:4_199:} 红影 发表于 2026-2-14 19:30
很温馨的制作,欣赏亦是金老师好帖
问好红影!谢谢欣赏,祝情人节快乐!{:4_187:} 啊~~~前辈今天是情人节的,老师还记得今天这个好日子{:4_205:} 温馨的场景,漂亮的制作,感谢前辈老师精彩分享{:4_187:} 小辣椒 发表于 2026-2-14 23:59
啊~~~前辈今天是情人节的,老师还记得今天这个好日子
哈哈哈,一个糟老头!{:4_170:} 小辣椒 发表于 2026-2-15 00:00
温馨的场景,漂亮的制作,感谢前辈老师精彩分享
问好小辣椒!谢谢欣赏!{:4_187:} 漂亮~祝亦是金老师新春快乐,马年大吉{:4_176:} 杨帆 发表于 2026-2-15 12:49
漂亮~祝亦是金老师新春快乐,马年大吉
问好杨帆老师!祝新春快乐,马年大吉!
页:
[1]