This commit is contained in:
Filip Rojek 2023-05-11 20:01:54 +02:00
parent 51b98dd39e
commit af9e6a6376
2 changed files with 7 additions and 8 deletions

View File

@ -16,7 +16,7 @@
<script>
const submit = document.querySelector("#submit")
submit.addEventListener("click", (e) => {
submit.addEventListener("click", async (e) => {
e.preventDefault()
const formData = new FormData();
@ -25,10 +25,10 @@
formData.append('message', document.querySelector("#message").value);
try {
fetch('/contact/send', {
method: 'POST',
body: formData
});
await fetch('/contact/send', {
method: 'POST',
body: formData
});
console.log('Message sent successfully.')
} catch (err) {
console.error('Error:', error)

View File

@ -22,13 +22,12 @@
const pgpmobile = document.querySelector("#pgpmobile")
const pgpcp = (e) => {
console.log(e)
e.preventDefault()
navigator.clipboard.writeText("fc37b989787acf8cbce7c0c2a56a345efe321161")
alert("pgp has been copied to the clipboard")
}
pgp.addEventListener("click", e => pgpcp)
pgpmobile.addEventListener("click", e => pgpcp)
pgp.addEventListener("click", pgpcp)
pgpmobile.addEventListener("click", pgpcp)
</script>
</section>