أخر الاخبار

halloween website design

 halloween website design










file html


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>home page</title>

    <link rel="stylesheet" href="https://unpkg.com/aos@next/dist/aos.css" />

    <link rel="stylesheet" href="https://unpkg.com/swiper@7/swiper-bundle.min.css" />

    <!-- font awesome cdn link  -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">

    <!-- custom css file link  -->
    <link rel="stylesheet" href="css/style.css">

</head>
<body>
    
<!-- header section starts  -->

<header class="header">

    <a href="#" class="logo"> <i class="fas fa-ghost"></i> logo </a>

    <nav class="navbar">
        <a href="#home" class="active">home</a>
        <a href="#products">products</a>
        <a href="#about">about</a>
        <a href="#arrivals">arrivals</a>
        <a href="#contact">contact</a>
        <a href="#blogs">blogs</a>
    </nav>

    <div class="icons">
        <div id="menu-btn" class="fas fa-bars"></div>
        <div id="search-btn" class="fas fa-search"></div>
        <a href="#" class="fas fa-shopping-cart"></a>
        <a href="#" class="fas fa-user"></a>
    </div>

    <form action="" class="search-form">
        <input type="search" placeholder="search here..." id="input-box">
        <label for="input-box" class="fas fa-search"></label>
    </form>

</header>

<!-- header section ends -->

<!-- home section starts  -->

<section class="home" id="home">

    <div class="swiper home-slider">

        <div class="swiper-wrapper">

            <div class="swiper-slide box" style="background: url(image/home-slider-1.jpg);">
                <div class="content">
                    <h3>happy Halloween</h3>
                    <p>special discount</p>
                    <div class="button">
                        <a href="#" class="btn">shop now</a>
                    </div>
                </div>
            </div>

            <div class="swiper-slide box" style="background: url(image/home-slider-2.jpg);">
                <div class="content">
                    <h3>upto 30% off</h3>
                    <p>on all costumes</p>
                    <div class="button">
                        <a href="#" class="btn">shop now</a>
                    </div>
                </div>
            </div>

            <div class="swiper-slide box" style="background: url(image/home-slider-3.jpg);">
                <div class="content">
                    <h3>limited offer</h3>
                    <p>don't miss it</p>
                    <div class="button">
                        <a href="#" class="btn">shop now</a>
                    </div>
                </div>
            </div>

        </div>

        <div class="swiper-button-next"></div>
        <div class="swiper-button-prev"></div>

    </div>

</section>

<!-- home section ends -->

<!-- products section starts  -->

<section class="products" id="products">

    <h1 class="heading"> our <span>products</span> </h1>

    <div class="swiper products-slider" data-aos="zoom-in">

        <div class="swiper-wrapper">

            <div class="swiper-slide box">
                <div class="icons">
                    <a href="#" class="fas fa-shopping-cart"></a>
                    <a href="#" class="fas fa-eye"></a>
                    <a href="#" class="fas fa-share"></a>
                </div>
                <div class="image">
                    <img src="image/product-1.jpg" alt="">
                </div>
                <div class="content">
                    <h3>latest products</h3>
                    <div class="price"> $79.99 <span>$95.99</span> </div>
                </div>
            </div>

            <div class="swiper-slide box">
                <div class="icons">
                    <a href="#" class="fas fa-shopping-cart"></a>
                    <a href="#" class="fas fa-eye"></a>
                    <a href="#" class="fas fa-share"></a>
                </div>
                <div class="image">
                    <img src="image/product-2.jpg" alt="">
                </div>
                <div class="content">
                    <h3>latest products</h3>
                    <div class="price"> $79.99 <span>$95.99</span> </div>
                </div>
            </div>

            <div class="swiper-slide box">
                <div class="icons">
                    <a href="#" class="fas fa-shopping-cart"></a>
                    <a href="#" class="fas fa-eye"></a>
                    <a href="#" class="fas fa-share"></a>
                </div>
                <div class="image">
                    <img src="image/product-3.jpg" alt="">
                </div>
                <div class="content">
                    <h3>latest products</h3>
                    <div class="price"> $79.99 <span>$95.99</span> </div>
                </div>
            </div>

            <div class="swiper-slide box">
                <div class="icons">
                    <a href="#" class="fas fa-shopping-cart"></a>
                    <a href="#" class="fas fa-eye"></a>
                    <a href="#" class="fas fa-share"></a>
                </div>
                <div class="image">
                    <img src="image/product-4.jpg" alt="">
                </div>
                <div class="content">
                    <h3>latest products</h3>
                    <div class="price"> $79.99 <span>$95.99</span> </div>
                </div>
            </div>

            <div class="swiper-slide box">
                <div class="icons">
                    <a href="#" class="fas fa-shopping-cart"></a>
                    <a href="#" class="fas fa-eye"></a>
                    <a href="#" class="fas fa-share"></a>
                </div>
                <div class="image">
                    <img src="image/product-5.jpg" alt="">
                </div>
                <div class="content">
                    <h3>latest products</h3>
                    <div class="price"> $79.99 <span>$95.99</span> </div>
                </div>
            </div>

        </div>

    </div>

