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

enchanced the travelsafty.html file #1876

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chandru110
Copy link

issue no 1875

Issues Found in the Previous Code
Code Redundancy: The code had repeated HTML structures and inline styles, especially in the navbar and circle animation, which could make maintenance harder.

Fixed Positioning for Animated Circles: All circles were positioned absolutely without dynamic generation or cleanup, leading to potential performance issues as the number of circles increased.

Poor Code Structure: Inline HTML and JavaScript for circle animations cluttered the code, making it less readable and hard to maintain.

Hard-Coded Color Choices: The circles’ color palette was hardcoded in an inline array in JavaScript, making it harder to edit or theme. Including these colors dynamically could simplify changes.

Lack of Responsiveness and Styling Consistency: Some elements (e.g., interactive map and buttons) lacked responsive styling and could potentially overflow on smaller screens.

Accessibility Issues: There were minimal accessibility features such as aria-label attributes, and color choices might not be readable for all users.

Improvements Applied in the Enhanced Code
Optimized Circle Generation with Loops: Instead of manually creating individual circle elements, a for loop was used to generate circles dynamically. This approach keeps the code short and easy to modify if the number of circles changes.

Event Handling Simplification: The mousemove event handler was used efficiently with a centralized coords object, updating circle positions in a single frame rather than recalculating them per circle, improving performance.

Better Color Management: Colors were managed through an array and applied in sequence across the circles, making it easy to modify or add new themes.

Responsive Navbar and Layout: Bootstrap’s responsive grid layout and navigation were improved to ensure the elements adapt smoothly on different screen sizes, making the design more mobile-friendly.

Code Organization for Readability: Code was reorganized to group similar sections together (HTML structure, styles, and scripts), making it easier to navigate and understand.

Accessibility Improvements: Added aria-label attributes for interactive elements to enhance usability for screen readers, creating a more inclusive design.

Commenting and Cleanup: Added comments to key parts of the JavaScript code to improve readability and understanding for future developers.

This enhanced code should provide a more maintainable, responsive, and accessible design with a smoother user experience.

Copy link

vercel bot commented Nov 2, 2024

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

Name Status Preview Comments Updated (UTC)
buddy-trail ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 2, 2024 10:52am

Copy link
Contributor

github-actions bot commented Nov 2, 2024

Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. In the meantime, please ensure that your changes align with our contributing.md. If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊

Copy link

netlify bot commented Nov 2, 2024

Deploy Preview for buddytrail ready!

Name Link
🔨 Latest commit 98b307c
🔍 Latest deploy log https://app.netlify.com/sites/buddytrail/deploys/6726045b949dd30008b7181e
😎 Deploy Preview https://deploy-preview-1876--buddytrail.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@chandru110
Copy link
Author

kindly add gssoc-ext and hacktoberfest-accepted label

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.

1 participant