added autoscroll for contact form

This commit is contained in:
Kamil Niemczycki 2022-07-31 22:39:14 +02:00
parent 1d9d84484d
commit f4dc87d841
Signed by: kamilniemczycki
GPG Key ID: 04D4E2012F969213
2 changed files with 15 additions and 6 deletions

View File

@ -1,5 +1,8 @@
<template> <template>
<div class="contact_container w-full bg-neutral-100 rounded-md border border-gray-200 md:max-w-[500px] p-2 shadow"> <div
id="contact-form"
class="contact_container w-full bg-neutral-100 rounded-md border border-gray-200 md:max-w-[500px] p-2 shadow"
>
<header class="mb-1.5"> <header class="mb-1.5">
<h3 class="text-xl"> <h3 class="text-xl">
Formularz kontaktowy Formularz kontaktowy
@ -204,6 +207,14 @@ function formSubmit(event) {
buttonDisabled.value = false buttonDisabled.value = false
}) })
} }
scrollTo('#contact-form')
}
function scrollTo(id) {
document.querySelector(id).scrollIntoView({
behavior: 'smooth'
})
} }
</script> </script>

View File

@ -1,9 +1,7 @@
<template> <template>
<section class="px-3 py-6"> <section class="flex flex-col px-3 py-6 md:flex-row items-start justify-center mx-auto gap-5">
<div class="flex flex-col md:flex-row items-start justify-center mx-auto gap-5"> <MailContact />
<MailContact /> <OtherContact />
<OtherContact />
</div>
</section> </section>
</template> </template>