</section>

<!-- products section ends -->

<!-- about section starts  -->

<section class="about" id="about">

    <div class="content" data-aos="fade-right">
        <h3>about us</h3>
        <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Magni, adipisci neque! Veritatis laboriosam odio corporis, quo fugit architecto. Veritatis in dicta qui odit soluta sequi ipsam facere eum numquam! Obcaecati.</p>
        <a href="#" class="btn">read more</a>
    </div>

</section>

<!-- about section ends -->

<!-- arrivals section starts  -->

<section class="arrivals" id="arrivals">

    <h1 class="heading"> new <span>arrivals</span> </h1>

    <div class="box-container">

        <div class="box" data-aos="fade-right">
            <div class="icons">
                <a href="#" class="fas fa-shopping-cart"></a>
                <a href="#" class="fas fa-eye"></a>
                <a href="#" class="fas fa-share"></a>
            </div>
            <div class="image">
                <img src="image/arrival-1.jpg" alt="">
            </div>
            <div class="content">
                <h3>latest products</h3>
                <div class="price"> $79.99 <span>$95.99</span> </div>
            </div>
        </div>

        <div class="box" data-aos="fade-down">
            <div class="icons">
                <a href="#" class="fas fa-shopping-cart"></a>
                <a href="#" class="fas fa-eye"></a>
                <a href="#" class="fas fa-share"></a>
            </div>
            <div class="image">
                <img src="image/arrival-2.jpg" alt="">
            </div>
            <div class="content">
                <h3>latest products</h3>
                <div class="price"> $79.99 <span>$95.99</span> </div>
            </div>
        </div>

        <div class="box" data-aos="fade-left">
            <div class="icons">
                <a href="#" class="fas fa-shopping-cart"></a>
                <a href="#" class="fas fa-eye"></a>
                <a href="#" class="fas fa-share"></a>
            </div>
            <div class="image">
                <img src="image/arrival-3.gif" alt="">
            </div>
            <div class="content">
                <h3>latest products</h3>
                <div class="price"> $79.99 <span>$95.99</span> </div>
            </div>
        </div>

        <div class="box" data-aos="fade-right">
            <div class="icons">
                <a href="#" class="fas fa-shopping-cart"></a>
                <a href="#" class="fas fa-eye"></a>
                <a href="#" class="fas fa-share"></a>
            </div>
            <div class="image">
                <img src="image/arrival-4.jpg" alt="">
            </div>
            <div class="content">
                <h3>latest products</h3>
                <div class="price"> $79.99 <span>$95.99</span> </div>
            </div>
        </div>

        <div class="box" data-aos="fade-down">
            <div class="icons">
                <a href="#" class="fas fa-shopping-cart"></a>
                <a href="#" class="fas fa-eye"></a>
                <a href="#" class="fas fa-share"></a>
            </div>
            <div class="image">
                <img src="image/arrival-5.jpg" alt="">
            </div>
            <div class="content">
                <h3>latest products</h3>
                <div class="price"> $79.99 <span>$95.99</span> </div>
            </div>
        </div>

        <div class="box" data-aos="fade-left">
            <div class="icons">
                <a href="#" class="fas fa-shopping-cart"></a>
                <a href="#" class="fas fa-eye"></a>
                <a href="#" class="fas fa-share"></a>
            </div>
            <div class="image">
                <img src="image/arrival-6.gif" alt="">
            </div>
            <div class="content">
                <h3>latest products</h3>
                <div class="price"> $79.99 <span>$95.99</span> </div>
            </div>
        </div>

    </div>

