翁奕童苑 发表于 2022-9-22 11:08

《再唱走西口》

本帖最后由 翁奕童苑 于 2022-9-22 11:08 编辑 <br /><br /><p></p>


<style>
.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{0%{
      opacity: 0;
    }
   
10%{
      opacity: 1;
    }
12%{
      opacity: 1;
    }
    18%{
      opacity: 0;
    }
}
img:nth-child(1) {background:url(https://www.z4a.net/images/2022/07/22/17681895403eb7f81.jpg)0 0/100% 100%;
animation-delay: 28s;
}
img:nth-child(2) {background:url(https://www.z4a.net/images/2022/07/22/3aad0c45c4401165c.jpg)0 0/100% 100%;
animation-delay: 24s;
}
img:nth-child(3) {background:url(https://www.z4a.net/images/2022/07/22/4ac6a299979c8b0e8.jpg)0 0/100% 100%;
animation-delay: 20s;
}
img:nth-child(4) {background:url(https://www.z4a.net/images/2022/07/22/5d06ea918ce907a73.jpg)0 0/100% 100%;
animation-delay: 16s;
}
img:nth-child(5) {background:url(https://www.z4a.net/images/2022/07/22/8b1deab65b1c21a01.jpg)0 0/100% 100%;
animation-delay: 12s;
}
img:nth-child(6) {background:url(https://www.z4a.net/images/2022/07/22/91f8cefa853022f4d.jpg)0 0/100% 100%;
animation-delay: 8s;
}
img:nth-child(7) {background:url(https://www.z4a.net/images/2022/07/22/6c1280584fba9f194.jpg)0 0/100% 100%;
animation-delay: 4s;
}
img:nth-child(8) {background:url(https://www.z4a.net/images/2022/07/22/24c588dfdd85bc6b3.jpg)0 0/100% 100%;
animation-delay: 0s;
}
</style>

<style>
      #papa { left: -180px; width: 960px; height: 600px;background:url(https://www.z4a.net/images/2022/07/22/24c588dfdd85bc6b3.jpg)0 0/100% 100%,linear-gradient(50deg, #000080, #ff0000, #000000, #00f000);box-shadow: 0px 0px 2px #000; overflow: hidden;border-radius:6%;display: grid; place-items: center; position: relative; z-index: 1; }
      #mplayer { position: absolute; top:500px; width: 300px; height: 80px; user-select: none; display: grid; place-items: center; cursor: pointer; }
      #mplayer:hover #btnwrap, #mplayer:hover #prog { transform: translateY(var(--yy)); }
      #mplayer:hover #btnwrap { background: linear-gradient(to top right, red, green); border-radius: 50%; opacity: .75; }
      #btnwrap, #prog { position: absolute; display: grid; place-items: center;transition: .5s; }
      #btnwrap { --yy: -15px; width: 40px; height: 40px; transform: rotate(45deg); border: 1px solid tan; border-radius: 6px; opacity: .25; }
      #btnplay { width: 20px; height: 20px; background: #eee; clip-path: polygon(0 0, 0% 100%, 100% 50%); }
      #btnpause { width: 2px; height: 20px; border-style: solid; border-width: 0px 4px; border-color: transparent #eee; display: none; }
      #prog { --yy: 20px; width: 300px; height: 16px; border-radius: 10px; background: linear-gradient(90deg, orange, red 100%, transparent 0); border: 1px solid gray; font:

normal 14px / 16px sans-serif; color: #1551C8; opacity: .75; }
      #lrc { position: absolute; top: 460px; font: bold 2.5em sans-serif;font-family:宋体; filter:drop-shadow(#FFFfff 1px 0 0)drop-shadow(#FFFfff 0 1px 0)drop-shadow(#FFFfff

-1px 0 0) drop-shadow(#FFFfff 0 -1px0);color: transparent; letter-spacing: 2px; background: linear-gradient(45deg, #012BFA 21%,#F60303 75%) 100% 100% / 200% 200%; background-

clip: text; -webkit-background-clip: text; }
      #mpic { position: absolute; width: 100%; height: 100%; mix-blend-mode: multiply; }
      @keyframes bgMove1 { from { background-position: 0 0; } to { background-position: -100% 0; } }
      @keyframes bgMove2 { from { background-position: 0 0; } to { background-position: -100% 0; } }
</style>

<div id="papa">
      <imgclass='photo '><img class='photo ' ><img class='photo '><imgclass='photo '><img class='photo ' ><img class='photo '><imgclass='photo '><imgclass='photo '>
<div id="lrc">马黑老师卡拉OK播放器</div>
      <div style="position: absolute; width: 413px; height: 136px; z-index: 20; left: 30px; top: 20px" id="layer3">
        <p align="center"><strong><font face="宋体" size="6" face="翁奕童苑" color="#FF0000">《再唱走西口》</font></strong></p>
        <p align="center"><strong><font face="宋体" size="4" color="#ffff00">演唱/成连芳 编辑/翁奕童苑</font></strong></div>
      <div id="mplayer">
                <div id="btnwrap"><span id="btnplay"></span><span id="btnpause"></span></div>
                <div id="prog">00:00 | 00:00</div>
      </div>
</div>

<script>
let lrcAr = [
      ['0.00','《再唱走西口》'],
        ['12.00','词/洪凯歌 曲/车骋中'],
        ['24.45','演唱/成连芳'],
        ['36.57','走了很远很远 走的很久很久'],
        ['48.64','走西口的哥哥妹难留'],
        ['57.70','离乡背井 背井离乡'],
        ['64.36','寻找那心中的天堂'],
        ['70.37','梦想有田有地还有那热炕头'],
        ['84.66','汗水身上淌 泪水心里流'],
        ['96.57','相信天道会把勤来酬'],
        ['109.16','一年年祈盼 一辈辈追求'],
        ['120.60','只为儿孙过上好日子'],
        ['129.56','有吃有穿乐悠悠 乐悠悠'],
        ['142.44','LRC字幕制作/翁奕童苑'],
        ['171.83','岁月如歌 时光如流'],
        ['183.56','走西口转眼百年后'],
        ['192.78','小伙子有了草原人的豪迈'],
        ['205.66','姑娘多了塞上江南的温柔'],
        ['219.66','阴山下放牧 黄河边麦收'],
        ['231.57','唱过了长调又把山曲儿吼'],
        ['244.45','一年年祈盼 一辈辈追求'],
        ['255.68','只为好日子越过越红火'],
        ['264.59','有梦想有奔头 有奔头'],
        ['277.00','只为好日子越过越红火'],
        ['286.74','有梦想有奔头'],
        ['310.46','谢谢欣赏']
];
let mKey = 0, mSeek = false, mFlag = true;
let aud = new Audio();

aud.src = 'http://chuangshicdn.data.mvbox.cn/music/yc/22/09/20/22092020231036922271.mp3';
aud.autoplay = true;
aud.loop = true;

btnwrap.onclick = () => aud.paused ? aud.play() : aud.pause();
prog.onclick = (e) => aud.currentTime = aud.duration * e.offsetX / prog.offsetWidth;
aud.addEventListener('pause', () => mState());
aud.addEventListener('play', () => mState());
aud.addEventListener('seeked', () => calcKey());

aud.addEventListener('timeupdate', () => {
      prog.style.background= 'linear-gradient(90deg, green, red ' + aud.currentTime / aud.duration * 100 + '%, snow 0)';
      prog.innerText = toMin(aud.currentTime) + ' | ' + toMin(aud.duration);
      for(j=0; j<lrcAr.length; j++) {
                if(aud.currentTime >= lrcAr) {
                        if(mKey === j) showLrc(lrcAr);
                        else continue;
                }
      }
});

let mState = () => aud.paused ? (btnplay.style.display = 'block', btnpause.style.display = 'none', lrc.style.animationPlayState = 'paused') : (btnplay.style.display = 'none',

btnpause.style.display = 'block', lrc.style.animationPlayState = 'running');

let showLrc = (time) => {
      lrc.style.animation = (mFlag ? 'bgMove1 ' : 'bgMove2 ') + time + 's linear forwards';
      lrc.innerHTML = lrcAr;
      mKey += 1;
      mFlag = !mFlag;
}

let calcKey = () => {
      for(j = 0; j < lrcAr.length; j ++) {
                if(aud.currentTime <= lrcAr) {
                        mKey = j - 1;
                        break;
                }
      }
      if(mKey <0) mKey = 0;
      let mtime = lrcAr - (aud.currentTime - lrcAr);
      showLrc(mtime);
}

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;
}
</script>

红影 发表于 2022-9-22 12:12

好看的图片轮播,歌词同步得准确。欣赏翁奕童苑好帖{:4_204:}

东篱闲人 发表于 2022-9-22 12:35

大嫚漂亮。。。{:5_116:}
页: [1]
查看完整版本: 《再唱走西口》