Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 10 commits into from
Feb 9, 2024

Conversation

jeromehardaway
Copy link
Contributor

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

  • User Experience: Positive reinforcement through visual feedback can enhance the user's interaction with the application, making the process of sending a message more rewarding and clear.
  • Consistency: Following React's naming conventions improves code readability and maintainability.
  • Scalability: Implementing the EmojiRain as a separate component allows for reuse in other parts of the application where similar visual feedback might be beneficial.

Testing

  • Manual testing was conducted to ensure the animation triggers correctly upon form submission and disappears after 5 seconds.
  • Tested across multiple browsers (Chrome, Firefox, Safari) to verify compatibility.
  • Verified that the form continues to handle errors gracefully and displays the appropriate feedback to the user.

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.

@jeromehardaway jeromehardaway self-assigned this Feb 9, 2024
Copy link

vercel bot commented Feb 9, 2024

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

@jeromehardaway jeromehardaway requested a review from a team February 9, 2024 04:09
Copy link
Contributor

@mrbernnz mrbernnz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

squirrel

@jeromehardaway jeromehardaway merged commit 3b2f77f into master Feb 9, 2024
3 checks passed
@jeromehardaway jeromehardaway deleted the ConfirmationSucess branch February 9, 2024 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants