Skip to content

Improve hero section UI with dark and light mode#316

Open
yuvraj-k-singh wants to merge 2 commits into
GitMetricsLab:mainfrom
yuvraj-k-singh:feature/ux-hero-improvement
Open

Improve hero section UI with dark and light mode#316
yuvraj-k-singh wants to merge 2 commits into
GitMetricsLab:mainfrom
yuvraj-k-singh:feature/ux-hero-improvement

Conversation

@yuvraj-k-singh
Copy link
Copy Markdown
Contributor

@yuvraj-k-singh yuvraj-k-singh commented May 18, 2026

Related Issue


Description

Upgraded the landing page Hero section to a modern, responsive design that supports dynamic Day/Night themes.

Key changes include:

  • Replaced the basic static white hero layout with an asymmetric split-screen grid layout (lg:grid-cols-12).
  • Integrated a highly polished dark/light mode background featuring a subtle digital cyber-grid pattern and soft, blurred ambient radial glows.
  • Enhanced the typography hierarchy with clean font weight contrast and an elegant linear color gradient running from blue to teal for the core headline.
  • Fixed a nested semantic HTML bug where a <Link> component was incorrectly wrapped inside a <button> element.
  • Added a visual centerpiece in the right column showcasing an interactive project dashboard mockup card complete with live metric data bars and a simulated GitHub contribution matrix.
  • Introduced floating, non-intrusive Git node icon badges (GitBranch, GitCommit, GitPullRequest) utilizing native CSS bounce animations and staggered delays to drastically improve visual appeal.
  • Ensured total responsiveness and strict z-index layering across all screen breakpoints.

How Has This Been Tested?

  • Verified responsive scaling on mobile, tablet, and desktop viewports via browser developer tools.
  • Tested light and dark mode state transitions to ensure smooth color fades (transition-colors duration-500) and readable contrast ratios for text and background UI assets.
  • Confirmed error-free React/TypeScript compilation after eliminating potential infinite rendering cycles from the matrix loop map and replacing space-separated custom string values inside arbitrary Tailwind utility brackets.
  • Validated button click behavior and accurate route redirection via the revised navigation wrapper element.

Screenshots (if applicable)

Before:
image

After:
image

Type of Change

  • Bug fix
  • New feature
  • Code style update
  • Breaking change
  • Documentation update

Summary by CodeRabbit

  • New Features
    • Hero section redesigned with animated two-column layout featuring the main call-to-action and an interactive dashboard mockup
    • Added animated contribution matrix grid and floating icon nodes
    • Enhanced styling with cyber-grid background and ambient glows for a modern visual experience

Review Change Stack

Signed-off-by: yuvraj-k-singh <yuvrajstudentbussiness@gmail.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented May 18, 2026

Deploy Preview for github-spy ready!

Name Link
🔨 Latest commit 42323cb
🔍 Latest deploy log https://app.netlify.com/projects/github-spy/deploys/6a0ae511a6aa0b0008548716
😎 Deploy Preview https://deploy-preview-316--github-spy.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

Warning

Rate limit exceeded

@yuvraj-k-singh has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 50 minutes and 56 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4ca9c6cb-793a-4899-8d68-5716bef78ef8

📥 Commits

Reviewing files that changed from the base of the PR and between d57b9e2 and 42323cb.

📒 Files selected for processing (1)
  • src/components/Hero.tsx
📝 Walkthrough

Walkthrough

The Hero component is redesigned from a minimal centered layout to a rich two-column animated interface. Extended icon imports and a MATRIX_CELLS constant enable a new contribution grid visualization. The JSX restructures with cyber-grid background effects, left-side typography and CTA, and a right-side dashboard mockup featuring the animated contribution matrix and floating Git icon nodes.

Changes

Hero Section Visual Redesign

Layer / File(s) Summary
Imports and matrix constant
src/components/Hero.tsx
Lucide icons expanded to include GitBranch, GitCommit, GitPullRequest, Layout for dashboard mockup elements; MATRIX_CELLS constant created as a fixed 21-element array to drive deterministic grid rendering.
Hero component layout and export
src/components/Hero.tsx
JSX restructured into two-column layout: left column with typography and styled Search-icon CTA link; right column with dashboard mockup including animated widgets, contribution matrix grid mapped from MATRIX_CELLS, floating Git icon nodes with bounce/delay animations, and neon center glow; background changes to cyber-grid with overflow-hidden and radial glow effects.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

gssoc25, level2, level:intermediate, quality:clean, gssoc:approved

Poem

A hero takes shape in vibrant neon glow,
Two columns dance where data flows,
Git icons float and matrices spin,
The dashboard dreams come dancing in. 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title mentions dark/light mode improvements, which aligns with a key aspect of the redesign, but does not capture the full scope of the substantial Hero section redesign including the new dashboard mockup and Git icon animations.
Description check ✅ Passed The PR description is comprehensive, follows the template structure, includes all required sections (Related Issue, Description, Testing, Screenshots, Type of Change), and provides detailed explanations of changes made.
Linked Issues check ✅ Passed The PR successfully addresses all key objectives from issue #314: improved typography hierarchy, modern dark/light mode background with cyber-grid pattern, enhanced button styling, responsive grid layout, subtle animations with Git icons, and a professional interactive dashboard mockup.
Out of Scope Changes check ✅ Passed All changes in the PR are directly aligned with the requirements from issue #314; no extraneous modifications or out-of-scope work is present in the Hero component redesign.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
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: 3

