TO黑老师代码——莺莺祥月
<div class="t_fsz"><table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_1825830">
<style>
#papa { margin: 120px 0 0 calc(50% - 725px); display: grid; place-items: center; width: 1280px; height: 606px; background: gray url('https://pic.imgdb.cn/item/63e1d2734757feff33c8279a.gif') no-repeat center/cover; overflow: hidden; user-select: none; box-shadow: 6px 3px 20px #000; position: relative; perspective: 3000px; z-index: 1; }
</style>
<div id="papa"></div>
<audio id="aud" src="https://link.hhtjim.com/163/247149.mp3" loop autoplay></audio>
<script >
(function() {
(function(mkPlayer) {let defaults = {lrcAr: [,],ttAr: ['花潮','论坛','LRC','在线'],lrc_css: 'top: 20px; left: 50%; transform: translateX(-50%);',player_css: 'bottom: 20px; left: calc(50% - 50px);', playerCode: `<style>#mplayer {--bg: linear-gradient(to right bottom,olive,black);position: absolute;width: 100px;height: 100px;display: grid;place-items: center;animation: rot 10s infinite linear;cursor: pointer;color: snow;transform-style: preserve-3d;}.pedal {position: absolute;width: 120px;height: 60px;background: var(--bg);font: bold 1.2em sans-serif;display: grid;place-items: center;opacity: .95;}.pedal:nth-of-type(1) { transform: rotateY(45deg) translateZ(50px); }.pedal:nth-of-type(2) { transform: rotateY(135deg) translateZ(50px); }.pedal:nth-of-type(3) { transform: rotateY(-135deg) translateZ(50px); }.pedal:nth-of-type(4) { transform: rotateY(-45deg) translateZ(50px); }#btnMsg { position: absolute; color: snow; background: #274a64; opacity: 0; border: 2px solid snow; border-radius: 8px; padding: 4px; transition: all .75s; cursor: pointer; z-index: 901; }#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 rot { to { transform: rotateY(-1turn); } }@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"><span class="pedal"></span><span class="pedal"></span><span class="pedal"></span><span class="pedal"></span></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, tnow = Date.now(), timerId;;data.ttAr.forEach( (item,key) => {let spans = mplayer.children;spans.innerText =item;});mplayer.onclick = () => 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);};document.addEventListener("fullscreenchange", () => {if (document.fullscreenElement !== null) {fs = true;btnMsg.innerText = '退出全屏';} else {fs = false;btnMsg.innerText = '全屏观赏';}});aud.addEventListener('pause', () => mState());aud.addEventListener('play', () => mState());aud.addEventListener('seeked', () => calcKey());let mState = () => aud.paused ? (lrc.style.setProperty('--state','paused'), mplayer.style.animationPlayState='paused') : (lrc.style.setProperty('--state','running'), mplayer.style.animationPlayState='running');aud.addEventListener('timeupdate', () => {for (j = 0; j < data.lrcAr.length; j++) {if (aud.currentTime >= data.lrcAr) {if (mKey === j) showLrc(data.lrcAr);else continue;}}});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,
lrc_css: '--bg: linear-gradient(hsla(180,80%,60%,.7),hsla(220,70%,40%,.5)); top: 500px;',
ttAr: ['莺莺祥月','评弹','莺莺祥月','评弹'],
player_css: '--bg: repeating-linear-gradient(90deg, transparent, black 8px, silver 6px);bottom: 60px; left: 77%; color: Azure;',
});
})();
</script>
</td></tr></table>
评弹,好听。糯糯软软的江南味道。欣赏有声有色好帖,黑黑收礼开心{:4_187:} 这个弹拨琵琶的动态的节奏倒是恰好。那泪滴太大了,流那么多泪啊{:4_173:} 欣赏老师佳作! 红影 发表于 2023-2-7 13:45
评弹,好听。糯糯软软的江南味道。欣赏有声有色好帖,黑黑收礼开心
谢谢鼓励 红影 发表于 2023-2-7 13:47
这个弹拨琵琶的动态的节奏倒是恰好。那泪滴太大了,流那么多泪啊
哈哈 海笑 发表于 2023-2-7 13:50
欣赏老师佳作!
谢谢鼓励 吴侬软语的感情太浓郁了,好美。 庶民 发表于 2023-2-7 14:46
吴侬软语的感情太浓郁了,好美。
谢谢 有声有色 发表于 2023-2-7 14:01
谢谢鼓励
特别漂亮的动图和代码制作,很赞{:4_187:} 有声有色 发表于 2023-2-7 14:01
哈哈
那没人的嘴也是动态呢,是在咿咿呀呀地演唱吧。 红影 发表于 2023-2-7 20:28
那没人的嘴也是动态呢,是在咿咿呀呀地演唱吧。
你看的真仔细,就是眼泪没做好 有声有色 发表于 2023-2-8 08:28
你看的真仔细,就是眼泪没做好
很不错的了,再小了会看不出的{:4_173:}
页:
[1]