Commit eaf7c6ea authored by hewenhao's avatar hewenhao

feat: ui

parent 81c693ad
...@@ -165,18 +165,43 @@ export default { ...@@ -165,18 +165,43 @@ export default {
frame() frame()
} else if (len > 3) { } else if (len > 3) {
const type = Math.random() > 0.5
let count = 3 let count = 3
let end = Date.now() + (5 * 1000) let end = Date.now() + (5 * 1000)
const frame = () => { const frame = () => {
if (count < 1) return if (count < 1) return
if (!this.$attrs.visible) return if (!this.$attrs.visible) return
myConfetti({ if (type) {
particleCount: 7, myConfetti({
spread: 160, particleCount: 2,
colors: colors, spread: 160,
angle: 90, colors: pick(colors, 2),
origin: { x: 0.5, y: 1 } 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) { if (Date.now() < end) {
requestAnimationFrame(frame) 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