docs: Move blobity to mounted hook

This commit is contained in:
Braks
2022-04-04 21:42:48 +02:00
parent 94dd8c8dd5
commit be24731aa1
+12 -10
View File
@@ -8,17 +8,19 @@ const dark = useDark({
selector: 'html',
})
const blobity = new Blobity({
color: dark.value ? '#ffffff' : '#000000',
invert: true,
zIndex: 0,
magnetic: false,
dotColor: '#10b981',
radius: 8,
})
onMounted(() => {
const blobity = new Blobity({
color: dark.value ? '#ffffff' : '#000000',
invert: true,
zIndex: 0,
magnetic: false,
dotColor: '#10b981',
radius: 8,
})
onBeforeUnmount(() => {
blobity.destroy()
onBeforeUnmount(() => {
blobity.destroy()
})
})
const breakpoints = useBreakpoints(breakpointsTailwind)