平凡 发表于 2023-12-6 14:24

回顾那些年的经典

<style>
#papa { margin: 0 0 0 calc(50% - 513px); display: grid; place-items: center; width: 1024px; height: 680px; background: gray url('https://pic.imgdb.cn/item/657012dcc458853aefece893.jpg') no-repeat center/cover; background-blend-mode: normal, color; box-shadow: 3px 3px 20px #000; overflow: hidden; user-select: none; position: relative; perspective: 3000px; z-index: 1; }
#papa::before, #papa::after { position: absolute; content: ''; pointer-events: none; }
#papa::after { content: '回顾那些年的经典'; font: bold 1.3em / 1.3em sans-serif; color: orange; text-shadow: 2px 2px 4px black; bottom: 600px; left:-5 0; transform: rotate(01deg); }
</style>

<div id="papa"></div>

<script >
(function() {
        (function(mkPlayer) {let defaults = {player_css: 'bottom: 0; left: 50%; transform: translateX(-50%);',mlist_css: 'top: 0; left: 0;',fs_btn: 'left: 0; top: 0;',playerCode: `<style>#mplayer {position: absolute;display: grid;grid-template-areas: 'cur btnplay dur''prog prog prog';gap: 8px 2px;place-items: end center;color: var(--color);font: normal 16px sans-serif;padding-bottom: 20px;z-index: 999;--ww: 260px;--color: hsla(0,0%,100%,.75);--track: hsla(90,100%,95%,.65);--prog: linear-gradient(90deg,hsla(90,30%,50%,.55),hsla(280,40%,50%,.75),hsla(30,100%,50%,.65));}#cur { grid-area: cur; color: var(--color); }#dur { grid-area: dur; color: var(--color); }#btnplay {--state: paused;grid-area: btnplay;background: conic-gradient(red,orange,yellow,green,teal,blue,purple);mask: radial-gradient(transparent 3px,red 0);-webkit-mask: radial-gradient(transparent 3px,red 0);border-radius: 50%;width: 35px;height: 35px;cursor: pointer;animation: rot linear 3s infinite;animation-play-state: var(--state);}#prog {--xx: 0px;grid-area: prog;width: var(--ww);height: 4px;background: var(--track);position: relative;display: grid;place-items: center;border-radius: 4px;}#prog::before, #prog::after { position: absolute; content: ''; }#prog::before {left: 0;width: var(--xx);height: 100%;border-radius: 6px;background: var(--prog);border-radius: 4px;}#prog::after {left: calc(var(--xx) - 12px);opacity: .85;width: 16px;height: 16px;background: radial-gradient(transparent 2px, teal 0, black);border-radius: 50%;cursor: pointer;}#mlist { --color1: lightgreen; --color2: pink;position: absolute; padding: 20px; }#mlist > a { color: var(--color1); cursor: pointer; text-shadow: 1px 1px 2px black; text-decoration: none; }#mlist >a:hover { color: var(--color2); }.sColor { color: var(--color2); }#btnMsg {position: absolute;color: snow;background: black;opacity: 0;border: 2px solid snow;border-radius: 8px;padding: 4px;transition: all .75s;cursor: pointer;z-index: 1000;}@keyframes rot { to { transform: rotate(1turn); } }</style><div id="mlist"></div><div id="mplayer"><span id="btnplay"></span><span id="prog"></span><span id="cur">00:00</span><span id="dur">00:00</span></div><span id="btnMsg">全屏观赏</span>`,};let playCode = (user_config) => {let data = Object.assign({}, defaults, user_config);papa.innerHTML += data.playerCode;mplayer.style.cssText += data.player_css;mlist.style.cssText += data.mlist_css;btnMsg.style.cssText += data.fs_btn;let mDrag = false, timerId, fs = false;let aud = document.createElement('audio');papa.appendChild(aud);(function addList() {let str = '';data.m_ar.forEach( (item,key) => {str += `<a onclick="javascript:mplay(${key})">${key+1} ${data.m_ar}</a><br>`;});mlist.innerHTML = str;})();btnplay.onclick = () => aud.paused ? aud.play() : aud.pause();btnMsg.onclick = () => fs ? document.exitFullscreen() : papa.requestFullscreen();papa.onmousemove = (e) => {clearTimeout(timerId);btnMsg.style.opacity = '.95';timerId = setTimeout('btnMsg.style.opacity = "0"', 3000);};aud.addEventListener('timeupdate', () => {cur.innerText = toMin(aud.currentTime);dur.innerText = toMin(aud.duration);if(mDrag===false) prog.style.setProperty('--xx', aud.currentTime * prog.offsetWidth / aud.duration + 'px');});aud.addEventListener('pause', () => mState());aud.addEventListener('play', () => mState());aud.addEventListener('ended', () => mplay());aud.onerror = () => mplay();prog.onmousedown = () => mDrag = true;document.onmouseup = () => mDrag = false;mplayer.onmouseup = (e) => { if(mDrag) aud.currentTime = aud.duration * e.offsetX / prog.offsetWidth; };mplayer.onmousemove = (e) => { if(mDrag) moveBar(e.offsetX); };let mState = () => aud.paused ? btnplay.style.setProperty('--state', 'paused'): btnplay.style.setProperty('--state', 'running');mplay = (idx=-1) => {if (idx < 0) idx = Math.floor(Math.random() * data.m_ar.length);aud.src = data.m_ar;aud.play();setRed(idx);};document.addEventListener("fullscreenchange", () => {if (document.fullscreenElement !== null) {fs = true;btnMsg.innerText = '退出全屏';} else {fs = false;btnMsg.innerText = '全屏观赏';}});let setRed= (idx) => {let str = mlist.innerHTML;str = str.replace(/<\/?span[^\>]*\>/g,'');str = str.replace(`${idx+1} ${m_ar}`, `${idx+1} <span class="sColor">${m_ar}</span>`);mlist.innerHTML = str;};let moveBar = (x) => {if(x < 0) x = 0;if(x > prog.offsetWidth - 5) x = prog.offsetWidth - 5;prog.style.setProperty('--xx', x + 'px');};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;};mplay();};mkPlayer.HCPlayer = playCode;})(this);
        let m_ar = [
                ["http://music.163.com/song/media/outer/url?id=1860518829.mp3","爱在深秋*谭咏麟"],
["http://music.163.com/song/media/outer/url?id=1319703763.mp3","春风秋雨*叶倩文"],
["http://music.163.com/song/media/outer/url?id=32689580.mp3","难得有情人*关淑怡"],
["http://music.163.com/song/media/outer/url?id=2068383739.mp3","初恋情人*刘小慧"],
["http://music.163.com/song/media/outer/url?id=94576.mp3","雨中的恋人们*黄凯芹"],
["http://music.163.com/song/media/outer/url?id=188175.mp3","倩女幽魂*张国荣"],
["http://music.163.com/song/media/outer/url?id=115431.mp3","红日*李克勤"],
["http://music.163.com/song/media/outer/url?id=27874938.mp3","偏偏喜欢你*陈百强"],
["http://music.163.com/song/media/outer/url?id=2014336723.mp3","你的浅笑*翻唱阿梨粤"],
["http://music.163.com/song/media/outer/url?id=276225.mp3","夕阳之歌*梅艳芳"],
["http://music.163.com/song/media/outer/url?id=28234006.mp3","真的爱你*Beyond"],
["http://music.163.com/song/media/outer/url?id=473750940.mp3","漫步人生路*翻唱刘惜君"],
["http://music.163.com/song/media/outer/url?id=32699980.mp3","捕风的汉子*谭咏麟"],
["http://music.163.com/song/media/outer/url?id=22831967.mp3","农民*Beyond"],
["http://music.163.com/song/media/outer/url?id=317776.mp3","信自己*叶蒨文"],
["http://music.163.com/song/media/outer/url?id=310449.mp3","风的季节*徐小凤"],
["http://music.163.com/song/media/outer/url?id=156631.mp3","是否我真的一无所有*王杰"],
["http://music.163.com/song/media/outer/url?id=5284592.mp3","上海滩*叶丽仪"],
["http://music.163.com/song/media/outer/url?id=171269.mp3","沉默是金*许冠杰 / 张国荣"],
["http://music.163.com/song/media/outer/url?id=212198.mp3","夜机*陈慧娴"],,
["http://music.163.com/song/media/outer/url?id=29723028.mp3","一起走过的日子*刘德华"],
["http://music.163.com/song/media/outer/url?id=29723022.mp3","暗里着迷*刘德华"],
["http://music.163.com/song/media/outer/url?id=115131.mp3","我的亲爱*黎明"],
["http://music.163.com/song/media/outer/url?id=5243287.mp3","容易受伤的女人*王菲"],
["http://music.163.com/song/media/outer/url?id=5277720.mp3","让一切随风*钟镇涛"],
["http://music.163.com/song/media/outer/url?id=5278470.mp3","最爱*周慧敏"],
["http://music.163.com/song/media/outer/url?id=1897928643.mp3","晚秋*黄凯芹"],
["http://music.163.com/song/media/outer/url?id=190808.mp3","夕阳醉了*张学友"],
["http://music.163.com/song/media/outer/url?id=5261937.mp3","野孩子*杨千嬅"],
["http://music.163.com/song/media/outer/url?id=115162.mp3","夜半小夜曲*李克勤"],
["http://music.163.com/song/media/outer/url?id=212193.mp3","红茶馆*陈慧娴"],
        ];


        HCPlayer({
                m_ar: m_ar,
                mlist_css: '--color1: lightgreen; --color2: orange; top: 0; right: 0;',
                fs_btn: 'left: 20px; top: 20px; background: #222;',
        });
})();
</script>

一剑飘香红 发表于 2023-12-6 14:50

沙发

一剑飘香红 发表于 2023-12-6 14:51

又得换浏览器观看,不错的播放器,经典的歌曲

平凡 发表于 2023-12-6 20:36

一剑飘香红 发表于 2023-12-6 14:50
沙发

剑哥晚上好

平凡 发表于 2023-12-6 20:36

一剑飘香红 发表于 2023-12-6 14:51
又得换浏览器观看,不错的播放器,经典的歌曲

都是好歌

巫荣云师 发表于 2023-12-6 20:42

欣赏收藏榕哥的[回顾那些年的经典] 很好听,点赞!

平凡 发表于 2023-12-6 21:10

巫荣云师 发表于 2023-12-6 20:42
欣赏收藏榕哥的[回顾那些年的经典] 很好听,点赞!

巫荣云师晚上好

容轩听雨 发表于 2023-12-6 22:14

欣赏一组经典歌曲,令人陶醉,问好

蓝魔 发表于 2023-12-6 23:06

欣赏一下,谢谢。

蓝魔 发表于 2023-12-7 22:35

欣赏一下,谢谢。
页: [1] 2
查看完整版本: 回顾那些年的经典