</section>

<!-- arrivals section ends -->

<!-- contact section starts  -->

<section class="contact" id="contact">

    <h1 class="heading"> <span>contact</span> us </h1>

    <div class="row">

        <form action="">
            <h3 data-aos="zoom-in">tell us something!</h3>
            <input data-aos="zoom-in" type="text" placeholder="your name" class="box">
            <input data-aos="zoom-in" type="email" placeholder="your email" class="box">
            <input data-aos="zoom-in" type="number" placeholder="your number" class="box">
            <textarea data-aos="zoom-in" placeholder="your message" class="box" cols="30" rows="10"></textarea>
            <input data-aos="zoom-in" type="submit" value="send message" class="btn">
        </form>

    </div>

</section>

<!-- contact section ends -->

<!-- blogs section starts  -->

<section class="blogs" id="blogs">

    <h1 class="heading"> our <span>blogs</span> </h1>

    <div class="box-container">

        <div class="box" data-aos="fade-right">
            <div class="image">
                <img src="image/blog-1.jpg" alt="">
            </div>
            <div class="content">
                <h3>Believe in the Magic of Halloween.</h3>
                
                <a href="#" class="btn">read more</a>
                <div class="icons">
                    <a href="#"> <i class="fas fa-calendar"></i> 1st may, 2021 </a>
                    <a href="#"> <i class="fas fa-user"></i> by admin </a>
                </div>
            </div>
        </div>

        <div class="box" data-aos="fade-down">
            <div class="image">
                <img src="image/blog-2.jpg" alt="">
            </div>
            <div class="content">
                <h3>Believe in the Magic of Halloween.</h3>
               
                <a href="#" class="btn">read more</a>
                <div class="icons">
                    <a href="#"> <i class="fas fa-calendar"></i> 1st may, 2021 </a>
                    <a href="#"> <i class="fas fa-user"></i> by admin </a>
                </div>
            </div>
        </div>

        <div class="box" data-aos="fade-left">
            <div class="image">
                <img src="image/blog-3.jpg" alt="">
            </div>
            <div class="content">
                <h3>Believe in the Magic of Halloween.</h3>
              
                <a href="#" class="btn">read more</a>
                <div class="icons">
                    <a href="#"> <i class="fas fa-calendar"></i> 1st may, 2021 </a>
                    <a href="#"> <i class="fas fa-user"></i> by admin </a>
                </div>
            </div>
        </div>

    </div>

</section>

<!-- blogs section ends -->

<!-- footer section starts  -->

