女神们节日快乐!
<style>#papa {
--state: paused;
margin: 150px 0 0 calc(50% - 720px);
display: grid;
place-items: center;
width: 1280px;
height: 650px;
background: lightblue url('https://365.tf/disk/tf/1678201115.jpg') no-repeat center/cover;
box-shadow: 6px 3px 20px #000;
user-select: none;
position: relative;
z-index: 1;
}
#mplayer1 {
position: absolute;
top:95px;
left: 120px;
width: 120px;
height: 120px;
display: grid;
place-items: center;
--state: paused;
transform: perspective(1000px) rotateX(50deg) rotateY(50deg);
}
.ball {
position: absolute;
top:170px;
left: 285px;
width: 10px;
height: 10px;
border-radius: 50%;
box-shadow: -5px 0 10px hsla(0,0%,0%,.42) inset;
}
@keyframes cover1 { from { width: 0; } to { width: 100%; } }
@keyframes cover2 { from { width: 0; } to { width: 100%; } }
@keyframes flash { to { box-shadow: 0 0 50px 20px hsla(60, 100%,50%, .35), -2px -2px 8px black inset; } }
</style>
<div id="papa">
<div id="mplayer1"></div>
<audio id="aud" src="https://music.163.com/song/media/outer/url?id=407007146.mp3" autoplay loop></audio>
</div>
<script>
(function() {
let total = 18, fs = false, timerId;
for(let i = 0; i < total; i ++) {
let ball = document.createElement('span');
ball.className = 'ball';
ball.style.cssText += `
background: #${Math.random().toString(16).substr(-6)};
transform: rotate(${160/total*i}deg) translate(20px);
animation: flash ${Math.random()+0.6}s infinite alternate var(--state);
`;
mplayer1.appendChild(ball);
}
(function(mkPlayer) {let defaults = {lrcAr: [],lrc_css: 'bottom: 20px; left: 50%; transform: translateX(-50%);',player_css: 'bottom: 20px; left: 50%; transform: translateX(-50%);',btn_size: '40px',playerCode: `<style>#mplayer {position: absolute;display: grid;grid-template-areas: 'cur btnplay dur''prog prog prog';gap: 2px 6px;place-items: end center;color: var(--color);font: normal 16px sans-serif;z-index: 999;--ww: 260px;--color: hsl(0, 100%, 100%);}#btnplay {grid-area: btnplay;--state: paused;width: 40px;height: 40px;cursor: pointer;display: grid;place-items: center;animation: rot linear 3s infinite;position: relative;animation: rot 3s linear infinite;animation-play-state: var(--state);}#btnplay > span {position: absolute;width: 10px;height: 10px;border-radius: 50%;background: linear-gradient(tan,red);}#prog {grid-area: prog;width: var(--ww);height: 20px;opacity: .95;cursor: pointer;}#cur { grid-area: cur; color: var(--color); }#dur { grid-area: dur; color: var(--color); }#lrc {--motion: cover2;--tt: 2s;--state: paused;--bg: linear-gradient(180deg,hsla(60,100%,50%,.45),hsla(200,50%,50%,.75));position: absolute;left: 20px;top: 10px;font: bold 2.6em sans-serif;color: hsl(0, 10%, 90%);white-space: pre;-webkit-background-clip: text;filter: drop-shadow(1px 1px2px hsla(0, 0%, 0%, .95));}#lrc::before {position: absolute;content: attr(data-lrc);width: 20%;height: 100%;color: transparent;overflow: hidden;white-space: pre;background: var(--bg);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="lrc" data-lrc="HCPlayer">HCPlayer</div><div id="mplayer"><div id="cur">00:00</div><div id="btnplay"><span></span></div><div id="dur">00:00</div><progress id="prog" max="100"></progress></div>`,};let playCode = (user_config) => {let data = Object.assign({}, defaults, user_config);papa.innerHTML += data.playerCode;mplayer.style.cssText += data.player_css;lrc.style.cssText += data.lrc_css;btnplay.style.width = btnplay.style.height = data.btn_size || '40px';let mKey = 0, mFlag = true;btnplay.onclick = () => aud.paused ? aud.play() : aud.pause();prog.onclick = (e) => aud.currentTime = aud.currentTime = aud.duration * e.offsetX / prog.offsetWidth;aud.addEventListener('timeupdate', () => {prog.value = aud.currentTime / aud.duration * 100;cur.innerText = toMin(aud.currentTime);dur.innerText = toMin(aud.duration);for (j = 0; j < data.lrcAr.length; j++) {if (aud.currentTime >= data.lrcAr) {cKey = j;if (mKey === j) showLrc(data.lrcAr);else continue;}}});aud.addEventListener('pause', () => mState());aud.addEventListener('play', () => mState());aud.addEventListener('seeked', () => calcKey());let mState = () => aud.paused ? (lrc.style.setProperty('--state','paused'),btnplay.style.setProperty('--state', 'paused'),mplayer1.style.setProperty('--state', 'paused')) : (lrc.style.setProperty('--state','running'),btnplay.style.setProperty('--state', 'running'),mplayer1.style.setProperty('--state', 'running'));let showLrc = (time) => {let name = mFlag ? 'cover1' : 'cover2';lrc.innerHTML = lrcAr;lrc.dataset.lrc = lrcAr.replace(/<br>/, '\n');lrc.style.setProperty('--motion', name);lrc.style.setProperty('--tt', time + 's');lrc.style.setProperty('--state', 'running');mKey += 1;mFlag = !mFlag;};let calcKey = () => {for (j = 0; j < data.lrcAr.length; j++) {if (aud.currentTime <= data.lrcAr) {mKey = j - 1;break;}}if (mKey < 0) mKey = 0;if (mKey > data.lrcAr.length - 1) mKey = data.lrcAr.length - 1;let time = data.lrcAr - (aud.currentTime - data.lrcAr);showLrc(time);};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);});})();};mkPlayer.HCPlayer = playCode;})(this);
let lrcAr = [,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
];
HCPlayer({
lrcAr: lrcAr,
lrc_css: 'top: 120px; left: 590px; --bg: #006d61;',
player_css: 'bottom: 40px; left: 800px; --color: #006d61; --ww: 180px;',
});
})();
</script>
<br><br><br><br> 这个手链播放器和美女手上的手链有控制作用,点击歌曲停止,美女手上的手链停止发光,歌曲开始,手链发光 宁静女神节快乐! 楚心兰 发表于 2023-3-7 19:49
宁静女神节快乐!
心兰好,女神节快乐~~{:10_402:}
明天可以败家了{:9001:} 买点自己喜欢的,弄点吃吃过个神节,不要太幸福哦{:9022:} 祝宁静节日快乐,也顺祝东篱的所有女神节日快乐!{:10_403:}{:10_403:}{:10_403:} 宁静 发表于 2023-3-7 19:52
心兰好,女神节快乐~~
想要两朵花
哈哈
宁静节日快乐{:10_402:} 这个播放器简单大方,我喜欢{:10_402:}
页:
[1]
2