fixed tablet view
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
hardik 2025-02-14 12:47:37 +05:30
parent 247b384ced
commit 1b5243bb5e
2 changed files with 37 additions and 22 deletions

View File

@ -25,6 +25,7 @@ import newbackground from "../components/imageandgif/full.png"
import newbackgroundtwo from "../components/imageandgif/newbacktwo.png" import newbackgroundtwo from "../components/imageandgif/newbacktwo.png"
import wasteimage from "../components/imageandgif/loopwastemanage.png" import wasteimage from "../components/imageandgif/loopwastemanage.png"
import WhyChooseUs from "./whyus"; import WhyChooseUs from "./whyus";
import WasteImageSection from "./wastemanagement";
@ -426,28 +427,7 @@ const HomePage: React.FC = () => {
</Grid> </Grid>
</Box> </Box>
<Grid <WasteImageSection/>
container
xs={12}
sx={{
height: "660px",
marginTop: { lg: 20, xs: 0 },
display: "flex",
justifyContent: "center",
alignItems: "center",
overflow: "hidden"
}}
>
<img
src={ wasteimage} // Different image for mobile
alt="Waste Image"
style={{
width: "100%",
height: "100%",
objectFit: "fill"
}}
/>
</Grid>
<WhyChooseUs /> <WhyChooseUs />
<OurTeam /> <OurTeam />

View File

@ -0,0 +1,35 @@
import { Grid, useMediaQuery, useTheme } from "@mui/material";
import wasteimage from "../components/imageandgif/loopwastemanage.png"; // Desktop Image
import mobileWasteImage from "../components/imageandgif/Soil & Water Contamination mob.png"; // Mobile Image
const WasteImageSection = () => {
const theme = useTheme(); // Use the existing theme, don't redeclare it
const isMobile = useMediaQuery(theme.breakpoints.down("sm")); // For screens < 600px
return (
<Grid
container
xs={12}
sx={{
height: "660px",
marginTop: { lg: 20, xs: 0 },
display: "flex",
justifyContent: "center",
alignItems: "center",
overflow: "hidden"
}}
>
<img
src={isMobile ? mobileWasteImage : wasteimage} // Different images for mobile & desktop
alt="Waste Image"
style={{
width: "100%",
height: "100%",
objectFit: "cover"
}}
/>
</Grid>
);
};
export default WasteImageSection;