祝你平安
<style>#papa {position:relative;margin-top:20px;margin-left: calc(50% - 681px);width: 1200px;height: 740px;box-shadow:0px 0px 0px 2px #ADFF2F,0px 0px 0px 13px #5E2612;overflow:hidden;border-radius:0%;background-image:url('https://z1.ax1x.com/2023/12/13/pifttSS.jpg'); }
#papa::after { position: absolute; content: '祝\a你\a平\a安'; white-space:pre; font: bold 3em sans-serif; font-style: normal; color: #668cff; top: 30px; left: 50px; text-shadow: 2px 2px 4px #000; }
</style>
<div id="papa"></div>
<audio id="aud" src='https://music.163.com/song/media/outer/url?id=1895377443.mp3' autoplay loop></audio>
<script >(function(mkPlayer) {let defaults = {lrcAr: [],lrc_css: 'top: 20px; left: 50%; transform: translateX(-50%);',player_css: ' bottom: 20px;left: 200px; transform: translateX(-50%);',playerCode: `<style>#mplayer {position: absolute;display: grid;grid-template-areas: 'cur btnplay dur''prog prog prog';gap: 0 4px;place-items: end center;font-size: 14px;--ww: 260px;--color: snow;}#cur {grid-area: cur;color: var(--color);}#dur {grid-area: dur;color: var(--color);}#btnplay {grid-area: btnplay;display: grid;grid-auto-flow: column;place-items: end center;gap: 4px;height: 60px;cursor: pointer;}#btnplay>span {background: red;width: 4px;transition: .6s;}#prog {grid-area: prog;width: var(--ww);height: 20px;opacity: .65;cursor: pointer;position: relative;}#lrc {--motion: cover2;--tt: 2s;--state: paused;--bg: linear-gradient(180deg, hsla(60, 50%, 50%, .45), hsla(80, 70%, 50%, .6), hsla(0, 100%, 50%, .75));position: absolute;left: 20px;top: 10px;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);}@keyframes cover1 { from { width: 0; } to { width: 100%; } }@keyframes cover2 { from { width: 0; } to { width: 100%; } }</style><div id="lrc" data-lrc="HCPlayer">HCPlayer</div><div id="mplayer"><div id="cur">00:00</div><div id="btnplay"></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;(function() {for (j = 0; j < 20; j++) {let pinpu = document.createElement('span');pinpu.className = 'pinpu';pinpu.style.cssText += `height: ${Math.floor(Math.random()*50) + 10}px; background: #${Math.random().toString(16).substr(-6)};`;btnplay.appendChild(pinpu);}})();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);setPinpu();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 = () => lrc.style.setProperty('--state', aud.paused ? 'paused' : '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;}};let setPinpu = () => {let eles = document.querySelectorAll('.pinpu');eles.forEach((item) => item.style.height = `${Math.floor(Math.random()*50) + 10}px`);};mkPlayer.HCPlayer = playCode;})(this);
let lrcAr = [
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
];
HCPlayer({
lrcAr: lrcAr,
/*
lrc_css: `
top: 20px;
left: 50%;
transform: translate(-50%);
--bg: linear-gradient(tan, red);
color: tan;
`,
player_css: `
bottom: 20px;
--color: snow;
--ww: 260px;
--track: snow;
--prog: purple;
`,
*/
});
</script>
<br><br><br><br><br><br><br><br> LRC编辑合拍,经典老歌,悦耳动听,赞一个,问好老师 问好朋友
欣赏学习
问好老师,欣赏学习您的佳作。点赞{:1_293:} 欣赏一下,谢谢。 容轩听雨 发表于 2022-12-28 17:27
LRC编辑合拍,经典老歌,悦耳动听,赞一个,问好老师
谢谢您的支持和美评!祈愿大家顺利度过新冠病毒传染期,健康平安! 张红 发表于 2022-12-28 17:55
问好朋友
欣赏学习
谢谢您的支持和问好!祝健康平安! 巫荣云师 发表于 2022-12-28 20:00
问好老师,欣赏学习您的佳作。点赞
谢谢您的支持和点赞!祝健康平安! 蓝魔 发表于 2022-12-28 22:58
欣赏一下,谢谢。
谢谢您的关注和支持!祝健康平安! 欣赏老师佳作!
页:
[1]
2