I am looking to replicate the hover functionality (UI) seen in this example: Desired UI Source:
Since adjusting background image styles can be complex, I have opted to use the Box Component from Material UI. Within the Box Component, I have implemented the image and added desired transitions such as zooming out. However, I am facing an issue with adding text to the Box component, which is essentially inside a Card Component.
Here is the code snippet for the specified section:
<Grid item xs={4}>
<Card
onMouseDown={console.log("fewfwg")}
className={classes.cardWelcomeTwo}
>
<CardActionArea>
<Box variant="outlined" style={{ position: "relative" }}>
<img
className={classes.paperImgWelcome}
src="https://render.fineartamerica.com/images/rendered/default/greeting-card/images-medium-5/ferris-wheel-sunset-eddie-yerkish.jpg?&targetx=0&targety=-25&imagewidth=500&imageheight=751&modelwidth=500&modelheight=700&backgroundcolor=AF7163&orientation=1"
alt="nothing"
/>
<CardContent>
<Typography
variant="h4"
component="h2"
className={classes.welcomeGridHeadingText}
>
Explore The City
</Typography>
</CardContent>
</Box>
</CardActionArea>
</Card>
</Grid>
Here are the styles defined in Styles.js:
paperImgWelcome: {
flexGrow: 1,
position: "relative",
"&:hover ": {
display: "flex",
transition: "0.6s all ease-in-out",
// animationTimingFunction: "ease-out",
transform: "scale(1.1)",
backgroundSize: "75%",
opacity: "0.75",
},
},
cardWelcomeTwo: {
position: "relative",
height: 510,
flexGrow: 1,
backgroundRepeat: "no-repeat",
backgroundSize: "cover",
},
welcomeGridHeadingText: {
position: "absolute",
textAlign: "center",
color: "white",
fontFamily: "'Lato'",
fontSize: "60px",
letterSpacing: "5px",
lineHeight: "60px",
},
Here is how my current UI appears: not hovered hovered