唐磊 - 丁香花TO:风中飞尘(学习黑黑-鹅 -播放器效果)
<style>#papa { margin: auto; left: -340px; width: 1280px; height: 650px;top:150px; background: url('https://wj.zp68.com/lxx/yunhua/2022/10/26/001.jpg') 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; }
#papa::before { position: absolute; content: url('https://wj.zp68.com/lxx/yunhua/2022/10/26/dxh1.jpg');left: 900px; top:300px; width: 300px; height: 300px;mix-blend-mode: multiply;}
#mplayer { position: absolute; bottom: 40px; display: grid; grid-template-columns: auto auto auto; place-items: center; gap: 6px; user-select: none; }
.pMid { position: absolute; place-items: start; left: 500px;top: 100px; }
.pLeft { position: absolute; place-items: start; left: 1000px;top: 0px; }
.pLeft1 { position: absolute; place-items: start; left: 1000px;top: 280px;}
#btnplay {border-radius: 50%; width: 50px; height: 50px; cursor: pointer; animation: rot linear 3s infinite; }
#prog { --ww: 0px; width: 320px; height: 12px; border: 1px solid green; border-radius: 6px; background: snow; opacity: .65; position: relative; }
#prog::before { position: absolute; content: ''; width: var(--ww); height: 12px; border-radius: 6px; background: snow linear-gradient(90deg,OliveDrab,DarkGreen); opacity: .75; }
#audtime { font: normal 14px sans-serif; color: #3a5b16 }
#lrc { --motion: cover1; --tt: 5s; --state: paused; position: absolute; bottom: 140px; font: bold 2.4em 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,90%,50%,.45),hsla(120,90%,50%,.45)); filter: inherit; -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%; } }
@keyframes rot { to { transform: rotate(1turn); } }
</style>
<div id="papa">
<div id="lrc" data-lrc="花潮lrc在线">花潮lrc在线</div>
<div class="pMid"><img src="https://wj1.zp68.com:812/lxx/yunhua/2022/10/20/fye.gif" alt="" /></div>
<div class="pLeft"><img src="https://wj.zp68.com/lxx/yunhua/2022/10/26/shuyw.gif" alt="" style="width: 180px;height: 240px;" /></div>
<div class="pLeft1"><img src="https://wj.zp68.com/lxx/yunhua/2022/10/20/qt.gif" alt="" style="width: 65px; height: 64px; mix-blend-mode: multiply; transform: rotate(-60deg);" /></div>
<div id="mplayer">
<img id="btnplay" src="https://wj.zp68.com/lxx/yunhua/2022/10/26/05.png" alt="" />
<span id="prog"></span>
<span id="audtime">00:00 | 00:00</span>
</div>
</div>
<script>
(function() {
let aud = new Audio(), mKey = 0, mFlag = true, down = true;
let lrcAr = [
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
];
aud.src = 'https://wj.zp68.com/lxx/yunhua/2022/10/26/dxh.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><br><br>
@马黑黑
黑黑,这个播放器也是好喜欢的,一下子找不到好的按钮图片,就用你的换了颜色,调整了其他的颜色,一个旧图图先看看效果 用了网络布局格式,但效果用了position: absolute 定位 现在就不知道下面2种前面的符号不一样,同样的定位,出来位置就不一样,不知道为什么
.pMid
#pMid 刚微信发了,播放器效果完美{:4_189:} 作业完成,先下了 小辣椒 发表于 2022-10-26 21:53
刚微信发了,播放器效果完美
恭喜恭喜 丁香花是一首很受欢迎的歌 淡雅中有凝练的高贵,极好的配色 欣赏精美音画佳作! 非常漂亮,,,爱了爱了,,{:4_204:}{:4_204:}{:4_366:} 满分作业!{:4_178:} 歌很好听但灰常伤感,,,,,,, 本帖最后由 梦油 于 2022-10-27 09:56 编辑
小辣椒朋友早晨好!你那摇曳的绿叶和飘落的花瓣相映成辉,再加上飞舞的蜻蜓,使整个画面显得很有些生活的气息。 很漂亮灵动,亲爱的构图很合适,歌词同步也很棒。小风收礼开心{:4_187:} 清新美姿的制作 小辣椒 发表于 2022-10-26 21:49
用了网络布局格式,但效果用了position: absolute 定位
这是允许的,必要时也应这么做 樵歌 发表于 2022-10-27 07:39
歌很好听但灰常伤感,,,,,,,
这歌有个感人的故事 《丁香花》是唐磊作词、编曲并演唱的一首歌曲。完成于2000年4月份,2002年上传到网络,2004年收录于唐磊本人的专辑《丁香花》中。
这是一首唯美的校园民谣,这首歌曲完成于2000年4月份,整首歌是为了纪念一个出车祸身亡的女孩子,唐磊好友的女友。风花雪月的年代总有很多让人感动的故事,象牙塔里面总有很多让人无法割舍情愫。丁香花只是一个载体,这首歌表达了对逝去人深深的怀念,其实也表达了对那段梦幻般年代深深的怀念。 经典老歌!辣椒 制作的真漂亮,赞!小风收礼开心!问好!
{:4_204:}{:4_199:}