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

Add - Added hover effects and offer prices to Today's Special items #228

Conversation

Ashwinib26
Copy link
Contributor

@Ashwinib26 Ashwinib26 commented Oct 11, 2024

Implemented a stylish custom font for "Today's Special," added hover effects and dynamic price displays (original prices and offer prices), ensuring a visually appealing and interactive user experience.

Before :

items

After :

changed

Summary by CodeRabbit

  • New Features

    • Enhanced visual design for "Today's Special" section with larger gradient text and updated font.
    • Improved card component heights for coffee, food, and drinks to maintain uniformity.
  • Bug Fixes

    • Refined price display logic for a smoother transition effect on hover.

Copy link

vercel bot commented Oct 11, 2024

@Ashwinib26 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 11, 2024

Walkthrough

The changes in TodaysSpecial.jsx focus on enhancing the visual presentation and structure of the "Today's Special" component. Key modifications include an updated header font size and style, adjustments to card component heights, and a refactoring of the price display logic to improve hover effects. These updates aim to create a more appealing and consistent layout for the special items showcased.

Changes

File Path Change Summary
frontend/src/components/Pages/TodaysSpecial.jsx Updated header font size and style, adjusted card heights, and refactored price display logic for hover effects.

Possibly related PRs

Suggested labels

enhancement, level 2, gssoc-ext

Suggested reviewers

  • RamakrushnaBiswal

Poem

In the garden of specials, bright and fair,
Today's delights dance in the air.
With hover and sparkle, they catch the eye,
Come taste the magic, give it a try!
A sprinkle of joy, a dash of cheer,
Our specials await, so hop over here! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 73003bf and 2ca5252.

📒 Files selected for processing (1)
  • frontend/src/components/Pages/TodaysSpecial.jsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/src/components/Pages/TodaysSpecial.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

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 (3)
frontend/src/components/Pages/TodaysSpecial.jsx (3)

55-58: Improved header styling looks great!

The changes to the header, including the larger font size, gradient effect, and custom font, significantly enhance the visual appeal of the "Today's Special" section. This aligns well with the PR objectives.

Consider adding a fallback font and ensuring the Lobster font is properly loaded. You can modify the font-family like this:

- style={{ fontFamily: 'Lobster, cursive' , lineHeight: '1.2', paddingBottom: '10px'}}
+ style={{ fontFamily: '"Lobster", cursive, sans-serif' , lineHeight: '1.2', paddingBottom: '10px'}}

Also, make sure to include the Lobster font in your project's font loading strategy.


63-75: Great improvements to the Coffee Card component!

The changes to the card height and the refactored price display logic with CSS transitions enhance both the visual consistency and the user interaction. This aligns well with the PR objectives for adding hover effects and improving the presentation of offer prices.

To improve accessibility, consider adding aria-hidden="true" to the price display div and including a visually hidden element with the price information that's always available to screen readers. For example:

<div className={`mt-4 transition-opacity duration-300 ease-in-out ${hoveredItem === 'coffee' ? 'opacity-100' : 'opacity-0'}`} aria-hidden="true">
  <p className="text-lg font-bold text-red-700 line-through">{todaysSpecial.coffee.originalPrice}</p>
  <p className="text-xl font-bold text-red-500">{todaysSpecial.coffee.offerPrice}</p>
</div>
<div className="sr-only">
  Original price: {todaysSpecial.coffee.originalPrice}, Offer price: {todaysSpecial.coffee.offerPrice}
</div>

This ensures that the price information is always accessible, regardless of the hover state.


Line range hint 1-118: Overall, excellent improvements to the Today's Special component!

The changes successfully implement the PR objectives of adding hover effects and displaying offer prices for the Today's Special items. The consistent styling and interaction patterns across all card types create a cohesive and visually appealing user interface.

To further improve the code structure and reduce duplication, consider extracting the common card structure into a separate reusable component. This would make the code more maintainable and easier to update in the future. Here's a suggestion:

  1. Create a new component, e.g., SpecialCard:
const SpecialCard = ({ item, type }) => (
  <div
    className={`bg-${type === 'food' ? 'teal' : 'pink'}-100 p-4 rounded-lg shadow-lg max-w-xs text-center transition-transform duration-300 ease-in-out transform hover:scale-105 mx-2`}
    style={{ minHeight: '350px', maxHeight: '350px' }}
    onMouseEnter={() => setHoveredItem(type)}
    onMouseLeave={() => setHoveredItem(null)}
  >
    <img className="w-64 h-48 object-cover object-center rounded-md mb-4" src={item.image} alt={item.name} />
    <h3 className="text-xl font-semibold">{item.name}</h3>
    <p className="text-gray-600">{item.description}</p>
    <div className={`mt-4 transition-opacity duration-300 ease-in-out ${hoveredItem === type ? 'opacity-100' : 'opacity-0'}`} aria-hidden="true">
      <p className="text-lg font-bold text-red-700 line-through">{item.originalPrice}</p>
      <p className="text-xl font-bold text-red-500">{item.offerPrice}</p>
    </div>
    <div className="sr-only">
      Original price: {item.originalPrice}, Offer price: {item.offerPrice}
    </div>
  </div>
);
  1. Use the new component in the main render function:
<div className="flex flex-col md:flex-row justify-around items-center mb-8 space-y-8 md:space-y-0 md:space-x-4">
  <SpecialCard item={todaysSpecial.coffee} type="coffee" />
  <SpecialCard item={todaysSpecial.food} type="food" />
  <SpecialCard item={todaysSpecial.drink} type="drink" />
</div>

This refactoring would significantly reduce code duplication and make future updates easier to manage.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 6102828 and 82cb524.

📒 Files selected for processing (1)
  • frontend/src/components/Pages/TodaysSpecial.jsx (2 hunks)
🧰 Additional context used
🔇 Additional comments (2)
frontend/src/components/Pages/TodaysSpecial.jsx (2)

81-93: Consistent improvements applied to the Food Card component

The changes to the Food Card component mirror those made to the Coffee Card, maintaining a consistent design and interaction pattern across the different item types. This uniformity enhances the overall user experience and aligns with the PR objectives.

Please apply the same accessibility improvements suggested for the Coffee Card component to this Food Card component as well.


99-111: Uniform improvements applied to the Drink Card component

The changes to the Drink Card component are consistent with those made to the Coffee and Food Card components. This uniformity across all item types creates a cohesive and polished user interface, fully aligning with the PR objectives.

Please apply the same accessibility improvements suggested for the Coffee and Food Card components to this Drink Card component as well.

Copy link

vercel bot commented Oct 12, 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 12, 2024 0:51am
play-cafe-backen ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 12, 2024 0:51am

@RamakrushnaBiswal
Copy link
Owner

image
@Ashwinib26 change the font and color to black

@Ashwinib26
Copy link
Contributor Author

@RamakrushnaBiswal , I made the required changes.

After Updates :

changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request gssoc-ext gssoc-extd program level1 for 10 points
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants