Commit eaf7c6ea authored by hewenhao's avatar hewenhao

feat: ui

parent 81c693ad
......@@ -165,18 +165,43 @@ export default {
frame()
} else if (len > 3) {
const type = Math.random() > 0.5
let count = 3
let end = Date.now() + (5 * 1000)
const frame = () => {
if (count < 1) return
if (!this.$attrs.visible) return
myConfetti({
particleCount: 7,
spread: 160,
colors: colors,
angle: 90,
origin: { x: 0.5, y: 1 }
})
if (type) {
myConfetti({
particleCount: 2,
spread: 160,
colors: pick(colors, 2),
angle: 315,
origin: { x: 0, y: 0 }
})
myConfetti({
particleCount: 2,
spread: 160,
colors: pick(colors, 2),
angle: 225,
origin: { x: 1, y: 0 }
})
} else {
myConfetti({
particleCount: 2,
spread: 80,
colors: pick(colors, 2),
angle: 135,
origin: { x: 1, y: 1 }
})
myConfetti({
particleCount: 2,
spread: 80,
colors: pick(colors, 2),
angle: 45,
origin: { x: 0, y: 1 }
})
}
if (Date.now() < end) {
requestAnimationFrame(frame)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment