diff --git a/Yi.Ai.Vue3/.claude/settings.local.json b/Yi.Ai.Vue3/.claude/settings.local.json index 131db92e..13e6d318 100644 --- a/Yi.Ai.Vue3/.claude/settings.local.json +++ b/Yi.Ai.Vue3/.claude/settings.local.json @@ -2,7 +2,8 @@ "permissions": { "allow": [ "Bash(npx vue-tsc --noEmit)", - "Bash(timeout 60 npx vue-tsc:*)" + "Bash(timeout 60 npx vue-tsc:*)", + "Bash(npm run dev:*)" ], "deny": [], "ask": [] diff --git a/Yi.Ai.Vue3/src/components/userPersonalCenter/components/ActivationCode.vue b/Yi.Ai.Vue3/src/components/userPersonalCenter/components/ActivationCode.vue index 88541897..48c2766d 100644 --- a/Yi.Ai.Vue3/src/components/userPersonalCenter/components/ActivationCode.vue +++ b/Yi.Ai.Vue3/src/components/userPersonalCenter/components/ActivationCode.vue @@ -31,33 +31,33 @@ class Particle { this.x = x; this.y = y; this.hue = hue; - + // Explosive physics const angle = Math.random() * Math.PI * 2; - const speed = Math.random() * 15 + 2; + const speed = Math.random() * 15 + 2; this.vx = Math.cos(angle) * speed; this.vy = Math.sin(angle) * speed; - + this.alpha = 1; this.decay = Math.random() * 0.015 + 0.005; this.gravity = 0.05; - this.friction = 0.96; - + this.friction = 0.96; + this.size = Math.random() * 3 + 1; this.brightness = 50; // Standard brightness for white bg visibility (0-100% HSL L value) - this.flicker = Math.random() > 0.5; + this.flicker = Math.random() > 0.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.hue += 0.5; + this.hue += 0.5; } draw(ctx: CanvasRenderingContext2D) { @@ -65,9 +65,9 @@ class Particle { // On white background: // We want high saturation (100%) and medium lightness (50%) to make colors pop against white. // If lightness is too high (like 80-100), it fades into white. - const lightness = this.flicker ? Math.random() * 20 + 40 : this.brightness; + const lightness = this.flicker ? Math.random() * 20 + 40 : this.brightness; ctx.fillStyle = `hsla(${this.hue}, 100%, ${lightness}%, ${this.alpha})`; - + ctx.beginPath(); ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2); ctx.fill(); @@ -93,7 +93,7 @@ class Shockwave { } update() { - this.radius += 15; + this.radius += 15; this.alpha -= 0.05; this.lineWidth -= 0.2; } @@ -132,10 +132,10 @@ function animate() { if (!ctx) return; // Clear with transparent fade for trails on white - // 'destination-out' erases content. + // 'destination-out' erases content. // To leave a trail on a white background (canvas is transparent over white gradient): // We need to gently erase what's there. - + ctx.globalCompositeOperation = 'destination-out'; ctx.fillStyle = 'rgba(255, 255, 255, 0.1)'; // Alpha controls trail length ctx.fillRect(0, 0, canvas.width, canvas.height); @@ -177,14 +177,14 @@ function triggerCelebration() { canvas.width = parent.clientWidth; canvas.height = parent.clientHeight; } - + const cx = canvas.width / 2; const cy = canvas.height / 2; // 1. Initial Mega Explosion triggerShake(); createExplosion(cx, cy, Math.random() * 360); - + // Start loop animate(); @@ -194,15 +194,15 @@ function triggerCelebration() { count++; const rx = cx + (Math.random() - 0.5) * canvas.width * 0.8; const ry = cy + (Math.random() - 0.5) * canvas.height * 0.8; - + createExplosion(rx, ry, Math.random() * 360); - - if (count % 3 === 0) triggerShake(); + + if (count % 3 === 0) triggerShake(); if (count > 25) { clearInterval(timer); } - }, 120); + }, 120); } async function handleRedeem() { @@ -221,7 +221,7 @@ async function handleRedeem() { duration: 3000, showClose: true, }); - activationCode.value = ''; + activationCode.value = ''; } catch (error: any) { // console.error(error); } finally { @@ -238,13 +238,13 @@ onUnmounted(() => {
开启您的专属惊喜权益
@@ -258,9 +258,9 @@ onUnmounted(() => { clearable @keyup.enter="handleRedeem" /> - -