switch partyjs to canvas-confetti.
This commit is contained in:
12
package-lock.json
generated
12
package-lock.json
generated
@@ -14,6 +14,7 @@
|
||||
"@wangeditor/editor": "^5.1.23",
|
||||
"@wangeditor/editor-for-vue": "^5.1.12",
|
||||
"axios": "1.6.2",
|
||||
"canvas-confetti": "^1.9.2",
|
||||
"chart.js": "^4.4.0",
|
||||
"codemirror": "^6.0.1",
|
||||
"copy-text-to-clipboard": "^3.2.0",
|
||||
@@ -21,7 +22,6 @@
|
||||
"highlight.js": "^11.9.0",
|
||||
"naive-ui": "^2.35.0",
|
||||
"normalize.css": "^8.0.1",
|
||||
"party-js": "^2.2.0",
|
||||
"pinia": "^2.1.7",
|
||||
"vue": "^3.3.8",
|
||||
"vue-chartjs": "^5.2.0",
|
||||
@@ -3531,6 +3531,11 @@
|
||||
"integrity": "sha512-na2WUmOxnwIZtwnFI2CZ/3er0wdNzU7hN+cPYz/z2ajHThnkWjNBOpEPP4n+4r2WPM847JaMotaJE3bnfzjyKw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/canvas-confetti": {
|
||||
"version": "1.9.2",
|
||||
"resolved": "https://registry.npmmirror.com/canvas-confetti/-/canvas-confetti-1.9.2.tgz",
|
||||
"integrity": "sha512-6Xi7aHHzKwxZsem4mCKoqP6YwUG3HamaHHAlz1hTNQPCqXhARFpSXnkC9TWlahHY5CG6hSL5XexNjxK8irVErg=="
|
||||
},
|
||||
"node_modules/chalk": {
|
||||
"version": "2.4.2",
|
||||
"resolved": "https://registry.npmmirror.com/chalk/-/chalk-2.4.2.tgz",
|
||||
@@ -5003,11 +5008,6 @@
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/party-js": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/party-js/-/party-js-2.2.0.tgz",
|
||||
"integrity": "sha512-50hGuALCpvDTrQLPQ1fgUgxKIWAH28ShVkmeK/3zhO0YJyCqkhrZhQEkWPxDYLvbFJ7YAXyROmFEu35gKpZLtQ=="
|
||||
},
|
||||
"node_modules/path-browserify": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/path-browserify/-/path-browserify-1.0.1.tgz",
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
"@wangeditor/editor": "^5.1.23",
|
||||
"@wangeditor/editor-for-vue": "^5.1.12",
|
||||
"axios": "1.6.2",
|
||||
"canvas-confetti": "^1.9.2",
|
||||
"chart.js": "^4.4.0",
|
||||
"codemirror": "^6.0.1",
|
||||
"copy-text-to-clipboard": "^3.2.0",
|
||||
@@ -22,7 +23,6 @@
|
||||
"highlight.js": "^11.9.0",
|
||||
"naive-ui": "^2.35.0",
|
||||
"normalize.css": "^8.0.1",
|
||||
"party-js": "^2.2.0",
|
||||
"pinia": "^2.1.7",
|
||||
"vue": "^3.3.8",
|
||||
"vue-chartjs": "^5.2.0",
|
||||
@@ -40,8 +40,8 @@
|
||||
"typescript": "^5.3.2",
|
||||
"unplugin-auto-import": "^0.16.7",
|
||||
"unplugin-vue-components": "^0.25.2",
|
||||
"vite": "^4.5.0",
|
||||
"unplugin-vue-markdown": "^0.25.2",
|
||||
"vite": "^4.5.0",
|
||||
"vue-tsc": "^1.8.22"
|
||||
}
|
||||
}
|
||||
|
||||
4
src/components.d.ts
vendored
4
src/components.d.ts
vendored
@@ -17,7 +17,7 @@ declare module 'vue' {
|
||||
NCollapseTransition: typeof import('naive-ui')['NCollapseTransition']
|
||||
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
|
||||
NDataTable: typeof import('naive-ui')['NDataTable']
|
||||
NDatePicker: (typeof import("naive-ui"))["NDatePicker"]
|
||||
NDatePicker: typeof import('naive-ui')['NDatePicker']
|
||||
NDescriptions: typeof import('naive-ui')['NDescriptions']
|
||||
NDescriptionsItem: typeof import('naive-ui')['NDescriptionsItem']
|
||||
NDropdown: typeof import('naive-ui')['NDropdown']
|
||||
@@ -25,7 +25,7 @@ declare module 'vue' {
|
||||
NEmpty: typeof import('naive-ui')['NEmpty']
|
||||
NForm: typeof import('naive-ui')['NForm']
|
||||
NFormItem: typeof import('naive-ui')['NFormItem']
|
||||
NFormItemGi: (typeof import("naive-ui"))["NFormItemGi"]
|
||||
NFormItemGi: typeof import('naive-ui')['NFormItemGi']
|
||||
NGi: typeof import('naive-ui')['NGi']
|
||||
NGradientText: typeof import('naive-ui')['NGradientText']
|
||||
NGrid: typeof import('naive-ui')['NGrid']
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<script setup lang="ts">
|
||||
import party from "party-js"
|
||||
import { code } from "oj/composables/code"
|
||||
import { problem } from "oj/composables/problem"
|
||||
import { isDesktop } from "~/shared/composables/breakpoints"
|
||||
@@ -12,6 +11,8 @@ import { useUserStore } from "~/shared/store/user"
|
||||
import Loading from "~/shared/icons/Loading.vue"
|
||||
import Bulb from "~/shared/icons/Bulb.vue"
|
||||
import Play from "~/shared/icons/Play.vue"
|
||||
// @ts-ignore
|
||||
import confetti from "canvas-confetti"
|
||||
|
||||
const userStore = useUserStore()
|
||||
const route = useRoute()
|
||||
@@ -188,9 +189,12 @@ watch(
|
||||
() => submission?.value?.result,
|
||||
(result) => {
|
||||
if (result === SubmissionStatus.accepted) {
|
||||
party.confetti(document.body, {
|
||||
count: party.variation.range(200, 400),
|
||||
size: party.variation.skew(2, 0.3),
|
||||
confetti({
|
||||
particleCount: 300,
|
||||
startVelocity: 30,
|
||||
gravity: 0.5,
|
||||
spread: 350,
|
||||
origin: { x: 0.5, y: 0.4 },
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
@@ -20,7 +20,7 @@ export default defineConfig({
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks: {
|
||||
fancy: ["highlight.js", "party-js"],
|
||||
fancy: ["highlight.js", "canvas-confetti"],
|
||||
chart: ["vue-chartjs", "chart.js"],
|
||||
editor: ["@wangeditor/editor"],
|
||||
codemirror: [
|
||||
|
||||
Reference in New Issue
Block a user