两手空空心空空(DJ 版)-倪红
本帖最后由 亚伦影音工作室 于 2024-4-4 19:15 编辑 <br /><br /><style>#papa { margin: 0 0 0 calc(50% - 593px); width: 1024px; height: 640px; background: url('https://638183.freep.cn/638183/t23/webp1/vmlm.webp') no-repeat center/cover; box-shadow: 3px 3px 20px #000; position: relative; z-index: 1; display: grid; place-items: center;overflow: hidden; }
#prog { position: absolute; bottom: 20px; width: 280px; height: 5px; background: linear-gradient(to right, #880000, #880000 var(--prg), white 0); color: snow; display: grid; place-items: center; --prg: 0%; --state: paused;border-radius: 2px;}
#prog::before, #prog::after { position: absolute;color: #880000; font:normal 1em 华文新魏;}
#prog::before { content: attr(data-cu); left:-45px; top: -5px; }
#prog::after { right: -45px; content: attr(data-du); ; top: -5px; }
#slider { position: absolute; width: 6px; height: 6px; background: #cccccc;box-shadow: 0px 0px 0px 4px #880000; left: var(--prg); border-radius: 50%; }
#btnplay { position: absolute; top: -80px; width: 50px; height: 50px; background: url('https://pic.imgdb.cn/item/65141b72c458853aef4cff4a.png') no-repeat center/cover; cursor: pointer; animation: rot 6s infinite linear var(--state); }
@keyframes rot { to { transform: rotate(1turn); filter: hue-rotate(360deg);} }
.ipic { position: absolute; bottom: 0;transform: skew(-3deg);transform-origin: bottom center;}
.ipic:nth-of-type(1) { left: 20px; bottom: -10px; animation: skew1 3sinfinite linear;width: 180px; height: 320px;}
.ipic:nth-of-type(2) { left: 650px; animation: skew2 6sinfinite linear; width: 250px; height: 420px; }
.ipic:nth-of-type(3) { left: 860px; bottom: -20px; animation: skew3 3sinfinite linear;width: 155px; height: 220px;}
.stop .ipic:nth-of-type(1){animation-play-state: paused;}
.stop .ipic:nth-of-type(2){animation-play-state: paused;}
.stop .ipic:nth-of-type(3){animation-play-state: paused;}
@keyframes skew1 { 50%{ transform: skew(3deg); } }
@keyframes skew2 { 50%{ transform: skew(3deg); } }
@keyframes skew3 { 50%{ transform: skew(3deg); } }
#vid { position: absolute; width: 100%; height: 100%; top:0%; object-fit: cover; pointer-events: none;opacity: 1;z-index: -1; transition: 0.1s all ease;}
#lrc {
--state: paused;
--motion: cover2;
--tt: 2s;
--bg: linear-gradient(0deg, #ff0000, #ff0000, #ff0000);
position: absolute;z-index: 6;
left: 52%;
transform: translate(-50%);
top: 20px;
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: 20%;
height: 100%;
color: transparent;
overflow: hidden;
white-space: pre;
background: var(--bg);
-webkit-background-clip: text;
animation: var(--motion) var(--tt) linear forwards;
animation-play-state: var(--state);
}
@keyframes cover1{0% { width: 0%;}100% { width: 100%;filter: hue-rotate(360deg);}}
@keyframes cover2 { 0% { width: 0%;}100% { width: 100%;filter: hue-rotate(360deg);}}
</style>
<div id="papa">
<video id="vid"src="https://img-baofun.zhhainiao.com/pcwallpaper_ugc/preview/83820f571702b407fedad290fe4bbd3e_preview.mp4" muted autoplay loop></video>
<div id="testImg">
<img class="ipic" src="https://pic.imgdb.cn/item/65b76f2c871b83018ac00c9e.png" alt="" />
<img class="ipic" src="https://pic.imgdb.cn/item/65b76cfb871b83018ab9b60e.png" alt="" />
<img class="ipic" src="https://pic.imgdb.cn/item/65b76fca871b83018ac1d6b5.png" alt="" />
</div>
<div id="prog" data-cu="00:00" data-du="00:00" title="调节进度">
<span id="btnplay" title="播放/暂停"></span>
<span id="slider"></span>
</div>
<div data-lrc="亚伦影音工作室" id="lrc" title="歌词显示">亚伦影音工作室</div>
</div>
<audio autoplay="" id="aud" loop="" src="https://wp.shq.cab/view.php/db50f312dbfdfb162e2da015bff16445.mp3"> </audio>
<script>
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 = () => prog.style.setProperty('--state', aud.paused ? 'paused' : 'running');
aud.addEventListener('pause', mState, false);
aud.addEventListener('play', mState, false);
aud.addEventListener('timeupdate', () => { prog.style.setProperty('--prg', aud.currentTime / aud.duration * 100 + '%'); prog.dataset.cu = toMin(aud.currentTime); prog.dataset.du = toMin(aud.duration); });
btnplay.onclick = (e) => { e.stopPropagation(); aud.paused ?( aud.play(),vid.play() ):( aud.pause(),vid.pause()); }
prog.onclick = (e) => aud.currentTime = e.offsetX * aud.duration / prog.offsetWidth;
vid=document.querySelector('#vid');
(function(){
var image = document.getElementById("testImg");
let mState = () => aud.paused ? (image.classList.add('stop')):(image.classList.remove('stop'));
aud.addEventListener('play', () => mState());
aud.addEventListener('pause', () => mState());
})();
</script>
<script >
(function() {
/*原始lrc歌词*/
let lrcStr = `两手空空心空空(DJ 版)-倪红
作词:龙奔
作曲:龙奔
出品公司:布丁音乐
「未经许可请勿商业翻唱」
坚持了一年又一年
只剩下无尽的疲倦
幸福的画面
何时才能实现
我在心中不断的祈愿
期盼着一年又一年
年年却从未有改变
现实的生活
离梦想太遥远
皱纹悄悄爬满我的脸
两手空空心也空空
时光为何越来越匆匆
每当到年底 心却很沉重
一次次的怪自己没用
两手空空心也空空
脸上越来越少的笑容
家人的期盼 让我很惶恐
自己的苦只有自己懂
期盼着一年又一年
年年却从未有改变
现实的生活
离梦想太遥远
皱纹悄悄爬满我的脸
两手空空心也空空
时光为何越来越匆匆
每当到年底 心却很沉重
一次次的怪自己没用
两手空空心也空空
脸上越来越少的笑容
家人的期盼 让我很惶恐
自己的苦只有自己懂
两手空空心也空空
脸上越来越少的笑容
家人的期盼 让我很惶恐
自己的苦只有自己懂
家人的期盼 让我很惶恐
自己的苦只有自己懂
自己的苦只有自己懂`;
/*变量 :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'),mplayer.style.animationPlayState = 'paused') : (lrc.style.setProperty('--state','running'),mplayer.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:} 歌词的位置是否再高点会更好?{:4_204:} AI图片建议少用一点,不自然。像那英说的吧,缺乏审美观点{:4_170:}
帖子精彩!点36个赞! 马黑黑 发表于 2024-1-29 19:15
AI图片建议少用一点,不自然。像那英说的吧,缺乏审美观点
帖子精彩!点36个赞!
谢谢老师的点评!是视频,可以换成图片! 亚伦影音工作室 发表于 2024-1-29 19:22
谢谢老师的点评!是视频,可以换成图片!
那个镁铝,显然是AI制作的,眼神空泛,这是当下AI镁铝的特点,当然也有好的AI作品。 好看,画面有美感{:4_199:}
页:
[1]