绿叶清舟 发表于 2022-8-13 21:06

谁的眼泪在飞

本帖最后由 绿叶清舟 于 2022-8-13 21:25 编辑 <br /><br /><style>
      #papa { left: -250px; width: 1100px; height: 700px; background: gray url('https://pic.imgdb.cn/item/62f79e5c16f2c2beb165bb02.jpg') no-repeat center/cover; box-shadow: 3px 3px 20px #000; overflow: hidden; position: relative; }
      #disc { position: absolute; width: 40px; height: 40px; left: 10px; bottom: 10px; background: conic-gradient(red,orange,yellow,green,teal,blue,purple); mask: radial-gradient(transparent 4px,red 0); -webkit-mask: radial-gradient(transparent 4px,red 0); border-radius: 50%; cursor: pointer; animation: rot 2s linear infinite; }
      #lrcbox { position: absolute; left: 60px; bottom: 10px;font: bold 22px / 40px sans-serif; color: lightblue; text-shadow: 2px 2px 4px #222; }
      #canv { position: absolute; width: 1100px; height: 550px; left: 0; top: 0; }
      @keyframes rot { to { transform: rotate(360deg); } }
</style>

<div id="papa">
      <span id="lrcbox">Loading ...</span>
      <canvas id="canv" width="1024" height="550"></canvas>
      <span id="disc"></span>
</div>

<script>
let ctx = canv.getContext('2d');
let w = canv.width, h = canv.height;
let num = (m, n) => Math.floor(Math.random() * (n - m + 1) + m);
let stars = new Array(500), meteors = new Array(10);
let aud = new Audio();
let lrcAr = [
      ['0.06','谁的眼泪在飞 - 孟庭苇'],
      
];
aud.loop = true;
aud.autoplay = true;
aud.src = 'http://music.163.com/song/media/outer/url?id=276721.mp3';

disc.style.animationPlayState = aud.paused ? 'paused' : 'running';
disc.onclick = () => aud.paused ? aud.play() : aud.pause();
aud.addEventListener('playing',()=> disc.style.animationPlayState = 'running');
aud.addEventListener('pause',()=> disc.style.animationPlayState = 'paused');
aud.addEventListener('timeupdate',function(){
      let tt = aud.currentTime;
      for(j=0; j<lrcAr.length; j++){
                if(tt >= lrcAr) lrcbox.innerHTML = lrcAr;
      }
});

function Star() {
      this.x = num(3, w - 3);
      this.y = num(3, h -3);
      this.r = num(1,3) * .5;
      this.a = num(1, 10) * 0.1;
      this.speedA = 0.01;
      this.color = 'rgba(153, 204, 255, .6)';
}

Star.prototype = {
      create: function() {
                ctx.beginPath();
                ctx.fillStyle = this.color;
                ctx.arc(this.x, this.y, this.r, 0, Math.PI * 2);
                ctx.fill();
      },
      flash: function() {
                this.a +=this.speedA;
                if(this.a > 1 || this.a < 0) this.speedA = -this.speedA;
                this.color = 'rgba(153, 204, 255, ' + this.a+ ')';
                this.create();
      },
      drop: function() {
                this.x += 2;
                this.y += 2;
                this.a = .45;
                if(this.x > w - 3 || this.y > h - 3) {
                        this.x = num(3, w - 3);
                        this.y = num(3, h -3);
                }
      }
};

for(let x = 0; x < stars.length; x++) {
      let star = new Star();
      stars = star;
}

for(let x = 0; x < meteors.length; x ++) meteors = num(0,stars.length - 1);

(function render() {
      ctx.globalCompositeOperation = 'destination-out';
      ctx.fillStyle = 'rgba(0,0,0,.1)';
      ctx.fillRect(0,0,w,h);
      ctx.globalCompositeOperation = 'lighter';
      for(let x of stars) x.flash();
      for(let x of meteors) stars.drop();
      requestAnimationFrame(render);
})();
</script>


红影 发表于 2022-8-13 21:19

漂亮的流星拖尾效果,这个帖子里的字体好别致{:4_187:}

绿叶清舟 发表于 2022-8-13 21:27

红影 发表于 2022-8-13 21:19
漂亮的流星拖尾效果,这个帖子里的字体好别致

影好,抠了几个,其他的是下载的行楷立体字体的

东篱闲人 发表于 2022-8-13 22:06

师傅哭了。。。{:5_116:}

马黑黑 发表于 2022-8-13 23:04

显然,这是天女的眼泪在飞

红影 发表于 2022-8-13 23:34

绿叶清舟 发表于 2022-8-13 21:27
影好,抠了几个,其他的是下载的行楷立体字体的

这些字体好奇妙{:4_187:}

千羽 发表于 2022-8-14 16:51

歌儿好听,标题做的漂亮{:4_187:}

绿叶清舟 发表于 2022-8-14 19:42

千羽 发表于 2022-8-14 16:51
歌儿好听,标题做的漂亮

谢谢千羽晚上好

绿叶清舟 发表于 2022-8-14 19:45

红影 发表于 2022-8-13 23:34
这些字体好奇妙

就是在以前那个取字的站里下载的了

无尘 发表于 2022-8-14 22:25

马黑黑 发表于 2022-8-13 23:04
显然,这是天女的眼泪在飞

是不是你惹哭的

马黑黑 发表于 2022-8-14 23:05

无尘 发表于 2022-8-14 22:25
是不是你惹哭的

没资格的

红影 发表于 2022-8-15 21:00

绿叶清舟 发表于 2022-8-14 19:45
就是在以前那个取字的站里下载的了

哦哦,要找到喜欢的,要翻半天的吧。

绿叶清舟 发表于 2022-8-16 19:53

红影 发表于 2022-8-15 21:00
哦哦,要找到喜欢的,要翻半天的吧。

找字容易的

醉美水芙蓉 发表于 2022-8-16 19:59

绿叶清舟 发表于 2022-8-16 20:04

醉美水芙蓉 发表于 2022-8-16 19:59
清舟美女做得漂亮!

谢谢芙蓉晚上好

小九 发表于 2022-8-17 19:04

经典好歌! 很好听{:4_187:}

千羽 发表于 2022-8-17 19:47

绿叶清舟 发表于 2022-8-14 19:42
谢谢千羽晚上好

清舟晚上好,不客气哈{:4_173:}

绿叶清舟 发表于 2022-8-17 20:11

小九 发表于 2022-8-17 19:04
经典好歌! 很好听

九好,还是老歌好听了

绿叶清舟 发表于 2022-8-17 20:13

千羽 发表于 2022-8-17 19:47
清舟晚上好,不客气哈

千羽晚上好,就 不客气了{:4_189:}

千羽 发表于 2022-8-17 20:13

绿叶清舟 发表于 2022-8-17 20:13
千羽晚上好,就 不客气了

嗯,喝水哈{:4_173:}
页: [1] 2
查看完整版本: 谁的眼泪在飞