Vets-Who-Code / vets-who-code-app

http://vetswhocode.io
47 stars 35 forks source link

Title: Add Emoji Rain Animation to Contact Form on Successful Submission #548

Closed jeromehardaway closed 5 months ago

jeromehardaway commented 5 months ago

This PR introduces an engaging visual feedback feature, the "Emoji Rain" animation, which activates upon a successful submission of the contact form. The purpose of this enhancement is to improve user experience by providing a delightful and positive visual cue that confirms their message has been sent successfully. Below are the key changes and their rationale:

Key Changes

  1. EmojiRain Component: A new React component that renders a series of emoji characters (🎖️) falling down the screen. This animation aims to add a fun and engaging element to the form submission process.

  2. State Management in Contact Form: Added a new state variable, showEmojiRain, to the ContactForm component to control the visibility of the EmojiRain animation. This state is toggled upon successful form submission, initiating the emoji rain effect.

  3. Form Submission Enhancement: Modified the onSubmit handler within the ContactForm component to trigger the EmojiRain animation by setting showEmojiRain to true upon receiving a successful response (HTTP 200) from the server. Additionally, a timeout is set to hide the animation after 5 seconds, ensuring the user interface remains clean and ready for further interactions.

  4. Component Capitalization Fix: Updated the component name from emojiRain to EmojiRain to follow React naming conventions, ensuring the component is recognized and rendered properly within the JSX.

Rationale

Testing

How to Test

  1. Navigate to the contact form page.
  2. Fill in all required fields and submit the form.
  3. Observe the emoji rain animation upon successful submission.
  4. Wait for the animation to disappear automatically after 5 seconds.

Please review the changes and provide your feedback.

Check out this link to see it working.

vercel[bot] commented 5 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vets-who-code-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 9, 2024 4:08am