给我一瓶酒一支烟
本帖最后由 宁静 于 2024-9-23 12:09 编辑 <br /><br /><style>#papa { margin: 150px 0 0 calc(50% - 675px); width: 1205px; height: 730px; background: lightblue url('https://wj.zp68.com/lxx/yunhua/2022/12/11/F.gif'); box-shadow: 1px 1px 3px #000; position: relative; display: grid; place-items: center; z-index: 1; }
#dt1{ position: absolute; width: 32px; height: 32px; top: 90px; left: 220px;z-index: 10; }
#dt2{ position: absolute; width: 32px; height: 32px; top: 50px; left: 1100px;z-index: 100; }
</style>
<div id="papa"></div>
<img id="dt1" src="https://wj.zp68.com/lxx/yunhua/2022/12/11/xx.jpg" alt=""/>
<img id="dt2" src="https://wj.zp68.com/lxx/yunhua/2022/12/11/xx.jpg" alt=""/>
<img id="dt3" src="https://file.uhsea.com/2409/4fe36c08b07d7017b9c2fe77b0b26eb1CF.pn" alt=""/>
<img src="F.gif" alt="" style="position: absolute; left: 650px; top:150px;mix-blend-mode: multiply; transform: translate(30px, 40px) rotate(360deg); " />
<audio id="aud" src="https://wj.zp68.com/lxx/yunhua/2022/12/11/jiu.mp3" loop autoplay></audio>
<script>
(function() {
(function(mkPlayer) {let defaults = {lrcAr: [],ypData: new Array(500).fill(0).map((v, k) => Math.floor(Math.random() * 200) + 10),pinpu: {size: 2.5, gap: 1,},player_css: 'left: 50%; transform: translateX(-50%); /*--color1: olive; --color2: silver*/',lrc_css:'',playerCode: `<style>#mplayer {--color1: green; --color2: lightgreen;position: absolute;bottom: 50px; left: calc(50% - 60px);width: 120px; height: 120px;border-radius: 50%;border: 6px solid var(--color1);display: grid; place-items: center center;user-select: none; cursor: pointer;}#tmsg { font: normal 14px sans-serif; color: var(--color1); text-shadow: 1px 1px 1px #000; z-index: 650; }#lrc {--motion: cover2;--tt: 2s;--state: paused;--bg: linear-gradient(180deg, hsla(120, 50%, 50%, .45), hsla(120, 100%, 50%, .75));position: absolute; left: 100px; top: 100px;font:bold 2.4em sans-serif;color: hsl(0, 10%, 90%);white-space: pre;-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: pre;background: var(--bg);filter: inherit;-webkit-background-clip: text;animation: var(--motion) var(--tt) linear forwards;animation-play-state: var(--state);}.mLine { --hh: 0px; position: absolute; width: 2px; height: 6px; background: var(--color1); }.mLine::before, .mLine::after {position: absolute;content: '';width: 100%;height: var(--hh); }.mLine::before { bottom: 0;left: 0;background: linear-gradient(to top, var(--color1), var(--color2)); }.mLine::after { top: 0;left: 0;background: linear-gradient(to bottom, var(--color1), var(--color2)); }@keyframes cover1 {from {width: 0;} to {width: 100%;}}@keyframes cover2 {from {width: 0;} to {width: 100%;}}</style><div id="mplayer"><span id="tmsg">play</span></div><div id="lrc" data-lrc="HCPlayer">HCPlayer--</div>`,};let playCode = (user_config) => {let data = Object.assign({}, defaults, user_config);papa.innerHTML += data.playerCode;mplayer.style.cssText += data.player_css;aud.loop = false;let ppsize = data.pinpu.size, gap = data.pinpu.gap;let mKey = 0, mFlag = true, ppnum = 0;let total = Math.floor(mplayer.clientWidth * Math.PI / (ppsize + gap));for(j=0; j< total; j++) {let ele = document.createElement('span');ele.className = 'mLine';ele.style.width = ppsize + 'px';ele.style.transform = `rotate(${j*360/total}deg) translateY(63px)`; mplayer.appendChild(ele);}let lines = document.querySelectorAll('.mLine');let max = Math.max.apply(null, data.ypData);let divide = max / mplayer.offsetHeight, coe = 10 / total / 2, plus;let update = () => {lines.forEach((item,key) => {plus = (key < total / 2 ? key : total - key) * coe * 5;item.style.setProperty('--hh',(Math.random() * ypData - 2) / 5 + plus + 'px');});if(!aud.paused) window.requestAnimationFrame(update);};mplayer.onclick = () => aud.paused ? aud.play() : aud.pause();aud.addEventListener('pause', () => mState());aud.addEventListener('playing', () => { mState(); update(); });aud.addEventListener('ended', () => { mKey = 0; ppnum = 0; aud.play(); });aud.addEventListener('timeupdate', () => {ppnum++;if (ppnum >= data.ypData.length) ppnum = 0;tmsg.innerText = '-' + toMin(aud.duration - aud.currentTime);for (j = 0; j < data.lrcAr.length; j++) {if (aud.currentTime >= data.lrcAr) {cKey = j;if (mKey === j) showLrc(data.lrcAr);else continue;}}});let mState = () => aud.paused ? lrc.style.setProperty('--state', 'paused') : lrc.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 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;};};mkPlayer.HCPlayer = playCode;})(this);
let lrcAr = [
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
];
let ypData = ;
HCPlayer({
lrcAr: lrcAr,
ypData: ypData,
lrc_css: '',
player_css: '--color1: Lime; --color2: LawnGreen; left: 880px;',
pinpu: {size: 1, gap: 0,},
});
})();
</script> 很好玩的一首歌,开心开心的,主要玩下面那个假响应式频谱播放器 右下角的播放控制很炫。
墨羽 发表于 2022-12-15 22:07
右下角的播放控制很炫。
好玩吧,测试成功了
晚上又不能睡觉了{:9001:} 有酒又烟,最幸福了 沉默 发表于 2022-12-15 22:15
有酒又烟,最幸福了
喝酒有利健康,抽烟不好
宁静 发表于 2022-12-15 22:18
喝酒有利健康,抽烟不好
戒烟会胖{:9001:}
我去碰运气了 今天第一名88分,谢了