Good day,
I am aiming an effect in a profile page example below,
Using React, my struggle is, I can't figure out how to keep the cover photo it's center when resizing the browser's width.
As you can see in the video. https://www.screencast.com/t/DxQWBO1FuJOu
- From 0 to 4 seconds the cover photo is making fit its width to the resizing browser and remains its center.
- From 5 seconds onwards or when reaching 1580px browser width, the cover image stops making a fit of its width and still keeping its center during resizing.
How can we achieve this? Any help is highly appreciated and saves me wasting hours.
Btw, the profile page is just a random profile
Keep safe this pandemic. Thank you.
here is my current code
import { Image } from 'react-bootstrap'
<Image
fluid
src='/'
style={{ width: '1920px', height: 'auto', position: 'absolute', zIndex: -1, objectFit: 'cover', objectPosition: 'center' }}
/>
