From dc402fd20288e7174ba4f6c3d605796f94ff0941 Mon Sep 17 00:00:00 2001 From: Christopher Cali Date: Sat, 11 Jun 2022 11:45:41 -0500 Subject: [PATCH] Add / hide success message at appropriate times --- apps/website/src/pages/index/index.vue | 146 +++++++++++-------------- 1 file changed, 65 insertions(+), 81 deletions(-) diff --git a/apps/website/src/pages/index/index.vue b/apps/website/src/pages/index/index.vue index a137b1f47..ab9fd5508 100644 --- a/apps/website/src/pages/index/index.vue +++ b/apps/website/src/pages/index/index.vue @@ -9,16 +9,16 @@ async function onSubmit() { const requestOptions = { method: 'POST', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ email: email.value }) + body: JSON.stringify({ email: email.value }), } const baseUrl = import.meta.env.PROD ? 'https://w47s4clcwi.execute-api.us-east-2.amazonaws.com/prod' : 'http://localhost:4000' try { - const response = await fetch( - `${baseUrl}/api/users/signup`, - requestOptions - ) + email.value = '' + // Change success message display to show + document.getElementById('success-message').style.display = 'block' + const response = await fetch(`${baseUrl}/api/users/signup`, requestOptions) console.log('response :>> ', response) const data = await response.json() } catch (err) { @@ -26,19 +26,22 @@ async function onSubmit() { } } +const hideSuccessMessage = () => { + document.getElementById('success-message').style.display = 'none' +} const slideshowProgress = ref(0) const currentSlide = ref(2) onMounted(() => { setInterval(() => { - slideshowProgress.value += .05 + slideshowProgress.value += 0.05 if (slideshowProgress.value >= 100) { slideshowProgress.value = 0 - currentSlide.value = (currentSlide.value + 1) !== 3 ? currentSlide.value + 1 : 0 + currentSlide.value = + currentSlide.value + 1 !== 3 ? currentSlide.value + 1 : 0 } }, 0.00000005) }) -