ฏ้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้
[最短路复习]555(https://www.luogu.com.cn/paste/q6pqlkx1)
tas
(super)极域
MitchellZhong2 https://www.luogu.com.cn/team/108860#main
复制链接到浏览器打开 https://online-video-cutter.com/cn/
https://www.bilibili.com/video/BV1LhXrYEEhU/?spm_id_from=333.337.search-card.all.click
// ==UserScript==
// @name 點擊煙花 - 按住滑鼠持續發射(間隔0.2秒 + 隨滑鼠移動)
// @namespace http://tampermonkey.net/
// @version 2.5
// @description 按住滑鼠左鍵持續發射煙花(0.2秒間隔),發射點隨滑鼠移動,爆炸範圍大、粒子下落緩、粒子50~80
// @match *://*/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
const canvas = document.createElement('canvas');
canvas.style.position = 'fixed';
canvas.style.inset = '0';
canvas.style.pointerEvents = 'none';
canvas.style.zIndex = '999999';
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
document.body.appendChild(canvas);
const ctx = canvas.getContext('2d');
window.addEventListener('resize', () => {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
});
const particles = [];
const rockets = [];
class Particle {
constructor(x, y, vx, vy, color, baseHue) {
this.x = x;
this.y = y;
this.vx = vx;
this.vy = vy;
this.baseHue = baseHue;
const hue = baseHue + (Math.random() - 0.5) * 40;
this.color = `hsl(${hue % 360}, 85%, ${60 + Math.random() * 25}%)`;
this.alpha = 1;
this.baseSize = 3.8 + Math.random() * 1.6;
this.gravity = 0.00 + Math.random() * 0.05;
this.friction = 0.975;
this.decay = 0.008 + Math.random() * 0.006;
this.shapeType = Math.floor(Math.random() * 4);
this.rotation = Math.random() * Math.PI * 2;
this.history = [];
this.maxHistory = 8 + Math.floor(Math.random() * 5);
}
update() {
this.vx *= this.friction;
this.vy *= this.friction;
this.vy += this.gravity;
this.x += this.vx;
this.y += this.vy;
this.alpha -= this.decay;
this.rotation += 0.04;
if (this.alpha > 0.1) {
this.history.push({x: this.x, y: this.y});
if (this.history.length > this.maxHistory) {
this.history.shift();
}
}
}
draw() {
if (this.alpha < 0.03) return;
for (let i = 0; i < this.history.length; i++) {
const pos = this.history[i];
const trailAlpha = (i + 1) / this.history.length * this.alpha * 0.6;
ctx.globalAlpha = trailAlpha;
ctx.fillStyle = this.color;
const trailSize = this.baseSize * (0.3 + i / this.history.length * 0.5);
ctx.beginPath();
ctx.arc(pos.x, pos.y, trailSize, 0, Math.PI * 2);
ctx.fill();
}
ctx.globalAlpha = this.alpha;
ctx.fillStyle = this.color;
ctx.strokeStyle = this.color;
const size = this.baseSize * (0.5 + this.alpha * 0.6);
ctx.save();
ctx.translate(this.x, this.y);
ctx.rotate(this.rotation);
switch (this.shapeType) {
case 0:
ctx.beginPath();
ctx.arc(0, 0, size, 0, Math.PI * 2);
ctx.fill();
break;
case 1:
ctx.fillRect(-size, -size, size * 2, size * 2);
break;
case 2:
ctx.lineWidth = size * 0.8;
ctx.beginPath();
ctx.moveTo(-size * 1.2, 0);
ctx.lineTo(size * 1.2, 0);
ctx.stroke();
break;
case 3:
ctx.lineWidth = size * 0.6;
ctx.beginPath();
ctx.moveTo(-size, 0);
ctx.lineTo(size, 0);
ctx.moveTo(0, -size);
ctx.lineTo(0, size);
ctx.stroke();
break;
}
ctx.restore();
}
}
class Rocket {
constructor(x, y) {
this.x = x;
this.y = y;
this.history = [];
this.maxHistory = 18;
const angle = (Math.random() - 0.5) * 0.52;
this.speed = 7 + Math.random() * 10;
this.vx = Math.sin(angle) * this.speed;
this.vy = -Math.cos(angle) * this.speed;
this.baseHue = Math.random() * 360;
this.color = `hsl(${this.baseHue}, 90%, 70%)`;
this.alive = true;
}
update() {
if (!this.alive) return;
this.x += this.vx;
this.y += this.vy;
this.vy += 0.14;
this.history.push({x: this.x, y: this.y});
if (this.history.length > this.maxHistory) {
this.history.shift();
}
if ((this.vy >= 0.02) || (this.y < 120 && Math.random() * 100<=10)) {
this.explode();
this.alive = false;
}
}
explode() {
// 粒子數調到50~80
const count = 60 + Math.floor(Math.random() * 31);
for (let i = 0; i < count; i++) {
const a = Math.random() * Math.PI * 2;
const spd = 1.5 + Math.random() * 6.5; // 增加初始速度,讓粒子炸得更遠
const vx = Math.cos(a) * spd;
const vy = Math.sin(a) * spd - 1.8;
particles.push(new Particle(this.x, this.y, vx, vy, null, this.baseHue));
}
}
draw() {
if (!this.alive) return;
for (let i = 0; i < this.history.length; i++) {
const pos = this.history[i];
const alpha = (i + 1) / this.history.length;
ctx.globalAlpha = 0.15 + alpha * 0.55;
ctx.fillStyle = this.color;
ctx.beginPath();
ctx.arc(pos.x, pos.y, 2.5 + alpha * 2, 0, Math.PI * 2);
ctx.fill();
}
ctx.globalAlpha = 1;
ctx.fillStyle = '#ffffff';
ctx.beginPath();
ctx.arc(this.x, this.y, 5, 0, Math.PI * 2);
ctx.fill();
}
}
// 按住持續發射功能
let isMouseDown = false;
let launchInterval = null;
let currentX = 0; // 即時滑鼠位置
let currentY = 0;
// 監聽滑鼠移動,即時更新位置
document.addEventListener('mousemove', e => {
currentX = e.clientX;
currentY = e.clientY;
});
document.addEventListener('mousedown', e => {
if (e.button === 0) { // 左鍵
isMouseDown = true;
// 立即發射第一個(使用即時位置)
rockets.push(new Rocket(currentX, currentY));
// 持續發射,每0.2秒一個
launchInterval = setInterval(() => {
if (isMouseDown) {
rockets.push(new Rocket(currentX, currentY));
}
}, 100); // 0.2秒 = 200ms
}
});
document.addEventListener('mouseup', e => {
if (e.button === 0) {
isMouseDown = false;
clearInterval(launchInterval);
}
});
document.addEventListener('mouseleave', () => {
isMouseDown = false;
clearInterval(launchInterval);
});
function animate() {
ctx.clearRect(0, 0, canvas.width, canvas.height);
for (let i = rockets.length - 1; i >= 0; i--) {
const r = rockets[i];
r.update();
r.draw();
if (!r.alive) rockets.splice(i, 1);
}
for (let i = particles.length - 1; i >= 0; i--) {
const p = particles[i];
p.update();
p.draw();
if (p.alpha <= 0.02) particles.splice(i, 1);
}
requestAnimationFrame(animate);
}
animate();
})();https://mihoyo.wiki/Phigros/whilePlaying/index.html?play=Anomaly&l=ez&c=official
https://c.wss.ink/f/jiaa5sy41et 复制链接到浏览器打开
https://vscode.dev/tunnel/d26/d:/ZZMMXX