有声有色 发表于 2023-6-17 12:28

越剧——求娘亲

本帖最后由 有声有色 于 2025-11-13 14:27 编辑 <br /><br /><div class="t_fsz">
<table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_1827376">
<style>
#papa { margin: 0 0 0 calc(50% - 681px);; display: grid; place-items: center; width: 1200px; height: 675px; background: gray url('https://pic.imgdb.cn/item/648d34d11ddac507cc47fe5c.gif') no-repeat center/cover; box-shadow: 8px 4px 20px #000; overflow: hidden; user-select: none; position: relative; perspective: 3000px; perspective-origin: 50% 30%; z-index: 1; overflow: hidden; }
.vid { position: absolute; width: 1200px; height: 630px; clip-path: circle(66% at top) ;top: -55px; right:0px; object-fit: cover; opacity: .4;mix-blend-mode: screen;}
</style>

<div id="papa"><video class="vid" src="http://alicdn-file-m.mvbox.cn/upload/334b54b94f3588c16a18ec29b24bfcfd.mp4" autoplay="autoplay" loop="loop" muted="muted"></video></div>
<audio id="aud" src="https://music.163.com/song/media/outer/url?id=1804329230.mp3" loop autoplay></audio>

<script >
(function() {
        (function(mkPlayer) {let defaults = {lrcAr: [,],ttAr: ['花潮', '论坛', 'LRC', '在线','HCP','Player'],lrc_css: 'top: 20px; left: 50%; transform: translateX(-50%);',player_css: 'bottom: 20px; left: calc(50% - 50px);',playerCode: `<style>#mplayer {--bg1: tan;--bg2: tan;--bg3: tan;--bg4: tan;--bg5: tan;--bg6: tan;--bg7: tan;--bg8: tan;--border: 1px dotted orange;position: absolute;width: 120px;height: 80px;cursor: pointer;transform-style: preserve-3d;animation: rot 16s linear infinite;animation-play-state: paused;display: grid;place-items: center; }#mplayer > span {width: 100%;height: 100%;border: var(--border);display: grid;place-items: center;font: norml 1.5em sans-serif;position: absolute;}#btnMsg {--btnColor: white;--btnBg: #0089f0;position: absolute;top:120px; left: calc(50% - 76px); color: var(--btnColor);background: var(--btnBg);opacity: 0;border: 2px solid var(--btnColor);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(-360deg); } }@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></span><span></span><span></span><span></span><span></span><span></span><span></span><span></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;btnMsg.style.cssText += data.btn_css;let mKey = 0,mFlag = true,fs = false,tnow = Date.now(),timerId;let sps = mplayer.children;let width = mplayer.offsetWidth, angle = 45;let trz = Math.ceil(Math.tan(Math.PI / 180 * (180 - angle) /2 ) * width / 2);Array.from(sps).forEach( (item,key) => {let ry = Math.floor(key*45);sps.style.transform = `rotateY(${ry}deg) translateZ(${trz}px)`;sps.style.background = `var(--bg${key+1})`;sps.innerText = data.ttAr;});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(330,100%,40%,.35),hsla(220,90%,60%,.7));
                        bottom: 30px;
                        color: snow;
                `,
                ttAr: ['','','','','','','',''],
                player_css: `
                        --bg1: url('') no-repeat center/cover;
                        --bg2: url('') no-repeat center/cover;
                        --bg3: url('') no-repeat center/cover;
                        --bg4: url('') no-repeat center/cover;
                        --bg5: url('') no-repeat center/cover;
                        --bg6: url('') no-repeat center/cover;
                        --bg7: url('') no-repeat center/cover;
                        --bg8: url('') no-repeat center/cover;
                        --border: 1px dotted olive;
                        width: 150px;
                        height: 160px;
                        top: 920px;
                `,
                btn_css: '--btnColor: white; --btnBg: transparent;',
        });
})();
</script></td></tr></table>

有声有色 发表于 2023-6-17 12:28

这个能听到声音了吧

红影 发表于 2023-6-17 16:08

能听到了,这个制作好棒,又能看到越剧片段,又能欣赏代码的精美制作,很赞{:4_199:}

梦缘 发表于 2023-6-17 16:55

问好老师,欣赏精彩佳作,谢谢分享,点赞!{:4_187:}

有声有色 发表于 2023-6-18 08:01

红影 发表于 2023-6-17 16:08
能听到了,这个制作好棒,又能看到越剧片段,又能欣赏代码的精美制作,很赞

谢谢鼓励

有声有色 发表于 2023-6-18 08:02

梦缘 发表于 2023-6-17 16:55
问好老师,欣赏精彩佳作,谢谢分享,点赞!

谢谢鼓励,有声音吗?

红影 发表于 2023-6-18 14:07

有声有色 发表于 2023-6-18 08:01
谢谢鼓励

您做了那么多的投影仪动画呢,真不容易{:4_199:}

有声有色 发表于 2023-6-18 14:17

红影 发表于 2023-6-17 16:08
能听到了,这个制作好棒,又能看到越剧片段,又能欣赏代码的精美制作,很赞

谢谢

有声有色 发表于 2023-6-18 14:17

梦缘 发表于 2023-6-17 16:55
问好老师,欣赏精彩佳作,谢谢分享,点赞!

谢谢

有声有色 发表于 2023-6-18 14:18

红影 发表于 2023-6-18 14:07
您做了那么多的投影仪动画呢,真不容易

其实也是在学习。

红影 发表于 2023-6-18 14:32

有声有色 发表于 2023-6-18 14:17
谢谢

不客气啊,感谢您带来的好帖{:4_187:}

红影 发表于 2023-6-18 14:33

有声有色 发表于 2023-6-18 14:18
其实也是在学习。

要去找图,还要制作,要花费很多精力呢{:4_204:}

有声有色 发表于 2023-6-18 14:51

红影 发表于 2023-6-18 14:33
要去找图,还要制作,要花费很多精力呢

退休了,就是闲,坐在电脑前找一些今后能用的素材

红影 发表于 2023-6-18 19:51

有声有色 发表于 2023-6-18 14:51
退休了,就是闲,坐在电脑前找一些今后能用的素材

自己做的素材更好呢。{:4_204:}
页: [1]
查看完整版本: 越剧——求娘亲