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

changes the font of navbar and added a hover effect. #103

Merged
merged 3 commits into from
Oct 6, 2024

Conversation

Ayush215mb
Copy link
Contributor

@Ayush215mb Ayush215mb commented Oct 6, 2024

I am again creating a pull request as my previous one was having many conflicts.
Please accept it as soon as possible because as you will accept other PR, this codebase will becomes outdated creating conflicts.

Summary by CodeRabbit

  • New Features

    • Enhanced desktop navigation menu with improved styling and hover effects for menu items and buttons.
    • Introduced the Poppins font for a refreshed look across the application.
  • Bug Fixes

    • Consistent hover effects for mobile menu buttons to match the desktop experience.
  • Style

    • Updated various CSS classes for better visual presentation and refined component styles, including scrollbar customization.

Copy link

vercel bot commented Oct 6, 2024

@Ayush215mb is attempting to deploy a commit to the bunty's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

coderabbitai bot commented Oct 6, 2024

Walkthrough

The pull request introduces styling and structural modifications to the Navbar.jsx component and the index.css file. Key updates include the addition of the Poppins font, enhanced hover effects for menu items and buttons, and adjustments to various CSS classes. While the visual presentation is improved, the core functionality, including authentication handling and mobile menu structure, remains unchanged.

Changes

File Change Summary
frontend/src/components/Shared/Navbar.jsx Updated styling for desktop menu items and buttons, added hover effects, no functional changes.
frontend/src/index.css Added Poppins font import, defined .Poppins class, updated .font-outline-2, .primary-btn, and .page-shadow classes, and customized scrollbar styles.

Possibly related PRs

Suggested labels

enhancement, level 1, gssoc-ext

Poem

🐇 In the navbar's glow, the Poppins font shines,
With hover effects that dance like fine lines.
Buttons now leap, with style so bright,
A menu that sparkles, a true delight!
So hop on and click, let the journey begin,
With each little change, we all can win! 🌟


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 0c1d994 and e8efabb.

📒 Files selected for processing (1)
  • frontend/src/components/Shared/Navbar.jsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/src/components/Shared/Navbar.jsx

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
Contributor

github-actions bot commented Oct 6, 2024

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

Copy link
Contributor

@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: 0

🧹 Outside diff range and nitpick comments (6)
frontend/src/index.css (4)

1-1: LGTM! Consider moving the .Poppins class into a layer.

The addition of the Poppins font and the corresponding class is a good improvement for typography consistency. The import provides a wide range of weights and styles, offering flexibility in design.

Consider moving the .Poppins class into the @layer base directive for better organization and to follow Tailwind's recommended structure:

@layer base {
  .Poppins {
    font-family: "Poppins", sans-serif;
  }
}

Also applies to: 15-17


Line range hint 9-13: Consider adding cross-browser support for text outline.

The addition of the .font-outline-2 class is a nice touch for creating outlined text. However, the current implementation only works in WebKit-based browsers.

To improve cross-browser compatibility, consider using a combination of text-shadow properties. Here's an example:

@layer base {
  .font-outline-2 {
    -webkit-text-stroke: 2px white;
    text-shadow:
      -2px -2px 0 #fff,
      2px -2px 0 #fff,
      -2px 2px 0 #fff,
      2px 2px 0 #fff;
  }
}

This approach will provide a similar effect in browsers that don't support -webkit-text-stroke.


Line range hint 21-26: LGTM! Consider improving readability of shadow values.

The updates to .primary-btn and .page-shadow classes are good improvements. The complex shadow effect in .page-shadow can create an interesting depth effect.

To improve readability of the shadow values in .page-shadow, consider breaking them into multiple lines:

.page-shadow {
  @apply shadow-[
    inset_0_0_8px_rgba(0,0,0,0.6),
    12px_12px_14px_rgba(0,0,0,0.9)
  ];
}

This format makes it easier to read and modify the shadow values if needed in the future.


Line range hint 30-44: Consider adding cross-browser support for scrollbar styling.

The addition of custom scrollbar styles is a nice touch for improving the user interface. However, the current implementation only works in WebKit-based browsers.

To improve cross-browser compatibility and maintain consistency with your project's color scheme, consider the following:

  1. Use CSS variables for colors to ensure consistency and easy updates:
:root {
  --scrollbar-bg: beige;
  --scrollbar-hover: #004D43;
}
  1. Add Firefox-specific scrollbar styling:
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-bg) transparent;
}

