Skip to content

Conversation

@Akdest
Copy link

@Akdest Akdest commented Aug 1, 2025

Updated UI of Landing Page, which is modern , added animations, responsive, and elements are placed correctly, added comments for dev friendly.
Thank you.

Summary by CodeRabbit

  • New Features

    • Enhanced the home page with animated UI elements, including animated shapes, feature cards, and call-to-action buttons using smooth motion effects.
    • Improved visual appeal with layered backgrounds and responsive animated components.
  • Chores

    • Added "framer-motion" as a new dependency to support animations.

@coderabbitai
Copy link

coderabbitai bot commented Aug 1, 2025

Walkthrough

A new dependency, "framer-motion," was added to the project's package.json. The Home.jsx page was extensively refactored to replace its static layout with animated UI elements using framer-motion, including animated shapes, motion-enhanced text, animated feature cards, and interactive call-to-action buttons. The control flow for fetching GitHub stars remains unchanged.

Changes

Cohort / File(s) Change Summary
Dependency Addition
eduaid_web/package.json
Added "framer-motion" (version ^12.23.12) to the dependencies list.
Home Page Animation Refactor
eduaid_web/src/pages/Home.jsx
Refactored the Home page to use framer-motion for animated UI elements: animated SVG shapes, motion-enhanced header and subtitle, animated feature cards, and interactive call-to-action buttons. Adjusted layout for layered effects and improved responsiveness. Moved GitHub stars display to navbar and made minor data handling fixes. No changes to the Home component's export signature or control flow for fetching GitHub stars.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant HomePage
    participant FramerMotion
    participant GitHubAPI

    User->>HomePage: Loads Home.jsx
    HomePage->>GitHubAPI: Fetch GitHub stars (unchanged)
    GitHubAPI-->>HomePage: Return star count
    HomePage->>FramerMotion: Render animated shapes, text, features, buttons
    FramerMotion-->>User: Display animated UI
    HomePage-->>User: Show updated GitHub stars in navbar
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes

Poem

🐇✨
I hopped through code with motion and flair,
Animated shapes now drift through the air.
With framer-motion, the page comes alive,
Buttons and features that bounce and thrive.
A starry navbar, a UI delight—
This rabbit approves, the changes feel right!
🌟

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this 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: 2

🧹 Nitpick comments (2)
eduaid_web/src/pages/Home.jsx (2)

70-87: Consider using unique icons for each feature

All features currently use the same starsImg icon, which may not be visually distinctive. Consider using different icons that better represent each feature's functionality.


299-319: Consider using consistent design tokens

The navbar uses arbitrary color values like #45454599 and #5a5a5a99. Consider defining these as CSS variables or Tailwind config values for better maintainability.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 122eefb and 034596b.

⛔ Files ignored due to path filters (1)
  • eduaid_web/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • eduaid_web/package.json (1 hunks)
  • eduaid_web/src/pages/Home.jsx (2 hunks)
🔇 Additional comments (4)
eduaid_web/package.json (1)

10-10: Approve framer-motion addition

The dependency "framer-motion": "^12.23.12" in eduaid_web/package.json is the latest stable release (published ~8 hours ago) and has no known direct security vulnerabilities per Snyk. It aligns perfectly with the PR’s animation objectives—no further changes needed.

eduaid_web/src/pages/Home.jsx (3)

1-9: Import statements look good!

The addition of framer-motion is appropriate for the animation features being implemented.


10-34: Animation variants are well-configured!

The animation configurations are clean and follow framer-motion best practices. Consider monitoring performance impact of infinite animations on lower-end devices.


53-69: GitHub stars fetching logic improvements look good!

The addition of toString() on line 63 ensures consistent string storage in localStorage.

