-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ff6c005
commit 86945b2
Showing
20 changed files
with
1,152 additions
and
232 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,195 @@ | ||
import React from "react"; | ||
import { Box, Typography, Button } from "@mui/material"; | ||
import Image from "next/image"; | ||
import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown"; | ||
import Slider from "react-slick"; | ||
import "slick-carousel/slick/slick.css"; | ||
import "slick-carousel/slick/slick-theme.css"; | ||
|
||
interface Service { | ||
name: string; | ||
description: string; | ||
images: any; | ||
} | ||
|
||
interface Page { | ||
title: string; | ||
titleImage: any; | ||
description: string; | ||
subtitle: string; | ||
subDescription: string; | ||
types: Service[]; | ||
} | ||
|
||
interface ServicesPageProps { | ||
page: Page; | ||
} | ||
|
||
const ServicesPage: React.FC<ServicesPageProps> = ({ page }) => { | ||
console.log(page); | ||
const handleClick = (id: string) => { | ||
const element = document.getElementById(id); | ||
if (element) { | ||
const offsetTop = element.offsetTop - 180; | ||
window.scrollTo({ | ||
top: offsetTop, | ||
behavior: "smooth", | ||
}); | ||
} | ||
}; | ||
|
||
const settings: SliderSettings = { | ||
infinite: true, | ||
accessibility: false, | ||
arrows: false, | ||
autoplay: true, | ||
dots: false, | ||
sync: true, | ||
speed: 3000, | ||
autoplaySpeed: 12000, | ||
slidesToShow: 1, | ||
slidesToScroll: 1, | ||
}; | ||
|
||
return ( | ||
<Box> | ||
<Box | ||
id="top" | ||
sx={{ | ||
position: "relative", | ||
height: "650px", | ||
textAlign: "center", | ||
color: "white", | ||
overflow: "hidden", | ||
mb: 10, | ||
mt: { xs: 2, md: 0 }, | ||
}} | ||
> | ||
<Image src={page.titleImage} alt="image" layout="fill" objectFit="cover" /> | ||
<Box | ||
sx={{ | ||
position: "absolute", | ||
top: 0, | ||
left: 0, | ||
width: "100%", | ||
|
||
height: "100%", | ||
backgroundColor: "rgba(0, 0, 0, 0.3)", | ||
display: "flex", | ||
flexDirection: "column", | ||
justifyContent: "center", | ||
alignItems: "center", | ||
}} | ||
> | ||
<Box maxWidth={1200}> | ||
<Typography variant="h3" gutterBottom> | ||
{page.title} | ||
</Typography> | ||
<Typography variant="h6" gutterBottom> | ||
{page.description} | ||
</Typography> | ||
</Box> | ||
<Box sx={{ display: { xs: "block", md: "flex" } }}> | ||
{page.types.map((service, index) => ( | ||
<Button | ||
key={index} | ||
variant="contained" | ||
onClick={() => handleClick(service.name.replace(/\s+/g, "-").toLowerCase())} | ||
sx={{ | ||
display: "flex", | ||
marginY: 2, | ||
margin: { md: 4 }, | ||
color: "white", | ||
width: "220px", | ||
alignItems: "center", | ||
}} | ||
> | ||
<Typography component="span" style={{ textDecoration: "none", color: "inherit" }}> | ||
{service.name} | ||
</Typography> | ||
<ArrowDropDownIcon /> | ||
</Button> | ||
))} | ||
</Box> | ||
</Box> | ||
</Box> | ||
|
||
<Box margin="auto" marginY={10} maxWidth={1200}> | ||
<Typography variant="h4" gutterBottom> | ||
{page.subtitle} | ||
</Typography> | ||
<Typography variant="body1" color="black"> | ||
{page.subDescription} | ||
</Typography> | ||
</Box> | ||
|
||
<Box> | ||
{page.types.map((service, index) => ( | ||
<Box key={index} width={1} mb={5}> | ||
<Box | ||
id={service.name.replace(/\s+/g, "-").toLowerCase()} | ||
data-testid={service.name.replace(/\s+/g, "-").toLowerCase()} | ||
margin="auto" | ||
marginY={10} | ||
maxWidth={1200} | ||
sx={{ textAlign: { xs: "center", md: "left" } }} | ||
> | ||
<Box sx={{ display: { md: "flex" } }}> | ||
<Box width={"100%"} maxWidth={500} height={300} margin={"auto"}> | ||
<Slider {...settings}> | ||
{service.images.map((image: any, index: any) => ( | ||
<Box | ||
key={index} | ||
sx={{ | ||
position: "relative", | ||
width: "100%", | ||
height: 300, | ||
}} | ||
> | ||
<Image | ||
src={image} | ||
alt={`Image ${index + 1}`} | ||
style={{ width: "100%", height: "100%", objectFit: "cover" }} | ||
/> | ||
</Box> | ||
))} | ||
</Slider> | ||
</Box> | ||
<Box | ||
textAlign="center" | ||
sx={{ ml: { md: 2 }, textAlign: { xs: "center", md: "left" } }} | ||
> | ||
<Typography | ||
variant="h4" | ||
sx={{ marginTop: { xs: 2, md: 0 }, textAlign: { xs: "center", md: "left" } }} | ||
gutterBottom | ||
> | ||
{service.name} | ||
</Typography> | ||
<Typography variant="h6" color="textSecondary"> | ||
{service.description} | ||
</Typography> | ||
</Box> | ||
</Box> | ||
</Box> | ||
</Box> | ||
))} | ||
</Box> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default ServicesPage; | ||
|
||
interface SliderSettings { | ||
infinite: boolean; | ||
accessibility: boolean; | ||
arrows: boolean; | ||
autoplay: boolean; | ||
dots: boolean; | ||
speed: number; | ||
sync: boolean; | ||
autoplaySpeed: number; | ||
slidesToShow: number; | ||
slidesToScroll: number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
import React from "react"; | ||
import { Box, Button, Typography } from "@mui/material"; | ||
import Slider from "react-slick"; | ||
import Image from "next/image"; | ||
import windowBefore1 from "../assets/windows/Alside_Casement_Beauty4.jpg"; | ||
import windowBefore2 from "../assets/windows/Alside_Casement_Beauty5.jpg"; | ||
import windowBefore3 from "../assets/windows/Alside_Casement_Beauty6.jpg"; | ||
import windowAfter1 from "../assets/windows/Alside_Mezzo_Slider_Beauty2.jpg"; | ||
import windowAfter2 from "../assets/windows/Alside_Promenade_ClassicBeauty2.jpg"; | ||
import windowAfter3 from "../assets/windows/Alside_Promenade_ContemporaryBeauty.jpg"; | ||
|
||
interface Service { | ||
name: string; | ||
description: string; | ||
images: any; | ||
} | ||
|
||
const services: Service[] = [ | ||
{ | ||
name: "Our Services", | ||
description: | ||
"We specialize in siding and window replacement. But we also replace doors, gutters, roofs, and trim.", | ||
images: [windowBefore1, windowBefore2, windowBefore3, windowAfter1, windowAfter2, windowAfter3], | ||
}, | ||
]; | ||
|
||
const ServiceCards: React.FC = () => { | ||
const settings = { | ||
infinite: true, | ||
accessibility: false, | ||
arrows: false, | ||
autoplay: true, | ||
dots: false, | ||
sync: true, | ||
speed: 3000, | ||
autoplaySpeed: 12000, | ||
slidesToShow: 1, | ||
slidesToScroll: 1, | ||
}; | ||
|
||
return ( | ||
<> | ||
{services.map((service, serviceIndex) => ( | ||
<Box key={serviceIndex}> | ||
<Box position="relative"> | ||
<Slider {...settings}> | ||
{service.images.map((image: any, index: any) => ( | ||
<Box key={index}> | ||
<Box | ||
sx={{ | ||
position: "relative", | ||
width: "100%", | ||
height: 400, | ||
}} | ||
> | ||
<Image src={image} alt={`Image ${index + 1}`} layout="fill" objectFit="cover" /> | ||
</Box> | ||
</Box> | ||
))} | ||
</Slider> | ||
<Box | ||
sx={{ | ||
position: "absolute", | ||
top: 0, | ||
left: 0, | ||
right: 0, | ||
bottom: 0, | ||
color: "white", | ||
display: "flex", | ||
flexDirection: "column", | ||
justifyContent: "center", | ||
alignItems: "center", | ||
padding: 4, | ||
paddingX: { xs: 2, md: 4 }, | ||
paddingBottom: 6, | ||
zIndex: 1, | ||
}} | ||
> | ||
<Box | ||
sx={{ | ||
backgroundColor: "rgba(255, 255, 255, 0.6)", | ||
width: "100%", | ||
height: "100%", | ||
maxWidth: 1200, | ||
padding: 3, | ||
borderRadius: "20px", | ||
textAlign: "center", | ||
display: "flex", | ||
flexDirection: "column", | ||
justifyContent: "space-between", | ||
}} | ||
> | ||
<Box> | ||
<Typography variant="h3" color="primary" mb={2} textAlign="center"> | ||
{service.name} | ||
</Typography> | ||
<Typography variant="h6" color="black"> | ||
{service.description} | ||
</Typography> | ||
</Box> | ||
<Box> | ||
<Box sx={{ marginBottom: 2 }}> | ||
<Button variant="contained" sx={{ color: "white" }}> | ||
Learn More | ||
</Button> | ||
</Box> | ||
</Box> | ||
</Box> | ||
</Box> | ||
</Box> | ||
</Box> | ||
))} | ||
</> | ||
); | ||
}; | ||
|
||
export default ServiceCards; |
Oops, something went wrong.