小辣椒 发表于 2022-10-10 20:43

航天人之歌 TO:黑黑


<style>
      #papa { left: -414px; width: 1440px; height: 840px; top:150px; background: #ccc url('https://wj.zp68.com/lxx/yunhua/2022/10/10/GIF.gif') no-repeat center/cover; box-shadow: 3px 3px 20px #000; display: grid; place-items: center; position: relative; z-index: 1; }
      #mplayer { position: absolute; left: 1110px; top: 750px; width: 300px; height: 80px; user-select: none; display: grid; place-items: center; cursor: pointer; }
      #mplayer:hover #btnwrap, #mplayer:hover #prog { transform: translateY(var(--yy)); }      
      #mplayer:hover #btnwrap { background: linear-gradient(to top right, red, green); border-radius: 50%; opacity: .75; }
      #btnwrap, #prog { position: absolute; display: grid; place-items: center;transition: .5s; }
      #btnwrap { --yy: -15px; width: 40px; height: 40px; transform: rotate(45deg); border: 1px solid tan; border-radius: 6px; opacity: .25; }
      #btnplay { width: 20px; height: 20px; background: #eee; clip-path: polygon(0 0, 0% 100%, 100% 50%); }
      #btnpause { width: 2px; height: 20px; border-style: solid; border-width: 0px 4px; border-color: transparent #eee; display: none; }
       #prog { --yy: 20px; width: 240px; height: 16px; border-radius: 10px; background: linear-gradient(90deg, rgba(0,0,0,.45), rgba(255,55,0,5) 100%, transparent 0); border: 1px solid lightgreen; font: normal 14px/16px sans-serif; color: snow; }
       #lrc { position: absolute; top: 150px;left: 150px; font: bold 2.5em sans-serif;font-family:微软雅黑; filter:drop-shadow(#FFFFFF 1px 0 0)drop-shadow(#FFFFFF 0 1px 0)drop-shadow(#FFFFFF -1px 0 0) drop-shadow(#FFFFFF 0 -1px0);color: transparent; letter-spacing: 2px; background: linear-gradient(50deg, #000080, #ff0000, #000000, #00f000) 100% 100% / 200% 200%; background-clip: text; -webkit-background-clip: text; }
       #plane1{position: absolute;left: 0px;top: 0;width: 20px;offset-distance: 0;offset-path: path("M0 10 Q500 180, 720 160 T1430 10");animation: move 8s linear infinite;}
       #plane2 {position: absolute;left: 10px;top: 0;width: 20px;offset-distance: 0;offset-path: path("M0 10 Q500 180, 720 160 T0 10");animation: move 8s linear infinite;}
       #dt1{ position: absolute; width: 81px; height: 55px; top: 282px; left: 736px; }
      #dt2{ position: absolute; width: 200px; height: 104px; top: 500px; left: 1200px; }
       #plane {position: absolute;left: 60px;top: 0;width: 200px;offset-distance: 0;offset-path: path("M0 220 Q800 440, 860 420 T1280 200");animation: move 8s linear infinite;}   
      @keyframes bgMove1 { from { background-position: 0 0; } to { background-position: -100% 0; } }
      @keyframes bgMove2 { from { background-position: 0 0; } to { background-position: -100% 0; } }
      @keyframes move { to { offset-distance: 100%;} }
</style>
<div id="papa">
      
         <img id="plane1" alt="" src="https://wj.zp68.com/lxx/yunhua/2022/10/10/xx.gif" />
      <img id="plane2" alt="" src="https://wj.zp68.com/lxx/yunhua/2022/10/10/xx.gif" />
         <img id="dt1" src="https://wj.zp68.com/lxx/yunhua/2022/10/10/hq.gif" alt="" />
          <img id="dt2" src="https://wj.zp68.com/lxx/yunhua/2022/10/10/jjj.png" alt="" />
          <img id="plane" src="https://wj.zp68.com/lxx/yunhua/2022/10/10/hj.png" alt="" />
   
      <div id="lrc">花潮lrc在线</div>
      <div id="mplayer">
                <div id="btnwrap"><span id="btnplay"></span><span id="btnpause"></span></div>
                <div id="prog">00:00 | 00:00</div>
      </div>
</div>
<script>
let lrcAr = [
                ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ];
let mKey = 0, mSeek = false, mFlag = true;
let aud = new Audio();

aud.src = 'https://wj.zp68.com/lxx/yunhua/2022/10/10/htrzg.mp3';
aud.autoplay = true;
aud.loop = true;
btnwrap.onclick = () => aud.paused ? aud.play() : aud.pause();
prog.onclick = (e) => aud.currentTime = aud.duration * e.offsetX / prog.offsetWidth;
aud.addEventListener('pause', () => mState());
aud.addEventListener('play', () => mState());
aud.addEventListener('seeked', () => calcKey());

aud.addEventListener('timeupdate', () => {
         prog.style.background= 'linear-gradient(90deg,rgba(0,0,0,.45), rgba(255,55,0,5) ' + aud.currentTime / aud.duration * 100 + '%, transparent 0)';
      prog.innerText = toMin(aud.currentTime) + ' | ' + toMin(aud.duration);
      for(j=0; j<lrcAr.length; j++) {
                if(aud.currentTime >= lrcAr) {
                        if(mKey === j) showLrc(lrcAr);
                        else continue;
                }
      }
});