Comment on lines +92 to +297
<svg
className="absolute top-0 left-0 w-full h-full opacity-10 z-0"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 100 100"
preserveAspectRatio="xMidYMid meet"
fill="none"
>
{/* Circles scattered with motion */}
<motion.circle
cx="15"
cy="20"
r="12"
fill="#FF005C"
opacity="1"
animate={{
cx: [15, 18, 13, 16, 15], // small random horizontal drift
cy: [20, 22, 19, 21, 20], // small vertical drift
}}
transition={{
duration: 8,
repeat: Infinity,
repeatType: "mirror",
ease: "easeInOut",
delay: 0,
}}
/>
<motion.circle
cx="80"
cy="25"
r="10"
fill="#00CBE7"
opacity="0.8"
animate={{
cx: [80, 78, 82, 79, 80],
cy: [25, 27, 23, 26, 25],
}}
transition={{
duration: 7,
repeat: Infinity,
repeatType: "mirror",
ease: "easeInOut",
delay: 1,
}}
/>
<motion.circle
cx="30"
cy="70"
r="15"
fill="#7600F2"
opacity="0.7"
animate={{
cx: [30, 32, 28, 31, 30],
cy: [70, 68, 72, 69, 70],
}}
transition={{
duration: 9,
repeat: Infinity,
repeatType: "mirror",
ease: "easeInOut",
delay: 2,
}}
/>
<motion.circle
cx="70"
cy="80"
r="18"
fill="#FF005C"
opacity="0.9"
animate={{
cx: [70, 73, 67, 71, 70],
cy: [80, 83, 77, 81, 80],
}}
transition={{
duration: 6.5,
repeat: Infinity,
repeatType: "mirror",
ease: "easeInOut",
delay: 3,
}}
/>

