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

made navbar responsive and consistent #883

Merged
merged 2 commits into from
Oct 29, 2024

Conversation

sujeet9682
Copy link
Contributor

@sujeet9682 sujeet9682 commented Oct 25, 2024

Issue Resolved

Closes: #828 Bug : Navbar is not responsive that will be closed through this PR

Description

Made the navbar responsive along with adding required element on navbar. Added item like login/signup which can be modified further dynamically as logout and profile easily.

Screen.Recording.2024-10-25.at.8.04.31.PM.mov

Type of change ☑️

  • Bug fix (non-breaking change which fixes an issue)
  • Code style update (formatting, local variables)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested? ⚙️

This changes are tested over local machine on localhost in macOS.

Checklist: ☑️

  • My code follows the guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly wherever it was hard to understand.
  • My changes generate no new warnings.
  • I have added things that prove my fix is effective or that my feature works.
  • Any dependent changes have been merged and published in downstream modules.

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced a mobile-friendly navigation menu with a hamburger icon.
    • Added a dynamic progress bar that updates based on scroll position.
    • Implemented dark mode toggle functionality with visual feedback.
    • Enhanced resume builder with new user input fields for contact information.
    • Restructured footer with sections for "About Us," "Services," "Support," and "Connect With Us."
    • Added Google Fonts and Font Awesome for improved visual elements.
  • Bug Fixes

    • Improved layout consistency and readability across multiple pages.
  • Style

    • Updated styling rules for better responsiveness and user interaction, including hover effects and color management.
    • Introduced new CSS variables for enhanced color management.

Copy link

coderabbitai bot commented Oct 25, 2024

Walkthrough

The pull request introduces significant structural and stylistic enhancements across multiple HTML files (about.html, index.html, resume.html) and a CSS file (style.css). Key updates include the addition of mobile navigation features, a progress bar, and improved layout and styling for better readability and user experience. The CSS has been refined to support new design elements and responsive behavior. Overall, the changes aim to modernize the interface and ensure compatibility with various screen sizes.

Changes

File Change Summary
about.html Reformatted <link> tag, reorganized <style>, added a progress bar, updated mobile navigation, restructured footer, improved content readability.
index.html Added title and stylesheet links, improved header and footer structure, introduced mobile navigation and dark mode functionality, updated styling for features and testimonials.
resume.html Added mobile navigation bar, authentication links, refined user input sections, improved layout and interactivity.
style.css Introduced new CSS variables, updated styles for various classes, added responsive design elements, refined footer styles.

Assessment against linked issues

