Skip to content

feat: add laptop icon with hover animation#114

Open
BASAVARAJ-CHIPPALAKATTI wants to merge 3 commits intoitshover:masterfrom
BASAVARAJ-CHIPPALAKATTI:add-laptop-icon
Open

feat: add laptop icon with hover animation#114
BASAVARAJ-CHIPPALAKATTI wants to merge 3 commits intoitshover:masterfrom
BASAVARAJ-CHIPPALAKATTI:add-laptop-icon

Conversation

@BASAVARAJ-CHIPPALAKATTI
Copy link
Copy Markdown

@BASAVARAJ-CHIPPALAKATTI BASAVARAJ-CHIPPALAKATTI commented Feb 16, 2026

Description

Adds a new laptop icon with hover animations:

  • Screen glow effect on hover
  • Keyboard subtle press
  • Lid slight movement
  • Power LED blink

Files Added/Modified

  • icons/laptop-icon.tsx - New icon component
  • icons/index.ts - Added to ICON_LIST
  • lib/icons.ts - Added to routing

Type of Change

  • New icon

Screenshots

Screenshot (214)

Checklist

  • Code follows project style
  • npm run check passes locally
  • Icon appears correctly
  • Hover animation works

Summary by CodeRabbit

  • New Features
    • Added a new animated laptop icon to the icon library with interactive hover effects for screen, keyboard, and LED elements.
    • Made the new laptop icon available throughout the app's icon collection for immediate use.

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Feb 16, 2026

@BASAVARAJ-CHIPPALAKATTI is attempting to deploy a commit to the abhijit-jha's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 16, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

Adds a new animated LaptopIcon React component (forwardRef with start/stop imperative API) and registers it in the icon registries (icons/index.ts and lib/icons.ts), plus exports the component as the default from icons/laptop-icon.tsx.

Changes

Cohort / File(s) Summary
New Animated Icon Component
icons/laptop-icon.tsx
Adds a forwardRef React component LaptopIcon (default export) exposing imperative methods startAnimation and stopAnimation, with SVG elements targeted by animations (screen-glow, keyboard, lid, led) and hover-driven control.
Icon Registry Updates
icons/index.ts, lib/icons.ts
Imports and registers LaptopIcon in icons/index.ts (inserts an ICON_LIST item for "laptop-icon" with keywords) and prepends a "laptop icon" entry to lib/icons.ts ICONS array (path /icons/laptop-icon).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰💻 I nudged the lid and gave a wink,
Keys that shimmer, lights that blink,
Hover, hum — the circuits play,
Paw-pressed rhythms start the display,
A rabbit grins at laptop day.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding a new laptop icon component with hover animations as described in the PR objectives and file changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into master

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • 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

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

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

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: 1

🤖 Fix all issues with AI agents
In `@icons/laptop-icon.tsx`:
- Around line 28-32: The SVG animation uses a 3D transform rotateX on the ".lid"
element which is unreliable across browsers; change the animate call for the
".lid" selector in icons/laptop-icon.tsx to use a 2D transform (for example
animate the element's y offset and/or scaleY with an appropriate
transformOrigin) to simulate the lid opening/closing instead of rotateX, and
match the easing/duration used by the keyboard animation to keep motion
consistent; ensure you update any transform-origin or attribute settings on the
".lid" element so the pivot looks correct.
🧹 Nitpick comments (3)
icons/laptop-icon.tsx (1)

12-39: Concurrent animations: start doesn't await individual animate calls.

The four animate calls in start are fired without await, so they run concurrently — which appears intentional for parallel animations. However, the function is declared async and returns undefined (no composed promise). If a consumer ever awaits startAnimation(), it won't wait for animations to complete. This is fine for the current hover usage but worth noting for the imperative API contract.

icons/index.ts (1)

262-266: Inconsistent indentation in the new ICON_LIST entry.

The properties of the new entry are indented with 2 spaces, while all other entries use 4 spaces (e.g., lines 268-270). This will likely be caught by a formatter, but worth fixing for consistency.

🔧 Proposed fix
   {
-  name: "laptop-icon", 
-  icon: LaptopIcon,
-  keywords: ["computer", "device", "tech", "laptop", "macbook", "notebook"],
+    name: "laptop-icon",
+    icon: LaptopIcon,
+    keywords: ["computer", "device", "tech", "laptop", "macbook", "notebook"],
   },
