chore(docs): cleanup intro

This commit is contained in:
braks
2024-01-29 21:56:44 +01:00
committed by Braks
parent e427e21c28
commit 5d2427ec2e
+5 -10
View File
@@ -56,7 +56,7 @@ const initialEdges = [
style: { strokeWidth: 4, stroke: '#0ea5e9' }, style: { strokeWidth: 4, stroke: '#0ea5e9' },
}, },
] ]
const { getNodes, findNode, setEdges, updateNodeInternals, dimensions, onNodesInitialized } = useVueFlow({ const { getNodes, findNode, setEdges, updateNodeInternals, dimensions, onPaneReady } = useVueFlow({
nodes: [ nodes: [
{ id: 'intro', type: 'box', position: { x: 0, y: 0 } }, { id: 'intro', type: 'box', position: { x: 0, y: 0 } },
{ id: 'examples', type: 'box', position: { x: -50, y: 400 } }, { id: 'examples', type: 'box', position: { x: -50, y: 400 } },
@@ -75,8 +75,7 @@ const { getNodes, findNode, setEdges, updateNodeInternals, dimensions, onNodesIn
const el = templateRef<HTMLDivElement>('el', null) const el = templateRef<HTMLDivElement>('el', null)
const setElements = useDebounceFn( const setElements = useDebounceFn(() => {
() => {
const offsetX = dimensions.value.width / 2 const offsetX = dimensions.value.width / 2
const offsetY = dimensions.value.height / 4 const offsetY = dimensions.value.height / 4
@@ -176,15 +175,11 @@ const setElements = useDebounceFn(
nextTick(() => { nextTick(() => {
updateNodeInternals() updateNodeInternals()
}) })
}, }, 1)
() => (currentBreakpoint.value === null ? 5 : 50),
)
onNodesInitialized(() => {
setElements()
})
onMounted(() => {
useResizeObserver(el, setElements) useResizeObserver(el, setElements)
})
function scrollTo() { function scrollTo() {
const el = document.getElementById('acknowledgement') const el = document.getElementById('acknowledgement')