{/* Features */}
<div className="flex flex-col items-end sm:items-center sm:flex-row sm:justify-between gap-4 mt-8">
{[
"Doc/Audio Input",
"In-depth questions gen",
"Dynamic Google Form Integration",
].map((feature, i) => (
<div
key={i}
className="flex items-center rounded-l-2xl sm:rounded-2xl px-6 py-3 bg-gradient-to-r from-[#FF005C] via-[#7600F2] to-[#00CBE7] gap-4 w-fit"
>
<img src={starsImg} width={32} height={16} alt="" />
<div className="text-white text-base sm:text-xl">{feature}</div>
{/* Rotated squares */}
<motion.rect
x="5"
y="75"
width="14"
height="14"
fill="#00CBE7"
opacity="0.8"
transform="rotate(40 5 75)"
animate={{
x: [5, 7, 3, 6, 5],
y: [75, 77, 73, 76, 75],
}}
transition={{
duration: 8,
repeat: Infinity,
repeatType: "mirror",
ease: "easeInOut",
delay: 0.5,
}}
/>
<motion.rect
x="65"
y="10"
width="12"
height="12"
fill="#7600F2"
opacity="0.5"
transform="rotate(25 65 10)"
animate={{
x: [65, 62, 68, 64, 65],
y: [10, 13, 7, 11, 10],
}}
transition={{
duration: 7,
repeat: Infinity,
repeatType: "mirror",
ease: "easeInOut",
delay: 1.5,
}}
/>
<motion.rect
x="85"
y="65"
width="18"
height="18"
fill="#FF005C"
opacity="0.2"
transform="rotate(15 85 65)"
animate={{
x: [85, 87, 83, 86, 85],
y: [65, 68, 63, 67, 65],
}}
transition={{
duration: 9,
repeat: Infinity,
repeatType: "mirror",
ease: "easeInOut",
delay: 2.5,
}}
/>

{/* Triangles */}
<motion.polygon
points="40,15 50,35 30,35"
fill="#7600F2"
opacity="0.7"
animate={{
points: [
"40,15 50,35 30,35",
"42,17 52,37 32,37",
"38,13 48,33 28,33",
"40,15 50,35 30,35",
],
}}
transition={{
duration: 8,
repeat: Infinity,
repeatType: "mirror",
ease: "easeInOut",
delay: 0,
}}
/>
<motion.polygon
points="55,70 70,90 40,90"
fill="#00CBE7"
opacity="0.6"
animate={{
points: [
"55,70 70,90 40,90",
"57,72 72,92 42,92",
"53,68 68,88 38,88",
"55,70 70,90 40,90",
],
}}
transition={{
duration: 7,
repeat: Infinity,
repeatType: "mirror",
ease: "easeInOut",
delay: 1,
}}
/>
<motion.polygon
points="75,40 90,60 60,60"
fill="#FF005C"
opacity="0.8"
animate={{
points: [
"75,40 90,60 60,60",
"77,42 92,62 62,62",
"73,38 88,58 58,58",
"75,40 90,60 60,60",
],
}}
transition={{
duration: 6.5,
repeat: Infinity,
repeatType: "mirror",
ease: "easeInOut",
delay: 2,
}}
/>
</svg>

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 SVG animations for performance and accessibility

The SVG contains many simultaneous infinite animations which could impact performance. Consider:

  1. Adding aria-hidden="true" to the SVG since it's decorative
  2. Reducing the number of animated elements or using CSS animations for better performance
  3. Extracting the animation logic into a reusable component to reduce code duplication
 <svg
   className="absolute top-0 left-0 w-full h-full opacity-10 z-0"
   xmlns="http://www.w3.org/2000/svg"
   viewBox="0 0 100 100"
   preserveAspectRatio="xMidYMid meet"
   fill="none"
+  aria-hidden="true"
 >
📝 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
<svg
className="absolute top-0 left-0 w-full h-full opacity-10 z-0"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 100 100"
preserveAspectRatio="xMidYMid meet"
fill="none"
>
{/* Circles scattered with motion */}
<motion.circle
cx="15"
cy="20"
r="12"
fill="#FF005C"
opacity="1"
animate={{
cx: [15, 18, 13, 16, 15], // small random horizontal drift
cy: [20, 22, 19, 21, 20], // small vertical drift
}}
transition={{
duration: 8,
repeat: Infinity,
repeatType: "mirror",
ease: "easeInOut",
delay: 0,
}}
/>
<motion.circle
cx="80"
cy="25"
r="10"
fill="#00CBE7"
opacity="0.8"
animate={{
cx: [80, 78, 82, 79, 80],
cy: [25, 27, 23, 26, 25],
}}
transition={{
duration: 7,
repeat: Infinity,
repeatType: "mirror",
ease: "easeInOut",
delay: 1,
}}
/>
<motion.circle
cx="30"
cy="70"
r="15"
fill="#7600F2"
opacity="0.7"
animate={{
cx: [30, 32, 28, 31, 30],
cy: [70, 68, 72, 69, 70],
}}
transition={{
duration: 9,
repeat: Infinity,
repeatType: "mirror",
ease: "easeInOut",
delay: 2,
}}
/>
<motion.circle
cx="70"
cy="80"
r="18"
fill="#FF005C"
opacity="0.9"
animate={{
cx: [70, 73, 67, 71, 70],
cy: [80, 83, 77, 81, 80],
}}
transition={{
duration: 6.5,
repeat: Infinity,
repeatType: "mirror",
ease: "easeInOut",
delay: 3,
}}
/>
{/* Features */}
<div className="flex flex-col items-end sm:items-center sm:flex-row sm:justify-between gap-4 mt-8">
{[
"Doc/Audio Input",
"In-depth questions gen",
"Dynamic Google Form Integration",
].map((feature, i) => (
<div
key={i}
className="flex items-center rounded-l-2xl sm:rounded-2xl px-6 py-3 bg-gradient-to-r from-[#FF005C] via-[#7600F2] to-[#00CBE7] gap-4 w-fit"
>
<img src={starsImg} width={32} height={16} alt="" />
<div className="text-white text-base sm:text-xl">{feature}</div>
{/* Rotated squares */}
<motion.rect
x="5"
y="75"
width="14"
height="14"
fill="#00CBE7"
opacity="0.8"
transform="rotate(40 5 75)"
animate={{
x: [5, 7, 3, 6, 5],
y: [75, 77, 73, 76, 75],
}}
transition={{
duration: 8,
repeat: Infinity,
repeatType: "mirror",
ease: "easeInOut",
delay: 0.5,
}}
/>
<motion.rect
x="65"
y="10"
width="12"
height="12"
fill="#7600F2"
opacity="0.5"
transform="rotate(25 65 10)"
animate={{
x: [65, 62, 68, 64, 65],
y: [10, 13, 7, 11, 10],
}}
transition={{
duration: 7,
repeat: Infinity,
repeatType: "mirror",
ease: "easeInOut",
delay: 1.5,
}}
/>
<motion.rect
x="85"
y="65"
width="18"
height="18"
fill="#FF005C"
opacity="0.2"
transform="rotate(15 85 65)"
animate={{
x: [85, 87, 83, 86, 85],
y: [65, 68, 63, 67, 65],
}}
transition={{
duration: 9,
repeat: Infinity,
repeatType: "mirror",
ease: "easeInOut",
delay: 2.5,
}}
/>
{/* Triangles */}
<motion.polygon
points="40,15 50,35 30,35"
fill="#7600F2"
opacity="0.7"
animate={{
points: [
"40,15 50,35 30,35",
"42,17 52,37 32,37",
"38,13 48,33 28,33",
"40,15 50,35 30,35",
],
}}
transition={{
duration: 8,
repeat: Infinity,
repeatType: "mirror",
ease: "easeInOut",
delay: 0,
}}
/>
<motion.polygon
points="55,70 70,90 40,90"
fill="#00CBE7"
opacity="0.6"
animate={{
points: [
"55,70 70,90 40,90",
"57,72 72,92 42,92",
"53,68 68,88 38,88",
"55,70 70,90 40,90",
],
}}
transition={{
duration: 7,
repeat: Infinity,
repeatType: "mirror",
ease: "easeInOut",
delay: 1,
}}
/>
<motion.polygon
points="75,40 90,60 60,60"
fill="#FF005C"
opacity="0.8"
animate={{
points: [
"75,40 90,60 60,60",
"77,42 92,62 62,62",
"73,38 88,58 58,58",
"75,40 90,60 60,60",
],
}}
transition={{
duration: 6.5,
repeat: Infinity,
repeatType: "mirror",
ease: "easeInOut",
delay: 2,
}}
/>
</svg>
<svg
className="absolute top-0 left-0 w-full h-full opacity-10 z-0"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 100 100"
preserveAspectRatio="xMidYMid meet"
fill="none"
aria-hidden="true"
>
🤖 Prompt for AI Agents
In eduaid_web/src/pages/Home.jsx around lines 92 to 297, the SVG has many
simultaneous infinite animations which may degrade performance and lacks
accessibility attributes. To fix this, add aria-hidden="true" to the SVG element
to mark it as decorative for screen readers, reduce the number of animated
elements or convert some animations to CSS-based animations for better
performance, and refactor the repeated animation logic into a reusable React
component to minimize code duplication and improve maintainability.

Comment on lines +380 to 403
<motion.a href="question-type" className="w-full sm:w-auto" whileHover={{ scale: 1.05, filter: "brightness(1.1)" }} whileTap={{ scale: 0.95 }}>
<motion.button
className="w-full sm:w-auto flex justify-center items-center gap-3 text-white px-8 py-4 bg-gradient-to-r from-[#FF005C] via-[#7600F2] to-[#00CBE7] rounded-2xl font-semibold text-xl focus:outline-none focus:ring-4 focus:ring-[#7600F2]/50"
variants={pulseVariant}
animate="animate"
whileHover={{ scale: 1.1, filter: "brightness(1.2)", boxShadow: "0 0 15px #7600F2" }}
whileTap={{ scale: 0.95 }}
>
Let’s get Started
<img src={arrow} width={24} height={24} alt="arrow" />
</motion.button>
</motion.a>

<motion.a href="history" className="w-full sm:w-auto" whileHover={{ scale: 1.05, filter: "brightness(1.1)" }} whileTap={{ scale: 0.95 }}>
<motion.button
className="w-full sm:w-auto flex justify-center items-center gap-3 text-white px-8 py-4 border-2 border-[#7600F2] rounded-2xl font-semibold text-xl focus:outline-none focus:ring-4 focus:ring-[#7600F2]/50"
whileHover={{ scale: 1.05, backgroundColor: "#7600F2", boxShadow: "0 0 15px #7600F2" }}
whileTap={{ scale: 0.95 }}
>
Your previous Work!
<img src={arrow} width={24} height={24} alt="arrow" />
</motion.button>
</motion.a>
</div>
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Extract reusable button component to reduce duplication

Both CTA buttons share similar animation props and styling. Consider creating a reusable AnimatedButton component to follow the DRY principle.

Example structure:

const AnimatedButton = ({ href, variant, children, ...props }) => (
  <motion.a href={href} whileHover={{ scale: 1.05, filter: "brightness(1.1)" }} whileTap={{ scale: 0.95 }}>
    <motion.button
      className={`w-full sm:w-auto flex justify-center items-center gap-3 text-white px-8 py-4 rounded-2xl font-semibold text-xl focus:outline-none focus:ring-4 focus:ring-[#7600F2]/50 ${
        variant === 'primary' 
          ? 'bg-gradient-to-r from-[#FF005C] via-[#7600F2] to-[#00CBE7]' 
          : 'border-2 border-[#7600F2]'
      }`}
      {...props}
    >
      {children}
    </motion.button>
  </motion.a>
);
🤖 Prompt for AI Agents
In eduaid_web/src/pages/Home.jsx around lines 380 to 403, there is duplicated
code for two CTA buttons with similar animation props and styling. To fix this,
create a reusable AnimatedButton component that accepts props like href,
variant, and children, and encapsulates the shared motion.a and motion.button
elements with their common animation and styling. Replace the existing button
instances with this new component, passing appropriate props to handle the
differences in styles and content, thereby reducing duplication and improving
maintainability.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant