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>
        *{
    padding0;
    margin0;
    font-family: sans-serif;
}

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

.box{
    width380px;
    height480px;
    position: relative;
    margin6% auto;
    background-color: #fff;
    padding5px;
    overflow: hidden;
}

.btn-box{
    width220px;
    margin35px auto;
    position: relative;
    box-shadow0 0 20px 9px #2b05ff1f;
    border-radius30px;
}


.toggle-btn{
    padding10px 30px;
    cursor: pointer;
    background: transparent;
    border0;
    outline: none;
    position: relative;
}

#btn{
    top0;
    left0;
    position: absolute;
    width110px;
    height100%;
    background: linear-gradient(to right, #10ff4c, #3c06ff);
    border-radius30px;
    transition.5s;
    
}

.icons{
    margin30px auto;
    text-align: center;
}
.icons img{
   width30px;
   margin0 12px;
   box-shadow0 0 20px 0 #7f7f7f3d;
   cursor: pointer;
}

.input-g{
    top180px;
    position: absolute;
    width280px;
    transition.5s;
}

.input-f{
    width100%;
    padding10px 0;
    margin5px 0;
    border-top0;
    border-left0;
    border-right0;
    border-bottom1px solid #999;
    outline: none;
    background: transparent;

}


.submit-btn{
    width85%;
    padding10px 30px;
    cursor: pointer;
    display: block;
    margin: auto;
    background: linear-gradient(to right, #10ff4c, #3c06ff);
    border0;
    outline: none;
    border-radius30px;
}

.checkbox{
    margin30px 10px 30px 0;
}
span{
    color: #777;
    font-size12px;
    bottom68px;
    position: absolute;

}


#Login{
    left50px;
}
#register{
    left450px;
}
    </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.