理查德克莱德曼经典曲目 TO;我也在/秋日安好
<style>#papa { margin: 0 0 0 calc(50% - 513px); display: grid; place-items: center; width: 1024px; height: 640px; background: gray url('https://pic.imgdb.cn/item/652f6202c458853aef5ec553.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: 'TO;我也在/秋日安好'; font: bold 1.3em / 1.3em sans-serif; color: orange; text-shadow: 2px 2px 4px black; bottom: 10px; left: 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=34341360.mp3","梦中的婚礼"],
["http://music.163.com/song/media/outer/url?id=34341349.mp3","秋日私语"],
["http://music.163.com/song/media/outer/url?id=1942033347.mp3","致爱丽丝"],
["http://music.163.com/song/media/outer/url?id=34341351.mp3","爱的纪念"],
["http://music.163.com/song/media/outer/url?id=34341358.mp3","水边的阿狄丽娜"],
["http://music.163.com/song/media/outer/url?id=34341353.mp3","罗密欧与朱丽叶"],
["http://music.163.com/song/media/outer/url?id=1961762571.mp3","瓦妮莎的微笑"],
["http://music.163.com/song/media/outer/url?id=34341364.mp3","星空"],
["http://music.163.com/song/media/outer/url?id=447926067.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> @我也在 小也
我只看见一个美女;P 一剑飘香红 发表于 2023-10-18 15:34
我只看见一个美女
剑哥,浏览器换个模式看看 欣赏收藏榕哥的[理查德克莱德曼经典曲目] 很好听,点赞! 平凡 发表于 2023-10-18 13:25
@我也在 小也
榕哥晚上好,老弟来晚了,不好意思哈。 一剑飘香红 发表于 2023-10-18 15:34
我只看见一个美女
哈哈哈一剑大哥{:1_292:} 经典名曲特别喜欢听,
好多书店和咖啡馆唱有播放这名曲。
谢谢榕哥哈,{:1_292:} 我这九块九包邮的老年机特别好使,进来就能打开观赏。:lol 欣赏一下,谢谢。
页:
[1]