Skip to content

Instantly share code, notes, and snippets.

View pmark's full-sized avatar

P. Mark Anderson pmark

View GitHub Profile
@pmark
pmark / parallax-scrolling-grid.tsx
Created August 30, 2024 06:55
Parallax Grid with React and Tailwind
import React, { useState, useEffect, useRef } from 'react';
const ParallaxScrolling = () => {
const [scrollY, setScrollY] = useState(0);
const [contentHeight, setContentHeight] = useState(0);
const containerRef = useRef(null);
const contentRef = useRef(null);
useEffect(() => {
const container = containerRef.current;