let mState = () => aud.paused ? (btnplay.style.display = 'block', btnpause.style.display = 'none', lrc.style.animationPlayState = 'paused') : (btnplay.style.display = 'none', btnpause.style.display = 'block', lrc.style.animationPlayState = 'running');

let showLrc = (time) => {
      lrc.style.animation = (mFlag ? 'bgMove1 ' : 'bgMove2 ') + time + 's linear forwards';
      lrc.innerHTML = lrcAr;
      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;
      let mtime = lrcAr - (aud.currentTime - lrcAr);
      showLrc(mtime);
}

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;
}
</script>
<br><br><br><br><br><br><br><br><br><br><br><br>

小辣椒 发表于 2022-10-10 20:44

@马黑黑

黑黑这个火箭的路径没有弄好,做在图图上了

小辣椒 发表于 2022-10-10 20:44

@走过岁月

谢谢岁月的粒子效果,做在了背景里面了

No Me Hables De Ese Amor
https://www.huachaowang.com/forum.php?mod=viewthread&tid=63696&fromuid=4275
(出处: 花潮论坛)


红影 发表于 2022-10-10 20:54

这个粒子用得好,在这个背景下特别大气,那个飞行的卫星也好看。这个帖子真棒。黑黑收礼开心{:4_187:}

加林森 发表于 2022-10-10 20:54

厉害厉害。制作得太漂亮了。赞!{:4_199:}

红影 发表于 2022-10-10 20:55

小辣椒 发表于 2022-10-10 20:44
@马黑黑

黑黑这个火箭的路径没有弄好,做在图图上了

这个飞行路径挺好啊,动态的红旗也特别棒{:4_187:}

千羽 发表于 2022-10-10 21:07

满满的正能量啊,鼓舞人心{:4_187:}

千羽 发表于 2022-10-10 21:10

那粒子效果引用的真好,还有飘扬的五星红旗,小辣椒太棒了{:4_199:}{:4_187:}

相约爱晚亭 发表于 2022-10-10 21:37

粒子效果做得好,帖子有气势!

马黑黑 发表于 2022-10-10 21:49

小辣椒 发表于 2022-10-10 20:44
@马黑黑

黑黑这个火箭的路径没有弄好,做在图图上了
是去访问一下国旗,然后继续前进。挺好的。

醉美水芙蓉 发表于 2022-10-10 21:53

马黑黑 发表于 2022-10-11 07:41

本帖最后由 马黑黑 于 2022-10-11 07:43 编辑

offset-path: path("M0 220 Q800 440, 860 420 T1280 200")

这是二次赛贝尔曲线。曲线上共三个节点:

① M0 220 :移动到 {0,220},即曲线的起点

② QQ800 440, 860 420 :红色部分是曲线的第二个节点,它与节点 ① 所构成的曲线段样式,受到 Q800 440 线外控制点的控制,这个点就是拉扯 点① 到 点② 所构成的直线为曲线的发力点。注意,蓝色部分是错误的,是 Q800 440,而不是 QQ800 440,都打成QQ号了这个。

③ T1280 200,曲线的最后一个节点 {1280,200},T表示与前面的那段曲线结合起来、平滑过渡。

走过岁月 发表于 2022-10-11 12:29

欣赏小辣椒精彩

小辣椒 发表于 2022-10-11 16:00

红影 发表于 2022-10-10 20:54
这个粒子用得好,在这个背景下特别大气,那个飞行的卫星也好看。这个帖子真棒。黑黑收礼开心

哈哈~~~亲爱的,这个路径效果我一直瞎蒙的

小辣椒 发表于 2022-10-11 16:01

加林森 发表于 2022-10-10 20:54
厉害厉害。制作得太漂亮了。赞!

队长好~~~谢谢欣赏{:4_187:}

小辣椒 发表于 2022-10-11 16:02

红影 发表于 2022-10-10 20:55
这个飞行路径挺好啊,动态的红旗也特别棒

路径我是改了几次,都是蒙了看看效果就定,自己不会设置

小辣椒 发表于 2022-10-11 16:02

千羽 发表于 2022-10-10 21:07
满满的正能量啊,鼓舞人心

啊~~~千羽美女换衣服了,太漂亮了{:4_178:}

小辣椒 发表于 2022-10-11 16:03

相约爱晚亭 发表于 2022-10-10 21:37
粒子效果做得好,帖子有气势!

粒子效果是岁月的原创,我拿来制作了背景

小辣椒 发表于 2022-10-11 16:04

马黑黑 发表于 2022-10-10 21:49
是去访问一下国旗,然后继续前进。挺好的。

哈哈~~我就瞎捣鼓{:4_189:}

小辣椒 发表于 2022-10-11 16:04

醉美水芙蓉 发表于 2022-10-10 21:53
很牛的贴子!谢谢小辣椒分享!

问好水芙蓉,谢谢欣赏~{:4_187:}
页: [1] 2
查看完整版本: 航天人之歌 TO:黑黑