lib/icons.ts (1)

2-5: Same indentation inconsistency as in icons/index.ts.

🔧 Proposed fix
   {
-  name: "laptop icon",  
-  path: "/icons/laptop-icon",
+    name: "laptop icon",
+    path: "/icons/laptop-icon",
   },

Comment thread icons/laptop-icon.tsx
Comment on lines +28 to +32
animate(
".lid",
{ rotateX: [0, 3, 0] },
{ duration: 0.5, ease: "easeOut" },
);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# First, let's look at the laptop-icon.tsx file to understand the context
fd laptop-icon.tsx --type f

Repository: itshover/itshover

Length of output: 82


🌐 Web query:

CSS rotateX 3D transform support on SVG elements browsers compatibility

💡 Result:

TL;DR (rotateX / other 3D CSS transforms on SVG elements)

  • Reliable cross‑browser: apply rotateX() to the outer <svg> element (or an HTML wrapper around the SVG). Browsers treat the root <svg> much like a normal element for CSS transforms. (stackoverflow.com)
  • Not reliably supported (inconsistent): applying rotateX() / rotate3d() directly to SVG graphics elements like <g>, <path>, <circle>, etc. is not interoperable; some browsers support parts of it, others don’t. (stackoverflow.com)

Practical compatibility notes

  • Firefox: has (at least some) support for 3D CSS transforms on SVG shapes, but it’s described as experimental / not something you can rely on cross‑browser (often requiring SVG/CSS tweaks like overflow: visible). (stackoverflow.com)
  • Chrome / Safari (Blink/WebKit): general web guidance and reported behavior indicate you can’t count on 3D transforms on individual SVG shapes; typical workaround is transforming the whole <svg> (or wrapping it). (stackoverflow.com)
  • IE / old EdgeHTML: CSS transforms on SVG elements don’t work in IE (EdgeHTML gained support for CSS transforms on SVG later, but that’s about SVG/CSS transforms generally—not a guarantee for per‑shape 3D). (css-tricks.com)

Why this is confusing

  • Specs/MDN allow a CSS transform counterpart for SVG, but explicitly warn that CSS transform-function compatibility on SVG isn’t guaranteed. (developer.mozilla.org)
  • “3D transforms supported by browsers” tables (e.g., caniuse “CSS3 3D Transforms”) describe HTML/CSS support overall, not “3D transforms on SVG graphics elements” specifically. (caniuse.com)

What to do for cross‑browser 3D tilt

  • Put the SVG inside a wrapper and transform the wrapper (or transform the root <svg>):
    .wrap { perspective: 800px; }
    .wrap svg { transform: rotateX(45deg); transform-origin: 50% 50%; }

Citations:


🏁 Script executed:

# Read the laptop-icon.tsx file
cat -n icons/laptop-icon.tsx | head -50

Repository: itshover/itshover

Length of output: 1880


🏁 Script executed:

# Also check around lines 28-32 more carefully
cat -n icons/laptop-icon.tsx | sed -n '1,40p'

Repository: itshover/itshover

Length of output: 1457


🏁 Script executed:

# Read more of the file to see the SVG structure and identify what .lid targets
cat -n icons/laptop-icon.tsx | sed -n '50,136p'

Repository: itshover/itshover

Length of output: 2651


rotateX may not work on SVG path elements in all browsers.

CSS 3D transforms like rotateX applied to SVG graphics elements (<path>, <rect>, <circle>) have inconsistent browser support. Chrome/Safari don't reliably support them, Firefox has experimental support, and IE doesn't support them. Consider using a 2D alternative like y offset or scaleY to simulate the lid movement, consistent with the keyboard animation already in use.

🤖 Prompt for AI Agents
In `@icons/laptop-icon.tsx` around lines 28 - 32, The SVG animation uses a 3D
transform rotateX on the ".lid" element which is unreliable across browsers;
change the animate call for the ".lid" selector in icons/laptop-icon.tsx to use
a 2D transform (for example animate the element's y offset and/or scaleY with an
appropriate transformOrigin) to simulate the lid opening/closing instead of
rotateX, and match the easing/duration used by the keyboard animation to keep
motion consistent; ensure you update any transform-origin or attribute settings
on the ".lid" element so the pivot looks correct.

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