醉美水芙蓉 发表于 2023-5-21 20:45

相伴红尘中

本帖最后由 醉美水芙蓉 于 2023-5-22 20:40 编辑 <br /><br /><style>
        #papa {
                margin: 0 0 0 calc(38% - 593px);
                width: 1180px;
                height: 720px;
                background: tan url('https://pic1.imgdb.cn/item/646a0eafe03e90d874a35ff8.jpg');
                box-shadow: 0 0 8px #000;
                display: grid;
                place-items: center;
                position: relative;
                overflow: hidden;
                --state: paused;
        }

    #vid {
        position: absolute;
        width: 1520px;
        height: 100%;
        border-radius: 2%;
        opacity: .76;
        object-fit: cover;
        pointer-events: none;
        mix-blend-mode: screen;

}       
        css-doodle { position: absolute; }       
       
</style>


<div id="papa">
        <!-- 播放器 -->
<css-doodle grid="1" id="mplayer">
      :doodle {
                @size: 1180px 720px;
                background: url('') no-repeat center/cover;
                box-shadow: 0 0 6px #000;
                position: relative;
                z-index: 1;
      }
      @size: 100px;
      clip-path: @shape(
fill: evenodd;
points: 400;
x: cos(2t) * cos(5t) * sin(t);
y: sin(2t) * sin(4t) * cos(5t);
      );
      position: absolute;
      background: rgb(@m3(@r(255)));
      offset-path: path('M512 180a300 120 0 1 0 600 0a300 120 0 1 0 -600 0z');
      animation: move 40s infinite linear var(--state);
      cursor: pointer;
      @keyframes move { to { offset-distance: 100%;} }
</css-doodle>
<css-doodle id="lrc">
                  :doodle {                           
                  @size: auto 4em;                           
                  top: 10px;                           
                  --geci: &quot;css-doodle player&quot;; --motion: cover2; --tt: 1s;                  }                  /* 单元格两个伪元素显示lrc歌词 */                  
                  display: grid;                  
                  place-items: center start;                  
                  :before, :after {                           
                  content: var(--geci);                           
                  color:LightGrey; /* 歌词底色 */                           
                  font: bold 2em sans-serif;                           
                  text-shadow: 1px 1px 2px #000;                           
                  white-space: pre;                     
                  }                  
                  :after {                           
                  position: absolute;                           
                  width: 0;                           
                  color: DarkSeaGreen; /* 同步歌词颜色 */                           
                  overflow: hidden;                           
                  animation: var(--motion) var(--tt) linear forwards var(--state);                  
                   }                  
                  @keyframes cover1 { from { width: 0; } to { width: 100%; } }                  
                  @keyframes cover2 { from { width: 0; } to { width: 100%; } }
      
</css-doodle>

<video id="vid" src="https://img.tukuppt.com/video_show/7165162/00/20/67/5f33b039ec172.mp4" autoplay="" loop="" muted=""></video>
<audio id="aud" src="https://www.qqmc.com/mp3/music272772246.mp3" autoplay="autoplay" loop="loop"></audio></div>


<script>
(function() {
        let script = document.createElement('script');
        script.src = 'https://638183.freep.cn/638183/web/api/css-doodle.js';
        document.head.appendChild(script);
        let slip = 0.5, mFlag = true, mKey = 0, clickIdx = 0, progChg = 0, cursors = ['default','pointer','pointer'];
let lrcAr = [
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
       
];
    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);};
        let mState = () => papa.style.setProperty('--state', aud.paused ? 'paused' : 'running');
        let showLrc = (time) => {lrc.style.setProperty('--motion', mFlag ? 'cover1' : 'cover2');lrc.style.setProperty('--geci', '"' + lrcAr + '"');lrc.style.setProperty('--tt', time + 's');mKey += 1;mFlag = !mFlag;};
        aud.addEventListener('play', mState, false);
        aud.addEventListener('pause', mState, false);
        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('--ttmsg1', `'${toMin(aud.currentTime)}'`);mplayer.style.setProperty('--ttmsg2', `'${toMin(aud.duration)}'`);mplayer.style.setProperty('--prog',`${100 * aud.currentTime / aud.duration}%`);});
        mplayer.onclick = () => aud.paused ? aud.play() : aud.pause();
})();
</script>

焱鑫磊 发表于 2023-5-21 20:51

欣赏!{:4_187:}

醉美水芙蓉 发表于 2023-5-21 20:56

焱鑫磊 发表于 2023-5-21 20:51
欣赏!

谢谢朋友支持!

梦缘 发表于 2023-5-21 20:58

欣赏老师的美帖,好美的图,歌很好听,欣赏点赞!{:4_185:}

醉美水芙蓉 发表于 2023-5-21 21:06

梦缘 发表于 2023-5-21 20:58
欣赏老师的美帖,好美的图,歌很好听,欣赏点赞!

谢谢梦缘老师支持!

起个网名好难 发表于 2023-5-21 21:35

欣赏佳作,晚上好!

小文 发表于 2023-5-21 21:37

很美

醉美水芙蓉 发表于 2023-5-21 21:55

起个网名好难 发表于 2023-5-21 21:35
欣赏佳作,晚上好!

谢谢老师支持!

醉美水芙蓉 发表于 2023-5-21 21:55

小文 发表于 2023-5-21 21:37
很美

谢谢朋友支持!

红影 发表于 2023-5-21 22:07

漂亮,欣赏水芙蓉美女好帖。{:4_187:}
播放器经过人物面孔了,最好能微调一下位置。{:4_204:}

醉美水芙蓉 发表于 2023-5-22 06:32

红影 发表于 2023-5-21 22:07
漂亮,欣赏水芙蓉美女好帖。
播放器经过人物面孔了,最好能微调一下位置。

是的,还没有找到位置呢?

红影 发表于 2023-5-22 18:24

醉美水芙蓉 发表于 2023-5-22 06:32
是的,还没有找到位置呢?

在路径的设置里,修改一下数值就好{:4_187:}

醉美水芙蓉 发表于 2023-5-22 20:42

红影 发表于 2023-5-22 18:24
在路径的设置里,修改一下数值就好

谢谢红影美女!

红影 发表于 2023-5-22 21:39

醉美水芙蓉 发表于 2023-5-22 20:42
谢谢红影美女!

不客气啊,问好水芙蓉美女{:4_187:}
页: [1]
查看完整版本: 相伴红尘中