醉美水芙蓉 发表于 2023-5-12 23:51

你是落在我心里的一抹红

本帖最后由 醉美水芙蓉 于 2023-5-12 22:40 编辑 <br /><br /><style>
#lrc { --motion: cover1; --tt: 1s; --state: paused; position: absolute; bottom: 100px; left:30%; font: bold 2.6em sans-serif; color:
#FAEFC0; -webkit-background-clip: text; filter: drop-shadow(1px 1px 2px hsla(0,100%,0%,.85)); width:80%;}
#lrc::before { position: absolute; content: attr(data-lrc); width:100%; height: 100%; color: transparent; overflow: hidden; white-space: nowrap; background: linear-gradient(180deg,hsla(0,100%,50%,.75),hsla(60,100%,50%,.65)); filter: inherit; -webkit-background-clip: text; animation: var(--motion) var(--tt) linear forwards; animation-play-state: 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 circle { from { transform: rotate(0) translate(50px); } to { transform: rotate(360deg) translate(50px); } }

@keyframes yao {
      from{transform: perspective(800px) rotatex(45deg); }
      to { transform: perspective(800px) rotatex(-45deg); }
}

.tit {
        position:absolute;width:800px;height: 30px;top:50px;LEFT: 50px;z-index: 100;text-align:left;
        filter: drop-shadow(-1px 1px 1px #ffffff)drop-shadow(0px -1px 1px #ffffff)drop-shadow(0px 0px 1px #ffffff)drop-shadow(0px 0px 1px #ffffff)drop-shadow(0px 0px 1px #ffffff);
        animation: yao 1.0s linear infinite alternate; font-family:微软简中圆;font-weight: bold;color: #f46ff6;transform-origin: top;margin: auto;}
#tit:hover { color: green; }

#papa {
      margin: auto;
      top: 0px;
      left: -30px;
      width: 1120px;
      height:868px;
      background: tan url('https://pic2.imgdb.cn/item/645e41110d2dde5777da6ad1.jpg');
      box-shadow: 0 0 8px #000;
      display: grid;
      place-items: center;
      position: relative;margin:100px 0 32px -200px;
                box-shadow:0px 0px 1px 2px #045768, 0px 0px 0px 8px #99e5f5,0px 0px 5px 15px #045768;
                overflow:hidden;border-radius:1%;
}
</style>


<div id="papa">
<css-doodle id="mplayer">
:doodle {
      @grid: 2 / 550px 100px;
      position: absolute;
      color: var(--color);
      bottom: 0;
      --prog: 0%;
      --size: 60px;
      --ttmsg1: '00:00';
      --ttmsg2: '00:00';
      --color: #F9F900;
      --state: paused;
                z-index:99;
}
@nth(1) {@place: 35% 100%;:after { content: var(--ttmsg1); }}
@nth(2) {@size: var(--size);@shape: windmill;@place: 50% 35%;background: var(--color);animation: rot 6s infinite linear var(--state);}
@nth(3) {@place: 65% 100%;:after { content: var(--ttmsg2); }}
@nth(4) {@place: 50% 80%;@size: 100% 2px;background: #bbb;display: grid;place-items: center start;:before {content: '';width: var(--prog);height: 100%;background: var(--color);}}
@keyframes rot { to { transform: rotate(1turn); } }
</css-doodle>
<css-doodle grid="16" id="fFloat">
        :doodle {
                @size: 1120px 868px;
                --state:paused;
        }
        position: absolute;
        left: -10%;
        top: @r(100)%;
        :after {
                position: absolute;
                content: '@p(✿,❁,❀,&#128174;,&#127802;)';
                color: snow;
                font-size: @r(10, 40)px;
        }
        animation: fall @r(6,20)s @r(-6, 6)s infinite var(--state);
        @keyframes fall {
                0% { left: -20%; transform: rotate(0deg); }
                100% {left: 140%; transform: rotate(@p(360, 720)deg); }
        }
</css-doodle>


<img src="https://z3.ax1x.com/2021/08/26/hujGMd.gif" style="z-index:88;position:absolute; top: 400px;right:50px;">





<!-- div id="hu" -->
<!--div id="baiBox"-->
<div class="tit">
<span style="color:#fb52f9;font-size:32px;">《 你是落在我心里的一抹红 》</span>
<span style="color:#3d46f7;font-size:20px;">   - 王馨</span></div>




       <!--div id="mama"><span id="box"></span></div-->

      <span id="btnplay"></span> <!--播放按钮代码-->
      <span id="lrc" data-lrc="花潮论坛lrc在线">花潮论坛lrc在线</span>
</div>
<audio id="aud" src="https://www.qqmc.com/mp3/music275950026.mp3" autoplay= "autoplay"></audio>

<script>

//let stepX = 1, stepY = 1, moveX= 0, moveY = 0;
(function() {
      let mKey = 0, mFlag = true, slip = 0.1;
let lrcAr = [
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
       
];
      aud.loop = false;
      btnplay.onclick = () => aud.paused ? aud.play() : aud.pause();
      aud.addEventListener('pause', () => mState());
      aud.addEventListener('play', () => mState());
      aud.addEventListener('ended', () => { mKey = 0; aud.play(); });
      aud.addEventListener('timeupdate', () => {
                for (j = 0; j < lrcAr.length; j++) {
                        if (aud.currentTime - slip >= lrcAr) {
                              if (mKey === j) showLrc(lrcAr);
                              else continue;
                        }
                }
      });
      //let mState = () => aud.paused ? (btnplay.style.animationPlayState = 'paused', lrc.style.setProperty('--state', 'paused')) : (btnplay.style.animationPlayState = 'running', lrc.style.setProperty('--state', 'running'));
      let showLrc = (time) => {
                let name = mFlag ? 'cover1' : 'cover2';
                lrc.innerHTML = lrc.dataset.lrc = lrcAr;
                lrc.style.setProperty('--motion', name);
                lrc.style.setProperty('--tt', time + 's');
                lrc.style.setProperty('--state', 'running');
                mKey += 1;
                mFlag = !mFlag;
      };
})();
(function() {
        let clickIdx = 0, progChg = 0, cursors = ['default','pointer','pointer'];
        let script = document.createElement('script');
        script.src = 'https://unpkg.com/css-doodle@0.34.9/css-doodle.min.js';
        document.head.appendChild(script);
        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'), lrc.style.setProperty('--state', 'paused'), fFloat.style.setProperty('--state', 'paused') ) :
                                                                        (mplayer.style.setProperty('--state', 'running'), lrc.style.setProperty('--state', 'running'),fFloat.style.setProperty('--state', 'running'));
                                                                       
        aud.addEventListener('play', mState, false);
        aud.addEventListener('pause', mState, false);
        aud.addEventListener('ended', () => { mKey = 0; aud.play(); });
        aud.addEventListener('timeupdate', () => {
                mplayer.style.setProperty('--ttmsg1', `'${toMin(aud.currentTime)}'`);
                mplayer.style.setProperty('--ttmsg2', `'${toMin(aud.duration-aud.currentTime)}'`);
                mplayer.style.setProperty('--prog',`${100 * aud.currentTime / aud.duration}%`)
   });

        mplayer.onclick = () => {if(clickIdx === 1) aud.paused ? aud.play() : aud.pause();if(clickIdx === 2) aud.currentTime = progChg;}
        mplayer.onmousemove = (e) => {let size = parseInt(window.getComputedStyle(mplayer).getPropertyValue('--size')), ww = mplayer.offsetWidth, hh = mplayer.offsetHeight;clickIdx = e.offsetY > hh/1.5 ? 2 : (e.offsetX > (ww - size)/2 && e.offsetX < (ww + size)/2 && e.offsetY < hh/1.5 ? 1 : 0);mplayer.style.cursor = cursors;if(clickIdx > 1) progChg = aud.duration * e.offsetX / ww;}

})();

</script>

小文 发表于 2023-5-13 07:50

厉害,欣赏得很{:4_187:}

红影 发表于 2023-5-13 09:29

这个用的是起个网名好难老师的代码吧,这个代码里不知怎样摆动字有点斜了,他的帖子里本来就想跟他说的{:4_173:}

红影 发表于 2023-5-13 09:30

水芙蓉的背景弄得漂亮,欣赏好帖{:4_187:}

起个网名好难 发表于 2023-5-13 09:45

红影 发表于 2023-5-13 09:29
这个用的是起个网名好难老师的代码吧,这个代码里不知怎样摆动字有点斜了,他的帖子里本来就想跟他说的{:4_ ...

年纪大了眼神不行,原来摆动是-30 ~ 30度摆动,改为-45 ~ 45度 {:5_106:}

起个网名好难 发表于 2023-5-13 09:46

佳作欣赏!

红影 发表于 2023-5-13 10:21

起个网名好难 发表于 2023-5-13 09:45
年纪大了眼神不行,原来摆动是-30 ~ 30度摆动,改为-45 ~ 45度

有可能加大点景深来适应就好了吧{:4_204:}

南无月 发表于 2023-5-13 10:48

漂亮,欣赏美贴{:4_199:}{:4_187:}

梦油 发表于 2023-5-13 10:51

小文 发表于 2023-5-13 07:50
厉害,欣赏得很

怎一个美字了得!醉美,醉美!

起个网名好难 发表于 2023-5-13 11:11

红影 发表于 2023-5-13 10:21
有可能加大点景深来适应就好了吧

不理解景深这个概念

醉美水芙蓉 发表于 2023-5-13 11:46

小文 发表于 2023-5-13 07:50
厉害,欣赏得很

谢谢朋友支持!

醉美水芙蓉 发表于 2023-5-13 11:47

红影 发表于 2023-5-13 09:29
这个用的是起个网名好难老师的代码吧,这个代码里不知怎样摆动字有点斜了,他的帖子里本来就想跟他说的{:4_ ...

谢谢红影美女点评!

醉美水芙蓉 发表于 2023-5-13 11:48

起个网名好难 发表于 2023-5-13 09:45
年纪大了眼神不行,原来摆动是-30 ~ 30度摆动,改为-45 ~ 45度

谢谢老师的代码!

醉美水芙蓉 发表于 2023-5-13 11:49

南无月 发表于 2023-5-13 10:48
漂亮,欣赏美贴

谢谢朋友支持!

醉美水芙蓉 发表于 2023-5-13 11:49

梦油 发表于 2023-5-13 10:51
怎一个美字了得!醉美,醉美!

谢谢梦油老师欣赏支持!

起个网名好难 发表于 2023-5-13 11:55

醉美水芙蓉 发表于 2023-5-13 11:48
谢谢老师的代码!

客气了, 都一样的。

梦油 发表于 2023-5-13 14:18

醉美水芙蓉 发表于 2023-5-13 11:49
谢谢梦油老师欣赏支持!

醉美!醉美!

红影 发表于 2023-5-13 17:21

起个网名好难 发表于 2023-5-13 11:11
不理解景深这个概念

我也不是很懂,只是感觉而已{:4_173:}

红影 发表于 2023-5-13 17:22

醉美水芙蓉 发表于 2023-5-13 11:47
谢谢红影美女点评!

客气了啊,问好水芙蓉美女{:4_187:}

起个网名好难 发表于 2023-5-13 18:32

红影 发表于 2023-5-13 17:21
我也不是很懂,只是感觉而已

不清楚它的物理意义。
页: [1] 2
查看完整版本: 你是落在我心里的一抹红