Objective Addressed Explanation
Navbar is not responsive (#828)

Possibly related PRs

Suggested labels

hacktoberfest, level2, gssoc-ext, hacktoberfest-accepted

Suggested reviewers

  • GarimaSingh0109

Poem

In the land of code where rabbits play,
We’ve spruced up the site in a stylish way.
With menus that dance and colors that gleam,
A progress bar shines, fulfilling the dream.
So hop on and scroll, enjoy the new view,
For every click brings a joy that is true! 🐇✨


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 18

🧹 Outside diff range and nitpick comments (5)
style.css (1)

86-90: Consider using responsive padding units

The fixed padding values (15px 30px) might cause layout issues on very small screens. Consider using relative units or reducing padding on mobile.

-    padding: 15px 30px;
+    padding: 15px clamp(15px, 3vw, 30px);
resume.html (2)

Line range hint 267-299: Enhance template selection UX and accessibility.

The template selection and review sections need improvements for better user experience and accessibility:

  1. Add loading states for template images
  2. Enhance keyboard navigation
  3. Add error handling for resume generation

Apply these improvements:

         <div class="template-section">
-            <div id="basic" class="template-card" onclick="selectTemplate('basic')">
-                <img src="templates/basic.jpg" alt="Basic Template">
+            <div id="basic" class="template-card" 
+                 role="button"
+                 tabindex="0"
+                 onclick="selectTemplate('basic')"
+                 onkeypress="(e) => e.key === 'Enter' && selectTemplate('basic')">
+                <img src="templates/basic.jpg" 
+                     alt="Basic Template Preview"
+                     loading="lazy">
                 <p>Basic</p>
             </div>
             <!-- Similar changes for other template cards -->
         </div>

         <div class="buttons">
-            <button id="prev-step-2" onclick="showStep(1)">Prev Step</button>
-            <button id="next-step-2" onclick="proceedToNextStep(3)">Next Step</button>
+            <button id="prev-step-2" onclick="showStep(1)" class="btn-secondary">Previous Step</button>
+            <button id="next-step-2" onclick="proceedToNextStep(3)" class="btn-primary">Next Step</button>
         </div>

     <div class="step-section" id="step-3" style="display: none;">
         <h2>Review Your Resume</h2>
-        <div id="resume-display">
+        <div id="resume-display" aria-live="polite">
+            <div id="loading-indicator" style="display: none;">
+                Generating resume preview...
+            </div>
+            <div id="error-message" style="display: none;">
+                Error generating resume. Please try again.
+            </div>
             <!-- Generated resume will be displayed here -->
         </div>

Accessibility and UX improvements needed for the responsive navbar

The implementation has several issues that need to be addressed:

  • No ARIA attributes or roles for the hamburger menu button and mobile navigation
  • Missing keyboard navigation support
  • No transition animations for the mobile menu
  • Menu toggle button lacks proper accessibility labels

Key locations requiring attention:

  • resume.html: Add aria-expanded, aria-controls, and aria-label to the menu toggle button
  • style.css: Add smooth transitions for mobile menu open/close
  • resume.html: Add proper keyboard navigation support for the mobile menu
🔗 Analysis chain

Line range hint 1-349: Overall assessment of navbar responsiveness implementation.

The changes successfully address the core issue (#828) by implementing a responsive navbar with proper mobile navigation. The addition of login/signup options and dark mode toggle enhances the functionality. However, several improvements are recommended above to ensure better accessibility, maintainability, and user experience.

Let's verify the navbar's responsiveness across different screen sizes:


Let me gather more information about the responsive navbar implementation:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for responsive design breakpoints in CSS
# Test: Search for media queries. Expect: Breakpoints for mobile navigation

rg -A 3 "@media.*max-width" style.css

Length of output: 347


Script:

#!/bin/bash
# Check mobile navbar styles and transitions
rg -A 5 "mobile-navbar" style.css

# Check hamburger menu implementation
rg -A 5 "hamburger|menu-toggle" style.css

# Check if there are any accessibility attributes for the menu
rg "aria-|role=" resume.html

Length of output: 809

about.html (1)

Line range hint 234-283: Remove commented-out CSS code.

The old navbar styles are commented out but still present in the file. This creates unnecessary code bloat and confusion.

Remove the entire commented-out section to maintain code cleanliness.

index.html (1)

1049-1050: Improve accessibility by providing descriptive alt text for images

The chatbot image on lines 1049-1050 uses an alt attribute with "chatbot". For better accessibility, consider providing a more descriptive alt text.

Update the alt attribute:

-              <img class="h-20" src="chatbot.gif" alt="chatbot">
+              <img class="h-20" src="chatbot.gif" alt="Chatbot assistant icon">
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 443ceed and e4cf6af.

📒 Files selected for processing (4)
  • about.html (5 hunks)
  • index.html (1 hunks)
  • resume.html (7 hunks)
  • style.css (1 hunks)
🔇 Additional comments (2)
index.html (2)

909-909: Verify the project name "Resum Resume" for correctness

The logo text on line 909 displays "Resum Resume". Please verify if this is the intended name or if it should be "Resume" or "Resume Builder" to maintain consistency with the rest of the site and branding.


951-963: Ensure mobile navigation menu toggles correctly

The script controlling the mobile navigation menu (lines 951-963) uses a transform to slide the menu. Ensure that the .mobile-navbar class has the necessary CSS to support the transform: translateY(-100%) property when hidden and transform: translateY(0) when visible.

I recommend checking the CSS for .mobile-navbar to confirm it includes the appropriate transition and transform properties for smooth animation.

Comment on lines +160 to +162
.dark-mode-toggle {
margin-left: 15px;
opacity: 0;
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix accessibility issue with hidden elements

Using opacity: 0 keeps elements in the accessibility tree and they remain clickable. If the intent is to hide these elements, use display: none or visibility: hidden instead.

.dark-mode-toggle {
    margin-left: 15px; 
-    opacity: 0;
+    display: none;
}
📝 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.

Suggested change
.dark-mode-toggle {
margin-left: 15px;
opacity: 0;
.dark-mode-toggle {
margin-left: 15px;
display: none;

Comment on lines +183 to +195
.mobile-navbar{
width: 100%;
height: 290px;
background-color: var(--deep-teal);
position: fixed;
display: none;
justify-content: space-around;
align-items: flex-start;
z-index: 999;
top: 71px;
border-top: 2px solid wheat;
transform: translateY(-100%); /* Initially hidden off-screen */
transition: transform 0.4s ease; /* Smooth transition */
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Prevent potential content overflow in mobile menu

The fixed height of 290px could cause content overflow if there are many navigation items. Consider using max-height with overflow-y scroll.

.mobile-navbar {
-    height: 290px;
+    max-height: 80vh;
+    overflow-y: auto;
     /* ... other properties ... */
}
📝 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.

Suggested change
.mobile-navbar{
width: 100%;
height: 290px;
background-color: var(--deep-teal);
position: fixed;
display: none;
justify-content: space-around;
align-items: flex-start;
z-index: 999;
top: 71px;
border-top: 2px solid wheat;
transform: translateY(-100%); /* Initially hidden off-screen */
transition: transform 0.4s ease; /* Smooth transition */
.mobile-navbar{
width: 100%;
max-height: 80vh;
overflow-y: auto;
background-color: var(--deep-teal);
position: fixed;
display: none;
justify-content: space-around;
align-items: flex-start;
z-index: 999;
top: 71px;
border-top: 2px solid wheat;
transform: translateY(-100%); /* Initially hidden off-screen */
transition: transform 0.4s ease; /* Smooth transition */

Comment on lines +213 to +225
@media (max-width: 900px) {
.navbar, #auth-links{
display: none;
}

.hamburger{
display: block;
}

.home .content h3 {
font-size: 5rem;
color: #333;
font-size: 4.5rem;
font-weight: 600;
line-height: 6rem;
.mobile-navbar{
display: flex;
}

Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Enhance responsive behavior with intermediate breakpoint

The current implementation jumps directly from desktop to mobile at 900px. Consider adding an intermediate breakpoint for tablet-sized screens to provide a better user experience.

+@media (max-width: 1024px) {
+    .navbar a {
+        font-size: 16px;
+        margin: 0 10px;
+    }
+    #auth-links a {
+        font-size: 16px;
+    }
+}

 @media (max-width: 900px) {
     /* existing mobile 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.

Suggested change
@media (max-width: 900px) {
.navbar, #auth-links{
display: none;
}
.hamburger{
display: block;
}
.home .content h3 {
font-size: 5rem;
color: #333;
font-size: 4.5rem;
font-weight: 600;
line-height: 6rem;
.mobile-navbar{
display: flex;
}
@media (max-width: 1024px) {
.navbar a {
font-size: 16px;
margin: 0 10px;
}
#auth-links a {
font-size: 16px;
}
}
@media (max-width: 900px) {
.navbar, #auth-links{
display: none;
}
.hamburger{
display: block;
}
.mobile-navbar{
display: flex;
}

Comment on lines +154 to +157
.dark-mod{
width: 20px;
margin-top: -11px;
cursor: pointer;
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Dark mode implementation needs fixes

The verification reveals several inconsistencies in the dark mode implementation:

  • Inconsistent class naming: .dark-mod vs .dark-mode vs .dark-mode-toggle
  • The dark mode toggle is hidden with opacity: 0 in CSS but is actively used in HTML files
  • The JavaScript implementation is commented out (// document.body.classList.toggle('dark-mode-toggle', this.checked))
  • While there is a basic dark mode style (.dark-mode { background-color: #121212; color: #ffffff; }), it lacks specific styles for navbar elements

Specific issues:

  • style.css: Fix class naming consistency from .dark-mod to .dark-mode
  • index.html, about.html, resume.html: Uncomment and fix the dark mode toggle JavaScript
  • style.css: Add dark mode specific styles for navbar elements
  • style.css: Remove opacity: 0 from .dark-mode-toggle if the toggle should be visible
🔗 Analysis chain

Verify dark mode implementation

The dark mode toggle appears to be incomplete:

  1. The toggle is hidden with opacity: 0
  2. The dark-mod class uses inconsistent naming (dark-mod vs dark-mode)
  3. No styles defined for dark mode state of navbar elements

Consider implementing proper dark mode styles for the navbar to ensure consistency.

Also applies to: 160-162


Let me gather more information about the dark mode implementation to verify the concerns.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for dark mode related styles and usage
echo "Checking for dark mode style definitions..."
rg -l "dark-mod|dark-mode" --type css

echo "Checking for dark mode toggle implementation..."
rg -l "dark-mode-toggle" --type html

Length of output: 322


Script:

#!/bin/bash
# Check dark mode related styles in style.css
echo "Dark mode styles in style.css:"
rg "dark-mod|dark-mode" -A 5 style.css

# Check dark mode toggle implementation in HTML files
echo -e "\nDark mode toggle in HTML files:"
rg "dark-mode-toggle" -A 5 *.html

# Check for any JavaScript handling dark mode
echo -e "\nJavaScript dark mode handling:"
rg "dark.*mode" --type js

Length of output: 4268

Comment on lines 91 to 103
<style>
body{
body {
padding: 0;
}
header{

header {
position: relative;
margin-bottom: 5rem;
}
footer{

footer {
margin-top: 5rem;
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Move inline styles to external CSS file.

The inline styles should be moved to the external stylesheet for better maintainability and to follow the separation of concerns principle.

  1. Remove the inline <style> block and add these styles to style.css:
-    <style>
-        body {
-            padding: 0;
-        }
-
-        header {
-            position: relative;
-            margin-bottom: 5rem;
-        }
-
-        footer {
-            margin-top: 5rem;
-        }
-    </style>
  1. Add responsive margins in style.css:
/* Add to style.css */
body {
    padding: 0;
}

header {
    position: relative;
    margin-bottom: 5rem;
}

footer {
    margin-top: 5rem;
}

@media (max-width: 768px) {
    header {
        margin-bottom: 3rem;
    }
    
    footer {
        margin-top: 3rem;
    }
}

Comment on lines +185 to 200
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>LinkedIn Resume Builder - Home</title>

<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">

<link rel="icon" href="images/favicon-removebg-preview.png">
<link rel="stylesheet" href="style.css">
<label for ="dark-mode-toggle">
<input type="checkbox" id="dark-mode-toggle" />
Toggle Dark Mode
</label>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" />

<link rel="icon" href="images/favicon-removebg-preview.png" />

<link
href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap"
rel="stylesheet" />

<link rel="stylesheet" href="style.css" />
<style>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove duplicate <head> elements to fix invalid HTML

The HTML document contains multiple <head> elements (lines 185-200 and 228-243). According to HTML standards, an HTML file should have only one <head> section. Multiple <head> elements can lead to unexpected behavior and render issues in browsers.

Apply this diff to remove the duplicate <head> sections and consolidate their unique contents into the main <head> at the beginning of the document:

-    <!-- Duplicate head section starting at line 185 -->
-    <head>
-        <meta charset="UTF-8" />
-        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-        <title>LinkedIn Resume Builder - Home</title>
-        <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
-        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" />
-        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" />
-
-        <link rel="icon" href="images/favicon-removebg-preview.png" />
-
-        <link
-          href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900&display=swap"
-          rel="stylesheet" />
-
-        <link rel="stylesheet" href="style.css" />
-        <style>
-          /* Features Section */
-          /* ...additional styles... */
-        </style>
-    </head>
-
-    <!-- Duplicate head section starting at line 228 -->
-    <head>
-          <meta charset="UTF-8" />
-          <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-          <title>LinkedIn Resume Builder - Home</title>
-          <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
-          <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" />
-          <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" />
-
-          <link rel="icon" href="images/favicon-removebg-preview.png" />
-
-          <link
-            href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900&display=swap"
-            rel="stylesheet" />
-
-          <link rel="stylesheet" href="style.css" />
-          <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css"
-            integrity="sha512-Kc323vGBEqzTmouAECnVceyQqyqdsSiqLQISBL29aUW4U/M7pSPA/gEUZQqv1cwx4OnYxTxve5UMg5GT6L4JJg=="
-            crossorigin="anonymous" referrerpolicy="no-referrer" />
-          <style>
-            /* ...additional styles... */
-          </style>
-      </head>

Move any unique links or styles from these sections into the main <head> section at the beginning of the file.

Also applies to: 228-243

Comment on lines +207 to +220
/* <label for = "dark-mode-toggle" style="margin: 20px; display: block; text-align: center;"><label for="dark-mode-toggle"><input type="checkbox" id="dark-mode-toggle" />Toggle Dark Mode </label></label>.features-card {

.features-card {
background-color: white;
padding : 30px;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
width: calc(25% - 30px);
text-align: center;
transition: transform 0.3s, box-shadow 0.3s, z-index 0.3s;
position: relative;
z-index: 1;
} */

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Correct improperly nested CSS comments to fix syntax errors

The CSS code between lines 207-220 and lines 305-321 contains improperly nested comments and unclosed comment blocks, which can cause CSS parsing errors.

Apply this diff to fix the CSS comments:

-      /* <label for = "dark-mode-toggle" style="margin: 20px; display: block; text-align: center;"><label for="dark-mode-toggle"><input type="checkbox" id="dark-mode-toggle" />Toggle Dark Mode </label></label>.features-card {
-    		
-    		.features-card {
-    			background-color: white;
-    			padding : 30px;
-    			border-radius: 8px;
-    			box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
-    			width: calc(25% - 30px);
-    			text-align: center;
-    			transition: transform 0.3s, box-shadow 0.3s, z-index 0.3s;
-    			position: relative;
-    			z-index: 1;
-    		} */
+      /* <label for="dark-mode-toggle" style="margin: 20px; display: block; text-align: center;">
+         <input type="checkbox" id="dark-mode-toggle" />Toggle Dark Mode
+      </label> */
+
+      .features-card {
+        background-color: white;
+        padding: 30px;
+        border-radius: 8px;
+        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
+        width: calc(25% - 30px);
+        text-align: center;
+        transition: transform 0.3s, box-shadow 0.3s, z-index 0.3s;
+        position: relative;
+        z-index: 1;
+      }

-      */ .features-card:hover {
+      .features-card:hover {
         transform: translateY(-10px) scale(1.1);
         box-shadow: 0 4px 8px #0073b1;
         z-index: 3;
       }

I can help refactor and clean up the CSS code to ensure proper syntax and functionality. Would you like me to provide the corrected CSS?

Also applies to: 305-321

Comment on lines +201 to +376
background-color: #f9f9f9;
}

/* <label for = "dark-mode-toggle" style="margin: 20px; display: block; text-align: center;"><label for="dark-mode-toggle"><input type="checkbox" id="dark-mode-toggle" />Toggle Dark Mode </label></label>.features-card {

/* <label for ="dark-mode-toggle" style="margin: 20px; display: block; text-align: center;"><label for="dark-mode-toggle"><input type="checkbox" id="dark-mode-toggle" />Toggle Dark Mode </label></label> */

.features-card {
background-color: white;
padding: 30px;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
width: calc(25% - 30px);
text-align: center;
transition: transform 0.3s, box-shadow 0.3s, z-index 0.3s;
position: relative;
z-index: 1;
}

*/ .features-card:hover {
transform: translateY(-10px) scale(1.1);
box-shadow: 0 4px 8px #0073b1;
z-index: 3;
}


.features h2 {
text-align: center;
color: #333;
margin-bottom: 40px;
font-size: 32px;
text-align: center;
color: #333;
/* Consider changing this for better contrast */
margin-bottom: 40px;
font-size: 32px;
}

.features-cards {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 30px;
max-width: 1200px;
margin: 0 auto;
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 30px;
max-width: 1200px;
margin: 0 auto;
}

.features-card {
background-color: white;
padding: 30px;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
width: calc(25% - 30px);
text-align: center;
transition: transform 0.3s, box-shadow 0.3s, z-index 0.3s;
position: relative;
z-index: 1;
background-color: #fff;
/* You might want to change this to a softer off-white */

border-radius: 18px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
width: calc(25% - 30px);
text-align: center;

transition: transform 0.3s, box-shadow 0.3s, z-index 0.3s;
position: relative;
z-index: 1;
}

.features-card:hover {
transform: translateY(-10px) scale(1.1);
box-shadow: 0 4px 8px #0073b1;
z-index: 3;
transform: translateY(-10px) scale(1.1);
box-shadow: 0 4px 8px #0073b1;
/* Consider adjusting this to match the modern minimalist theme */
z-index: 3;
}

.features-card img {
width: 60px;
height: 60px;
margin-bottom: 20px;
width: 100%;
/* Set the width for the icon images */
height: 185px;
/* Set the height for the icon images */
/* margin-bottom: 20px; */
border-radius: 10px 10px 0 0;
/* Rounded corners for the images */
transition: transform 0.3s ease;
}

Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consolidate duplicate CSS styles to improve maintainability

The CSS styles for classes like .features, .features-card, .features h2, and related selectors are defined multiple times (lines 201-376 and lines 578-637). This duplication can lead to inconsistencies and makes the code harder to maintain.

Consider consolidating these styles into single definitions for each selector to enhance readability and ease future updates.

Also applies to: 578-637

index.html Outdated
Comment on lines 998 to 1014
<img src="assets/joao-ferrao-4YzrcDNcRVg-unsplash.jpg" alt="Easy to Use">
<h3>Easy to Use</h3>
<p>Create a professional resume effortlessly with our user-friendly interface.</p>
</div>
<div class="features-card">
<img src="assets/instant resume.jpg" alt="Instant Resume">
<h3>Instant Resume</h3>
<p>Generate a polished resume in seconds using your LinkedIn profile data.</p>
</div>
<div class="features-card">
<img src="assets/securedata.jpg" alt="Secure Data">
<h3>Secure Data</h3>
<p>Your personal information is safe with our secure and encrypted platform.</p>
</div>
<div class="features-card">
<img src="assets/support.jpg" alt="24/7 Support">
<h3>24/7 Support</h3>
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Optimize images for better performance

The images used in the features section (lines 998-1014) are large and might not be optimized for web use, potentially affecting page load times.

Consider compressing the images or using appropriately sized versions to improve performance without compromising visual quality.

Comment on lines +965 to +977
document.getElementById('toggler').addEventListener('change', function () {
// document.body.classList.toggle('dark-mode-toggle', this.checked);

// Change icon between darl and light
const icon = document.querySelector('.theme-mode');
if (this.checked) {
icon.classList.remove('fa-sun');
icon.classList.add('fa-moon');
} else {
icon.classList.remove('fa-moon');
icon.classList.add('fa-sun');
}
});
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Uncomment the dark mode toggle functionality

The JavaScript code for the dark mode toggle (lines 965-977) has a crucial line commented out, which prevents the dark mode from activating when the toggle is used.

Uncomment the line to enable dark mode functionality:

-            // document.body.classList.toggle('dark-mode-toggle', this.checked);
+            document.body.classList.toggle('dark-mode-toggle', this.checked);
📝 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.

Suggested change
document.getElementById('toggler').addEventListener('change', function () {
// document.body.classList.toggle('dark-mode-toggle', this.checked);
// Change icon between darl and light
const icon = document.querySelector('.theme-mode');
if (this.checked) {
icon.classList.remove('fa-sun');
icon.classList.add('fa-moon');
} else {
icon.classList.remove('fa-moon');
icon.classList.add('fa-sun');
}
});
document.getElementById('toggler').addEventListener('change', function () {
document.body.classList.toggle('dark-mode-toggle', this.checked);
// Change icon between darl and light
const icon = document.querySelector('.theme-mode');
if (this.checked) {
icon.classList.remove('fa-sun');
icon.classList.add('fa-moon');
} else {
icon.classList.remove('fa-moon');
icon.classList.add('fa-sun');
}
});

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 7

🧹 Outside diff range and nitpick comments (2)
resume.html (1)

Line range hint 277-292: Improve template selection accessibility.

The template selection cards lack proper keyboard navigation and ARIA attributes.

Enhance accessibility of template selection:

-            <div id="basic" class="template-card" onclick="selectTemplate('basic')">
-                <img src="templates/basic.jpg" alt="Basic Template">
-                <p>Basic</p>
-            </div>
+            <button 
+                type="button"
+                id="basic" 
+                class="template-card"
+                onclick="selectTemplate('basic')"
+                aria-label="Select Basic template"
+                role="radio"
+                aria-checked="false">
+                <img src="templates/basic.jpg" alt="" aria-hidden="true">
+                <p>Basic</p>
+            </button>

Apply similar changes to other template cards and add keyboard navigation:

const templateCards = document.querySelectorAll('.template-card');
templateCards.forEach(card => {
    card.addEventListener('keydown', (e) => {
        if (e.key === ' ' || e.key === 'Enter') {
            e.preventDefault();
            card.click();
        }
    });
});
about.html (1)

Line range hint 649-672: Move inline styles to external stylesheet.

The inline styles at the bottom of the file should be moved to the external stylesheet for better maintainability.

Move these styles to style.css:

// In style.css
+ .footer-section {
+     display: flex;
+     justify-content: left;
+     flex-direction: column;
+ }
+ 
+ .ul {
+     display: flex;
+     flex-direction: column;
+     justify-content: left;
+ }
+ 
+ .footer li {
+     text-align: left;
+ }
+ 
+ .footer a {
+     color: white;
+ }
+ 
+ .footer p {
+     margin-top: 2rem;
+ }

Then remove the inline <style> tag from the HTML file.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between e4cf6af and 1b48e0a.

📒 Files selected for processing (3)
  • about.html (6 hunks)
  • index.html (2 hunks)
  • resume.html (7 hunks)
🔇 Additional comments (8)
about.html (6)

18-27: Remove duplicate CSS variables.

The :root CSS variables are declared twice in the file.

Also applies to: 146-151


346-467: Optimize scroll performance and progress bar implementation.

The progress bar implementation needs optimization for better performance.


490-499: Improve navigation accessibility.

The navigation components need proper ARIA attributes and keyboard accessibility.


558-560: Add meaningful alt text to images.

Also applies to: 568-569, 584-586


637-640: Improve social media links security and functionality.


674-686: Fix JavaScript errors and consolidate scripts.

The script contains a reference to a non-existent element and should be consolidated with other scripts.

index.html (2)

243-245: Preserve unique Font Awesome 6 stylesheet link when consolidating head sections.

When consolidating the duplicate head sections as suggested in the previous review, ensure to preserve this unique Font Awesome 6 stylesheet link that's only present in the third head section.


998-1014: Verify image paths and ensure they exist.

The feature cards reference images from the assets/ directory. Let's verify these paths are correct and the images exist.

✅ Verification successful

All referenced image files exist in the correct location

All image paths referenced in the feature cards section are valid and the files exist in the assets/ directory:

  • assets/joao-ferrao-4YzrcDNcRVg-unsplash.jpg
  • assets/instant resume.jpg
  • assets/securedata.jpg
  • assets/support.jpg
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that referenced images exist in the assets directory

# Test: Check if the images exist
fd -t f -e jpg -e gif . | grep -E "joao-ferrao-4YzrcDNcRVg-unsplash.jpg|instant resume.jpg|securedata.jpg|support.jpg"

Length of output: 231

Comment on lines +51 to +60
<div class="main-links">
<a href="#home">Home</a>
<a href="about.html">About</a>
<a href="resume.html">Build Resume</a>
</div>
<div class="auth-links">
<a href="signup.html">Sign Up</a>
<a href="login.html">Login</a>
</nav>

<div class="icons">
<a href="about.html" class="fas fa-info-circle"></a>
<a href="#" class="fas fa-envelope"></a>
<a href="login.html" id="loginIcon" class="fas fa-user"></a>
</div>
</header>
</nav>
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Reduce code duplication in navigation structure.

The navigation links are duplicated between the main navbar and mobile navbar, which violates the DRY principle and makes maintenance harder.

Consider using a single source of navigation links that can be reused:

-    <nav class="mobile-navbar">
-        <div class="main-links">
-            <a href="#home">Home</a>
-            <a href="about.html">About</a>
-            <a href="resume.html">Build Resume</a>
-        </div>
-        <div class="auth-links">
-            <a href="signup.html">Sign Up</a>
-            <a href="login.html">Login</a>
-        </div>
-    </nav>
+    <template id="nav-links">
+        <a href="#home">Home</a>
+        <a href="about.html">About</a>
+        <a href="resume.html">Build Resume</a>
+    </template>
+    <nav class="mobile-navbar">
+        <div class="main-links"></div>
+        <div class="auth-links"></div>
+    </nav>

Add this JavaScript to populate navigation:

const navTemplate = document.getElementById('nav-links');
const mobileNav = document.querySelector('.mobile-navbar .main-links');
mobileNav.innerHTML = navTemplate.innerHTML;

Comment on lines 141 to 146
<label>Contact Number:</label>
<input type="tel" id="contact" placeholder="Enter your contact number">

<label>Location:</label>
<input type="text" id="location" placeholder="Enter your location">
</div>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add input validation for contact fields.

The new contact and location fields lack proper validation and accessibility attributes.

Add validation and accessibility improvements:

-                    <label>Contact Number:</label>
-                    <input type="tel" id="contact" placeholder="Enter your contact number">
+                    <label for="contact">Contact Number:</label>
+                    <input type="tel" id="contact" 
+                           placeholder="Enter your contact number"
+                           pattern="[0-9]{10}"
+                           aria-describedby="contact-format"
+                           required>
+                    <small id="contact-format" class="form-text">
+                        Please enter a valid 10-digit phone number
+                    </small>

-                    <label>Location:</label>
-                    <input type="text" id="location" placeholder="Enter your location">
+                    <label for="location">Location:</label>
+                    <input type="text" id="location" 
+                           placeholder="Enter your location"
+                           required>
📝 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.

Suggested change
<label>Contact Number:</label>
<input type="tel" id="contact" placeholder="Enter your contact number">
<label>Location:</label>
<input type="text" id="location" placeholder="Enter your location">
</div>
<label for="contact">Contact Number:</label>
<input type="tel" id="contact"
placeholder="Enter your contact number"
pattern="[0-9]{10}"
aria-describedby="contact-format"
required>
<small id="contact-format" class="form-text">
Please enter a valid 10-digit phone number
</small>
<label for="location">Location:</label>
<input type="text" id="location"
placeholder="Enter your location"
required>
</div>

Comment on lines +67 to +73
menuToggle.addEventListener('change', function () {
if (this.checked) {
mobileNavbar.style.transform = 'translateY(0)'; // Slide down into view
} else {
mobileNavbar.style.transform = 'translateY(-100%)'; // Slide up out of view
}
});
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Enhance mobile menu transitions and touch support.

The current implementation directly manipulates styles and lacks touch event support, which may affect mobile UX.

Use CSS transitions and add touch support:

+    <style>
+        .mobile-navbar {
+            transform: translateY(-100%);
+            transition: transform 0.3s ease-in-out;
+        }
+        .mobile-navbar.active {
+            transform: translateY(0);
+        }
+    </style>
-        menuToggle.addEventListener('change', function () {
-            if (this.checked) {
-                mobileNavbar.style.transform = 'translateY(0)';
-            } else {
-                mobileNavbar.style.transform = 'translateY(-100%)';
-            }
-        });
+        menuToggle.addEventListener('change', function () {
+            mobileNavbar.classList.toggle('active', this.checked);
+        });
+        
+        // Add touch support
+        let touchStartY = 0;
+        mobileNavbar.addEventListener('touchstart', e => {
+            touchStartY = e.touches[0].clientY;
+        });
+        
+        mobileNavbar.addEventListener('touchmove', e => {
+            const touchY = e.touches[0].clientY;
+            const diff = touchY - touchStartY;
+            if (diff > 50) { // Swipe down threshold
+                menuToggle.checked = false;
+                mobileNavbar.classList.remove('active');
+            }
+        });

Committable suggestion was skipped due to low confidence.

Comment on lines +529 to +541
document.getElementById('toggler').addEventListener('change', function () {
// document.body.classList.toggle('dark-mode-toggle', this.checked);

// Change icon between darl and light
const icon = document.querySelector('.theme-mode');
if (this.checked) {
icon.classList.remove('fa-sun');
icon.classList.add('fa-moon');
} else {
icon.classList.remove('fa-moon');
icon.classList.add('fa-sun');
}
});
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix dark mode toggle implementation.

The dark mode toggle has several issues:

  1. The commented-out code should be removed
  2. The dark mode state is not persisted
  3. The initial state is not set based on user preference

Apply these improvements:

+    // Check for user's preferred color scheme
+    const prefersDarkScheme = window.matchMedia('(prefers-color-scheme: dark)');
+    
+    // Get stored theme or use system preference
+    const currentTheme = localStorage.getItem('theme') || 
+        (prefersDarkScheme.matches ? 'dark' : 'light');
+    
+    // Apply initial theme
+    if (currentTheme === 'dark') {
+        document.body.classList.add('dark-mode');
+        document.getElementById('toggler').checked = true;
+    }
+
     document.getElementById('toggler').addEventListener('change', function () {
-        // document.body.classList.toggle('dark-mode-toggle', this.checked);
+        document.body.classList.toggle('dark-mode', this.checked);
+        localStorage.setItem('theme', this.checked ? 'dark' : 'light');

         // Change icon between dark and light
         const icon = document.querySelector('.theme-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.

Suggested change
document.getElementById('toggler').addEventListener('change', function () {
// document.body.classList.toggle('dark-mode-toggle', this.checked);
// Change icon between darl and light
const icon = document.querySelector('.theme-mode');
if (this.checked) {
icon.classList.remove('fa-sun');
icon.classList.add('fa-moon');
} else {
icon.classList.remove('fa-moon');
icon.classList.add('fa-sun');
}
});
// Check for user's preferred color scheme
const prefersDarkScheme = window.matchMedia('(prefers-color-scheme: dark)');
// Get stored theme or use system preference
const currentTheme = localStorage.getItem('theme') ||
(prefersDarkScheme.matches ? 'dark' : 'light');
// Apply initial theme
if (currentTheme === 'dark') {
document.body.classList.add('dark-mode');
document.getElementById('toggler').checked = true;
}
document.getElementById('toggler').addEventListener('change', function () {
document.body.classList.toggle('dark-mode', this.checked);
localStorage.setItem('theme', this.checked ? 'dark' : 'light');
// Change icon between dark and light
const icon = document.querySelector('.theme-mode');
if (this.checked) {
icon.classList.remove('fa-sun');
icon.classList.add('fa-moon');
} else {
icon.classList.remove('fa-moon');
icon.classList.add('fa-sun');
}
});

Comment on lines +470 to +502
<header>
<!-- <input type="checkbox" name="" id="toggler">
<label for="toggler" class="fas fa-bars"></label> -->
<a href="#" class="logo">Resum Resume<span>.</span></a>

<nav class="navbar">
<a href="#home">Home</a>
<a href="about.html">About</a>
<a href="resume.html">Build Resume</a>
<!-- <a href="signup.html">Sign Up</a> -->
<!-- <a href="login.html">Login</a> -->
</nav>

<div class="auth-and-theme">
<!-- Login/Signup dynamically added, adding JS below, you can see -->
<div id="auth-links">
<a href="signup.html" id="signup-link">Sign Up</a>
<a href="login.html" id="login-link">Login</a>
</div>

<!-- Hamburger menu for small screens -->
<div class="hamburger">
<input type="checkbox" id="menu-toggle" class="menu-toggle">
<label for="menu-toggle" class="fas fa-bars menu-icon"></label>
</div>
<!-- Dark mode toggle, better in last of nav -->
<div class="dark-mod">
<input type="checkbox" name="" id="toggler" class="dark-mode-toggle">
<label for="toggler" class="fas fa-moon theme-mode"></label>
</div>
</div>

</header>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Improve header structure and accessibility.

The header section has several issues:

  1. Commented-out code should be removed
  2. The logo link lacks proper href and aria-label
  3. The navigation menu needs proper ARIA attributes

Apply these improvements:

-    <a href="#" class="logo">Resum Resume<span>.</span></a>
+    <a href="index.html" class="logo" aria-label="Home">Resum Resume<span>.</span></a>

-    <nav class="navbar">
+    <nav class="navbar" aria-label="Main navigation">

Also, remove the commented-out code at lines 471-472 and 479-480.

📝 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.

Suggested change
<header>
<!-- <input type="checkbox" name="" id="toggler">
<label for="toggler" class="fas fa-bars"></label> -->
<a href="#" class="logo">Resum Resume<span>.</span></a>
<nav class="navbar">
<a href="#home">Home</a>
<a href="about.html">About</a>
<a href="resume.html">Build Resume</a>
<!-- <a href="signup.html">Sign Up</a> -->
<!-- <a href="login.html">Login</a> -->
</nav>
<div class="auth-and-theme">
<!-- Login/Signup dynamically added, adding JS below, you can see -->
<div id="auth-links">
<a href="signup.html" id="signup-link">Sign Up</a>
<a href="login.html" id="login-link">Login</a>
</div>
<!-- Hamburger menu for small screens -->
<div class="hamburger">
<input type="checkbox" id="menu-toggle" class="menu-toggle">
<label for="menu-toggle" class="fas fa-bars menu-icon"></label>
</div>
<!-- Dark mode toggle, better in last of nav -->
<div class="dark-mod">
<input type="checkbox" name="" id="toggler" class="dark-mode-toggle">
<label for="toggler" class="fas fa-moon theme-mode"></label>
</div>
</div>
</header>
<header>
<a href="index.html" class="logo" aria-label="Home">Resum Resume<span>.</span></a>
<nav class="navbar" aria-label="Main navigation">
<a href="#home">Home</a>
<a href="about.html">About</a>
<a href="resume.html">Build Resume</a>
</nav>
<div class="auth-and-theme">
<!-- Login/Signup dynamically added, adding JS below, you can see -->
<div id="auth-links">
<a href="signup.html" id="signup-link">Sign Up</a>
<a href="login.html" id="login-link">Login</a>
</div>
<!-- Hamburger menu for small screens -->
<div class="hamburger">
<input type="checkbox" id="menu-toggle" class="menu-toggle">
<label for="menu-toggle" class="fas fa-bars menu-icon"></label>
</div>
<!-- Dark mode toggle, better in last of nav -->
<div class="dark-mod">
<input type="checkbox" name="" id="toggler" class="dark-mode-toggle">
<label for="toggler" class="fas fa-moon theme-mode"></label>
</div>
</div>
</header>

Comment on lines +827 to +852
@media (max-width: 768px) {
.navbar {
flex-direction: column;
align-items: flex-start;
}

.navbar ul {
flex-direction: column;
gap: 10px;
margin-top: 10px;
}

.hero-content {
flex-direction: column;
}

.hero-text {
padding-right: 0;
margin-bottom: 30px;
}

.features-card,
.testimonial-card {
width: 100%;
}
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove duplicate responsive styles.

These responsive styles are duplicates of the ones defined at lines 716-750. Consolidate them into a single definition to maintain consistency and improve maintainability.

Comment on lines +1108 to +1119
function updateProgressBar() {
const scrollTop = window.scrollY;
const windowHeight = document.documentElement.scrollHeight - window.innerHeight;
const scrollPercentage = (scrollTop / windowHeight) * 100;


const progressBar = document.getElementById('progress-bar');


lastScrollPercentage += (scrollPercentage - lastScrollPercentage) * 0.1;
progressBar.style.width = lastScrollPercentage + '%';
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Optimize progress bar performance.

The current implementation updates the progress bar on every scroll event and uses a simple easing calculation. Consider these improvements:

  1. Use requestAnimationFrame for smoother animations
  2. Throttle the scroll event handler to reduce calculations
 function updateProgressBar() {
-  const scrollTop = window.scrollY;
-  const windowHeight = document.documentElement.scrollHeight - window.innerHeight;
-  const scrollPercentage = (scrollTop / windowHeight) * 100;
-
-  lastScrollPercentage += (scrollPercentage - lastScrollPercentage) * 0.1;
-  progressBar.style.width = lastScrollPercentage + '%';
+  requestAnimationFrame(() => {
+    const scrollTop = window.scrollY;
+    const windowHeight = document.documentElement.scrollHeight - window.innerHeight;
+    const scrollPercentage = (scrollTop / windowHeight) * 100;
+    
+    lastScrollPercentage += (scrollPercentage - lastScrollPercentage) * 0.1;
+    progressBar.style.width = lastScrollPercentage + '%';
+  });
 }
-window.addEventListener('scroll', updateProgressBar);
+window.addEventListener('scroll', throttle(updateProgressBar, 16)); // ~60fps
+
+function throttle(func, limit) {
+  let inThrottle;
+  return function() {
+    const args = arguments;
+    const context = this;
+    if (!inThrottle) {
+      func.apply(context, args);
+      inThrottle = true;
+      setTimeout(() => inThrottle = false, limit);
+    }
+  }
+}

Committable suggestion was skipped due to low confidence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug : Navbar is not responsive
2 participants