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', selector: 'html',
}) })
const blobity = new Blobity({ onMounted(() => {
color: dark.value ? '#ffffff' : '#000000', const blobity = new Blobity({
invert: true, color: dark.value ? '#ffffff' : '#000000',
zIndex: 0, invert: true,
magnetic: false, zIndex: 0,
dotColor: '#10b981', magnetic: false,
radius: 8, dotColor: '#10b981',
}) radius: 8,
})
onBeforeUnmount(() => { onBeforeUnmount(() => {
blobity.destroy() blobity.destroy()
})
}) })
const breakpoints = useBreakpoints(breakpointsTailwind) const breakpoints = useBreakpoints(breakpointsTailwind)