有声有色 发表于 2023-6-19 14:00

越剧——庵堂认娘

本帖最后由 有声有色 于 2023-6-20 08:40 编辑 <br /><br /><div class="t_fsz">
<table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_1912908">

<style>
#papa {
      margin: 80px 0 0 calc(50% - 593px);
      width: 1024px;
      height: 640px;
      background: lightblue url('https://pic.imgdb.cn/item/648febe91ddac507ccfd0291.gif') no-repeat center / cover;
      box-shadow: 3px 3px 20px #000;
      position: relative;
      z-index: 1; overflow: hidden; display: grid; place-items: center;
           --state: paused;   
}
.mybox {
        position: absolute;
        left: 580px;
        top: 40px;
        width: 260px;
        height: 260px;
        background: rebeccapurple url('https://pic.imgdb.cn/item/648e55401ddac507ccffc4f1.jpg') no-repeat center / cover;
        border-radius: 50%;
        clip-path: polygon(
                0 0, 100% 0, 100% 100%, 50% 100%, 50% 95%, 67% 67%, 95% 50%,
      67% 33%, 50% 5%, 33% 33%, 5% 50%, 33% 67%, 50% 95%, 50% 100%, 0 100%
        );
animation: move 12s infinite linear var(--state);
}
#pic {
        position: absolute;
        left: 594px;
        top: 54px;
        width: 226px;
        height: 226px;
        opacity: .85;
        border-radius: 50%;
}
@keyframes move { to { transform: rotate(360deg); } }
@keyframes rot2 { from { transform: rotate(-15deg) scale(1); } to { transform: rotate(15deg) scale(1.5); } }
.tit { position: absolute; left: 50px; top:10px; display: grid;place-items: center; font: bold 2.8em '楷体',serif; color: SandyBrown; text-shadow: 1px 1px 2px tan;writing-mode: vertical-rl; }
.vid { position: absolute; width: 1024px; height: 695px; top: -55px;object-fit: cover; opacity: .98; clip-path: circle(78% at bottom) ;mix-blend-mode: screen;}
</style>
<div id="papa">
<video class="vid" src="https://img.tukuppt.com/video_show/2269348/00/17/44/5ec495391393a_10s_big.mp4" autoplay="autoplay" loop="loop" muted="muted"></video>


<css-doodle grid="4x1" id="mplayer">
        :doodle {
                @size: 1024px 640px;
                display: block;
                opacity: .95;
                position: absolute;
                z-index: 1;       
                --geci: 'HUACHAO';
                --motion: cover2;
                --ww: 300px;
                --prog: 0;
                --tt: 1s;
                --tt1: '00:00';
                --tt2: '00:00';
                --xplace: 69%;
                --yplace: 94%;
                --color: Gold;
                --state: paused;
        }
        position: absolute;
        @nth(1) { /* 歌词 */
                @size: auto 3em;
                @place: 49% 86%;
                transform: translate(-50%);
                display: grid;
                place-items: center start;
                :before, :after {
                        content: var(--geci);
                        width: fit-content;
                        height: fit-content;
                        font: bold 1.8em Sans-serif;
                        color: #ccc;
                        text-shadow: 1px 1px 2px #000;
                        white-space: pre;
                }
                :after {
                        position: absolute;
                        white-space: pre;
                        width: 0;
                        color: Gold;
                        overflow: hidden;
                        animation: var(--motion) var(--tt) linear forwards var(--state);
                }
        }
        @nth(2) { /* 进度条 */
                @size: var(--ww) 2px;
                @place: var(--xplace) calc(var(--yplace) - 10px);
                background: silver;
                :before, :after { content: ''; }
                :before {
                        position: absolute;
                        left: 0;
                        width: var(--prog);
                        height: 100%;
                        background: var(--color);
                }
                :after {
                        width: 100%;
                        height: 10px;
                        cursor: pointer;
                }
        }
        @nth(3) { /* 按钮 */
                @size: 60px;
                @place: var(--xplace) calc(var(--yplace) - 52px);
                cursor: pointer;
                animation: rot 6s infinite linear var(--state);
                :after {
                        content: '';
                        @size: inherit;
                        @shape: clover 4;
                        background-color: Navy;
                        background-image: radial-gradient(red, Yellow, green);
                }
        }
        @nth(4) { /* 播放时间 */
                @size: var(--ww) 20px;
                @place: var(--xplace) calc(var(--yplace) - 30px);
                :before, :after{
                        position: absolute;
                        width: 100%;
                        height: 100%;
                        color: var(--color);
                }
                :before { content: var(--tt1); }
                :after { content: var(--tt2); text-align: right; }
        }
        @keyframes cover1 { from { width: 0; } to { width: 100%; } }
        @keyframes cover2 { from { width: 0; } to { width: 100%; } }
        @keyframes rot { to { transform: rotate(360deg); } }
</css-doodle>
</div>

<audio id="aud" src="https://www.joy127.com/url/105422.mp3" autoplay="autoplay" loop="loop"></audio>

