Skip to content

Commit 760fab5

Browse files
committed
πŸŽ‡ fixes #31
1 parent 0694a44 commit 760fab5

File tree

4 files changed

+37
-1
lines changed

4 files changed

+37
-1
lines changed

β€Žpackage-lock.jsonβ€Ž

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žpackage.jsonβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"apollo-utilities": "^1.0.3",
2020
"auth0-helpers": "^0.4.2",
2121
"auth0-js": "^9.6.1",
22+
"canvas-confetti": "0.0.3",
2223
"classnames": "^2.2.5",
2324
"cloudinary-core": "^2.5.0",
2425
"cloudinary-react": "^1.0.6",

β€Žsrc/lib/confetti.jsβ€Ž

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import confetti from 'canvas-confetti'
2+
3+
export const fireworks = () => {
4+
const DURATION_IN_MS = 7 * 1000
5+
const endTime = Date.now() + DURATION_IN_MS
6+
7+
const firework = () => {
8+
confetti({
9+
startVelocity: 20,
10+
spread: 700,
11+
ticks: 200,
12+
origin: {
13+
x: Math.random(),
14+
y: Math.random() - 0.2
15+
}
16+
})
17+
18+
const done = Date.now() > endTime
19+
if (done) {
20+
return
21+
}
22+
23+
setTimeout(firework, Math.random() * 700)
24+
}
25+
26+
firework()
27+
}
28+
29+
window.fireworks = fireworks

β€Žsrc/lib/payment.jsβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import gql from 'graphql-tag'
33

44
import { apollo } from './apollo'
55
import track from './track'
6+
import { fireworks } from './confetti'
67

78
// https://stripe.com/docs/checkout#integration-custom
89
// https://stripe.com/docs/checkout/express
@@ -89,7 +90,7 @@ export const stripeCheckout = (packageInfo, routerHistory) => {
8990
localStorage.setItem('package', packageInfo.key)
9091
localStorage.removeItem('stripe.associatedTokenWithUser')
9192

92-
// todo show spinner
93+
fireworks()
9394

9495
const { key: packageName, licenses: teamLicenses } = packageInfo
9596

0 commit comments

Comments
Β (0)