Skip to content

feat: add AntiGravityBackground component for enhanced visual effects…#117

Closed
prajwallshetty wants to merge 1 commit intoDeveloper-Kommunity-24:mainfrom
prajwallshetty:main
Closed

feat: add AntiGravityBackground component for enhanced visual effects…#117
prajwallshetty wants to merge 1 commit intoDeveloper-Kommunity-24:mainfrom
prajwallshetty:main

Conversation

@prajwallshetty
Copy link
Copy Markdown

@prajwallshetty prajwallshetty commented Feb 22, 2026

Add Anti-Gravity Particle Background to Hero Section

Summary

Replaces the static hero background with an interactive anti-gravity particle canvas effect scoped exclusively to the landing page hero section.

Changes

  • Added AntiGravityBackground.tsx — a canvas-based particle system with mouse repulsion

no build issues @jtuluve

https://deploy-preview-117--dk24.netlify.app/

Copilot AI review requested due to automatic review settings February 22, 2026 17:59
@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 22, 2026

Deploy Preview for dk24 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 2f64b90
🔍 Latest deploy log https://app.netlify.com/projects/dk24/deploys/699b4400a5db9b0008278df2
😎 Deploy Preview https://deploy-preview-117--dk24.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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds an interactive anti-gravity particle background effect to the landing page hero section, replacing the previously static background. The implementation uses HTML5 Canvas with a custom particle system that responds to mouse movements with a repulsion effect.

Changes:

  • Added AntiGravityBackground.tsx component implementing a canvas-based particle system with mouse interaction
  • Integrated the new component into the hero section with proper z-index layering
  • Added responsive container styling to accommodate the background effect

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
src/components/hero-section.tsx Integrated AntiGravityBackground component into hero section with positioning styles
src/components/Antigravitybackground.tsx New canvas-based particle system with mouse repulsion physics and connection rendering

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

import Link from "next/link";
import { Button } from "@/components/ui/button";
import { siteConfig } from "@/config/site";
import { AntiGravityBackground } from "@/components/Antigravitybackground";
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

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

The filename "Antigravitybackground.tsx" doesn't follow the codebase's kebab-case naming convention for component files. All other component files in the codebase use kebab-case (e.g., hero-section.tsx, background-pattern.tsx, community-card.tsx). The file should be renamed to "anti-gravity-background.tsx" and the import statement updated accordingly.

Suggested change
import { AntiGravityBackground } from "@/components/Antigravitybackground";
import { AntiGravityBackground } from "@/components/anti-gravity-background";

Copilot uses AI. Check for mistakes.
Comment on lines +75 to +93
function drawConnections() {
const particles = particlesRef.current;
for (let i = 0; i < particles.length; i++) {
for (let j = i + 1; j < particles.length; j++) {
const dx = particles[i].x - particles[j].x;
const dy = particles[i].y - particles[j].y;
const dist = Math.sqrt(dx * dx + dy * dy);
if (dist < 100) {
const alpha = (1 - dist / 100) * 0.18;
x2d.beginPath();
x2d.moveTo(particles[i].x, particles[i].y);
x2d.lineTo(particles[j].x, particles[j].y);
x2d.strokeStyle = `rgba(34,197,94,${alpha})`;
x2d.lineWidth = 0.6;
x2d.stroke();
}
}
}
}
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

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

The drawConnections function has O(n²) complexity, creating and drawing lines for all particle pairs within range. With 180 particles, this potentially draws up to 16,110 connections per frame. This could cause performance issues, especially on lower-end devices. Consider implementing spatial partitioning (e.g., a grid-based approach) to reduce the number of distance checks, or reduce the PARTICLE_COUNT constant if performance becomes an issue.

Copilot uses AI. Check for mistakes.
Comment on lines +171 to +172
window.addEventListener("mousemove", handleMouseMove);
window.addEventListener("mouseleave", handleMouseLeave);
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

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

The mouse event listeners are attached to the window object, which means the component will respond to mouse movements anywhere on the page, not just within the hero section. This could cause unnecessary animation updates when users interact with other parts of the page. Consider attaching the event listeners to the canvas element itself or checking if the mouse position is within the canvas bounds before updating the mouseRef.

Copilot uses AI. Check for mistakes.
Comment thread src/components/Antigravitybackground.tsx
Comment thread src/components/Antigravitybackground.tsx
Comment thread src/components/Antigravitybackground.tsx
@gaureshpai gaureshpai assigned jtuluve and dev-shetty and unassigned jtuluve Feb 23, 2026
@dev-shetty dev-shetty removed their assignment Feb 23, 2026
Copy link
Copy Markdown
Member

@gaureshpai gaureshpai left a comment

Choose a reason for hiding this comment

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

Hey @prajwallshetty, the current implementation of the antigravity like bg for the landing page has a few issues like the end is abrupt and also not well visible in the light mode. Can you please look into it. Also can you please create the ClientX PR seperately for the project addition and the tilt PR for the logo in the landing page? Thank you

PS: update the branch, create different branches for each task.

@gaureshpai gaureshpai marked this pull request as draft March 3, 2026 11:09
@gaureshpai
Copy link
Copy Markdown
Member

no response - invalid PR

@gaureshpai gaureshpai closed this Apr 12, 2026
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.

5 participants