焱鑫磊 发表于 2023-9-2 21:19

《你做了我梦里的人》红蔷薇 TO:红影

本帖最后由 焱鑫磊 于 2023-9-2 21:18 编辑 <br /><br /><style>
#papa{ margin: 100px -300px;width: 1200px;box-shadow: 0px 0px 0px 0px #cccccc, 0px 0px 0px 0px #880000; overflow: hidden;height: 750px;background: url('https://pic.imgdb.cn/item/64f2fc4a661c6c8e54c80cf7.jpg') no-repeat center/cover;border: 0px solid;display: grid;position: relative;z-index: 12345; --state: running;}

.photo {width: 100%; height: 100%;
    position: absolute;z-index: 1;
    top:0px; left:0px;
    opacity: 0;
    animation: round 180s linear infinite;}
@keyframes round {
0% { -webkit-transform:rotate(0)scale(1)translate(0%,0%); opacity:0}
2% { -webkit-transform:rotate(0)scale(1.5)translate(-10%,0%); opacity:1}
4% { -webkit-transform:rotate(0)scale(1.5)translate(0%,10%)rotateZ(0deg); opacity:1}
6% { -webkit-transform:rotate(0)scale(1.5)translate(0%,-10%)rotateZ(0deg); opacity:1}
8% { -webkit-transform:rotate(0)scale(1.5)translate(10%,0%)rotateZ(0deg); opacity:1}
10% { -webkit-transform:rotate(0deg)scale(1.5)translate(0%,0%)rotateZ(0deg); opacity:0}
}
img:nth-child(1) {animation-delay: 162s;}
img:nth-child(2) {animation-delay: 144s;}
img:nth-child(3) {animation-delay: 126s;}
img:nth-child(4) {animation-delay: 108s;}
img:nth-child(5) {animation-delay: 90s;}
img:nth-child(6) {animation-delay: 72s;}
img:nth-child(7) {animation-delay: 54s;}
img:nth-child(8) {animation-delay: 36s;}
img:nth-child(9) {animation-delay: 18s;}
img:nth-child(10) {animation-delay: 0s;}
.stop img:nth-child(1),
.stop img:nth-child(2),
.stop img:nth-child(3),
.stop img:nth-child(4),
.stop img:nth-child(5),
.stop img:nth-child(6),
.stop img:nth-child(7),
.stop img:nth-child(8),
.stop img:nth-child(9),
.stop img:nth-child(10){animation-play-state: paused;}

#dt{position: absolute;top:0%; left:0%;width: 100%;height: 100%;mix-blend-mode: lighten;z-index: 3; transform: rotateX(0deg);}
#prog { position: absolute; bottom: 60px; width: 180px; height: 12px; background: linear-gradient(to right, snow var(--prg), gray 0) repeat-x 0 50% / 100% 1px;left:12%; color: snow; display: grid; place-items: center; --prg: 0%; --state: paused; z-index: 999;}
#prog::before, #prog::after { position: absolute; top: 10px; }
#prog::before { content: attr(data-cu); left: 0; }
#prog::after { right: 0; content: attr(data-du); }
#slider { position: absolute; width: 3px; height: 7px; background: snow; left: var(--prg); }
#btnplay { position: absolute; top: -20px;font: normal 3.3em/0em serif;
color:#ffffff; cursor: pointer; animation: rot 6s infinite linear var(--state); }
@keyframes rot { to { transform: rotate(1turn); } }

#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: 85%;
      font:normal 3em 华文行楷;
      font-weight:800;
      color: #0000;
      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: 100%;transform:rotate(0deg)scale(0)}100% { width: 100%;transform:rotate(0deg)scale(1);filter:hue-rotate(360deg)}}
@keyframes cover2 {    0% { width: 100%;transform:rotate(0deg)scale(0)}100% { width: 100%;transform:rotate(0deg)scale(1);filter:hue-rotate(360deg)}}
#papa:hover #fullscreen { display:block ;}
#fullscreen { position: absolute; top:5%; left:85%;color:#ffffff; filter:drop-shadow( 1px 1px 1px #000000);font: normal 2.6em 华文隶书; opacity: 1; cursor: pointer; z-index: 1111}
                        </style>

<div id="papa">
<span id="fullscreen">全屏观赏</span>
<div id='dt'><img id="Img" src="https://pic.imgdb.cn/item/64f335fd661c6c8e54d6b032.png" width="100%" height="100%"></div>

<div id="testImg" >
<img class="photo" src="https://pic.imgdb.cn/item/64f2f97f661c6c8e54c671e0.jpg" /><img class="photo"
src="https://pic.imgdb.cn/item/64f2f9d0661c6c8e54c6be4f.jpg" /><img class="photo"
src="https://pic.imgdb.cn/item/64f2f9ea661c6c8e54c6c7a0.jpg" /><img class="photo"
src="https://pic.imgdb.cn/item/64f2fa02661c6c8e54c6cf5c.jpg" /><img class="photo"
src="https://pic.imgdb.cn/item/64f2fa21661c6c8e54c6dce0.jpg" /><img class="photo"
src="https://pic.imgdb.cn/item/64f2fa38661c6c8e54c6e911.jpg" /><img class="photo"
src="https://pic.imgdb.cn/item/64f2fa4f661c6c8e54c6f433.jpg" /><img class="photo"
src="https://pic.imgdb.cn/item/64f2fa6f661c6c8e54c7025c.jpg" /><img class="photo"
src="https://pic.imgdb.cn/item/64f2fa87661c6c8e54c70559.jpg" /><img class="photo"
src="https://pic.imgdb.cn/item/64f2fa02661c6c8e54c6cf5c.jpg" />
</div>