*:hover {
  scrollbar-color: var(--scrollbar-hover) transparent;
}
  1. Update the WebKit scrollbar styles to use the CSS variables:
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-bg);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-hover);
}

This approach will provide a more consistent scrollbar appearance across different browsers while making it easier to update the color scheme in the future.

frontend/src/components/Shared/Navbar.jsx (2)

101-103: Improved desktop menu styling and interaction.

The changes enhance the visual appeal and user experience of the desktop menu. The addition of the Poppins font, increased spacing, and larger font size improve readability. The hover effect with scale and translation provides better visual feedback to users.

Consider adding a smooth transition to the hover effect for a more polished look:

- <li key={item.name} className="transform hover:scale-110 hover:-translate-y-1 transition ">
+ <li key={item.name} className="transform hover:scale-110 hover:-translate-y-1 transition duration-300 ease-in-out">

124-125: Consistent styling for login button.

The login button now has the same hover effect as the menu items and logout button, which further improves the overall consistency of the user interface. This change enhances the user experience by providing uniform interaction across all clickable elements in the navbar.

Consider adding an aria-label to the login and logout buttons to improve accessibility:

- <button
+ <button
+   aria-label="Log In"
    onClick={handleLogin}
    className={`${baseTextColorClass} ${hoverTextColorClass} transform hover:scale-110 hover:-translate-y-1 transition `}
    type="button"
  >
    Log In
  </button>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between dfd3962 and 0c1d994.

📒 Files selected for processing (2)
  • frontend/src/components/Shared/Navbar.jsx (2 hunks)
  • frontend/src/index.css (2 hunks)
🧰 Additional context used
🔇 Additional comments (2)
frontend/src/components/Shared/Navbar.jsx (2)

114-116: Consistent styling for logout button.

The logout button now has the same hover effect as the menu items, which improves the overall consistency of the user interface. This change enhances the user experience by providing uniform interaction across all clickable elements in the navbar.


Line range hint 1-190: Overall improvement in navbar styling and consistency.

The changes made to the Navbar component enhance its visual appeal and user experience without affecting its core functionality. The consistent hover effects across menu items and buttons create a more cohesive interface.

Regarding the addition of the Poppins font:

  1. Ensure that the Poppins font is properly imported in your project, either through a CSS import or a link in the HTML file.
  2. Consider adding a fallback font for cases where Poppins might not be available:
- <ul className="ml-4 flex space-x-5 Poppins font-semibold text-lg">
+ <ul className="ml-4 flex space-x-5 font-poppins font-semibold text-lg">

Then, in your CSS (probably in index.css):

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

.font-poppins {
  font-family: 'Poppins', sans-serif;
}

This approach ensures that the Poppins font is properly loaded and provides a fallback if it's not available.

To verify the font import, please run the following script:

✅ Verification successful

Let's proceed to search the entire codebase for any references to the "Poppins" font to determine where it is being imported or used.


Poppins font is properly imported and used.

The Poppins font is correctly imported in frontend/src/index.css and utilized within the Navbar component and Tailwind configuration. No further action is required.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if Poppins font is imported in index.css or index.html

echo "Checking for Poppins font import in index.css:"
rg --type css "font-family.*Poppins" src/index.css

echo "Checking for Poppins font import in index.html:"
rg "https://fonts.googleapis.com/css.*family=Poppins" public/index.html

echo "If no results are shown, the Poppins font might not be properly imported."

Length of output: 603


Script:

#!/bin/bash
# Search for 'Poppins' in all CSS and JavaScript/JSX files

echo "Searching for Poppins font imports in CSS files:"
rg --type css "Poppins"

echo "Searching for Poppins font imports in JavaScript/JSX files:"
rg --type js "Poppins"

echo "If no results are found, the Poppins font might not be imported or used in the codebase."

Length of output: 980

@Ayush215mb
Copy link
Contributor Author

My assigned issue was #39 and my last PR which was having conflicts were #69 .
I have completed the issue assigned to me, so add the labels in this PR and accept it.

Copy link

vercel bot commented Oct 6, 2024

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

Name Status Preview Comments Updated (UTC)
play-cafe ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 6, 2024 3:03pm

@RamakrushnaBiswal
Copy link
Owner

LGTM 🚀

@Ayush215mb
Copy link
Contributor Author

@RamakrushnaBiswal You also have to assign me here and add labels in this PR for hacktober and gssoc to count it.
They are not counting it right now so please add them asap .

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

Successfully merging this pull request may close these issues.

2 participants