小辣椒 发表于 2023-7-3 18:33

往事只能回味 歌手:童丽


<style>
#papa { margin: auto; left: -340px;width: 1280px; height: 650px; top: 150px; background: url('https://wj.zp68.com/lxx/yunhua/2022/10/10/2F.gif') no-repeat center/cover; box-shadow: 3px 3px 20px #000; position: relative; display: grid; place-items: center; user-select: none; z-index: 1; --opt: .25;}
#mplayer { position: absolute; bottom: 70px;left: 400px;display: grid; grid-template-columns: auto auto auto; place-items: center; gap: 6px; user-select: none; }
#btnplay { width: 40px; height: 40px; text-align: center; font: normal 40px/40px sans-serif; color: Green; cursor: pointer; animation: rot linear 4s infinite; }
#prog { --ww: 0px; width: 200px; height: 12px; border: 1px solid green; border-radius: 8px; background: snow; opacity: .65; position: relative; }
#prog::before { position: absolute; content: ''; width: var(--ww); height: 12px; border-radius: 6px; background: snow linear-gradient(90deg, orange, green); opacity: .75; }
#audtime { font: normal 14px sans-serif; color: Sienna; }
#lrc { --motion: cover1; --tt: 5s; --state: paused; position: absolute; left: 450px;top: 470px; font: bold 1.8em sans-serif; color: hsl(0,10%,90%); -webkit-background-clip: text; filter: drop-shadow(1px 1px 1px hsla(0,0%,0%,.95)); }
#lrc::before { position: absolute; content: attr(data-lrc); width: 20%; height: 100%; color: transparent; overflow: hidden; white-space: nowrap; background: linear-gradient(180deg,hsla(120, 80%, 50%, .55),hsla(120, 80%, 50%, .55)); filter: inherit; -webkit-background-clip: text; animation: var(--motion) var(--tt) linear forwards; animation-play-state: var(--state); }
#dt1{ position: absolute; width: 334px; height: 153px; top: 455px; left: 400px; }
#dt2{ position: absolute; width: 451px; height: 254px; top: 0px; left: 0px; }
#dt3{ position: absolute; width: 25px; height: 25px; top: 320px; left: 1030px; }
#fish { position: absolute; left: 1080px; top:90px; width: 20px;offset-distance: 0;offset-path: path('M-110 95a93.5 62 0 1 0 147 0a93.5 62 0 1 0 -187 0z'); offset-distance: 100%; animation: swim 25s infinite; }
#fish1 { position: absolute; left: 1085px; top: 95px; width: 20px;offset-distance: 0;offset-path: path('M-110 95a93.5 62 0 1 0 147 0a93.5 62 0 1 0 -187 0z'); offset-distance: 100%; animation: swim 25s infinite; }
@keyframes cover1 { from { width: 0; } to { width: 100%; } }
@keyframes cover2 { from { width: 0; } to { width: 100%; } }
@keyframes rot { to { transform: rotate(1turn); } }
@keyframes swim { to { offset-distance: 0%; } }
</style>
<div id="papa">

         <img id="dt1" src="https://wj.zp68.com/lxx/yunhua/2022/10/10/bu.jpg" alt="" />
      <img id="dt2" src="https://wj.zp68.com/lxx/yunhua/2022/10/10/bt.jpg" alt="" />
       <img id="dt3" src="https://wj.zp68.com/lxx/yunhua/2022/10/10/xx.gif" alt="" />
      <img id="fish" src="https://wj.zp68.com/lxx/yunhua/2022/10/10/xx.gif" alt="" />
      <img id="fish1" src="https://wj.zp68.com/lxx/yunhua/2022/10/10/xx.gif" alt="" />
      <div id="lrc" data-lrc="童丽--往事只能回味">童丽--往事只能回味</div>
      <div id="mplayer">
                <span id="btnplay">❁</span>
                <span id="prog"></span>
                <span id="audtime">00:00 | 00:00</span>
      </div>