<div id="lrc" data-lrc="花潮lrc在线">花潮lrc在线</div>
    <div id="prog" data-cu="00:00" data-du="00:00" title="调节进度">
       <span id="btnplay" title="播放/暂停"> <P id="btn" >❊</p></span>
         <span id="slider"></span>
    </div>
</div>

<audio id="aud" src="https://i.mp3.wf/view.php/e1677c1dcd8fa5935c47eef6419c80ff.mp3" autoplay="" loop=""></audio>
<script>
let toMin = (val) => { if (!val) return '00:00'; let min = parseInt(val / 60), sec = parseFloat(Math.floor(val) % 60); 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() : aud.pause(); }
prog.onclick = (e) => aud.currentTime = e.offsetX * aud.duration / prog.offsetWidth;
</script>

<script>
let toMin = (val) => { if (!val) return '00:00'; let min = parseInt(val / 60), sec = parseFloat(Math.floor(val) % 60); if(sec < 10) sec = '0' + sec; return min + ':' + sec; };
let mState = () => mplayer.style.setProperty('--state', aud.paused ? 'paused' : 'running');
aud.addEventListener('play', mState, false);
aud.addEventListener('pause', mState, false);
aud.addEventListener('timeupdate', () => {
      let prg = aud.currentTime / aud.duration * 100 + 20;
      mplayer.style.setProperty('--prg', prg + '%');
});
btnP1.onclick = btnP2.onclick = () => aud.paused ? aud.play() : aud.pause();
aud.addEventListener('timeupdate', () => { mplayer.style.setProperty('--prg', aud.currentTime / aud.duration * 100 + '%');mplayer.dataset.tt = toMin(aud.currentTime) + '\n' + toMin(aud.duration);for (j = 0; j < data.lrcAr.length; j++) { if (aud.currentTime >= data.lrcAr) { if (mKey === j) showLrc(data.lrcAr);   else continue; } } });
progP.onclick = (e) => aud.currentTime = e.offsetX * aud.duration / progP.offsetWidth;
</script>
<script >
(function() {
/*原始lrc歌词*/
let lrcStr = `
《你做了我梦里的人》红蔷薇
词:荣荣 曲:钰柃
LRC歌词制作:焱鑫磊
轰轰烈烈爱一场
好想把你留身旁
我也不想去远方
从此不见你模样
漫漫长夜泪两行
千言万语对谁讲
我把思念寄月亮
但愿能暖你心房
你做了我梦里的人呐
让我想你心好痛
梦里望着你的眼神
温柔把你拥入怀中
你做了我梦里的人呐
但愿梦醒能重逢
我会记住我们的约定
衣锦还乡和你伴一生
轰轰烈烈爱一场
好想把你留身旁
我也不想去远方
从此不见你模样
漫漫长夜泪两行
千言万语对谁讲
我把思念寄月亮
但愿能暖你心房
你做了我梦里的人呐
让我想你心好痛
梦里望着你的眼神
温柔把你拥入怀中
你做了我梦里的人呐
但愿梦醒能重逢
我会记住我们的约定
衣锦还乡和你伴一生
轰轰烈烈爱一场
好想把你留身旁
我也不想去远方
从此不见你模样
漫漫长夜泪两行
千言万语对谁讲
我把思念寄月亮
但愿能暖你心房
你做了我梦里的人呐
让我想你心好痛
梦里望着你的眼神
温柔把你拥入怀中
你做了我梦里的人呐
但愿梦醒能重逢
我会记住我们的约定
衣锦还乡和你伴一生
我会记住我们的约定
衣锦还乡和你伴一生

`;

/*变量 :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); /*获得歌词数组*/
})();
let fs = true;
      fullscreen.onclick = () => {
                fs ? (fullscreen.innerText = '退出全屏',papa.requestFullscreen()) : (fullscreen.innerText = '全屏观赏', document.exitFullscreen());
                fs = !fs;
      };

</script>

东篱闲人 发表于 2023-9-2 21:51

又一个精彩,不停创新啊。。{:5_116:}

红影 发表于 2023-9-2 22:09

好漂亮的制作。欣赏焱鑫磊好帖{:4_199:}

焱鑫磊 发表于 2023-9-2 22:17

东篱闲人 发表于 2023-9-2 21:51
又一个精彩,不停创新啊。。

休息日,玩网络!{:4_187:}

焱鑫磊 发表于 2023-9-2 22:19

红影 发表于 2023-9-2 22:09
好漂亮的制作。欣赏焱鑫磊好帖

给红影送美女来了。{:4_183:}

红影 发表于 2023-9-2 22:42

焱鑫磊 发表于 2023-9-2 22:19
给红影送美女来了。

刚看到是送我的呢,谢谢焱鑫磊,太幸福了{:4_179:}

红影 发表于 2023-9-2 22:42

焱鑫磊 发表于 2023-9-2 22:19
给红影送美女来了。

《你做了我梦里的人》这歌名真好,今晚去梦里找你一起玩{:4_173:}

东篱闲人 发表于 2023-9-3 09:08

焱鑫磊 发表于 2023-9-2 22:17
休息日,玩网络!

平时玩谁?{:5_106:}

焱鑫磊 发表于 2023-9-3 09:11

东篱闲人 发表于 2023-9-3 09:08
平时玩谁?

不能说!{:4_203:}

东篱闲人 发表于 2023-9-3 09:12

焱鑫磊 发表于 2023-9-3 09:11
不能说!

{:4_172:}
页: [1]
查看完整版本: 《你做了我梦里的人》红蔷薇 TO:红影