黑桃A TO:马黑黑&走过岁月
本帖最后由 朵拉 于 2023-5-25 21:30 编辑 <br /><br /><style>#papa { left: -214px; width: 1024px; height: 640px; background: url('https://pic1.imgdb.cn/item/635d09ee16f2c2beb13bd1a9.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://638183.freep.cn/638183/t22/gif/127.gif'); transform: translate(0,-100px); mix-blend-mode: screen; }
#papa::after { position: absolute; content: url('https://638183.freep.cn/638183/t22/gif/127.gif'); transform: translate(0,100px); mix-blend-mode: screen; }
#mplayer { position: absolute; bottom: 10px; display: grid; grid-template-columns: auto auto auto; place-items: center; gap: 6px; user-select: none; }
#btnplay { width: 45px; height: 45px; cursor: pointer; display: grid; place-items: center; animation: rot linear 3s infinite; position: relative; }
#btnplay > span { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: gray; }
#prog { --ww: 0px; width: 200px; height: 12px; border-radius: 6px; background: snow; opacity: .65; cursor: pointer; position: relative; }
#prog::before { position: absolute; content: ''; width: var(--ww); height: 12px; border-radius: 6px; background: snow linear-gradient(90deg, red, blue); opacity: .65; }
#audtime { font: normal 14px sans-serif; color: snow; }
#lrc { --motion: cover1; --tt: 5s; --state: paused; position: absolute; top: 20px; font: bold 2em 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(0,5%,50%,.45),hsla(200,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">
<div id="lrc" data-lrc="花潮lrc在线">花潮lrc在线</div>
<div id="mplayer">
<div id="btnplay"><span></span></div>
<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 = 'http://www.kumeiwp.com/sub/filestores/2023/04/02/00880f72839f861d090aeecc7ff98a14.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;};
(function mkSpan() {[...Array(10).keys()].forEach((ele,key) => {ele = document.createElement('span');ele.style.cssText += `background: linear-gradient(135deg, #${Math.random().toString(16).substr(-6)}, #${Math.random().toString(16).substr(-6)}); transform: rotate(${key*36}deg) translate(18px)`;btnplay.appendChild(ele);});})();
})();
</script> @马黑黑
马老师 看过来,请指点{:4_190:} @走过岁月
岁月老师 看过来,请指点{:4_190:} dj歌曲的歌词 调不到一个同步,
就这样子吧{:4_203:} 科普 黑桃A的价格不菲{:4_173:} 本帖最后由 朵拉 于 2022-10-29 23:13 编辑
{:4_208:} 朵拉 发表于 2022-10-29 19:32
dj歌曲的歌词 调不到一个同步,
就这样子吧
dj很快,手慢调不了{:4_170:} 朵拉 发表于 2022-10-29 19:31
@马黑黑
马老师 看过来,请指点
除了歌词同步,其他很完美 黑黑的毛毛球效果用在这个帖子里很漂亮呢,欣赏朵宝好帖{:4_204:} 这个有点靠谱:
let lrcAr = [
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
];
很魔幻的色彩。厉害{:4_204:} 朵拉 发表于 2022-10-29 19:31
@走过岁月
岁月老师 看过来,请指点
来了,劲爆的音乐,做得很好,没啥好指点了,可惜没有美臀,有点遗憾 谢谢朵拉美女 {:4_204:} 马黑黑 发表于 2022-10-29 20:35
这个有点靠谱:
let lrcAr = [
重新调整了,好多了,谢谢马师{:4_190:} 醉美水芙蓉 发表于 2022-10-29 19:53
欣赏朵拉朋友的精彩!
谢谢芙蓉的临帖欣赏{:4_204:} 红影 发表于 2022-10-29 20:21
黑黑的毛毛球效果用在这个帖子里很漂亮呢,欣赏朵宝好帖
谢谢影宝欣赏,周末愉快{:4_204:} 樵歌 发表于 2022-10-29 21:15
很魔幻的色彩。厉害
哇~~樵歌也来了,敬茶{:4_190:} 走过岁月 发表于 2022-10-29 21:26
来了,劲爆的音乐,做得很好,没啥好指点了,可惜没有美臀,有点遗憾
岁月老师稀罕美臀,了解{:4_190:} 欣赏朵拉美帖,点赞!
页:
[1]
2