</div>
<script>
(function() {
      let aud = new Audio(), mKey = 0, mFlag = true;
       let lrcAr = [
                ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
       
];

      aud.src = 'https://wj.zp68.com/lxx/yunhua/2022/10/10/wsznhs.mp3';
      aud.loop = true;
      aud.autoplay = true;
      if(aud.paused) btnplay.style.animationPlayState = 'paused';
      btnplay.onclick = () => aud.paused ? aud.play() : aud.pause();
      prog.onclick = (e) => aud.currentTime = aud.duration * e.offsetX / prog.offsetWidth;
      aud.addEventListener('seeked', () => calcKey());
      aud.addEventListener('pause', () =>mState());
      aud.addEventListener('play', () =>mState());
      aud.addEventListener('timeupdate', () => {let prg = aud.currentTime * prog.offsetWidth / aud.duration < 6 ? 6 : aud.currentTime * prog.offsetWidth / aud.duration;prog.style.setProperty('--ww', prg + 'px');audtime.innerText = toMin(aud.currentTime) + ' | ' + toMin(aud.duration);for(j=0; j<lrcAr.length; j++) {if(aud.currentTime >= lrcAr) {cKey = j;if(mKey === j) showLrc(lrcAr);else continue;}}});
      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 showLrc = (time) => {let name = mFlag ? 'cover1' : 'cover2';lrc.innerHTML = lrc.dataset.lrc = lrcAr;lrc.style.setProperty('--motion', name);lrc.style.setProperty('--tt', time + 's');lrc.style.setProperty('--state', 'running');mKey += 1;mFlag = !mFlag;};
      let mState = () => aud.paused ? (btnplay.style.animationPlayState='paused',lrc.style.setProperty('--state', 'paused'),papa.style.setProperty('--opt','0')) : (btnplay.style.animationPlayState='running', lrc.style.setProperty('--state', 'running'),papa.style.setProperty('--opt','.25'));
      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>
<br><br><br><br><br><br><br><br>

小辣椒 发表于 2023-7-3 18:34

偷懒,没有做图,旧图加了2个补丁{:4_170:}

小辣椒 发表于 2023-7-3 18:36

最近作业没有做就玩旧的前面学习过的播放器了

小文 发表于 2023-7-3 18:56

厉害!欣赏!

醉美水芙蓉 发表于 2023-7-3 19:05

焱鑫磊 发表于 2023-7-3 20:14

喜欢!赞!{:4_187:}

千羽 发表于 2023-7-3 20:22

加上了灵动的元素,背景图就变得{:4_187:}丰富多彩了

千羽 发表于 2023-7-3 20:23

歌儿也挺好听的。问好小辣椒{:4_185:}

岩新新 发表于 2023-7-3 20:41

欣赏精彩制作1

樵歌 发表于 2023-7-3 21:34

同的清新明朗,一贯的小辣椒光明风格!沒做复杂的照样好看!

四海八荒 发表于 2023-7-3 22:18

小辣椒 发表于 2023-7-3 18:34
偷懒,没有做图,旧图加了2个补丁

也是曾经流行的乞丐服{:4_173:}补丁画龙点睛

梦缘 发表于 2023-7-4 11:02

问好老师,欣赏精彩佳作,谢谢分享!{:4_178:}

小辣椒 发表于 2023-7-4 13:49

梦缘 发表于 2023-7-4 11:02
问好老师,欣赏精彩佳作,谢谢分享!

谢谢梦缘欣赏,问好{:4_187:}

小辣椒 发表于 2023-7-4 13:50

四海八荒 发表于 2023-7-3 22:18
也是曾经流行的乞丐服补丁画龙点睛

八荒你没有明白,我是原图加了2个补丁,表面看不出的,要看源码的{:4_173:}

小辣椒 发表于 2023-7-4 13:51

樵歌 发表于 2023-7-3 21:34
同的清新明朗,一贯的小辣椒光明风格!沒做复杂的照样好看!

樵哥哥是鼓励我,我知道的,谢谢樵哥哥,我会注意用眼的。。。。{:4_179:}

小辣椒 发表于 2023-7-4 13:52

岩新新 发表于 2023-7-3 20:41
欣赏精彩制作1

谢谢岩新新欣赏{:4_187:}

小辣椒 发表于 2023-7-4 13:54

千羽 发表于 2023-7-3 20:23
歌儿也挺好听的。问好小辣椒

千羽好,我一般专辑里面有起码10首歌,所以一直可以发许多次,以后图图再重新打几个补丁就换其他歌曲了{:4_173:}

小辣椒 发表于 2023-7-4 13:54

千羽 发表于 2023-7-3 20:22
加上了灵动的元素,背景图就变得丰富多彩了

谢谢千羽夸奖,小辣椒会难为情的

小辣椒 发表于 2023-7-4 13:55

焱鑫磊 发表于 2023-7-3 20:14
喜欢!赞!

问好焱鑫磊,谢谢欣赏{:4_171:}

小辣椒 发表于 2023-7-4 13:56

醉美水芙蓉 发表于 2023-7-3 19:05
不错的!欣赏小辣椒佳作!

谢谢水芙蓉欣赏,问好{:4_171:}
页: [1] 2
查看完整版本: 往事只能回味 歌手:童丽