三千里繁华
<style>#papa {
margin: 10px -300px;
width: 1164px;
height: 620px;
background:#000078;
box-shadow: 3px 3px 2px #000;
position: relative;
z-index: 1;
}
#papa:hover #mplayer { transition: .7s; opacity: .9; }
#tp {position: absolute;box-shadow: 0px 0px 0px 2px #000000, 0px 0px 0px 10px #cccccc;
left: 505px;border-radius: 0%;z-index: 2;
top: 16%;background: url('https://img-baofun.zhhainiao.com/pcwallpaper_ugc/static/b273937938b1acfa3df3283fd40141c7.jpg') center/cover no-repeat;
width: 562px;
height: 310px;opacity: 1;}
.photo {width: 100%; height: 100%;
position: absolute;
top:0px; left:0px;filter:contrast(140%)brightness(100%);
opacity: 0;
animation-name: round ;animation-duration: 32s;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
@keyframes round {
3% {
opacity: 1;
clip-path:polygon(50% 50%, 100% 50%, 50% 50%, 50% 100%, 50% 50%, 0 50%, 50% 50%, 50% 0);}
8% {
opacity: 1;background-position: 0% -100%;clip-path: polygon(75% 25%, 100% 50%, 75% 75%, 50% 100%, 25% 75%, 0 50%, 25% 25%, 50% 0);
}
13% {
opacity: 1;background-position: 0% -100%;clip-path: polygon(50% 0, 100% 0, 100% 50%, 100% 100%, 50% 100%, 0 100%, 0 50%, 0 0);
}
18% {
opacity: 0;background-position: 0% -100%;clip-path:polygon(50% 0, 100% 0, 100% 50%, 100% 100%, 50% 100%, 0 100%, 0 50%, 0 0);
-webkit-transform:translate(0%,0%)scale(1);}
}
.photo:nth-child(1) {background:url(https://img-baofun.zhhainiao.com/pcwallpaper_ugc/static/f8b2a6523a38c3c6c61be0ac6501d6e9.jpg)0 0/100% 100%;
animation-delay: 28s;
}
.photo:nth-child(2) {background:url(https://img-baofun.zhhainiao.com/pcwallpaper_ugc/static/29c50e716edbe7f5bd4004c1fae3a5cc.jpg)0 0/100% 100%;
animation-delay: 24s;
}
.photo:nth-child(3) {background:url(https://img-baofun.zhhainiao.com/pcwallpaper_ugc/static/c8eff17a7a0d1132a001fc899d9d51e4.jpg)0 0/100% 100%;
animation-delay: 20s;
}
.photo:nth-child(4) {background:url(https://img-baofun.zhhainiao.com/pcwallpaper_ugc/static/3d56f2dfc5ee58313cd2c9113ae2beed.jpeg)0 0/100% 100%;
animation-delay: 16s;
}
.photo:nth-child(5) {background:url(https://img-baofun.zhhainiao.com/pcwallpaper_ugc/static/a8fa482d66a757a54c2abd72ef68243a.jpg)0 0/100% 100%;
animation-delay: 12s;
}
.photo:nth-child(6) {background:url(https://img-baofun.zhhainiao.com/pcwallpaper_ugc/static/17f43572bffffec2c3a21152d05598bc.jpg)0 0/100% 100%;
animation-delay: 8s;
}
.photo:nth-child(7) {background:url(https://img-baofun.zhhainiao.com/pcwallpaper_ugc/static/148ac3256a463f25a0bc67fc74722d9f.jpg)0 0/100% 100%;
animation-delay: 4s;
}
.photo:nth-child(8) {background:url(https://img-baofun.zhhainiao.com/pcwallpaper_ugc/static/9ffc373a1dadbf420296df3f08fad75f.jpg)0 0/100% 100%;
animation-delay: 0s;
}
.stop img:nth-child(1) {
animation-play-state: paused;
}
.stop img:nth-child(2){
animation-play-state: paused;
}
.stopimg:nth-child(3){
animation-play-state: paused;
}
.stop img:nth-child(4){
animation-play-state: paused;
}
.stop img:nth-child(5){
animation-play-state: paused;
}
.stop img:nth-child(6){
animation-play-state: paused;
}
.stop img:nth-child(7) {
animation-play-state: paused;
}
.stop img:nth-child(8) {
animation-play-state: paused;
}
#vid { display: none; }
#canv {position: absolute;
display: block;
left: 0%; mix-blend-mode:normal;
top: 0%;
border-radius: 0%;
opacity: 1;
animation: opa 0s infinite alternate ;
}
#mplayer {
position: absolute;
left:82.5%;
bottom: 115px;
width: 30px;
height: 30px;background:#000000;
border: 3px solid #ffffff;
border-radius: 50%;
opacity: 1;
transition: .7s;
display: grid;
place-items: center;
--disp1: 0; --disp2: 1;
}
#mplayer::before, #mplayer::after {
position: absolute;
content: '';
border-style: solid;
border-color: #ffffff;
cursor: pointer;
transition: .4s;
}
#mplayer::before {
width: 0;
height: 0;
left:10px;
border-width: 10px 12px;
border-color: transparent transparent transparent #ffffff;
opacity: var(--disp1);
}
#mplayer::after {
width: 2px;
height: 20px;
border-width: 0 4px 0 4px;
opacity: var(--disp2);
}
@keyframes opa { to {opacity: 0;} }
</style>
<div id="papa">
<div id="tp"><div id="testImg"><imgclass='photo '><img class='photo ' ><img class='photo '><imgclass='photo '><img class='photo ' ><img class='photo '><imgclass='photo '><imgclass='photo '></div></div>
<canvas id="canv"></canvas>
<divtype="button" id="testBtn"> <div id="mplayer"></div></div>
<div data-lrc="亚伦影音工作室" id="lrc">亚伦影音工作室</div>
</div>
<audio id="aud" src="https://www.qqmc.com/mp3/music268153336.mp3" loop autoplay></audio>
<video id="vid" src="http://chuangshicdn.data.mvbox.cn/music/yc/23/03/31/23033107370103179429.mp4" loop autoplay muted></video>
<script>
(function(){
let ctx = canv.getContext('2d');
let ww = canv.width =1164, hh = canv.height =620;
let loop = () => {ctx.drawImage(vid, 0, 0, ww, hh);if(!vid.paused) {requestAnimationFrame(loop);return;}}
let mState = () => aud.paused ? (mplayer.style.setProperty('--disp1','1'), mplayer.style.setProperty('--disp2','0'), vid.pause()) : (mplayer.style.setProperty('--disp1','0'), mplayer.style.setProperty('--disp2','1'), vid.play());
vid.addEventListener('play', loop, false);
aud.addEventListener('play', () => mState());
aud.addEventListener('pause', () => mState());
mplayer.addEventListener('click', () => aud.paused ? aud.play() : aud.pause());
})();
</script>
<script >
var image = document.getElementById("testImg"),
button = document.getElementById("testBtn");
if (image.classList && image && button) {
button.onclick = function() {
if (this.value == '.') {
image.classList.remove('stop');
this.value = '*';
} else {
image.classList.add('stop');
this.value = '.';
}
};
}
</script>
<style type="text/css">#lrc {
--state: paused;
--motion: cover2;
--tt: 2s;
--bg: linear-gradient(180deg, #880000, #880000);
position: absolute;z-index: 3;
left: 68%;
transform: translate(-50%);
top: 60%;
font:normal 1.8em 华文行楷;
color: #000078;
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 { from { width: 0; } to { width: 100%; } }
@keyframes cover2 { from { width: 0; } to { width: 100%; } }
</style>
<script >
(function() {
/*原始lrc歌词*/
let lrcStr = `三千里繁华
作词:潘群
作曲:潘群
编曲:Hom 国雄@聚耳音娱
制作人:亚伦
笛箫:郑明君
吉他:邓仲伟
和音:陈鹏飞
出品 亚伦影音工作室
东街连雨下
西窗纳晚霞
是谁藏在寒烟深处弄琵琶
恍然间又逢当时
正年少鲜衣怒马
仍和你执手对饮茶
南城过酒家
北村登高塔
明知道你已离去数冬夏
怎奈我独自咀嚼风景
味同白蜡
不如随你赴天涯
三千里繁华
而我满眼尽是她
用半生牵挂
只等回眸那一刹
岁月淹没了情话
任庭间落叶笑我多痴傻
三千里繁华
过尽云帆不是她
若就此放下
余生堪与谁对答
总是青春留不住
换一缕白发
南城过酒家
北村登高塔
明知道你已离去数冬夏
怎奈我独自咀嚼风景
味同白蜡
不如随你赴天涯
三千里繁华
而我满眼尽是她
用半生牵挂
只等回眸那一刹
岁月淹没了情话
任庭间落叶笑我多痴傻
三千里繁华
过尽云帆不是她
若就此放下
余生堪与谁对答
总是青春留不住
换一缕白发
三千里繁华
而我满眼尽是她
用半生牵挂
只等回眸那一刹
岁月淹没了情话
任庭间落叶笑我多痴傻
三千里繁华
过尽云帆不是她
若就此放下
余生堪与谁对答
总是青春留不住
换一缕白发
`;
/*变量 :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>
怎么看见有2个? 是不一样的吗?
亚伦你不用上班啊,出帖速度杠杠的,我看帖都是抽空上来看看的{:4_170:} 小辣椒 发表于 2023-3-31 14:31
是不一样的吗?
亚伦你不用上班啊,出帖速度杠杠的,我看帖都是抽空上来看看的
两天一班,太空闲了! 亚伦影音工作室 发表于 2023-3-31 14:42
两天一班,太空闲了!
幸福的,你2个帖不一样吗?我都没有仔细看,要晚上回家电脑看看 亚伦你为什么发2个一样的帖呢? 小辣椒 发表于 2023-3-31 21:50
亚伦你为什么发2个一样的帖呢?
那个有背景,提现音画多样性! 又是个漂亮的投影机,这个制作真美{:4_187:}
页:
[1]