Header Ads

Header ADS

WEB DEVELOPMENT PROJECT PRACTICE

I CREATE AMAZING LOIN & REGISTER FORM   & SERVE WITH LOCALHOST HTML & CSS & JAVASCRIPT......




CODE......


<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>login form-1</title>
    <style>
        *{
    padding: 0;
    margin: 0;
    font-family: sans-serif;
}

.sho{
    height: 100%;
    width: 100%;
    background-image: url("aha.jpg");
    background-position: center;
    background-size: cover;
    position: absolute;
}

.box{
    width: 380px;
    height: 480px;
    position: relative;
    margin: 6% auto;
    background-color: #fff;
    padding: 5px;
    overflow: hidden;
}

.btn-box{
    width: 220px;
    margin: 35px auto;
    position: relative;
    box-shadow: 0 0 20px 9px #2b05ff1f;
    border-radius: 30px;
}


.toggle-btn{
    padding: 10px 30px;
    cursor: pointer;
    background: transparent;
    border: 0;
    outline: none;
    position: relative;
}

#btn{
    top: 0;
    left: 0;
    position: absolute;
    width: 110px;
    height: 100%;
    background: linear-gradient(to right, #10ff4c, #3c06ff);
    border-radius: 30px;
    transition: .5s;
    
}

.icons{
    margin: 30px auto;
    text-align: center;
}
.icons img{
   width: 30px;
   margin: 0 12px;
   box-shadow: 0 0 20px 0 #7f7f7f3d;
   cursor: pointer;
}

.input-g{
    top: 180px;
    position: absolute;
    width: 280px;
    transition: .5s;
}

.input-f{
    width: 100%;
    padding: 10px 0;
    margin: 5px 0;
    border-top: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 1px solid #999;
    outline: none;
    background: transparent;

}


.submit-btn{
    width: 85%;
    padding: 10px 30px;
    cursor: pointer;
    display: block;
    margin: auto;
    background: linear-gradient(to right, #10ff4c, #3c06ff);
    border: 0;
    outline: none;
    border-radius: 30px;
}

.checkbox{
    margin: 30px 10px 30px 0;
}
span{
    color: #777;
    font-size: 12px;
    bottom: 68px;
    position: absolute;

}


#Login{
    left: 50px;
}
#register{
    left: 450px;
}
    </style>
    
</head>

<body>
    <div class="sho">
        <div class="box">
            <div class="btn-box">
                <div id="btn"></div>
                <button type="button" class="toggle-btn" onclick="Login()">Log In</button>
                <button type="button" class="toggle-btn" onclick="register()">Register</button>
            </div>
            <div class="icons">
                <a href="https://www.facebook.com/onlyoneshohaib" target="blank"> <img src="fb.png" alt="facebook"></a>
                <a href="https://www.youtube.com/channel/UCDC8Kc6zVxAZzUy-4cq4hwA" target="blank"> <img src="yt.png" alt="youtube"></a>
                <a href="https://www.instagram.com/shohaib.ahmad/" target="blank"> <img src="in.png" alt="instagrame"></a>
            </div>

            <form id="Login" class="input-g">
                <input type="text" class="input-f" placeholder=" User Id" required>
                <input type="text" class="input-f" placeholder=" Enter Password" required>
                <input type="checkbox" class="checkbox"><span>Remember Password</span>
                <button type="submit" class="submit-btn">Log In</button>
            </form>
            <form id="register" class="input-g">
                <input type="text" class="input-f" placeholder=" User Id" required>
                <input type="email" class="input-f" placeholder=" Email Id" required>
                <input type="text" class="input-f" placeholder=" Enter Password" required>
                <input type="checkbox" class="checkbox"><span>I Agree to the terms & Conditions</span>
                <button type="submit" class="submit-btn">Register</button>
            </form>
        </div>
    </div>
</body>
<--START JAVA SCRIPT IS HER-->
<script>
    let x = document.getElementById("Login");
    let y = document.getElementById("register");
    let z = document.getElementById("btn");

    function register(){
        x.style.left = "-400px";
        y.style.left = "50px";
        z.style.left = "110px";
    }
    function Login(){
        x.style.left = "50px";
        y.style.left = "450px";
        z.style.left = "0";
    }


const http = require("http");
const fs = require("fs");
const home = fs.readFileSync("index.html")


const hostname = '127.0.0.1';
const port = 3000;

const server = http.createServer((req, res)=>{
    console.log(req.url);
    url = req.url;

    res.statusCode = 200;
    res.setHeader('Content-Type', 'text/html');
    if(url == '/'){
        res.end(home);
    }

    else{
        res.statusCode = 404;
        res.end("<h1>404 not found</h1>");
    }
});
  
  server.listen(port, hostname, () => {
    console.log(`Server running at http://${hostname}:${port}/`);
  });



</script>
</html>

No comments

Powered by Blogger.