醉美水芙蓉 发表于 2023-6-17 23:14

萍聚【《Everlasting Flame》

本帖最后由 醉美水芙蓉 于 2023-6-17 23:17 编辑 <br /><br /><style>
#papa {
      margin: 80px 0 0 calc(50% - 593px);
      width: 1024px;
      height: 684px;
      background: lightblue url('https://pic.imgdb.cn/item/648dca0d1ddac507cc6a0dcc.jpg') no-repeat center / cover;
      box-shadow: 3px 3px 20px #000;
      position: relative; overflow: hidden;
      z-index: 1;
      --state: paused;
}
#pic {
        position: absolute;
        left: 180px;
        top: 290px;
        width: 130px;
        height:130px;
        opacity: .85;
        z-index: 10;
}

</style>
<div id="papa">
<img id="pic" src="https://pic.imgdb.cn/item/647b268df024cca173175957.gif" alt="" />
<css-doodle grid="7x1" id="mplayer">
        :doodle {
                @size: 1024px 600px;
                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: 25%;
                --yplace: 98%;
                --color: Navy;
                --state: paused;
        }
        position: absolute;
        @nth(1) { /* 歌词 */
                @size: auto 3em;
                @place: 50% 10%;
                transform: translate(-50%);
                display: grid;
                place-items: center start;
                :before, :after {
                        content: var(--geci);
                        width: fit-content;
                        height: fit-content;
                        font: bold 2.5em Sans-serif;
                        color: #ccc;
                        text-shadow: 1px 1px 2px #000;
                        white-space: pre;
                }
                :after {
                        position: absolute;
                        white-space: pre;
                        width: 0;
                        color: green;
                        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 5;
                        background: var(--color);
                }
        }
        @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; }
        }
        @match(i ≥ 5) { /* 飞行物 */
                @size: 200px 113px;
                @place: 50px 44px;
                background: url('https://638183.freep.cn/638183/Pic/2022/btf.gif');
                offset-path: path('M450 100 Q710 200 1050 300');
                offset-distance: 0%;
                animation: fly 40s calc(@r(30) * -3s) infinite linear var(--state);
        }
        @keyframes cover1 { from { width: 0; } to { width: 100%; } }
        @keyframes cover2 { from { width: 0; } to { width: 100%; } }
        @keyframes rot { to { transform: rotate(-360deg); } }
        @keyframes fly { to { offset-distance: 100%; }}
</css-doodle>
<css-doodle grid="16x1" id="zi">
        :doodle {
                @size:1024px 600px;
                position: absolute;
        }
        @size: 40px;
        @place: 30px 260px;
        font: bold 30px sans-serif;
        font-shadow: 1px 1px 2px #000;
        color: RoyalBlue;
        :after { content: '@pn([蓉之最美姑苏小冠三吴水醉芙])'; }
        offset-path: path('M80 100 a160 70 0 1 1 320 0 a170 70 0 1 1 -320 0z');
        <!-- offset-distance: calc(100 / @size * (@i - 1) * 1%); -->
        offset-rotate: 0deg;
        animation: move 12s infinite linear var(--state);
        @keyframes move {
                from { offset-distance: calc(100% / @size * (@i - 1) + 100%); }
                to { offset-distance: calc(100% / @size * (@i - 1)); }
        }
</css-doodle>
</div>
<audio id="aud" src="https://www.qqmc.com/mp3/music168391762.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 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'),zi.style.setProperty('--state', 'paused') ) : (mplayer.style.setProperty('--state','running'),zi.style.setProperty('--state', 'running'));
        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();
        }
})();
</script>

樵歌 发表于 2023-6-18 06:45

还没听过英语版的这歌,别有一番滋味。那圈圈也做得不错。{:4_187:}

醉美水芙蓉 发表于 2023-6-18 07:13

樵歌 发表于 2023-6-18 06:45
还没听过英语版的这歌,别有一番滋味。那圈圈也做得不错。

樵歌早上好!父亲节快乐!

红影 发表于 2023-6-18 09:35

漂亮的制作。欣赏水芙蓉好帖。我也是第一次听到这首歌的英文版呢,有趣{:4_204:}

红影 发表于 2023-6-18 09:39

你的转动字用了13个字,在grid里可以设置13个格子,我用16是因为我加了16个字。格子数最好和字数对应起来,这样便于估算相关数据{:4_204:}

醉美水芙蓉 发表于 2023-6-18 13:30

红影 发表于 2023-6-18 09:35
漂亮的制作。欣赏水芙蓉好帖。我也是第一次听到这首歌的英文版呢,有趣

谢谢红影美女光临!

醉美水芙蓉 发表于 2023-6-18 13:31

红影 发表于 2023-6-18 09:39
你的转动字用了13个字,在grid里可以设置13个格子,我用16是因为我加了16个字。格子数最好和字数对应起来, ...

谢谢红影美女指导!

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

醉美水芙蓉 发表于 2023-6-18 13:30
谢谢红影美女光临!

问好水芙蓉美女,周日快乐{:4_187:}

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

醉美水芙蓉 发表于 2023-6-18 13:31
谢谢红影美女指导!

指导不敢当,大家相互交流{:4_173:}

小辣椒 发表于 2023-6-18 15:04

欣赏水芙蓉漂亮的制作{:4_199:}

醉美水芙蓉 发表于 2023-6-18 15:12

小辣椒 发表于 2023-6-18 15:04
欣赏水芙蓉漂亮的制作

小辣椒来了!下午好!谢谢光临!

梦缘 发表于 2023-6-18 19:39

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

醉美水芙蓉 发表于 2023-6-18 21:56

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

谢谢老师光临!

南无月 发表于 2023-6-18 22:23

太棒了,美人好看歌好听,欣赏水芙蓉好贴{:4_187:}

醉美水芙蓉 发表于 2023-6-19 07:01

南无月 发表于 2023-6-18 22:23
太棒了,美人好看歌好听,欣赏水芙蓉好贴

谢谢月儿光临!
页: [1]
查看完整版本: 萍聚【《Everlasting Flame》