<section class="footer" id="footer">

    <div class="box-container">

        <div class="box" data-aos="fade-right">
            <h3>our branches</h3>
            <a href="#"> <i class="fas fa-map-marker-alt"></i> india </a>
            <a href="#"> <i class="fas fa-map-marker-alt"></i> USA </a>
            <a href="#"> <i class="fas fa-map-marker-alt"></i> russia </a>
            <a href="#"> <i class="fas fa-map-marker-alt"></i> france </a>
            <a href="#"> <i class="fas fa-map-marker-alt"></i> japan </a>
        </div>

        <div class="box" data-aos="fade-down">
            <h3>quick links</h3>
            <a href="#"> <i class="fas fa-arrow-right"></i> home </a>
            <a href="#"> <i class="fas fa-arrow-right"></i> products </a>
            <a href="#"> <i class="fas fa-arrow-right"></i> about </a>
            <a href="#"> <i class="fas fa-arrow-right"></i> arrivals </a>
            <a href="#"> <i class="fas fa-arrow-right"></i> contact </a>
            <a href="#"> <i class="fas fa-arrow-right"></i> blogs </a>
        </div>

        <div class="box" data-aos="fade-up">
            <h3>contact us</h3>
            <a href="#"> <i class="fas fa-phone"></i> +96411111111 </a>
            <a href="#"> <i class="fas fa-phone"></i> +96400000000 </a>
            <a href="#"> <i class="fas fa-envelope"></i> mohammedmuslim@gmail.com </a>
            <a href="#"> <i class="fas fa-map-marker-alt"></i> Iarq,Baghdad </a>
        </div>

        <div class="box" data-aos="fade-left">
            <h3>contact us</h3>
            <a href="#"> <i class="fab fa-facebook-f"></i> facebook </a>
            <a href="#"> <i class="fab fa-twitter"></i> twitter </a>
            <a href="#"> <i class="fab fa-instagram"></i> instagram </a>
            <a href="#"> <i class="fab fa-linkedin"></i> linkedin </a>
            <a href="#"> <i class="fab fa-pinterest"></i> pinterest </a>
        </div>

    </div>

    <div class="credit"> created by <span>mohammed muslim</span> | all rights reserved </div>

</section>

<!-- footer section ends -->


















<script src="https://unpkg.com/swiper@7/swiper-bundle.min.js"></script>

<!-- custom js file links  -->
<script src="js/script.js"></script>

<script src="https://unpkg.com/aos@next/dist/aos.js"></script>
<script>
  AOS.init({
      delay:400,
      duration:800
  });
</script>

</body>
</html>


file css

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;300;400;500;600&display=swap');

:root{
    --main-color:#ef7819;
    --black:#141215;
}

*{
    font-family'Poppins'sans-serif;
    margin:0padding:0;
    box-sizingborder-box;
    outlinenoneborder:none;
    text-decorationnone;
    text-transformcapitalize;
    transitionall .2s linear;
    transition: width none;
}

html{
    font-size62.5%;
    overflow-xhidden;
    scroll-behaviorsmooth;
    scroll-padding-top7rem;
    
}

html::-webkit-scrollbar{
    width1rem;
}

html::-webkit-scrollbar-track{
    backgroundvar(--black);
}

html::-webkit-scrollbar-thumb{
    backgroundvar(--main-color);
}

body{
    overflow-xhidden;
    backgroundvar(--black);
}

section{
    padding:2rem 9%;
}

.heading{
    font-size4rem;
    text-aligncenter;
    padding-bottom2rem;
    color:#fff;
}

.heading span{
    color:var(--main-color);
}

.btn{
    margin-top1rem;
    displayinline-block;
    padding:.8rem 3rem;
    font-size1.7rem;
    background:#fff;
    font-weight500;
    color:var(--black);
    cursorpointer;
}

.btn:hover{
    backgroundvar(--main-color);
    color:#fff;
    letter-spacing.1rem;
}

.header{
    positionfixed;
    top:0left:0right:0;
    z-index1000;
    backgroundrgba(0,0,0,.3);
    padding:3rem 9%;
    displayflex;
    align-itemscenter;
    justify-contentspace-between;
}

.header .logo{
    font-size2.5rem;
    color:#fff;
    font-weightbolder;
}

.header .logo i{
    padding-right.5rem;
    color:var(--main-color);
    animation: floating 3s linear infinite;
}

@keyframes floating{
    0%, 100%{
        transformtranslateY(0rem);
    }
    50%{
        transformtranslateY(-1rem);
    }
}

