Skip to content

Commit

Permalink
grid
Browse files Browse the repository at this point in the history
  • Loading branch information
ChinmayShrivastava committed Mar 26, 2024
1 parent be3c0c1 commit 1de4d82
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/grideffect/GridEffect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export function GridCell({ isHovered }: { isHovered: boolean }) {
export function Grid({ rows }: { rows: number }) {
const cellRefs = useRef<Array<HTMLDivElement | null>>([]);
const [hoveredCell, setHoveredCell] = useState<number | null>(null);
const gridHeight = 100 * (rows+0.5);

const handleMouseMove = (e: MouseEvent) => {
const foundCell = cellRefs.current.find((currentCell) => {
Expand Down Expand Up @@ -57,7 +58,7 @@ export function Grid({ rows }: { rows: number }) {
))}
</div>
{/* set pointer events to none */}
<div className="pointer-events-none absolute left-0 top-0 z-[-1] size-full h-screen bg-gradient-to-b from-transparent to-white">
<div className={"pointer-events-none absolute left-0 top-0 z-[-1] size-full bg-gradient-to-b from-transparent via-white to-white"} style={{ height: gridHeight }}>
</div>
</>
);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { Logo } from '../templates/Logo';
const MyApp = ({ Component, pageProps }: AppProps) => (
<div>
<Background color="">
<Grid rows={9} />
<Grid rows={8} />
<Section yPadding="py-6">
<NavbarTwoColumns logo={<Logo xl />}>
<li>
Expand Down

0 comments on commit 1de4d82

Please sign in to comment.