This is a Adventure web

 <!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>Adventure web</title>
    <style>
        @import url('https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700,800,900,=&display=swap');
        @import url('https://fonts.googleapis.com/css2?family=Rancho&display=swap');

        * {
            margin0;
            padding0;
            box-sizingborder-box;
            font-family'poppins'sans-serif;
        }

        body {
            overflow-xhidden;
            background#fff;
            min-height100vh;

        }

        #header {
            positionabsolute;
            top0;
            left0;
            width100%;
            padding30px100px;
            displayflex;
            justify-contentspace-between;
            align-itemscenter;
            z-index1000;
        }


        #header .logo {
            color#094b65;
            font-weight700;
            font-size2em;
            text-decorationnone;

        }

        #header ul {
            displayflex;
            justify-contentcenter;
            align-itemscenter;
        }

        #header ul li {
            list-stylenone;
            margin-left20px;

        }

        #header ul li a {
            text-decorationnone;
            padding6px 15px;
            color#094b65;
            border-radius20px;
        }

        #header ul li a:hover,
        #header ul li a.active {
            background#094b65;
            color#fff;
        }
        section::before{
            content'';
            positionabsolute;
            bottom0;
            left0;
            width100%;
            height100px;
            backgroundlinear-gradient(to top #094b65,transparent);
            z-index10;

        }

        section img{
            positionabsolute;
            top0;
            left0;
            width100%;
            height100%;
            object-fitcover;
            pointer-eventsnone;

        }
        section {
            positionrelative;
            width100%;
            height100vh;
            displayflex;
            justify-contentcenter;
            align-itemscenter;

        }

        section #text {
            positionabsolute;
            color#094b65;
            font-size10vw;
            text-aligncenter;
            line-height0.55em;
            font-family'Rancho', cursive;
            transformtranslateY(-50%);
        }

        section #text span {
            font-size0.20em;
            letter-spacing2px;
            font-weight400px;
            font-family'Poppins'sans-serif;

        }

        #btn {
            text-decorationnone;
            displayinline-block;
            padding8px 30px;
            background#fff;
            color#094b65;
            font-size1.2em;
            font-weight500;
            letter-spacing2px;
            border-radius40px;
            transformtranslateY(100px);
        }

        .sec {
            positionrelative;
            padding100px;
            background#094b65;
        }

        .sec h2 {
            font-size3.5em;
            color#f78;
            margin-bottom10px;

        }

        .sec p {
            font-size1em;
            color#fff;

        }
    </style>

</head>

<body>
    <header id="header">
        <a href="#" class="logo">Jungle</a>
        <ul>
            <li><a href="#" class="active">Home</a></li>
            <li><a href="#">About</a></li>
            <li><a href="#">Destination</a></li>
            <li><a href="#">Contact us</a></li>

        </ul>
    </header>

    <section>
        <h2 id="text"><span>Its time to take for a new</span><br>Adventure</h2>
        <img src="bird1.png" alt="there is a bird" id="bird1">
        <img src="bird2.png" alt="there is a bird" id="bird2">
        <img src="forest.png" alt="there is a bird" id="forest">
        <!-- <img src="bird1.png" alt="there is a bird" id="bird1">
        <img src="bird1.png" alt="there is a bird" id="bird1"> -->

        
        <a href="#" id="btn">Expolre</a>
        <img src="rocks.png" alt="rocks" id="rocks">
        <img src="water.png" alt="water" id="water">
    </section>
    <div class="sec">
        <h2>Parallax Scrolling Effect</h2>
        <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Eligendi, ullam vero.</p>
    </div>
    <script>
        let text = document.getElementById('text')
        let bird1 = document.getElementById('bird1');
        let bird2 = document.getElementById('bird2');
        let btn = document.getElementById('btn');
        let rocks = document.getElementById('rocks');
        let forest = document.getElementById('forest');
        let water = document.getElementById('water');
        let header = document.getElementById('header');


        window.addEventListener('scroll',function(){
            let value = window.scrollY;

            text.style.top =50 +value * -0.1 + '%';
            bird1.style.top = value * -2.0 + 'px';
            bird1.style.left = value * 3 +'px';

            bird2.style.top = value * 1.5 + 'px';
            bird2.style.left = value * -5 + 'px';

            btn.style.marginTop = value * 1.5 + 'px';


            rocks.style.top = value * -0.20 + 'px';
            


        })
    </script>
</body>

</html>a

Comments

Popular Posts