《看不透的红尘》流苏
本帖最后由 焱鑫磊 于 2023-5-24 18:57 编辑 <br /><br /> <style>#papa {
margin: 100px -280px;
width: 1164px;
height: 640px;
background: url('https://img.fy6b.com/2023/05/24/a174fcf0051cf.jpg'); box-shadow: 3px 3px 20px #000; position: relative; display: grid; place-items: center; z-index: 1; }
#papa::after { content: ''; position: absolute; width: 1164; height: 640; opacity: .06; background: url('https://ln2018.oss-cn-hangzhou.aliyuncs.com/2022/htm/gif/xu.gif');}
</style>
<div id="papa"></div>
<audio id="aud" src="https://mp3.t57.cn:7087/kwlink_d.php?id=76262724" loop autoplay></audio>
<script>
(function() {
(function(mkPlayer) {let defaults = {lrcAr: [],ypData: new Array(800).fill(0).map((v, k) => Math.floor(Math.random() * 400) + 10),pinpu: {size: 2, gap: 1,},player_css: 'left: 80%; transform: translateX(-90%); /*--color1: olive; --color2: silver*/',lrc_css:'',playerCode: `<style>#mplayer {--color1: green; --color2: lightgreen;position: absolute;bottom: 240px; left: calc(10% - 400px);width: 120px; height: 120px;border-radius: 50%;border: 2px solid var(--color1);display: grid; place-items: center center;user-select: none; cursor: pointer;}#tmsg { font: normal 18px sans-serif; color: var(--color1); text-shadow: 1px 1px 1px #ffffff; z-index: 360; }#lrc {--motion: cover2;--tt: 2s;--state: paused;--bg: linear-gradient(180deg, hsla(200, 50%, 50%, .95), hsla(128, 100%, 50%, .95));position: absolute;
top: 520px;font: bold 2.4em sans-serif;color: hsl(0, 10%, 95%);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="标题">《看不透的红尘》流苏</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(73px)`; 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; 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 < 50) min = '0' + min;if (sec < 50) sec = '0' + sec;return min + ':' + sec;};};mkPlayer.HCPlayer = playCode;})(this);
let lrcAr = [
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
];
ypData = ;
HCPlayer({
lrcAr: lrcAr,
ypData: ypData,
lrc_css: '',
player_css: '--color1: green; --color2: gold; left: 520px;',
pinpu: {size: 1, gap: 0,},
});
})();
</script>
这个毛茸茸播放器频谱能完全吻合歌曲,这个制作的画面很清爽,漂亮{:4_199:} 红影 发表于 2023-5-25 09:39
这个毛茸茸播放器频谱能完全吻合歌曲,这个制作的画面很清爽,漂亮
红影好!{:4_187:} 美丽的画面,好看的播放器,欣赏点赞!{:4_171:} 梦缘 发表于 2023-5-25 10:53
美丽的画面,好看的播放器,欣赏点赞!
问候梦缘好!{:4_204:} 焱鑫磊 发表于 2023-5-25 09:49
红影好!
这个画面非常清爽,漂亮{:4_187:} 制作的画面很清爽,漂亮。{:4_204:}
页:
[1]