🧹 Nitpick comments (1)
src/components/Hero.tsx (1)

79-80: ⚡ Quick win

Move constant arrays outside the map function.

The intensitiesDark and intensitiesLight arrays are recreated on every iteration (21 times per render). Since these are constant values, declare them once outside the .map() callback or at module level to avoid unnecessary allocations.

♻️ Proposed refactor

Move the arrays outside the map callback:

                {/* Simulated GitHub Contribution Grid */}
                <div className="bg-slate-100/80 dark:bg-slate-950/80 p-4 rounded-xl border border-slate-200/60 dark:border-slate-800/40">
                  <div className="text-xs text-slate-500 uppercase tracking-wider font-semibold mb-2">Contribution Matrix</div>
                  <div className="grid grid-cols-7 gap-1.5 w-max">
+                   {(() => {
+                     const intensitiesDark = ['bg-slate-800', 'bg-emerald-900/60', 'bg-emerald-700', 'bg-emerald-500', 'bg-emerald-400'];
+                     const intensitiesLight = ['bg-slate-200', 'bg-emerald-200', 'bg-emerald-300', 'bg-emerald-500', 'bg-emerald-600'];
+                     return MATRIX_CELLS.map((cellIndex) => {
-                    {MATRIX_CELLS.map((cellIndex) => {
-                      // Stable indexing pattern to avoid flashing visual layouts on state updates
-                      const intensitiesDark = ['bg-slate-800', 'bg-emerald-900/60', 'bg-emerald-700', 'bg-emerald-500', 'bg-emerald-400'];
-                      const intensitiesLight = ['bg-slate-200', 'bg-emerald-200', 'bg-emerald-300', 'bg-emerald-500', 'bg-emerald-600'];
-                      
                       return (
                         <div 
                           key={cellIndex} 
                           className={`w-3 h-3 rounded-[2px] transition-all duration-300 hover:scale-125 
                             ${intensitiesLight[cellIndex % intensitiesLight.length]} 
                             dark:${intensitiesDark[cellIndex % intensitiesDark.length]}`} 
                         />
                       );
-                    })}
+                     });
+                   })()}
                  </div>
                </div>

Alternatively, define them at module level alongside MATRIX_CELLS.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/Hero.tsx` around lines 79 - 80, The intensitiesDark and
intensitiesLight arrays are being recreated inside the .map() in the Hero
component; move these constant arrays out of the map callback (e.g., declare
them once at the top of the Hero component or at module level alongside
MATRIX_CELLS) so they are allocated once per module/render rather than on every
iteration; update references inside the map to use the moved intensitiesDark and
intensitiesLight identifiers.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/Hero.tsx`:
- Around line 25-27: The span in Hero.tsx that renders "Like Never Before" uses
bg-clip-text and text-transparent so the drop-shadow in its className is
ineffective; remove the drop-shadow utility from that span's className (or
instead move the glow to a wrapper element by applying a box-shadow on a
parent/container or creating a pseudo-element to render a blurred gradient glow)
and update the JSX for the span (the element with className including
"bg-clip-text text-transparent") accordingly.
- Around line 85-87: The current className builds a dynamic dark: prefix
("dark:${intensitiesDark[cellIndex % intensitiesDark.length]}"), which Tailwind
cannot purge; instead ensure the dark variant is a complete literal by changing
how classes are selected: stop concatenating "dark:" at render time and either
(a) store dark variants already prefixed (e.g., intensitiesDark contains strings
like "dark:bg-..." as literals) and use className={`...
${intensitiesLight[cellIndex % intensitiesLight.length]}
${intensitiesDark[cellIndex % intensitiesDark.length]}`}, or (b) map the index
to a fixed pair of literal classes and pick both light and dark strings together
(use variables intensitiesLight, intensitiesDark and cellIndex to index them) so
no runtime string builds produce the dark: prefix.
- Around line 97-107: The staggered delays on the three icon containers are
using non-functional arbitrary classes like [animation-delay:1s] alongside
animate-bounce (see the divs that include animate-bounce and the
GitBranch/GitCommit/GitPullRequest icons); replace those arbitrary delay classes
with a supported approach such as adding a style prop with animationDelay (e.g.
style={{ animationDelay: '1s' }}) on the specific containers, or use a single
Tailwind arbitrary animate shorthand like
animate-[bounce_1s_ease-in-out_1s_infinite] to embed the delay into the class;
update the three divs that currently include [animation-delay:...] to one of
these supported patterns so the staggered timing is actually applied.

---

Nitpick comments:
In `@src/components/Hero.tsx`:
- Around line 79-80: The intensitiesDark and intensitiesLight arrays are being
recreated inside the .map() in the Hero component; move these constant arrays
out of the map callback (e.g., declare them once at the top of the Hero
component or at module level alongside MATRIX_CELLS) so they are allocated once
per module/render rather than on every iteration; update references inside the
map to use the moved intensitiesDark and intensitiesLight identifiers.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 923cab54-4ea9-493c-8e2f-86e5d8094587

📥 Commits

Reviewing files that changed from the base of the PR and between 8d17610 and d57b9e2.

📒 Files selected for processing (1)
  • src/components/Hero.tsx

Comment thread src/components/Hero.tsx Outdated
Comment thread src/components/Hero.tsx Outdated
Comment thread src/components/Hero.tsx Outdated
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.

🚀 Feature: Improve Hero Section UI/UX

1 participant