你好2023
本帖最后由 马黑黑 于 2022-12-31 08:56 编辑 <br /><br /><style>#papa { margin: -40px 0 0 calc(50% - 593px); width: 1024px; height: 640px; background: darkgray url('https://638183.freep.cn/638183/t22/webp/bbg.webp') no-repeat center/cover; box-shadow: 4px 8px 16px #000; display: grid; place-items: center; perspective: 3000px; opacity: .95; overflow: hidden; position: relative; z-index: 1; }
.yanhua { position: absolute; border-radius: 50%; mix-blend-mode: difference; }
</style>
<div id="papa"></div>
<audio id="aud" src="https://music.163.com/song/media/outer/url?id=25889173.mp3" autoplay loop></audio>
<script >
(function() {
(function(mkPlayer) {let defaults = {lrcAr: [ ],lrc_css: 'top: 15px; left: 50%; transform: translate(-50%)',player_css: 'bottom: 5px; left: 50%; transform: translate(-50%)',angle: -90,playerCode: `<style>#mplayer {--ww: 300px;--hh:100px;--state: paused;position: absolute;width: var(--ww);height: var(--hh);transform-style: preserve-3d;cursor: pointer;z-index: 899;}#mplayer::before { position: absolute; content: ''; left: -20px; right: -20px; top: 0; bottom: -35px; }.mline {position: absolute;width: 6px;height: 10px;bottom: 0;left: calc(50% - 4px);border-radius: 10px;transition: all .35s;opacity: .95;}.mline::before {position: absolute;content: '';width: 10px;height: 10px;left: calc(50% - 5px);background: var(--psecolor);border-radius: 50%;transition: all var(--ts);animation: up 1s infinite;animation-play-state: var(--state);}#btnMsg {position: absolute;color: snow;background: darkblue;opacity: 0;border: 2px solid snow;border-radius: 8px;padding: 4px;transition: all .75s;cursor: pointer;z-index: 1001;}#lrc {--motion: cover2;--tt: 1s;--state: running;--bg: linear-gradient(180deg,hsla(100,10%,50%,.75),hsla(100,100%,20%,.65));position: absolute;font: bold 2.4em sans-serif;color: hsl(100, 100%, 90%);white-space: pre;-webkit-background-clip: text;filter: drop-shadow(1px 1px 2px hsla(0, 100%, 0%, .85));z-index: 900;}#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 up { to { top: -20px; } }</style><div id="lrc" data-lrc="HCPlayer">HCPlayer</div><div id="mplayer"></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;lrc.style.cssText += data.lrc_css;let mKey = 0, mFlag = true, fs = false, timerId;let total = Math.floor(mplayer.offsetWidth / 8), mRad = Math.floor(mplayer.offsetWidth / 2), tnow = Date.now();mplayer.onclick = (e) => 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);};for (j = 0; j < total; j++) {let ele = document.createElement('span');ele.className = 'mline';ele.style.cssText += `background: linear-gradient(to bottom, #${Math.random().toString(16).substr(-6)}, #${Math.random().toString(16).substr(-6)});transform: rotateY(${j*180/total + data.angle}deg) translateZ(${mRad}px);--psecolor: linear-gradient(135deg, #${Math.random().toString(16).substr(-6)}, #${Math.random().toString(16).substr(-6)});--ts: ${Math.random()}s;`;mplayer.appendChild(ele);}let lines = document.querySelectorAll('.mline');let update = () => {if (Date.now() - tnow > 65) {lines.forEach((item, key) => {let ph = aud.paused ? 0 : mplayer.offsetHeight;item.style.height = Math.random() * ph + 'px';});tnow = Date.now();}requestAnimationFrame(update);};update();aud.addEventListener('timeupdate', () => {for (j = 0; j < data.lrcAr.length; j++) {if (aud.currentTime >= data.lrcAr) {if (mKey === j) showLrc(data.lrcAr);else continue;}}});aud.addEventListener('pause', () => mState());aud.addEventListener('play', () => mState());aud.addEventListener('seeked', () => calcKey());document.addEventListener("fullscreenchange", () => {if (document.fullscreenElement !== null) {fs = true;btnMsg.innerText = '退出全屏';} else {fs = false;btnMsg.innerText = '全屏观赏';}});let mState = () => aud.paused ? (lrc.style.setProperty('--state', 'paused'), mplayer.style.setProperty('--state', 'paused')) : (lrc.style.setProperty('--state', 'running'), mplayer.style.setProperty('--state', 'running'));let showLrc = (time) => {let name = mFlag ? 'cover1' : 'cover2';lrc.innerHTML = data.lrcAr;lrc.dataset.lrc = data.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);};};mkPlayer.HCPlayer = playCode;})(this);
let lrcAr = [, ];
HCPlayer({
lrcAr: lrcAr,
player_css: '--ww: 360px; --hh:80px; left: 20px; bottom: 40px;',
lrc_css: '--bg: linear-gradient(0deg,hsla(0,90%,50%,.35),hsla(90,10%,50%,.65)); color: tan; top: 36%;',
angle: -150,
});
let imgAr = ['https://638183.freep.cn/638183/t22/gif/383.gif','https://638183.freep.cn/638183/t22/gif/ace.gif'];
Array.from({length: 20}).forEach( (item) => {
item = document.createElement('img');
item.className = 'yanhua';
let idx = Math.round(Math.random());
item.src = imgAr;
item.alt = '';
item.style.cssText += `
left: ${Math.random()* 85}%;
top: ${Math.random() * 20}%;
width: ${Math.random()*200 + 50}px;
`;
papa.appendChild(item);
});
})();
</script> 祝花潮朋友新年快乐!
祝黑黑先生新年快乐! 梦油 发表于 2022-12-31 09:46
祝花潮朋友新年快乐!
祝黑黑先生新年快乐!
非常感谢!祝你2023心想事成、身体健康、阖家幸福! 这个真喜庆,明天就跨入2023年了,祝福大家! 好喜庆。。赞 醉美水芙蓉 发表于 2022-12-31 11:51
好喜庆的帖!黑黑老师辛苦了!
{:4_180:} 黑黑这个效果太棒了{:4_178:}
烟花特别喜庆,音乐也是的 同样的祝福送给黑黑,元旦快乐!新年快乐!{:4_187:} 全屏效果更加有节日的气氛了{:4_199:} 祝黑黑大神新的一年心想事成,发大财了请我们吃饭哦{:4_170:} 小辣椒 发表于 2022-12-31 19:11
祝黑黑大神新的一年心想事成,发大财了请我们吃饭哦
谢谢!吃饭没问题 小辣椒 发表于 2022-12-31 19:08
黑黑这个效果太棒了
烟花特别喜庆,音乐也是的
预祝2023一切顺顺利利 小辣椒 发表于 2022-12-31 19:08
同样的祝福送给黑黑,元旦快乐!新年快乐!
非常感谢! 小辣椒 发表于 2022-12-31 19:10
全屏效果更加有节日的气氛了
{:4_181:} 马黑黑 发表于 2022-12-31 19:15
谢谢!吃饭没问题
好吧,等你发大财了{:4_170:} 马黑黑 发表于 2022-12-31 19:16
预祝2023一切顺顺利利
谢谢黑黑 马黑黑 发表于 2022-12-31 19:16
非常感谢!
还客气啊{:4_189:} 马黑黑 发表于 2022-12-31 19:17
大气就是这样来的,全屏效果太赞了{:4_199:} 小辣椒 发表于 2022-12-31 19:38
还客气啊
必须的