有声有色 发表于 2024-6-19 13:15

京剧锁麟囊——春秋亭

本帖最后由 有声有色 于 2025-1-16 13:10 编辑 <br /><br /><style>
#tz { margin: 30px 0 30px calc(50% - 721px); width: 1280px; height: 640px; background: url('https://pic.imgdb.cn/item/6672673dd9c307b7e911a4ee.jpg') no-repeat center/cover; box-shadow: 2px 2px 6px gray; overflow: hidden; z-index: 1; position: relative; }
#lrc { position: absolute; left: 20px; top: 20px; font: normal 40px sans-serif; white-space: nowrap; color: lightgreen; text-shadow: 1px 1px 1px gray; animation: fly 20s linear infinite alternate var(--state); --ww: 350px; }
#player { position: absolute; left: calc(50% - 140px); bottom: 20px; width: 280px; height:10px; background: linear-gradient(to right, var(--color) var(--prg), transparent 0); border: 1px solid var(--color); border-radius: 6px; display: grid; place-items: center; --color: green; --prg: 0%; --btnSize: 50px;}
#player::before, #player::after { position: absolute; content: ''; }
#player::before { width: var(--btnSize); height: var(--btnSize); top: calc(var(--btnSize) * -1 - 5px); background: url('https://638183.freep.cn/638183/t23/btn/f5.png') no-repeat center/cover; filter: hue-rotate(180deg); animation: rot 6s linear infinite var(--state);}
#player::after { content: attr(data-time); inset: -30px 0 10px 0; text-align: justify; text-align-last: justify; font-size: 14px; color: var(--color); pointer-events: none; }
.vid { position: absolute; bottom: 0; width: 100%; height: calc(100% + 60px); object-fit: cover; mix-blend-mode: screen; pointer-events: none; }
@keyframes rot { to { transform: rotate(360deg); } }
@keyframes fly { to { left: calc(100% - var(--ww) - 20px); } }
</style>

<div id="tz">
        <audio id="aud" src="https://link.hhtjim.com/163/1914690092.mp3" autoplay loop></audio>
        <video class="vid" src="https://img.tukuppt.com/video_show/2402760/00/02/03/5b514b877f2c4.mp4

" autoplay loop muted></video>
        <div id="lrc">HUACHAO PLAYER</div>
        <div id="player" data-time="00:00 00:00"></div>
</div>

<script>
var vids = document.querySelectorAll('.vid');
var btnSize = parseInt(window.getComputedStyle(player).getPropertyValue('--btnSize'));

var lrcKey = 0;

var showLrc = () => {
        if(lrcKey >= lrcAr.length) return false;
        lrc.innerText = lrcAr;
        lrc.style.setProperty('--ww', lrc.offsetWidth + 'px');
        lrcKey ++;
};

var mState = () => {
        tz.style.setProperty('--state',['running','paused'][+aud.paused]);
        if(vids.length > 0) vids.forEach(vid => aud.paused ? vid.pause() : vid.play());
};

var s2m = (s) => (Math.floor(s / 60)).toString().padStart(2, '0') + ':' + (Math.floor(s % 60)).toString().padStart(2, '0');

aud.onplaying = aud.onpause = () => mState();

aud.onseeked = () => {
        for(var j = 0; j < lrcAr.length; j ++) {
                if(aud.currentTime < lrcAr) {
                        lrcKey = j - 1;
                        if(lrcKey < 0) lrcKey = 0;
                        break;
                }
        }
};

aud.ontimeupdate = () => {
        player.style.setProperty('--prg', (aud.currentTime / aud.duration * 100 || 0) + '%');
        player.dataset.time = s2m(aud.currentTime) + ' ' + s2m(aud.duration);
        if(lrcKey <= lrcAr.length - 1 && aud.currentTime >= lrcAr) showLrc();
}

player.onclick = (e) => {
        if(e.offsetY > 0) aud.currentTime = aud.duration * e.offsetX / player.offsetWidth;
        if(e.offsetY < 0 && e.offsetX > player.offsetWidth / 2 - btnSize / 2 && e.offsetX < player.offsetWidth / 2 + btnSize / 2) aud.paused ? aud.play() : aud.pause();
}

player.onmousemove = (e) => {
        if(e.offsetY < 0) {
                if(e.offsetX > player.offsetWidth / 2 - btnSize / 2 && e.offsetX < player.offsetWidth / 2 + btnSize / 2) {
                        player.title = aud.paused ? '播放' : '暂停';
                        player.style.cursor = 'pointer';
                }
        }else{
                player.title = '调节进度';
                player.style.cursor = 'pointer';
        }
};

let lrcAr = [
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
       
];

</script></td>

梦油 发表于 2024-6-19 13:53

美的享受。谢谢有声有色朋友。

梦江南 发表于 2024-6-19 14:39

漂亮!谢谢老师带来美的享受!{:4_199:}

有声有色 发表于 2024-6-19 15:17

梦油 发表于 2024-6-19 13:53
美的享受。谢谢有声有色朋友。

自娱自乐、安度晚年。

有声有色 发表于 2024-6-19 15:17

梦江南 发表于 2024-6-19 14:39
漂亮!谢谢老师带来美的享受!

谢谢·鼓励

红影 发表于 2024-6-19 16:10

这个戏曲制作带歌词,还带进度条和视频,有声有色老师越做越好了{:4_187:}

红影 发表于 2024-6-19 16:10

把戏曲融入音画制作,这真好。很赞{:4_199:}

梦油 发表于 2024-6-19 16:51

有声有色 发表于 2024-6-19 15:17
自娱自乐、安度晚年。

是的,我们的年纪都大了,要自己为自己找乐。

有声有色 发表于 2024-6-20 09:35

红影 发表于 2024-6-19 16:10
这个戏曲制作带歌词,还带进度条和视频,有声有色老师越做越好了

嘿嘿老师新的做歌词我都看不懂,只能还是用老的那个。

有声有色 发表于 2024-6-20 09:35

红影 发表于 2024-6-19 16:10
把戏曲融入音画制作,这真好。很赞

谢谢

有声有色 发表于 2024-6-20 09:36

梦油 发表于 2024-6-19 16:51
是的,我们的年纪都大了,要自己为自己找乐。

是的,其实最主要只要身体健康比啥都好

梦油 发表于 2024-6-20 16:46

有声有色 发表于 2024-6-20 09:36
是的,其实最主要只要身体健康比啥都好

我们就求个开心、舒心、安心……

红影 发表于 2024-6-20 20:01

有声有色 发表于 2024-6-20 09:35
嘿嘿老师新的做歌词我都看不懂,只能还是用老的那个。

都行啊,只要能做出来就好呢{:4_187:}

红影 发表于 2024-6-20 20:02

有声有色 发表于 2024-6-20 09:35
谢谢

不客气{:4_190:}
页: [1]
查看完整版本: 京剧锁麟囊——春秋亭