把你的一生借给我一天
本帖最后由 醉美水芙蓉 于 2022-10-29 15:26 编辑 <br /><br /> <style>#papa { margin: auto; left: -340px; width: 1280px; height: 650px;top:50px; background: url('https://s1.ax1x.com/2022/10/29/x5nqT1.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('');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="pLeft1"><img src="https://pic.imgdb.cn/item/630f5ee516f2c2beb1d5673f.png" alt="" style="width: 65px; height: 64px; mix-blend-mode: multiply; transform: rotate(-60deg);" /></div>
<div id="mplayer">
<img id="btnplay" src="https://s1.ax1x.com/2022/09/30/xu5egK.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://www.qqmc.com/up/kwlink.php?id=241495643&.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>
欣赏、点赞
你这是高产啊,一天几帖。 起个网名好难 发表于 2022-10-29 15:45
欣赏、点赞
问候老师好!由于不熟悉所以多做了几个! 看看有木有愿意借的{:4_170:} 很柔美的画面,这花瓣的点缀真好看。歌曲名很有意思。欣赏水芙蓉好帖{:4_187:} 马黑黑 发表于 2022-10-29 18:04
看看有木有愿意借的
哈哈!抖音流行的歌曲,刚好看见这个图片就做了老师的一个播放器! 红影 发表于 2022-10-29 19:00
很柔美的画面,这花瓣的点缀真好看。歌曲名很有意思。欣赏水芙蓉好帖
花瓣是借小辣椒的! 醉美水芙蓉 发表于 2022-10-29 19:25
哈哈!抖音流行的歌曲,刚好看见这个图片就做了老师的一个播放器!
{:4_187:} 醉美水芙蓉 发表于 2022-10-29 19:26
花瓣是借小辣椒的!
水芙蓉用得很好呢,这个帖子特别漂亮{:4_187:} 欣赏精美音画佳作! 相约爱晚亭 发表于 2022-10-30 08:06
欣赏精美音画佳作!
谢谢老师支持!
页:
[1]