Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 30 additions & 26 deletions src/components/Practice/Mechanics3.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ const Mechanics2 = ({
},
}}
>
<Box sx={{ position: "relative", cursor: "zoom-in" }}>
{image && (
{image?.split("/")?.[4] && (
<Box sx={{ position: "relative", cursor: "zoom-in" }}>
<img
onClick={() => setZoomOpen(true)}
src={image}
Expand All @@ -273,32 +273,36 @@ const Mechanics2 = ({
}}
alt=""
/>
)}

{/* Subtle gradient overlay across the top */}
<Box
sx={{
position: "absolute",
top: 0,
left: 0,
right: 0,
height: "40px", // Height of the gradient overlay
background:
"linear-gradient(to bottom, rgba(0, 0, 0, 0.4), transparent)",
borderTopLeftRadius: "20px",
borderTopRightRadius: "20px",
display: "flex",
alignItems: "center",
paddingLeft: "8px",
}}
>
{/* Zoom icon positioned in the top-left corner */}
<ZoomInIcon
onClick={() => setZoomOpen(true)}
sx={{ color: "white", fontSize: "22px", cursor: "pointer" }}
/>
{/* Subtle gradient overlay across the top */}
<Box
sx={{
position: "absolute",
top: 0,
left: 0,
right: 0,
height: "40px", // Height of the gradient overlay
background:
"linear-gradient(to bottom, rgba(0, 0, 0, 0.4), transparent)",
borderTopLeftRadius: "20px",
borderTopRightRadius: "20px",
display: "flex",
alignItems: "center",
paddingLeft: "8px",
}}
>
{/* Zoom icon positioned in the top-left corner */}
<ZoomInIcon
onClick={() => setZoomOpen(true)}
sx={{
color: "white",
fontSize: "22px",
cursor: "pointer",
}}
/>
</Box>
</Box>
</Box>
)}
<Modal
open={zoomOpen}
onClose={() => setZoomOpen(false)}
Expand Down