<script>
(function(){
        let script = document.createElement('script');
        script.src = 'https://638183.freep.cn/638183/web/api/css-doodle.js';
        document.head.appendChild(script);
let vid = document.querySelector('.vid');
        let mKey = 0, mFlag = true, slip = 0.6;
        let lrcAr = [
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
       
];
        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 mState = () => aud.paused ? (mplayer.style.setProperty('--state', 'paused'),papa.style.setProperty('--state', 'paused'), vid.pause() ) : (mplayer.style.setProperty('--state','running'),papa.style.setProperty('--state', 'running'), vid.play());
        let showLrc = (time) => {mplayer.style.setProperty('--motion', mFlag ? 'cover1' : 'cover2');mplayer.style.setProperty('--geci', '"' + lrcAr + '"');mplayer.style.setProperty('--tt', time + 's');mKey += 1;mFlag = !mFlag;};
        let calcKey = () => {for (j = 0;j < lrcAr.length;j++) {if (aud.currentTime <= lrcAr) {mKey = j - 1;break;}}if (mKey < 0) mKey = 0;if (mKey > lrcAr.length - 1) mKey = lrcAr.length - 1;let time = lrcAr - (aud.currentTime - lrcAr);showLrc(time);};
        aud.addEventListener('timeupdate', () => {for (j = 0; j < lrcAr.length; j++) {if (aud.currentTime - slip >= lrcAr) {cKey = j;if (mKey === j) showLrc(lrcAr);else continue;}}mplayer.style.setProperty('--prog', 100*aud.currentTime/aud.duration + '%');mplayer.style.setProperty('--tt1', `'${toMin(aud.currentTime)}'`);mplayer.style.setProperty('--tt2', `'${toMin(aud.duration)}'`);});
        aud.addEventListener('play', mState, false);
        aud.addEventListener('pause', mState, false);
        aud.addEventListener('seeked', () => calcKey());
        window.onload = () => {
                let btns = mplayer.shadowRoot.querySelectorAll('cell');
                let ww = parseInt(window.getComputedStyle(mplayer).getPropertyValue('--ww'));
                btns.onclick = (e) => aud.currentTime = e.offsetX * aud.duration / ww;
                btns.onclick = () => aud.paused ? aud.play() : aud.pause();
        }
        let outstr = '茫茫人海寻娘亲', num = 0;
        Array.from({length: outstr.length}).forEach((item,key) => {
                item = document.createElement('span');
                item.className = 'tit';
                item.innerText = outstr.slice(key,key+1);
                item.style.cssText += `top: ${key * 70 + 50}px`;
                papa.appendChild(item);
        });
        let tits = document.querySelectorAll('.tit');
        (function chgFn() {
                tits.style.animation = 'rot2 linear 1s backwards';
                setTimeout( () => {
                        chgFn();
                        tits.style.animation = '';
                }, 1200);
                num += 1;
                if(num > outstr.length - 1) num = 0;
        })();
})();
</script></td></tr></table>

红影 发表于 2023-6-19 15:13

漂亮的制作,这香炉的动态又是有声有色老师自己做的吧,很像的烟雾{:4_187:}

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

这个歌词同步很准确的,很赞。不过怎么没有播放器啊{:4_173:}

有声有色 发表于 2023-6-19 15:34

红影 发表于 2023-6-19 15:13
漂亮的制作,这香炉的动态又是有声有色老师自己做的吧,很像的烟雾

香炉网上找的。烟雾做的

有声有色 发表于 2023-6-19 15:35

红影 发表于 2023-6-19 15:18
这个歌词同步很准确的,很赞。不过怎么没有播放器啊

https://www.joy127.com/url/105422.mp3

樵歌 发表于 2023-6-19 16:19

香炉做得特别逼真.
给你转了轱辘相赠【新提醒】给有声有色转个轱辘 - 祝福礼堂 - 花潮论坛 - Powered by Discuz!
https://www.huachaowang.com/forum.php?mod=viewthread&tid=69417

有声有色 发表于 2023-6-19 16:27

樵歌 发表于 2023-6-19 16:19
香炉做得特别逼真.
给你转了轱辘相赠【新提醒】给有声有色转个轱辘 - 祝福礼堂 - 花潮论坛 - Powered by D ...

谢谢,做的那么好 学习了

红影 发表于 2023-6-19 16:58

有声有色 发表于 2023-6-19 15:34
香炉网上找的。烟雾做的

那个动态做得很漂亮{:4_187:}

红影 发表于 2023-6-19 16:58

有声有色 发表于 2023-6-19 15:35


我不是说歌曲地址,是帖子里没看到播放器?

梦缘 发表于 2023-6-19 19:13

欣赏老师的分享,精彩!{:4_187:}

有声有色 发表于 2023-6-20 08:47

红影 发表于 2023-6-19 16:58
我不是说歌曲地址,是帖子里没看到播放器?

我也不知道,看来对代码我还是一窍不通,只能照葫芦画瓢,我换了一个,TO你的劝君更尽一杯酒音画

有声有色 发表于 2023-6-20 08:47

梦缘 发表于 2023-6-19 19:13
欣赏老师的分享,精彩!

谢谢支持

红影 发表于 2023-6-20 15:30

有声有色 发表于 2023-6-20 08:47
我也不知道,看来对代码我还是一窍不通,只能照葫芦画瓢,我换了一个,TO你的劝君更尽一杯酒音画

现在播放器看到了{:4_173:}
页: [1]
查看完整版本: 越剧——庵堂认娘