Видео недоступно для предпросмотра
Смотреть в Telegram
🕷 کد طرح موس عنکبوتی با جاوا اسکریپت:
const spiders = many(2, spawn)
addEventListener("pointermove", (e) => {
spiders.forEach(spider => {
spider.follow(e.clientX, e.clientY)
});
});
requestAnimationFrame(function anim(t) {
if (w !== innerWidth) w = canvas.width = innerWidth;
if (h !== innerHeight) w = canvas.height = innerHeight;
ctx.fillStyle = "#000";
drawCircle(0, 0, w*10);
ctx.fillStyle = ctx.StrokeStyle = "#FFF";
t /= 1000;
spiders.forEach(spider => spider.tick(t))
requestAnimationFrame(anim);
});
#javascript
➿➿➿➿➿➿➿➿
@programmers_gathering
const spiders = many(2, spawn)
addEventListener("pointermove", (e) => {
spiders.forEach(spider => {
spider.follow(e.clientX, e.clientY)
});
});
requestAnimationFrame(function anim(t) {
if (w !== innerWidth) w = canvas.width = innerWidth;
if (h !== innerHeight) w = canvas.height = innerHeight;
ctx.fillStyle = "#000";
drawCircle(0, 0, w*10);
ctx.fillStyle = ctx.StrokeStyle = "#FFF";
t /= 1000;
spiders.forEach(spider => spider.tick(t))
requestAnimationFrame(anim);
});
#javascript
➿➿➿➿➿➿➿➿
@programmers_gathering