diff --git a/apps/frontend/src/pages/servers/index.vue b/apps/frontend/src/pages/servers/index.vue index 207fc3230..522a326c8 100644 --- a/apps/frontend/src/pages/servers/index.vue +++ b/apps/frontend/src/pages/servers/index.vue @@ -403,7 +403,7 @@

Frequently Asked Questions

-
+
@@ -416,7 +416,7 @@

-
+
@@ -430,7 +430,7 @@

-
+
@@ -444,7 +444,7 @@

-
+
@@ -457,7 +457,7 @@

-
+
@@ -890,6 +890,22 @@ const isAtCapacity = computed( () => isSmallAtCapacity.value && isMediumAtCapacity.value && isLargeAtCapacity.value, ); +const scrollToFaq = () => { + if (route.hash) { + // where pyro-hash === route.hash + const faq = document.querySelector(`[pyro-hash="${route.hash.slice(1)}"]`); + if (faq) { + const top = faq.getBoundingClientRect().top; + const offset = window.innerHeight / 2 - faq.clientHeight / 2; + window.scrollTo({ top: window.scrollY + top - offset, behavior: "smooth" }); + } + } +}; + +onMounted(scrollToFaq); + +watch(() => route.hash, scrollToFaq); + const selectProduct = async (product, custom) => { if (isAtCapacity.value) { addNotification({