deal-confetti-burst
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "deal-confetti-burst" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-801ea5540fba5a598c9b3420cd018be6accb615c400aea3fee37d3aaad6a9d30. Verify the upstream source and version against https://skillhub.cn/skills/user_f1b049da/deal-confetti-burst before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
For adding deal‑closing celebration confetti: use when implementing canvas‑confetti or creating deal celebration effects, confetti effects, or success moment celebrations. Ensures a visible burst that never blocks mouse clicks or page interaction.
Introduction source: third_party · user_f1b049da · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Not specified in the source documentation.
- Audience
- Not specified in the source documentation.
- Inputs and outputs
- Not specified in the source documentation.
- Software, accounts and paid services
- ```bash npm i canvas-confetti
- Limits and differences
- Not specified in the source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: deal-confetti-burst
description: >-
Use when adding deal-closing celebration confetti with canvas-confetti, or when
the user asks for 成交礼花、成交庆祝动效、canvas-confetti、礼花特效、成功瞬间庆祝。
Ensures a visible burst that never blocks mouse clicks or page interaction.Deal Confetti Burst(成交礼花)
在「成交 / 签约成功」瞬间用 canvas-confetti 播放礼花。只做视觉效果,绝不拦截鼠标与页面操作。
何时启用
- 成交、回款确认、合同签署成功等正向业务瞬间
- 用户明确要求 canvas-confetti / 礼花 / 庆祝动效
- 要求「有动效,但不影响点击」
硬约束(不可违反)
- 可点击穿透:礼花层必须
pointer-events: none。禁止用全屏遮罩、禁止在 canvas 上绑 click。 - 有效果:成交触发后肉眼可见粒子(建议
particleCount >= 80,持续约 1–3s)。 - 不挡业务:动画期间按钮、表单、弹窗仍可正常点击与输入。
- 只庆祝成功:仅在业务成功回调里触发;失败 / 取消不放礼花。
- 尊重减弱动效:
prefers-reduced-motion: reduce时跳过动画,可只保留 Toast 文案。 - 及时收尾:优先用库自带 canvas;若自建 canvas,动画结束后可移除节点,避免残留占位。
标准工作流
Deal Confetti Burst
- [ ] 安装 canvas-confetti
- [ ] 封装 fireDealConfetti()(含 reduced-motion 判断)
- [ ] 确保 canvas pointer-events: none + 足够高的 z-index
- [ ] 挂到成交成功路径(仅 success)
- [ ] 手动验证:动画中仍能点击页面控件
Step 1:依赖
npm i canvas-confetti
# 类型(可选)
npm i -D @types/canvas-confetti
import confetti from 'canvas-confetti';
Step 2:非阻挡画布(推荐)
默认 confetti() 一般会自建 canvas 并设为不接收指针;仍须显式保证:
function ensureClickThrough(canvas: HTMLCanvasElement): void {
canvas.style.pointerEvents = 'none';
canvas.style.position = 'fixed';
canvas.style.inset = '0';
canvas.style.width = '100%';
canvas.style.height = '100%';
canvas.style.zIndex = '9999'; // 看得见,但点不中
}
自建 canvas 时:
const canvas = document.createElement('canvas');
ensureClickThrough(canvas);
document.body.appendChild(canvas);
const fire = confetti.create(canvas, { resize: true, useWorker: true });
Step 3:成交礼花发射
export function fireDealConfetti(): void {
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) return;
const defaults = { spread: 62, startVelocity: 45, zIndex: 9999 };
// 双翼齐发,观感更像「成交庆祝」
confetti({ ...defaults, particleCount: 90, origin: { x: 0.2, y: 0.7 } });
confetti({ ...defaults, particleCount: 90, origin: { x: 0.8, y: 0.7 } });
}
更强仪式感可用短连发(仍保持 click-through):
export function fireDealConfettiFanfare(): void {
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) return;
const end = Date.now() + 1200;
const frame = () => {
confetti({ particleCount: 36, angle: 60, spread: 55, origin: { x: 0, y: 0.7 }, zIndex: 9999 });
confetti({ particleCount: 36, angle: 120, spread: 55, origin: { x: 1, y: 0.7 }, zIndex: 9999 });
if (Date.now() < end) requestAnimationFrame(frame);
};
frame();
}
Step 4:挂到成交成功
async function onDealSuccess() {
// ...已有成功逻辑、关闭弹窗、刷新列表等
fireDealConfetti();
ElMessage.success('恭喜成交!');
}
禁止:把礼花绑在按钮 mousedown 且无论成败都放;禁止用 el-dialog 全屏 loading 盖住再放礼花导致误判「点不了」。
交互验收(必须做)
- 触发成交成功 → 看到礼花
- 礼花播放中点击下方按钮 / 输入框 → 仍有响应
- 开发者工具看 canvas →
pointer-events: none - 系统开启「减少动态效果」→ 不播粒子、业务提示仍在
反模式
| 禁止 | 原因 |
|---|---|
全屏 div 盖住页面再放礼花 |
挡住点击 |
canvas 未设 pointer-events: none |
点中画布无业务响应 |
z-index 极高且可点的自定义层 |
误吞事件 |
在 setInterval 无限放礼花 |
性能与干扰 |
| 失败接口也放礼花 | 误导用户 |
Agent 交付检查
- [ ] 依赖已接入,成功路径可触发
- [ ] 动效可见
- [ ] 明确不拦截鼠标(代码 + 手工点按验证)
- [ ] reduced-motion 已处理
附加资源
- API 与调参:reference.md
- Vue 模板:templates/vue-deal-burst.md
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 针对成交/签约成功等明确业务场景,实用价值高
- 强调视觉效果与交互不冲突,解决常见实现痛点
Highlights
- 触发词覆盖中英文常见表达,边界清晰
- 明确限定在成功场景,避免误触发
Highlights
- Phase/步骤清晰,包含标准工作流与验收标准
- 提供正反模式对比,文档完整度高
Highlights
- 依赖来源明确,参数合理
- 覆盖reduced-motion异常场景,click-through保障机制完善
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Install or fetch external dependencies
Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.
Mentioned in main document · lines 42, 44
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
```bash npm i canvas-confetti
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.