.header .navbar a{
    font-size1.7rem;
    color:#fff;
    margin:0 1rem;
}

.header .navbar a.active,
.header .navbar a:hover{
    color:var(--main-color);
}

.header .icons a,
.header .icons div{
    font-size2.5rem;
    color:#fff;
    margin-left2rem;
    cursorpointer;
}

.header .icons a:hover,
.header .icons div:hover{
    color:var(--main-color);
}

#menu-btn{
    displaynone;
}

.header .search-form{
    positionabsolute;
    top:115%right:-105%;
    background#fff;
    width:50rem;
    height:5rem;
    displayflex;
    align-itemscenter;
    opacity0;
}

.header .search-form.active{
    right:2rem;
    opacity1;
    transition.4s linear;
}

.header .search-form input{
    width:100%;
    padding:0 1.5rem;
    font-size1.6rem;
    color:var(--black);
    text-transformnone;
}

.header .search-form label{
    font-size2.5rem;
    padding-right1.5rem;
    colorvar(--black);
    cursorpointer;
}

.header .search-form label:hover{
    color:var(--main-color);
}

.header.active{
    padding:2rem 9%;
    background#222;
}

.home{
    padding:0;
}

.home .home-slider .box{
    min-height100vh;
    displayflex;
    align-itemscenter;
    justify-contentcenter;
    padding:2rem;
    background-sizecover !important;
    background-positioncenter !important;
}

.home .home-slider .box .content{
    text-aligncenter;
}

.home .home-slider .box .content h3{
    font-size5rem;
    color:#fff;
    transition-delay.2s;
}

.home .home-slider .box .content p{
    font-size3rem;
    color:#fff;
    transition-delay.4s;
    padding:1rem 0;
}

.home .home-slider .box .content .button{
    transition-delay.6s;
}

.home .home-slider .box .content > *{
    transformtranslateY(2rem);
    opacity0;
}

.home .home-slider .swiper-slide-active .content > *{
    transformtranslateY(0rem);
    opacity1;
}

.home .home-slider .swiper-button-next{
    right4rem;
    color:#fff;
    opacity0;
}

.home .home-slider .swiper-button-prev{
    left4rem;
    color:#fff;
    opacity0;
}

.home .home-slider .swiper-button-next:hover,
.home .home-slider .swiper-button-prev:hover{
    color:var(--main-color);
}

.home .home-slider:hover .swiper-button-next,
.home .home-slider:hover .swiper-button-prev{
    opacity1;
}

.products .products-slider .box{
    positionrelative;
    text-aligncenter;
    overflowhidden;
}

.products .products-slider .box .image{
    height:40rem;
    width:100%;
    overflowhidden;
}

.products .products-slider .box .image img{
    height:100%;
    width:100%;
    object-fitcover;
}

.products .products-slider .box:hover .image img{
    transformscale(1.2);
}

.products .products-slider .box .icons{
    positionabsolute;
    top0right-6rem;
    z-index1;
}

.products .products-slider .box:hover .icons{
    right1rem;
}

.products .products-slider .box .icons a{
    height4.5rem;
    width4.5rem;
    line-height4.5rem;
    border-radius50%;
    font-size2rem;
    color:var(--black);
    background#fff;
    margin-top1rem;
    displayblock;
}

.products .products-slider .box .icons a:hover{
    backgroundvar(--main-color);
    color:#fff;
}

.products .products-slider .box .content{
    padding1rem 0;
}

.products .products-slider .box .content h3{
    font-size2.5rem;
    font-weightnormal;
    color:#fff;
}

.products .products-slider .box .content .price{
    font-size2rem;
    font-weightbolder;
    color:#fff;
}

.products .products-slider .box .content .price span{
    font-size1.5rem;
    font-weightnormal;
    color:var(--main-color);
    text-decorationline-through;
}

