docs: Move blobity to mounted hook

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