-
Notifications
You must be signed in to change notification settings - Fork 115
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
[Feature]Revamp Homepage CSS & Add Relevant Images for Enhanced UI #352 #375
Conversation
WalkthroughThe changes encompass a comprehensive overhaul of multiple HTML files, CSS styles, and JavaScript functionality. Key modifications include restructuring the layout of Changes
Assessment against linked issues
Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
❌ Deploy Preview for manageyourwaste failed. Why did it fail? →
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 16
🧹 Outside diff range and nitpick comments (6)
script.js (6)
19-26
: Add email format validation in signup formThe
validateSignup
function currently does not validate the email address format. To ensure users provide a valid email, consider adding an email pattern check.Apply this diff to include email validation:
// Clear previous error message errorMessage.innerText = ''; + // Email validation + const emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; + if (!emailPattern.test(email)) { + errorMessage.innerText = 'Please enter a valid email address.'; + return false; // Prevent form submission + } // Check if fields are empty if (!fullName || !email || !password1 || !password2) { errorMessage.innerText = 'Please fill all the details.'; return false; // Prevent form submission }
51-61
: Add email format validation in login formSimilarly, the
validateLogin
function lacks email format validation. Adding this check improves data integrity and user experience.Apply this diff to include email validation:
// Clear previous error message errorMessage.innerText = ''; + // Email validation + const emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; + if (!emailPattern.test(email)) { + errorMessage.innerText = 'Please enter a valid email address.'; + return false; // Prevent form submission + } // Check if fields are empty if (!email || !password1) { errorMessage.innerText = 'Please fill all the details.'; return false; // Prevent form submission }
137-138
: Improve error handling in image upload functionalityCurrently, errors during the fetch request are only logged to the console, which might leave users unaware of issues. Providing user feedback enhances the user experience.
Apply this diff to display an error message to the user:
.catch(error => { console.error(error); + classificationResult.textContent = 'An error occurred during classification. Please try again later.'; + disposalInformation.textContent = ''; });
174-177
: Use consistent validation methods in feedback formThe feedback form uses
alert
for message validation, whereas other fields usesetCustomValidity
. For consistency and better accessibility, consider usingsetCustomValidity
for the message field.Apply this diff to update the message validation:
// Message validation if (message.length < 10) { - alert('Message must be at least 10 characters long.'); + feedbackMessage.setCustomValidity('Message must be at least 10 characters long.'); valid = false; }And ensure to call
feedbackMessage.reportValidity();
when displaying validation errors.
205-209
: Provide user feedback on newsletter subscription errorWhen the email validation fails in the newsletter form, the user might not be adequately informed. Enhance the error message display for clarity.
Ensure the
newsletterErrorMessage
element is visible and styled appropriately so that users notice the validation messages.
243-247
: Handle slider updates on initial load and slide changeThe
updateSlider
function calculates the slide width on each call. If the slides have different widths or if images are not fully loaded, this could lead to incorrect positioning.Consider ensuring images are loaded before calculating slide widths or setting a fixed slide width for consistency.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (6)
assets/6824802.jpg
is excluded by!**/*.jpg
assets/6881999.jpg
is excluded by!**/*.jpg
assets/arrangement-cooked-fish-leftovers-recycle-symbol.jpg
is excluded by!**/*.jpg
assets/front-view-recycling-basket-grass-with-trash.jpg
is excluded by!**/*.jpg
assets/rb_2148298503.png
is excluded by!**/*.png
assets/rb_8795.png
is excluded by!**/*.png
📒 Files selected for processing (5)
- index.css (1 hunks)
- index.html (1 hunks)
- register.html (2 hunks)
- script.js (1 hunks)
- styles.css (2 hunks)
🧰 Additional context used
🔇 Additional comments (4)
script.js (2)
179-186
: Ensure feedback form data is submitted upon successful validationAfter successful validation, the form is reset without submitting the data due to
event.preventDefault()
. If the intention is to submit the form data to the server, remove the prevent default or handle form submission viafetch
.
148-186
: Review form submission logic in feedback formThe feedback form prevents default submission (line 149) and resets the form upon successful validation (line 181) without submitting data to the server. If the intent is to send feedback to the server, implement an AJAX request or remove
event.preventDefault()
.Let me know if you'd like assistance in implementing the form submission to the server.
index.html (2)
10-11
:⚠️ Potential issueAvoid including both 'styles.css' and 'index.css' to prevent CSS conflicts.
Including both CSS files may lead to conflicting styles or redundant code. If
index.css
is intended to replacestyles.css
, consider removingstyles.css
from the<head>
section.Apply this diff to remove the unnecessary stylesheet link:
- <link rel="stylesheet" href="styles.css" /> <link rel="stylesheet" href="index.css" />
Likely invalid or redundant comment.
34-34
:⚠️ Potential issueRemove the duplicate closing
</nav>
tag to fix HTML structure.There is an extra
</nav>
closing tag, which may disrupt the HTML structure and lead to rendering issues. Ensure that all tags are properly nested and closed.Apply this diff to remove the extra closing tag:
</nav> - </nav> <div class="nav-controls">
Likely invalid or redundant comment.
script.js
Outdated
const menuToggle = document.getElementById('menu-toggle'); | ||
const navLinks = document.getElementById('nav-links'); | ||
|
||
menuToggle.addEventListener('click', () => { | ||
navLinks.style.display = navLinks.style.display === 'flex' ? 'none' : 'flex'; | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consolidate menu toggle functionality to prevent redundancy
The menu toggle is implemented both inside the DOMContentLoaded
event listener and again outside. This duplication may lead to inconsistent behavior.
Apply this diff to remove the redundant code:
- const menuToggle = document.getElementById('menu-toggle');
- const navLinks = document.getElementById('nav-links');
-
- menuToggle.addEventListener('click', () => {
- navLinks.style.display = navLinks.style.display === 'flex' ? 'none' : 'flex';
- });
Ensure that the menu toggle functionality is fully implemented within the DOMContentLoaded
event listener.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
const menuToggle = document.getElementById('menu-toggle'); | |
const navLinks = document.getElementById('nav-links'); | |
menuToggle.addEventListener('click', () => { | |
navLinks.style.display = navLinks.style.display === 'flex' ? 'none' : 'flex'; | |
}); | |
<p>Have an Account? <a class="link" href="">Login Here!</a></p><a class="link" href=""> | ||
</a></div><a class="link" href=""> | ||
|
||
</a></form></div><a class="link" href=""> | ||
</a></div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix unmatched <a>
tags to ensure proper HTML structure.
There are several unmatched or improperly nested <a>
tags, which can cause layout issues and unexpected behavior in the document structure.
Apply this diff to correct the HTML structure:
<p>Have an Account? <a class="link" href="">Login Here!</a></p><a class="link" href="">
- </a></div><a class="link" href="">
+ </div>
- </a></form></div><a class="link" href="">
+ </form></div>
Ensure all <a>
tags are properly opened and closed, and that nesting is appropriately structured.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
<p>Have an Account? <a class="link" href="">Login Here!</a></p><a class="link" href=""> | |
</a></div><a class="link" href=""> | |
</a></form></div><a class="link" href=""> | |
</a></div> | |
<p>Have an Account? <a class="link" href="">Login Here!</a></p> | |
</div> | |
</form></div> | |
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 8
🧹 Outside diff range and nitpick comments (2)
script.js (1)
1-16
: Remove unnecessary console.log statementThe
smoothScrolling
function looks good overall, but there's an unnecessaryconsole.log
statement that should be removed before deploying to production.Apply this diff to remove the console.log:
lenis.on('scroll', (e) => { - console.log(e); });
styles.css (1)
Line range hint
1-2094
: Overall improvements with room for further refinement.The changes to
styles.css
have significantly enhanced the visual appeal and functionality of the website. Key improvements include:
- Responsive layout adjustments for various sections.
- Enhanced visual design with hover effects and transitions.
- New sections like the upload card and expanded FAQ styling.
However, there are areas for further improvement:
- Consistency: Ensure color schemes, button styles, and layout patterns are consistent across all sections.
- Accessibility: Pay attention to color contrast ratios and keyboard navigation, especially for interactive elements.
- Responsiveness: Some sections could benefit from more fine-tuned responsive breakpoints.
- Performance: Consider using CSS custom properties (variables) for repeated values like colors to make maintenance easier.
To improve maintainability and consistency, consider:
- Implementing a CSS methodology like BEM (Block Element Modifier) for more structured class naming.
- Using CSS custom properties for colors, fonts, and other repeated values.
- Organizing the CSS into logical sections (e.g., reset, layout, components, utilities) for easier navigation and maintenance.
- Implementing a style guide or design system to ensure consistency across the entire site.
These changes will make the stylesheet more robust, easier to maintain, and more consistent in its application across the site.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (4)
- index.html (1 hunks)
- register.html (2 hunks)
- script.js (1 hunks)
- styles.css (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- register.html
🧰 Additional context used
🔇 Additional comments (16)
script.js (5)
235-278
: LGTM: Eco-tips slider implementationThe eco-tips slider implementation looks good. It correctly handles navigation between slides, updates the slider position on window resize and load events, and manages edge cases when reaching the first or last slide.
1-289
: Overall improvements with minor issues to addressThe changes in this file significantly enhance the functionality and user experience of the application. New features like smooth scrolling and the eco-tips slider have been well-implemented. The code structure is generally good, with clear separation of concerns for different UI components.
However, there are a few minor issues to address:
- Remove the console.log statement in the smoothScrolling function.
- Verify the input field names in the HTML for both signup and login forms.
- Fix the potential division by zero in the progress bar calculation.
- Remove the duplicate theme toggle code at the end of the file.
Once these issues are addressed, the code will be in excellent shape.
49-64
: Verify input field names in HTML for login formThe
validateLogin
function looks correct, but similar to the signup function, there might be a mismatch between the input field names used here and those in the HTML file. Specifically, check if the HTML form usespassword1
for the password field in the login form.Run the following script to verify the input field names for the login form:
#!/bin/bash # Description: Check for password input field name in login form HTML # Test: Search for password input field in login form HTML rg -i 'input.*type=["'']password["''].*name=["'']password1?["''].*id=["'']form2["'']' --type html
107-113
:⚠️ Potential issuePrevent potential division by zero in progress bar calculation
The progress bar calculation on line 110 could potentially lead to a division by zero error if the document height equals the window height.
Apply this diff to handle the edge case:
window.addEventListener('scroll', () => { const windowHeight = window.innerHeight; const documentHeight = document.documentElement.scrollHeight; const scrollTop = window.pageYOffset || document.documentElement.scrollTop; - const scrollPercentage = (scrollTop / (documentHeight - windowHeight)) * 100; + const maxScroll = documentHeight - windowHeight; + const scrollPercentage = maxScroll > 0 ? (scrollTop / maxScroll) * 100 : 0; progressBar.style.width = scrollPercentage + '%'; });Likely invalid or redundant comment.
17-47
: Verify input field names in HTMLThe
validateSignup
function looks good, but there might be a mismatch between the input field names used here and those in the HTML file. Specifically, check if the HTML form usespassword1
andpassword2
for the password fields.Run the following script to verify the input field names:
index.html (11)
37-37
: Fix the typo in the aria-label for better accessibility.The
aria-label
for the theme toggle still contains a typo: "Toggle darok mde" should be "Toggle dark mode".Apply this diff to fix the typo:
- <div id="theme-toggle" aria-label="Toggle darok mde">🌓</div> + <div id="theme-toggle" aria-label="Toggle dark mode">🌓</div>
42-55
: Great improvement to the hero section!The expanded hero section with additional text and an image significantly enhances the introduction to the waste management theme. The call-to-action button is well-placed and encourages user engagement.
57-73
: Excellent redesign of the upload section!The inclusion of an image preview and the use of a custom file input significantly improve the user experience and visual consistency of the upload functionality.
76-117
: Great additions and improvements to the information sections!The new classification and disposal sections provide clear areas for displaying results. The redesigned waste categories section with images and a card-based layout significantly enhances visual engagement and information presentation.
119-223
: Excellent additions to the features and FAQ sections!The expanded features section and the new comprehensive FAQ section greatly enhance the value provided to users. These additions align well with the objectives of improving user engagement and providing informative content.
224-234
: Great addition of the feedback section!The new feedback section with a simple form encourages user participation and provides a valuable channel for user input. This addition aligns well with the objective of enhancing user engagement.
237-357
: Excellent addition of the comprehensive about us section!The new about us section, including the mission and values, provides valuable information about the organization. The use of images and well-structured content enhances readability and visual appeal, aligning perfectly with the objectives of improving user experience and engagement.
365-366
: Addid="name"
to the name input field for proper label association.The
<label>
element usesfor="name"
, but the corresponding<input>
is still missingid="name"
. Adding theid
ensures the label is correctly associated with the input, improving form accessibility.Apply this diff to add the missing
id
attribute:- <input placeholder="Enter your full name" class="form_style" type="text"> + <input id="name" placeholder="Enter your full name" class="form_style" type="text">
377-381
: Fix unmatched<a>
tags to ensure proper HTML structure.There are still several unmatched or improperly nested
<a>
tags, which can cause layout issues and unexpected behavior in the document structure.Apply this diff to correct the HTML structure:
<p>Have an Account? <a class="link" href="">Login Here!</a></p><a class="link" href=""> - </a></div><a class="link" href=""> + </div> - </a></form></div><a class="link" href=""> + </form></div> -</a></div> +</div>Ensure all
<a>
tags are properly opened and closed, and that nesting is appropriately structured.
382-419
: Excellent addition of a comprehensive footer!The new footer section with newsletter subscription, social media links, community message, and main section links greatly enhances user engagement and provides valuable information. The reinforcement of the organization's commitment to sustainability aligns well with the overall theme of the website.
1-423
: Overall excellent improvements to the homepage!The changes made to
index.html
significantly enhance the user interface and user experience, aligning well with the PR objectives. The additions of new sections, improved visual elements, and more comprehensive content greatly contribute to user engagement and information presentation. A few minor issues were identified and should be addressed, but overall, this is a substantial improvement to the homepage.
const themeToggle = document.getElementById('theme-toggle'); | ||
const body = document.body; | ||
|
||
themeToggle.addEventListener('click', () => { | ||
body.classList.toggle('dark-mode'); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove duplicate theme toggle code
This theme toggle code is a duplicate of the implementation inside the DOMContentLoaded event listener (lines 79-85). To prevent potential conflicts and maintain consistency, it should be removed.
Apply this diff to remove the duplicate code:
-const themeToggle = document.getElementById('theme-toggle');
-const body = document.body;
-
-themeToggle.addEventListener('click', () => {
- body.classList.toggle('dark-mode');
-});
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
const themeToggle = document.getElementById('theme-toggle'); | |
const body = document.body; | |
themeToggle.addEventListener('click', () => { | |
body.classList.toggle('dark-mode'); | |
}); |
width: 100vw; | ||
height: 90vh; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Consider using relative units for hero dimensions.
The hero section's width and height are set using viewport units (100vw
and 90vh
). While this can create a full-width hero section, it may cause issues on some devices.
Consider using relative units or a combination of units for better responsiveness:
- width: 100vw;
- height: 90vh;
+ width: 100%;
+ min-height: 90vh;
This change ensures the hero spans the full width of its container without potential overflow issues, and maintains a minimum height of 90% of the viewport height while allowing it to grow if needed.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
width: 100vw; | |
height: 90vh; | |
width: 100%; | |
min-height: 90vh; |
button { | ||
background: #94fb1f; | ||
font-family: inherit; | ||
padding: 0.6em 1.3em; | ||
font-weight: 900; | ||
font-size: 18px; | ||
border: 3px solid black; | ||
border-radius: 0.4em; | ||
box-shadow: 0.1em 0.1em; | ||
} | ||
|
||
button:hover { | ||
transform: translate(-0.05em, -0.05em); | ||
box-shadow: 0.15em 0.15em; | ||
} | ||
|
||
button:active { | ||
transform: translate(0.05em, 0.05em); | ||
box-shadow: 0.05em 0.05em; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
New button styling adds visual interest but consider accessibility.
The new button styling creates a distinctive look with a green background, black border, and box shadow. While this can enhance visual appeal, there are a few considerations:
- The contrast between the green background (#94fb1f) and black text may not meet WCAG accessibility standards for color contrast.
- The use of
transform
andbox-shadow
for hover and active states provides good visual feedback but ensure it doesn't affect layout or readability.
Consider adjusting the colors for better contrast and ensuring the interactive states don't impair usability:
button {
- background: #94fb1f;
+ background: #4CAF50; /* A darker green for better contrast */
color: black;
/* ... other properties ... */
}
button:hover {
transform: translate(-0.05em, -0.05em);
box-shadow: 0.15em 0.15em;
+ background: #45a049; /* Slightly darker on hover for visual feedback */
}
button:active {
transform: translate(0.05em, 0.05em);
box-shadow: 0.05em 0.05em;
}
Also, consider adding focus
styles to ensure keyboard navigation accessibility.
Committable suggestion was skipped due to low confidence.
/* FAQ Item Expanded */ | ||
.faq-item.active p { | ||
max-height: 500px; | ||
} | ||
|
||
/* FAQ Hover Effect */ | ||
.faq-item:hover h3 { | ||
color: #388E3C; | ||
} | ||
|
||
/* Responsive */ | ||
@media (max-width: 768px) { | ||
.faqs h2 { | ||
font-size: 24px; | ||
} | ||
|
||
.faq-item h3 { | ||
font-size: 18px; | ||
} | ||
|
||
.faq-item p { | ||
font-size: 14px; | ||
} | ||
} | ||
/* FAQ Section */ | ||
.faqs { | ||
padding: 40px 20px; | ||
background-color: #f9f9f9; | ||
text-align: left; | ||
} | ||
|
||
.faqs h2 { | ||
text-align: center; | ||
font-size: 28px; | ||
margin-bottom: 30px; | ||
color: #333; | ||
} | ||
|
||
/* FAQ Items Styling */ | ||
.faq-item { | ||
margin-bottom: 20px; | ||
border-bottom: 1px solid #ddd; | ||
padding: 10px 0; | ||
cursor: pointer; | ||
} | ||
|
||
.faq-item h3 { | ||
font-size: 20px; | ||
color: #4CAF50; | ||
margin-bottom: 10px; | ||
position: relative; | ||
transition: color 0.3s ease; | ||
} | ||
|
||
.faq-item h3::after { | ||
content: '\002B'; /* Plus sign icon */ | ||
font-size: 24px; | ||
position: absolute; | ||
right: 0; | ||
top: 0; | ||
transition: transform 0.3s ease; | ||
} | ||
|
||
.faq-item.active h3::after { | ||
content: '\2212'; /* Minus sign icon */ | ||
} | ||
|
||
.faq-item p { | ||
font-size: 16px; | ||
color: #555; | ||
line-height: 1.6; | ||
max-height: 0; | ||
overflow: hidden; | ||
transition: max-height 0.3s ease; | ||
} | ||
|
||
/* FAQ Item Expanded */ | ||
.faq-item.active p { | ||
max-height: 500px; | ||
} | ||
|
||
/* FAQ Hover Effect */ | ||
.faq-item:hover h3 { | ||
color: #388E3C; | ||
} | ||
|
||
/* Responsive */ | ||
@media (max-width: 768px) { | ||
.faqs h2 { | ||
font-size: 24px; | ||
} | ||
|
||
.faq-item h3 { | ||
font-size: 18px; | ||
} | ||
|
||
.faq-item p { | ||
font-size: 14px; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
FAQ section styling is good, but consider accessibility and visual consistency.
The new FAQ section styling creates an accordion-like structure, which is a good pattern for presenting FAQs. However, there are a few areas that could be improved:
- The use of
cursor: pointer
on the entirefaq-item
might be confusing. It's better to make only the question clickable. - The color scheme doesn't fully match the rest of the site's design.
- The accordion functionality relies on JavaScript to toggle the
active
class, but there's no clear visual indicator of the expanded state.
Consider the following adjustments:
.faqisection {
/* ... existing properties ... */
+ background-color: #f5f5f5; /* Match the features section background */
}
.faqs {
- width: 50%;
+ width: 100%;
+ max-width: 800px;
/* ... other properties ... */
}
.faq-item {
- cursor: pointer;
+ border: 1px solid #e0e0e0;
+ border-radius: 8px;
+ margin-bottom: 10px;
+ overflow: hidden;
}
.faq-item h3 {
+ cursor: pointer;
font-size: 20px;
- color: #4CAF50;
+ color: #333;
margin-bottom: 10px;
position: relative;
- transition: color 0.3s ease;
+ transition: background-color 0.3s ease;
+ padding: 15px;
}
.faq-item h3::after {
content: '\002B';
font-size: 24px;
position: absolute;
right: 15px;
top: 50%;
transform: translateY(-50%);
- transition: transform 0.3s ease;
+ transition: transform 0.3s ease, color 0.3s ease;
}
.faq-item.active h3 {
+ background-color: #4CAF50;
+ color: white;
}
.faq-item.active h3::after {
content: '\2212';
+ color: white;
}
.faq-item p {
/* ... existing properties ... */
+ padding: 0 15px 15px;
}
.faq-item.active p {
- max-height: 500px;
+ max-height: 1000px; /* Increased to accommodate more content */
}
- .faq-item:hover h3 {
- color: #388E3C;
- }
+ .faq-item h3:hover {
+ background-color: #e8f5e9;
+ }
+
+ .faq-item.active h3:hover {
+ background-color: #45a049;
+ }
@media (max-width: 768px) {
.faqs {
+ width: 90%;
}
/* ... other media query styles ... */
}
These changes improve the visual consistency with the rest of the site, enhance accessibility by making only the question clickable, and provide clearer visual feedback for the expanded state. The layout is also more responsive now.
Committable suggestion was skipped due to low confidence.
.upload-card { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
padding: 20px; | ||
background-color: #fff; | ||
border-radius: 10px; | ||
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); | ||
width: 350px; | ||
margin: 20px auto; | ||
} | ||
|
||
.upload-container { | ||
text-align: center; | ||
} | ||
|
||
.upload-img img { | ||
width: 100%; | ||
max-width: 500px; | ||
margin-bottom: 20px; | ||
border-radius: 8px; | ||
} | ||
|
||
.upload-text h2 { | ||
font-size: 22px; | ||
margin-bottom: 10px; | ||
} | ||
|
||
.custom-file-upload { | ||
display: inline-block; | ||
padding: 10px 20px; | ||
color: white; | ||
background-color: #007bff; | ||
border-radius: 4px; | ||
cursor: pointer; | ||
transition: background-color 0.3s ease; | ||
} | ||
|
||
.custom-file-upload:hover { | ||
background-color: #0056b3; | ||
} | ||
|
||
.custom-file-upload span { | ||
font-size: 16px; | ||
} | ||
|
||
.upload-submit button { | ||
margin-top: 20px; | ||
padding: 10px 20px; | ||
background-color: #28a745; | ||
color: white; | ||
border: none; | ||
border-radius: 4px; | ||
cursor: pointer; | ||
transition: background-color 0.3s ease; | ||
} | ||
|
||
.upload-submit button:hover { | ||
background-color: #218838; | ||
} | ||
|
||
/* Responsive Design */ | ||
@media screen and (max-width: 480px) { | ||
.upload-card { | ||
max-width: 100%; | ||
padding: 15px; | ||
} | ||
|
||
.upload-img img { | ||
max-width: 150px; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Upload card styling is good, but consider accessibility and responsiveness.
The new upload card styling creates a centered, visually appealing layout for file uploads. However, there are a few points to consider:
- The fixed width of 350px might be too wide for very small mobile screens.
- The color contrast between the blue button (#007bff) and white text might not meet WCAG standards.
- The hover state for the upload button only changes the background color, which might not be sufficient visual feedback.
Consider the following adjustments:
.upload-card {
- width: 350px;
+ width: 100%;
+ max-width: 350px;
margin: 20px auto;
}
.custom-file-upload {
- background-color: #007bff;
+ background-color: #0056b3; /* Darker blue for better contrast */
color: white;
/* ... other properties ... */
+ transition: background-color 0.3s ease, transform 0.2s ease;
}
.custom-file-upload:hover {
- background-color: #0056b3;
+ background-color: #003d80; /* Even darker on hover */
+ transform: translateY(-2px);
}
+ .custom-file-upload:focus {
+ outline: 2px solid #0056b3;
+ outline-offset: 2px;
+ }
.upload-submit button {
/* ... existing properties ... */
+ transition: background-color 0.3s ease, transform 0.2s ease;
}
.upload-submit button:hover {
background-color: #218838;
+ transform: translateY(-2px);
}
+ .upload-submit button:focus {
+ outline: 2px solid #28a745;
+ outline-offset: 2px;
+ }
@media screen and (max-width: 480px) {
.upload-card {
- max-width: 100%;
+ max-width: 90%; /* Allows for some margin on very small screens */
padding: 15px;
}
.upload-img img {
max-width: 150px;
}
+
+ .custom-file-upload,
+ .upload-submit button {
+ width: 100%; /* Full width buttons on small screens */
+ }
}
These changes improve responsiveness, enhance accessibility with better color contrast and focus states, and provide more noticeable hover effects for better user feedback.
Committable suggestion was skipped due to low confidence.
.features { | ||
padding: 40px 20px; | ||
background-color: #f5f5f5; | ||
text-align: center; | ||
} | ||
|
||
.features h2 { | ||
font-size: 28px; | ||
margin-bottom: 30px; | ||
color: #333; | ||
} | ||
|
||
.features-container { | ||
display: flex; | ||
justify-content: space-around; | ||
gap: 20px; | ||
flex-wrap: wrap; | ||
} | ||
|
||
.feature-card { | ||
background-color: white; | ||
border-radius: 10px; | ||
padding: 20px; | ||
width: 700px; | ||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); | ||
transition: transform 0.3s ease, box-shadow 0.3s ease; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
text-align: left; | ||
} | ||
|
||
.feature-card h3 { | ||
font-size: 22px; | ||
margin-bottom: 10px; | ||
color: #4CAF50; | ||
} | ||
|
||
.feature-card p { | ||
font-size: 16px; | ||
color: #555; | ||
margin-bottom: 20px; | ||
} | ||
|
||
.feature-card:hover { | ||
transform: translateY(-10px); | ||
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); | ||
} | ||
|
||
.feature-card .cta-button, .feature-card .hero-btn { | ||
display: inline-block; | ||
padding: 10px 20px; | ||
background-color: #4CAF50; | ||
color: white; | ||
border: none; | ||
border-radius: 5px; | ||
text-decoration: none; | ||
transition: background-color 0.3s ease; | ||
cursor: pointer; | ||
} | ||
|
||
.feature-card .cta-button:hover, .feature-card .hero-btn:hover { | ||
background-color: #388E3C; | ||
} | ||
|
||
/* Styling for icons - Placeholder for now */ | ||
.icon { | ||
width: 50px; | ||
height: 50px; | ||
background-color: #4CAF50; | ||
border-radius: 50%; | ||
margin-bottom: 15px; | ||
} | ||
|
||
/* Blockquote for eco-fact */ | ||
blockquote { | ||
font-style: italic; | ||
margin-bottom: 10px; | ||
color: #777; | ||
} | ||
|
||
#fact-highlight { | ||
font-weight: bold; | ||
color: #333; | ||
} | ||
|
||
/* Responsive Design */ | ||
@media (max-width: 768px) { | ||
.features-container { | ||
flex-direction: column; | ||
align-items: center; | ||
} | ||
|
||
.feature-card { | ||
width: 100%; | ||
max-width: 350px; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Features section styling is improved, but consider further enhancements.
The new styling for the features section creates an attractive card-based layout with hover effects. However, there are a few areas that could be improved:
- The fixed width of 700px for feature cards might be too wide for some screen sizes.
- The use of
white
as a background color might not provide enough contrast with the overall page background (#f5f5f5). - The icon placeholder doesn't match the overall design aesthetic.
Consider the following adjustments:
.features-container {
display: flex;
justify-content: space-around;
gap: 20px;
flex-wrap: wrap;
}
.feature-card {
- width: 700px;
+ width: 100%;
+ max-width: 700px;
- background-color: white;
+ background-color: #ffffff;
+ border: 1px solid #e0e0e0;
/* ... other properties ... */
}
.feature-card:hover {
transform: translateY(-10px);
- box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
+ box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1);
}
- .icon {
- width: 50px;
- height: 50px;
- background-color: #4CAF50;
- border-radius: 50%;
- margin-bottom: 15px;
- }
+ .icon {
+ font-size: 2.5rem;
+ color: #4CAF50;
+ margin-bottom: 15px;
+ }
@media (max-width: 768px) {
.feature-card {
- width: 100%;
- max-width: 350px;
+ max-width: 100%;
}
+
+ .feature-card h3 {
+ font-size: 20px;
+ }
+
+ .feature-card p {
+ font-size: 14px;
+ }
}
These changes improve responsiveness, enhance the visual design with subtle borders and adjusted shadows, and replace the icon placeholder with a more flexible font-based approach. The media query adjustments ensure better readability on smaller screens.
Committable suggestion was skipped due to low confidence.
.feedback { | ||
margin-top: 30px; | ||
background-color: #ffffff; | ||
/* White background for better contrast */ | ||
padding: 20px; | ||
border-radius: 10px; | ||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); | ||
max-width: 500px; | ||
margin: 0 auto; | ||
} | ||
|
||
.feedback h2 { | ||
text-align: center; | ||
color: #00796b; | ||
/* Consistent color with the theme */ | ||
margin-bottom: 20px; | ||
} | ||
|
||
.feedback form { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.feedback input, | ||
.feedback textarea { | ||
margin: 10px 0; | ||
padding: 12px; | ||
border: 1px solid #00796b; | ||
border-radius: 5px; | ||
font-size: 16px; | ||
background-color: #e0f7fa; | ||
/* Matches the background theme */ | ||
} | ||
|
||
.feedback textarea { | ||
min-height: 100px; | ||
/* Larger space for feedback text */ | ||
} | ||
|
||
.feedback button { | ||
background-color: #00796b; | ||
/* Light mode button color (same as header) */ | ||
color: white; | ||
/* Text color for contrast */ | ||
padding: 12px; | ||
border: none; | ||
border-radius: 5px; | ||
font-size: 16px; | ||
cursor: pointer; | ||
transition: background-color 0.3s ease; | ||
} | ||
|
||
.feedback button:hover { | ||
background-color: #004d40; | ||
/* Darker teal on hover */ | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Feedback section styling is good, but consider consistency and accessibility.
The new feedback section styling creates a clean, card-like form for user input. However, there are a few areas that could be improved:
- The color scheme doesn't fully align with the rest of the site's design.
- The input fields' background color (#e0f7fa) might not provide enough contrast with the white text for placeholder text.
- The button styling doesn't match the global button styles defined earlier in the file.
Consider the following adjustments:
.feedback {
/* ... existing properties ... */
- background-color: #ffffff;
+ background-color: #f5f5f5;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
+ border: 1px solid #e0e0e0;
}
.feedback h2 {
/* ... existing properties ... */
- color: #00796b;
+ color: #4CAF50;
}
.feedback input,
.feedback textarea {
/* ... existing properties ... */
- border: 1px solid #00796b;
+ border: 1px solid #4CAF50;
- background-color: #e0f7fa;
+ background-color: #ffffff;
+ color: #333;
}
.feedback textarea {
min-height: 100px;
+ resize: vertical;
}
.feedback button {
- background-color: #00796b;
+ background: #4CAF50;
- color: white;
+ color: black;
- padding: 12px;
- border: none;
- border-radius: 5px;
- font-size: 16px;
- cursor: pointer;
- transition: background-color 0.3s ease;
+ font-family: inherit;
+ padding: 0.6em 1.3em;
+ font-weight: 900;
+ font-size: 18px;
+ border: 3px solid black;
+ border-radius: 0.4em;
+ box-shadow: 0.1em 0.1em;
+ transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s;
}
.feedback button:hover {
- background-color: #004d40;
+ transform: translate(-0.05em, -0.05em);
+ box-shadow: 0.15em 0.15em;
+ background-color: #45a049;
}
+ .feedback button:focus {
+ outline: 2px solid #4CAF50;
+ outline-offset: 2px;
+ }
These changes improve visual consistency with the rest of the site, enhance accessibility with better color contrast, and align the button styling with the global button styles defined earlier in the file. The textarea is now resizable vertically for better user experience.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
.feedback { | |
margin-top: 30px; | |
background-color: #ffffff; | |
/* White background for better contrast */ | |
padding: 20px; | |
border-radius: 10px; | |
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); | |
max-width: 500px; | |
margin: 0 auto; | |
} | |
.feedback h2 { | |
text-align: center; | |
color: #00796b; | |
/* Consistent color with the theme */ | |
margin-bottom: 20px; | |
} | |
.feedback form { | |
display: flex; | |
flex-direction: column; | |
} | |
.feedback input, | |
.feedback textarea { | |
margin: 10px 0; | |
padding: 12px; | |
border: 1px solid #00796b; | |
border-radius: 5px; | |
font-size: 16px; | |
background-color: #e0f7fa; | |
/* Matches the background theme */ | |
} | |
.feedback textarea { | |
min-height: 100px; | |
/* Larger space for feedback text */ | |
} | |
.feedback button { | |
background-color: #00796b; | |
/* Light mode button color (same as header) */ | |
color: white; | |
/* Text color for contrast */ | |
padding: 12px; | |
border: none; | |
border-radius: 5px; | |
font-size: 16px; | |
cursor: pointer; | |
transition: background-color 0.3s ease; | |
} | |
.feedback button:hover { | |
background-color: #004d40; | |
/* Darker teal on hover */ | |
} | |
.feedback { | |
margin-top: 30px; | |
background-color: #f5f5f5; | |
/* White background for better contrast */ | |
padding: 20px; | |
border-radius: 10px; | |
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); | |
max-width: 500px; | |
margin: 0 auto; | |
border: 1px solid #e0e0e0; | |
} | |
.feedback h2 { | |
text-align: center; | |
color: #4CAF50; | |
/* Consistent color with the theme */ | |
margin-bottom: 20px; | |
} | |
.feedback form { | |
display: flex; | |
flex-direction: column; | |
} | |
.feedback input, | |
.feedback textarea { | |
margin: 10px 0; | |
padding: 12px; | |
border: 1px solid #4CAF50; | |
border-radius: 5px; | |
font-size: 16px; | |
background-color: #ffffff; | |
color: #333; | |
} | |
.feedback textarea { | |
min-height: 100px; | |
/* Larger space for feedback text */ | |
resize: vertical; | |
} | |
.feedback button { | |
background: #4CAF50; | |
color: black; | |
font-family: inherit; | |
padding: 0.6em 1.3em; | |
font-weight: 900; | |
font-size: 18px; | |
border: 3px solid black; | |
border-radius: 0.4em; | |
box-shadow: 0.1em 0.1em; | |
transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s; | |
} | |
.feedback button:hover { | |
transform: translate(-0.05em, -0.05em); | |
box-shadow: 0.15em 0.15em; | |
background-color: #45a049; | |
} | |
.feedback button:focus { | |
outline: 2px solid #4CAF50; | |
outline-offset: 2px; | |
} |
.hero { | ||
|
||
|
||
color: white; | ||
text-align: center; | ||
padding: 80px 20px; | ||
} | ||
.hero h2 { | ||
font-size: 2.5rem; | ||
margin-bottom: 20px; | ||
} | ||
|
||
.hero p { | ||
font-size: 1.2rem; | ||
margin-bottom: 30px; | ||
} | ||
|
||
.hero-content { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
padding: 20px; | ||
gap: 20px; | ||
} | ||
|
||
.hero-text { | ||
flex: 1; | ||
} | ||
|
||
.hero-img { | ||
flex: 1; | ||
} | ||
|
||
.hero-img img { | ||
width: 100%; | ||
max-width: 900px; | ||
border-radius: 8px; | ||
} | ||
|
||
/* Hero button styling */ | ||
.hero-btn { | ||
display: inline-block; | ||
padding: 10px 20px; | ||
background-color: #4CAF50; /* Button color */ | ||
color: white; | ||
text-decoration: none; | ||
border-radius: 4px; | ||
transition: background-color 0.3s ease; | ||
} | ||
|
||
.hero-btn:hover { | ||
background-color: #45a049; | ||
} | ||
|
||
/* Responsive styling */ | ||
@media screen and (max-width: 768px) { | ||
.hero-content { | ||
flex-direction: column-reverse; /* Stack content and image */ | ||
text-align: center; | ||
} | ||
|
||
.hero-img { | ||
margin-bottom: 20px; | ||
} | ||
|
||
.hero-text h2 { | ||
font-size: 24px; | ||
} | ||
|
||
.hero-btn { | ||
padding: 12px 24px; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Hero section layout improved, but consider further enhancements.
The hero section now uses flexbox for better content alignment and includes responsive adjustments. This is a good improvement for layout control. However, there are a few points to consider:
- The media query breakpoint at 768px might be too low for larger tablets in landscape mode.
- The button styling in the hero section doesn't match the new global button style defined earlier.
Consider the following adjustments:
.hero-content {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px;
gap: 20px;
+ flex-wrap: wrap; /* Allow wrapping on smaller screens */
}
.hero-text, .hero-img {
- flex: 1;
+ flex: 1 1 300px; /* Allow growing, shrinking, and set a basis */
}
@media screen and (max-width: 768px) {
.hero-content {
flex-direction: column-reverse;
text-align: center;
}
+ .hero-text, .hero-img {
+ flex-basis: 100%; /* Full width on small screens */
+ }
}
+ @media screen and (min-width: 769px) and (max-width: 1024px) {
+ .hero-content {
+ flex-wrap: wrap;
+ }
+ .hero-text, .hero-img {
+ flex-basis: 100%;
+ }
+ }
.hero-btn {
- display: inline-block;
- padding: 10px 20px;
- background-color: #4CAF50;
- color: white;
- text-decoration: none;
- border-radius: 4px;
- transition: background-color 0.3s ease;
+ /* Apply the global button styles here */
+ background: #4CAF50;
+ font-family: inherit;
+ padding: 0.6em 1.3em;
+ font-weight: 900;
+ font-size: 18px;
+ border: 3px solid black;
+ border-radius: 0.4em;
+ box-shadow: 0.1em 0.1em;
+ transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s;
}
.hero-btn:hover {
- background-color: #45a049;
+ transform: translate(-0.05em, -0.05em);
+ box-shadow: 0.15em 0.15em;
+ background-color: #45a049;
}
These changes will make the hero section more responsive across various screen sizes and align the button styling with the global button styles.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
.hero { | |
color: white; | |
text-align: center; | |
padding: 80px 20px; | |
} | |
.hero h2 { | |
font-size: 2.5rem; | |
margin-bottom: 20px; | |
} | |
.hero p { | |
font-size: 1.2rem; | |
margin-bottom: 30px; | |
} | |
.hero-content { | |
display: flex; | |
justify-content: space-between; | |
align-items: center; | |
padding: 20px; | |
gap: 20px; | |
} | |
.hero-text { | |
flex: 1; | |
} | |
.hero-img { | |
flex: 1; | |
} | |
.hero-img img { | |
width: 100%; | |
max-width: 900px; | |
border-radius: 8px; | |
} | |
/* Hero button styling */ | |
.hero-btn { | |
display: inline-block; | |
padding: 10px 20px; | |
background-color: #4CAF50; /* Button color */ | |
color: white; | |
text-decoration: none; | |
border-radius: 4px; | |
transition: background-color 0.3s ease; | |
} | |
.hero-btn:hover { | |
background-color: #45a049; | |
} | |
/* Responsive styling */ | |
@media screen and (max-width: 768px) { | |
.hero-content { | |
flex-direction: column-reverse; /* Stack content and image */ | |
text-align: center; | |
} | |
.hero-img { | |
margin-bottom: 20px; | |
} | |
.hero-text h2 { | |
font-size: 24px; | |
} | |
.hero-btn { | |
padding: 12px 24px; | |
} | |
} | |
.hero { | |
color: white; | |
text-align: center; | |
padding: 80px 20px; | |
} | |
.hero h2 { | |
font-size: 2.5rem; | |
margin-bottom: 20px; | |
} | |
.hero p { | |
font-size: 1.2rem; | |
margin-bottom: 30px; | |
} | |
.hero-content { | |
display: flex; | |
justify-content: space-between; | |
align-items: center; | |
padding: 20px; | |
gap: 20px; | |
flex-wrap: wrap; /* Allow wrapping on smaller screens */ | |
} | |
.hero-text, .hero-img { | |
flex: 1 1 300px; /* Allow growing, shrinking, and set a basis */ | |
} | |
.hero-img img { | |
width: 100%; | |
max-width: 900px; | |
border-radius: 8px; | |
} | |
/* Hero button styling */ | |
.hero-btn { | |
/* Apply the global button styles here */ | |
background: #4CAF50; | |
font-family: inherit; | |
padding: 0.6em 1.3em; | |
font-weight: 900; | |
font-size: 18px; | |
border: 3px solid black; | |
border-radius: 0.4em; | |
box-shadow: 0.1em 0.1em; | |
transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s; | |
} | |
.hero-btn:hover { | |
transform: translate(-0.05em, -0.05em); | |
box-shadow: 0.15em 0.15em; | |
background-color: #45a049; | |
} | |
/* Responsive styling */ | |
@media screen and (max-width: 768px) { | |
.hero-content { | |
flex-direction: column-reverse; /* Stack content and image */ | |
text-align: center; | |
} | |
.hero-text, .hero-img { | |
flex-basis: 100%; /* Full width on small screens */ | |
} | |
.hero-img { | |
margin-bottom: 20px; | |
} | |
.hero-text h2 { | |
font-size: 24px; | |
} | |
.hero-btn { | |
padding: 12px 24px; | |
} | |
} | |
@media screen and (min-width: 769px) and (max-width: 1024px) { | |
.hero-content { | |
flex-wrap: wrap; | |
} | |
.hero-text, .hero-img { | |
flex-basis: 100%; | |
} | |
} |
@sahhoArjun097 USe a tag or make the btn in navar transparent create a separate issue for the same and complete it by tonight itself if possible |
Issues Identification
Closes: #352
This pull request revamps the homepage CSS and adds relevant images to enhance the overall user interface (UI) of the website. The changes aim to create a more visually appealing and engaging experience for users, addressing feedback received on the previous design.
-CSS Revamp: The entire homepage UI has been redesigned with improved CSS styles, focusing on better alignment, spacing, and responsiveness to different screen sizes.
-Image Integration: Added relevant images throughout the homepage to provide visual context and break up text-heavy sections, making the content more engaging and digestible.
-Consistency: Ensured that the design elements are consistent with the overall theme of the website, maintaining brand identity while improving aesthetics.
-Accessibility: Made improvements to ensure that the homepage is more accessible, including better color contrast and text readability.
Types of Changes
Please check the boxes that apply
Checklist
Please check the boxes that apply
bandicam.2024-10-21.03-04-41-909.mp4
If applicable, please attach screenshots of the changes made to the user interface.
Additional Information
Please provide any other information that is relevant to this pull request.
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Style
Documentation