.about{
    backgroundurl(../image/about-bt.jpgno-repeat;
    background-positioncenter;
    background-sizecover;
}

.about .content{
    padding:13rem 0;
    max-width50rem;
}

.about .content h3{
    font-size3rem;
    color:var(--main-color);
}

.about .content p{
    font-size1.5rem;
    color:#fff;
    line-height2;
    padding1rem 0;
}

.arrivals .box-container{
    displaygrid;
    grid-template-columnsrepeat(auto-fitminmax(30rem1fr));
    gap:1.5rem;
}

.arrivals .box-container .box{
    positionrelative;
    text-aligncenter;
    overflowhidden;
}
.arrivals .box-container .box .image{
    height:40rem;
    width:100%;
    overflowhidden;
}
.arrivals .box-container .box .image img{
    height:100%;
    width:100%;
    object-fitcover;
}
.arrivals .box-container .box:hover .image img{
    transformscale(1.2);
}
.arrivals .box-container .box .icons{
    positionabsolute;
    top0right-6rem;
    z-index1;
}
.arrivals .box-container .box:hover .icons{
    right1rem;
}
.arrivals .box-container .box .icons a{
    height4.5rem;
    width4.5rem;
    line-height4.5rem;
    border-radius50%;
    font-size2rem;
    color:var(--black);
    background#fff;
    margin-top1rem;
    displayblock;
}
.arrivals .box-container .box .icons a:hover{
    backgroundvar(--main-color);
    color:#fff;
}
.arrivals .box-container .box .content{
    padding1rem 0;
}
.arrivals .box-container .box .content h3{
    font-size2.5rem;
    font-weightnormal;
    color:#fff;
}
.arrivals .box-container .box .content .price{
    font-size2rem;
    font-weightbolder;
    color:#fff;
}
.arrivals .box-container .box .content .price span{
    font-size1.5rem;
    font-weightnormal;
    color:var(--main-color);
    text-decorationline-through;
}

.contact .row{
    displayflex;
    flex-wrapwrap;
}

.contact .row .map{
    flex:1 1 42rem;
    width100%;
}

.contact .row form{
    flex:1 1 42rem;
    padding2rem;
    text-aligncenter;
    background:#222;
}

.contact .row form h3{
    font-size3rem;
    padding-bottom1rem;
    color:var(--main-color);
}

.contact .row form .box{
    width:100%;
    padding:1rem 1.2rem;
    background:var(--black);
    color:#fff;
    font-size1.6rem;
    text-transformnone;
    margin.7rem 0;
}

.contact .row form textarea{
    height:15rem;
    resizenone;
}

.blogs .box-container{
    displaygrid;
    grid-template-columnsrepeat(auto-fitminmax(30rem1fr));
    gap:1.5rem;
}

.blogs .box-container .box .image{
    height:25rem;
    width:100%;
    overflowhidden;
}

.blogs .box-container .box .image img{
    height:100%;
    width:100%;
    object-fitcover;
}

.blogs .box-container .box:hover .image img{
    transformscale(1.2);
}

.blogs .box-container .box .content{
    padding:2rem;
    background#222;
}

.blogs .box-container .box .content h3{
    font-size2.5rem;
    color:var(--main-color);
    line-height1.8;
}

.blogs .box-container .box .content p{
    font-size1.5rem;
    color:#fff;
    line-height2;
}

.blogs .box-container .box .content .icons{
    margin-top2rem;
    padding-top2rem;
    border-top.1rem solid #fff3;
    displayflex;
    align-itemscenter;
    justify-contentspace-between;
}

.blogs .box-container .box .content .icons a{
    font-size1.4rem;
    color:var(--main-color);
}

.blogs .box-container .box .content .icons a:hover{
    color:#fff;
}

.blogs .box-container .box .content .icons a i{
    padding-right.5rem;
}

.footer{
    background#000;
}

.footer .box-container{
    displaygrid;
    grid-template-columnsrepeat(auto-fitminmax(25rem1fr));
    gap:1.5rem;
}

.footer .box-container .box h3{
    font-size2.2rem;
    color:#fff;
    padding:1rem 0;
}

.footer .box-container .box a{
    font-size1.4rem;
    color:#aaa;
    padding:1rem 0;
    displayblock;
}

.footer .box-container .box a:hover{
    color:var(--main-color);
}

.footer .box-container .box a i{
    padding-right.5rem;
    color:var(--main-color);
}

.footer .box-container .box a:hover i{
    padding-right2rem;
    color:#fff;
}

.footer .credit{
    padding:1rem;
    padding-top2.5rem;
    margin-top2.5rem;
    border-top:.1rem solid #fff3;
    font-size2rem;
    color:#aaa;
    text-aligncenter;
}

.footer .credit span{
    color:var(--main-color);
}

/* media queries  */

@media (max-width:991px){

    html{
        font-size:55%;
    }

    .header{
        padding:2rem;
    }

    .header.active{
        padding:2rem;
    }

    section{
        padding:2rem;
    }

}

@media (max-width:768px){

    #menu-btn{
        displayinline-block;
    }

    .header .search-form{
        width:90%;
    }

    .header .navbar{
        positionabsolute;
        top:99%left:0right:0;
        background:#222;
        clip-pathpolygon(0 0100% 0100% 00 0);
    }

    .header .navbar.active{
        clip-pathpolygon(0 0100% 0100% 100%0% 100%);
    }

    .header .navbar a{
        displayblock;
        margin:2rem;
        font-size2rem;
    }

}

