react-background-slider icon indicating copy to clipboard operation
react-background-slider copied to clipboard

Change from viewport size to div size

Open mattsafaii opened this issue 5 years ago • 2 comments

Can this be used as the background for a Hero section instead of covering the entire viewport.

Is that possible?

mattsafaii avatar May 27 '20 02:05 mattsafaii

Nevermind I figured it out.

I went to node_modules > react-background-slider > dist > index.js and changed the height in css.

mattsafaii avatar May 27 '20 02:05 mattsafaii

Is there a way to add a media query to the node_modules > react-background-slider > dist > index.js file?

I tried adding a media query for the mobile height under: "#ReactBackgroundSlider > figure {\n height: 800px;\n...

My goal is for a height of 800px on desktop and 600px on mobile.

mattsafaii avatar May 27 '20 03:05 mattsafaii

It's possible to query the screen size inside React and based on that pass different sized images to the component. For example see this blog here.

u2ix avatar Apr 03 '24 15:04 u2ix