David Hakobyan

Background Snippets Noise effect11

Heroes 29

About

Here is Background Snippets Noise effect component

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Background Snippets Noise effect11 to your project and fits it to your theme.

Code

How Background Snippets Noise effect11 is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import React, { useRef, useEffect } from "react";

const Noise: React.FC<{ patternRefreshInterval?: number; patternAlpha?: number }> = ({ patternRefreshInterval = 2, patternAlpha = 15 }) => {
  const ref = useRef<HTMLCanvasElement | null>(null);
  useEffect(() => {
    const c = ref.current; if (!c) return;
    const ctx = c.getContext("2d", { alpha: true }); if (!ctx) return;
    let f=0,id=0,S=1024;
    const resize=()=>{c.width=S;c.height=S;c.style.width="100vw";c.style.height="100vh";};
    const draw=()=>{const img=ctx.createImageData(S,S);const d=img.data;for(let i=0;i<d.length;i+=4){const v=Math.random()*255;d[i]=v;d[i+1]=v;d[i+2]=v;d[i+3]=patternAlpha;}ctx.putImageData(img,0,0);};
    const loop=()=>{if(f%patternRefreshInterval===0)draw();f++;id=requestAnimationFrame(loop);};
    addEventListener("resize",resize);resize();loop();return()=>{removeEventListener("resize",resize);cancelAnimationFrame(id);};
  },[patternRefreshInterval,patternAlpha]);
  return <canvas ref={ref} className="pointer-events-none absolute inset-0" style={{ imageRendering: "pixelated" }}/>;
};

export default function Component() {
  return (
    <div className="fixed inset-0 -z-10 bg-neutral-950">
      <div className="absolute inset-0 bg-[radial-gradient(circle_640px_at_50%_180px,#8b5cf633,transparent_70%)]" />
      <div className="pointer-events-none absolute inset-0 bg-[linear-gradient(to_right,#94a3b833_1px,transparent_1px),linear-gradient(to_bottom,#94a3b833_1px,transparent_1px)] bg-[size:20px_24px] [mask-image:radial-gradient(ellipse_80%_55%_at_50%_15%,#000_70%,transparent_100%)] [-webkit-mask-image:radial-gradient(ellipse_80%_55%_at_50%_15%,#000_70%,transparent_100%)] [mask-repeat:no-repeat] [-webkit-mask-repeat:no-repeat]" />
      <Noise patternAlpha={16}/>
    </div>
  );
}

More by David Hakobyan

View all
  • Futuristic Hero

    Futuristic Hero

    2.7K
  • Hero ASCII one

    Hero ASCII one

    1.4K
  • Hero ASCII

    Hero ASCII

    1.4K
  • Admit One Ticket

    Admit One Ticket

    1.2K
  • Border Beam

    Border Beam

    1.1K
  • Navigation Menu

    Navigation Menu

    990
  • Border Beam Search

    Border Beam Search

    701
  • Thinking Orbs

    Thinking Orbs

    509

More in Heroes

View all
  • Agency Hero Section

    Agency Hero Section

    1.1K
  • Facts Hero

    Facts Hero

    5
  • SaaS Template

    SaaS Template

    2.7K
  • Hero

    Hero

    1.4K
  • Hero Section 01

    Hero Section 01

    56
  • Responsive Hero Banner

    Responsive Hero Banner

    2.2K
  • Portfolio Hero

    Portfolio Hero

    78
  • Centered Hero with Image Fan

    Centered Hero with Image Fan

    1.1K