jscottsmith / react-scroll-parallax

🔮 React hooks and components to create parallax scroll effects for banners, images or any other DOM elements.
https://react-scroll-parallax.damnthat.tv/
MIT License
2.9k stars 158 forks source link

feat: handle composed `ParallaxBannerLayers` as children; add story d… #150

Closed jscottsmith closed 2 years ago

jscottsmith commented 2 years ago

Allows ParallaxBannerLayers components to be composed as children of ParallaxBanner instead of using the layers property.

Todo

Example

import { ParallaxBanner, ParallaxBannerLayer } from 'react-scroll-parallax';

const Component = () => (
   <ParallaxBanner>
      <ParallaxBannerLayer
        image="https://s3-us-west-2.amazonaws.com/s.cdpn.io/105988/banner-background.jpg"
        speed={-20}
      />
      <ParallaxBannerLayer
        image="https://s3-us-west-2.amazonaws.com/s.cdpn.io/105988/banner-foreground.png"
        speed={-10}
      />
  </ParallaxBanner>
);

See #147

vercel[bot] commented 2 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/jscottsmith/react-scroll-parallax/C1DwrPdhRacEG77E9XYw2iN1k9jV
✅ Preview: https://react-scroll-parallax-git-feature-composed-b-1cd700-jscottsmith.vercel.app

codecov-commenter commented 2 years ago

Codecov Report

Merging #150 (61c403a) into master (d34092d) will decrease coverage by 0.09%. The diff coverage is 88.88%.

@@            Coverage Diff             @@
##           master     #150      +/-   ##
==========================================
- Coverage   86.25%   86.16%   -0.10%     
==========================================
  Files          19       19              
  Lines         211      224      +13     
  Branches       37       40       +3     
==========================================
+ Hits          182      193      +11     
- Misses         28       30       +2     
  Partials        1        1              
Impacted Files Coverage Δ
src/components/ParallaxBanner/index.tsx 93.10% <88.23%> (-6.90%) :arrow_down:
.../ParallaxBanner/components/ParallaxBannerLayer.tsx 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d34092d...61c403a. Read the comment docs.

github-actions[bot] commented 2 years ago

size-limit report 📦

Path Size
dist/react-scroll-parallax.cjs.production.min.js 5.86 KB (0%)
dist/react-scroll-parallax.esm.js 5.55 KB (0%)