@media (max-width:450px){

    html{
        font-size:50%;
    }

    .home .home-slider .swiper-button-next,
    .home .home-slider .swiper-button-prev{
        displaynone;
    }

}


file js

let searchForm = document.querySelector('.search-form');

document.querySelector('#search-btn').onclick = () =>{
  searchForm.classList.toggle('active');
  navbar.classList.remove('active');
}

let navbar = document.querySelector('.navbar');

document.querySelector('#menu-btn').onclick = () =>{
  navbar.classList.toggle('active');
  searchForm.classList.remove('active');
}

// scroll spy 
let section = document.querySelectorAll('section');
let navLinks = document.querySelectorAll('.header .navbar a');

window.onscroll = () =>{
  searchForm.classList.remove('active');
  navbar.classList.remove('active');

  if(window.scrollY > 0){
    document.querySelector('.header').classList.add('active');
  }else{
    document.querySelector('.header').classList.remove('active');
  }

  section.forEach(sec =>{
    let top = window.scrollY;
    let offset = sec.offsetTop - 200;
    let height = sec.offsetHeight;
    let id = sec.getAttribute('id');

    if(top >= offset && top < offset + height){
      navLinks.forEach(link =>{
        link.classList.remove('active');
        document.querySelector('.header .navbar a[href*='+id+']').classList.add('active');
      });
    };

  });

};

window.onload = () =>{
  if(window.scrollY > 0){
    document.querySelector('.header').classList.add('active');
  }else{
    document.querySelector('.header').classList.remove('active');
  }
}

var swiper = new Swiper(".home-slider", {
  spaceBetween: 20,
  effect: "fade",
  loop:true,
  navigation: {
    nextEl: ".swiper-button-next",
    prevEl: ".swiper-button-prev",
  },
  centeredSlides: true,
  autoplay: {
    delay: 9500,
    disableOnInteraction: false,
  },
});

var swiper = new Swiper(".products-slider", {
  spaceBetween: 20,
  loop:true,
  centeredSlides: true,
  autoplay: {
    delay: 9500,
    disableOnInteraction: false,
  },
  grabCursor:true,
  breakpoints: {
    0: {
      slidesPerView: 1,
    },
    768: {
      slidesPerView: 2,
    },
    991: {
      slidesPerView: 3,
    },
  },
});

تعليقات



حجم الخط
+
16
-
تباعد السطور
+
2
-