张惠妹跳进来
本帖最后由 马黑黑 于 2022-10-27 08:07 编辑 <br /><br /><style>#papa { left: -214px; width: 1024px; height: 640px; background: url('https://638183.freep.cn/638183/t22/webp/gvw.webp') no-repeat center/cover; box-shadow: 3px 3px 20px #000; position: relative; display: grid; place-items: center; user-select: none; overflow: hidden; z-index: 1; --opt: .25; }
#papa > img { position: absolute; top: 20px; mix-blend-mode: multiply; }
#papa > img:nth-of-type(1) { transform: translate(80px,-15px) rotate(15deg); }
#papa > img:nth-of-type(2) { transform: rotate(-15deg); }
#mplayer { position: absolute; bottom: 10px; display: grid; grid-template-columns: auto auto auto; place-items: center; gap: 6px; user-select: none; }
#btnplay { width: 50px; height: 50px; cursor: pointer; animation: rot linear 3s infinite; }
#prog { --ww: 0px; width: 300px; height: 12px; 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, red,green); opacity: .65; }
#audtime { font: normal 14px sans-serif; color: snow; }
#lrc { --motion: cover1; --tt: 5s; --state: paused; position: absolute; bottom: 60px; font: bold 2.4em sans-serif; color: hsl(0,10%,90%); -webkit-background-clip: text; filter: drop-shadow(1px 1px 2px 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,100%,50%,.45),hsla(0,100%,50%,.75)); 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">
<img src="https://638183.freep.cn/638183/t22/webp/gvw1.webp" alt="" />
<img src="https://638183.freep.cn/638183/t22/webp/gvw1.webp" alt="" />
<div id="lrc" data-lrc="花潮lrc在线">花潮lrc在线</div>
<div id="mplayer">
<img id="btnplay" src="https://638183.freep.cn/638183/t22/btn/g3.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://music.163.com/song/media/outer/url?id=28754101.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;};
document.title = '张惠妹跳进来';
})();
</script>
本帖最后由 马黑黑 于 2022-10-27 11:36 编辑
背景图是藏民跳锅庄舞的情景。通常,锅庄舞是围着火堆跳的,这是预演,火还没生起来。 你妹纸真多呵{:4_189:} 樵歌 发表于 2022-10-27 08:04
你妹纸真多呵
@小辣椒 说,随便上一次非诚勿扰就可以带一个连的妹纸回家 黑黑配色太棒了,画面2种颜色,播放器就2种同色{:4_178:} 刚昨天电视上知道这个锅庄舞,今天黑黑就做出来了,厉害{:4_199:} 可惜今天耳麦没有带,音乐暂时听不了,哑巴舞看看{:4_170:} 欣赏音画佳作! 相约爱晚亭 发表于 2022-10-27 11:13
欣赏音画佳作!
{:4_190:} 小辣椒 发表于 2022-10-27 09:12
可惜今天耳麦没有带,音乐暂时听不了,哑巴舞看看
无声电影也曾经流行过 小辣椒 发表于 2022-10-27 09:11
刚昨天电视上知道这个锅庄舞,今天黑黑就做出来了,厉害
锅庄舞你也有了解 我这里播放不了,连无声电影都看不到,只能晚上回去再欣赏了{:4_187:} 红影 发表于 2022-10-27 12:32
我这里播放不了,连无声电影都看不到,只能晚上回去再欣赏了
放不了就是无声的 醉美水芙蓉 发表于 2022-10-27 11:47
很漂亮的画面,谢谢黑黑老师分享!
{:4_190:} 这人影制作得可真好,颜色搭配很美。 怎么没见到锅的 绿叶清舟 发表于 2022-10-27 16:51
怎么没见到锅的
锅庄舞,有庄无锅的,锅都跳舞去了 马黑黑 发表于 2022-10-27 08:08
@小辣椒 说,随便上一次非诚勿扰就可以带一个连的妹纸回家
一个连少些了点儿,最好带一个团{:4_189:} 樵歌 发表于 2022-10-27 17:24
一个连少些了点儿,最好带一个团
规模太大容易招惹是非