Commit e9052784 authored by Muhammad Ameen's avatar Muhammad Ameen 💻

Header complete with responsive

parent e9842750
...@@ -2,18 +2,26 @@ import React from "react"; ...@@ -2,18 +2,26 @@ import React from "react";
import carouselImg from "../../assets/images/offer.jpg"; import carouselImg from "../../assets/images/offer.jpg";
import { Carousel } from "react-bootstrap"; import { Carousel } from "react-bootstrap";
import { carouselData } from "../../Helper/dummyData";
import style from "./Carousel.module.scss"
const MainCarousel = () => { const MainCarousel = () => {
return ( return (
<> <>
<Carousel variant="dark"> <Carousel variant="dark" controls={false} indicators={false} className={`${style.carousel}`} interval={3000}>
{carouselData?.map((item, inndex) => {
return (
<Carousel.Item> <Carousel.Item>
<img className="d-block w-100" src={carouselImg} alt="First slide" /> <img
<Carousel.Caption> className={`d-block w-100 ${style.image}`}
<h5>First slide label</h5> src={item?.image}
<p>Nulla vitae elit libero, a pharetra augue mollis interdum.</p> alt="First slide"
</Carousel.Caption> fluid
/>
</Carousel.Item> </Carousel.Item>
);
})}
{/* <Carousel.Item> {/* <Carousel.Item>
<img <img
className="d-block w-100" className="d-block w-100"
......
.image{
height: 550px;
}
.carousel{
height: 550px;
}
@media only screen and (max-width: 1200px) {
.image{
height: 350px;
}
.carousel{
height: 350px;
}
}
\ No newline at end of file
import fruitAndVegetablesImg from "../assets/images/fruitAndVegetables.jpeg";
import offerImg from "../assets/images/offer.jpg";
import discountImg from "../assets/images/20_discount.jpeg";
import mart_innerImg from "../assets/images/mart_inner.jpeg";
const headerData = [ const headerData = [
{ {
id: 1, id: 1,
link: "Mobile Tablet and Laptop", link: "Mobile Tablet and Laptop",
}, },
];
const carouselData = [
{ id: 1, image: fruitAndVegetablesImg },
{ id: 2, image: offerImg },
{ id: 3, image: discountImg },
{ id: 4, image: mart_innerImg },
]; ];
export {headerData} export { headerData, carouselData };
import React from "react"; import React from "react";
import MainNavbar from "../../Components/Navbar/Navbar"; import MainNavbar from "../../Components/Navbar/Navbar";
import MainCarousel from "../../Components/Carousel/Carousel"; import MainCarousel from "../../Components/Carousel/Carousel";
import style from "./Home.module.scss" import style from "./Home.module.scss";
import { Container } from "react-bootstrap"; import { Container, Row, Col } from "react-bootstrap";
import bestPriceImg from "../../assets/images/bestPrice.jpg";
import prayerMatImg from "../../assets/images/prayerMat.jpg";
const Home = () => { const Home = () => {
return ( return (
...@@ -11,10 +13,25 @@ const Home = () => { ...@@ -11,10 +13,25 @@ const Home = () => {
<div> <div>
<MainNavbar /> <MainNavbar />
</div> </div>
<div className={style.carouselContainer}> <div>
<Container> <Container className={style.carouselContainer}>
<Row className={style.carouselContainerRow}>
<Col xl={3} md={12} sm={12}>
<div className={style.leftImages}>
<div>
<img src={bestPriceImg} alt="best price" />
</div>
<div>
<img src={prayerMatImg} alt="prayer mat" />
</div>
</div>
</Col>
<Col xl={8} md={12} sm={12}>
<div>
<MainCarousel /> <MainCarousel />
</div>
</Col>
</Row>
</Container> </Container>
</div> </div>
</section> </section>
......
.carouselContainer {
margin-top: 30px;
.leftImages {
display: flex;
align-items: center;
flex-direction: column;
width: 100%;
}
.leftImages div:nth-child(2) {
margin-top: 30px;
}
.carouselContainerRow {
display: flex;
justify-content: center;
}
}
@media only screen and (max-width: 1200px) {
.carouselContainer{
// background-color: red;
.leftImages {
display: flex;
justify-content: center;
flex-direction: row;
width: 100%;
overflow: auto;
}
.leftImages div {
padding: 0px 30px 30px 30px;
}
.leftImages div:nth-child(2) {
margin-top: 0px;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment