Hoa Kỳjscottsmith/react-scroll-parallax
🔮 React hooks and components to create parallax scroll effects for banners, images or any other DOM elements.
Thành tựu nổi bật
Những danh hiệu mới nhất của dự án
#1 Repository của tuần
#1 Repository của tuần
#1 Repository của tuần
🌌 React Scroll Parallax — Parallax cuộn trang mượt nhờ Web Animations API
Tạo hiệu ứt parallax cuộn trang cho banner, hình ảnh hoặc bất kỳ phần tử DOM nào chỉ bằng vài dòng code.
React Scroll Parallax là một thư viện React giúp bạn dễ dàng thêm hiệu ứng parallax dựa trên tiến trình cuộn trang. Dựa trên Parallax Controller và Web Animations API, mỗi phần tử được điều khiển bởi ScrollTimeline hoặc ViewTimeline, áp dụng các keyframe dịch chuyển, quay, tỉ lệ và độ trong suốt mà không chặn luồng chính.
✨ Điểm nổi bật
- useParallax(): hook áp dụng hiệu ứng parallax thông qua ref.
- <Parallax>: component bao bọc phần tử con với cùng hiệu ứng.
- Web Animations API: chạy trên compositor, không chặn main thread.
- ScrollTimeline / ViewTimeline: liên kết tiến trình animation với cuộn trang.
- <ParallaxBanner>: tạo banner parallax phức tạp với nhiều lớp.
- <ParallaxProvider>: cung cấp context toàn cục cho controller.
- useParallaxController(): quản lý và đồng bộ nhiều hiệu ứng.
- Hỗ trợ Next.js 13: tài liệu hướng dẫn tích hợp chi tiết.
💡 Vì sao đáng chú ý
Không chỉ là thư viện parallax đơn giản, React Scroll Parallax tận dụng công nghệ nền tảng của trình duyệt để mang lại hiệu năng cao. Việc dùng ScrollTimeline/ViewTimeline giúp animation luôn mượt mà và đồng bộ với hành vi cuộn, trong khi Web Animations API đảm bảo mọi thứ chạy trên compositor. Phù hợp cho các trang web cần hiệu ứng hình ảnh sống động mà không hy vọng giảm tốc độ.
#React #Parallax #ScrollAnimation #WebAnimationsAPI #TiniX
Dự án tương tự
Khám phá các dự án và mô hình AI khác có sự tương đồng.
Simple & lightweight (<4kb gzipped) vanilla JavaScript library to create smooth & beautiful animations when you scroll.
Simple & lightweight (<4kb gzipped) vanilla JavaScript library to create smooth & beautiful animations when you scroll.
🤖 Powerful asynchronous state management, server-state utilities and data fetching for the web. TS/JS, React Query, Solid Query, Svelte Query and Vue Query.
A lightweight React & vanilla JavaScript library that adds a parallax effect to any image.
freeCodeCamp.org's open-source codebase and curriculum. Learn math, programming, and computer science for free.
GSAP (GreenSock Animation Platform): high-performance JavaScript animation for anything JavaScript can touch. 100% free, including every plugin.