Sunday, August 22, 2021

html inputs codes


 

<DOCTYPE html>

<html>

<head>

<title> INPUT TYPES</title>

</head>

<body>

<p>hi helo</p>

<form>

NAME:<br>

<input types="text"value="YOUR NAME">

<br>

PASSWORD:<br>

<input type="password" value="password">

<br><br>

<input type="submit"value="SUBMIT">

<input type="reset"value="RESET">

<br>

GENDER:<br>

<input type="radio"name="gender"value="male">

Male<br>

<input type="radio"name="gender"value="female">

Female<br>


<input type="url" id="send"oninput="result.value=send.value">

<br>

<input type="submit">

<br>

<input type="text" id="result">

<br> <br>

<input type="color" id="send"oninput="result.value=send.value">

<input type="text" id="result">



</form>


</body>

</html>

#adityasskk

html inputs

INPUT TYPES

hi helo

NAME:

PASSWORD:



GENDER:
Male
Female




#adityasskk

html Responsive Checkout Form

 



<!DOCTYPE html>

<html>

<head>

<meta name="viewport" content="width=device-width, initial-scale=1">

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

<style>

body {

  font-family: Arial;

  font-size: 17px;

  padding: 8px;

}


* {

  box-sizing: border-box;

}


.row {

  display: -ms-flexbox; /* IE10 */

  display: flex;

  -ms-flex-wrap: wrap; /* IE10 */

  flex-wrap: wrap;

  margin: 0 -16px;

}


.col-25 {

  -ms-flex: 25%; /* IE10 */

  flex: 25%;

}


.col-50 {

  -ms-flex: 50%; /* IE10 */

  flex: 50%;

}


.col-75 {

  -ms-flex: 75%; /* IE10 */

  flex: 75%;

}


.col-25,

.col-50,

.col-75 {

  padding: 0 16px;

}


.container {

  background-color: #f2f2f2;

  padding: 5px 20px 15px 20px;

  border: 1px solid lightgrey;

  border-radius: 3px;

}


input[type=text] {

  width: 100%;

  margin-bottom: 20px;

  padding: 12px;

  border: 1px solid #ccc;

  border-radius: 3px;

}


label {

  margin-bottom: 10px;

  display: block;

}


.icon-container {

  margin-bottom: 20px;

  padding: 7px 0;

  font-size: 24px;

}


.btn {

  background-color: #04AA6D;

  color: white;

  padding: 12px;

  margin: 10px 0;

  border: none;

  width: 100%;

  border-radius: 3px;

  cursor: pointer;

  font-size: 17px;

}


.btn:hover {

  background-color: #45a049;

}


a {

  color: #2196F3;

}


hr {

  border: 1px solid lightgrey;

}


span.price {

  float: right;

  color: grey;

}


/* Responsive layout - when the screen is less than 800px wide, make the two columns stack on top of each other instead of next to each other (also change the direction - make the "cart" column go on top) */

@media (max-width: 800px) {

  .row {

    flex-direction: column-reverse;

  }

  .col-25 {

    margin-bottom: 20px;

  }

}

</style>

</head>

<body>


<h2>Responsive Checkout Form</h2>

<p>Resize the browser window to see the effect. When the screen is less than 800px wide, make the two columns stack on top of each other instead of next to each other.</p>

<div class="row">

  <div class="col-75">

    <div class="container">

      <form action="/action_page.php">

      

        <div class="row">

          <div class="col-50">

            <h3>Billing Address</h3>

            <label for="fname"><i class="fa fa-user"></i> Full Name</label>

            <input type="text" id="fname" name="firstname" placeholder="John M. Doe">

            <label for="email"><i class="fa fa-envelope"></i> Email</label>

            <input type="text" id="email" name="email" placeholder="john@example.com">

            <label for="adr"><i class="fa fa-address-card-o"></i> Address</label>

            <input type="text" id="adr" name="address" placeholder="542 W. 15th Street">

            <label for="city"><i class="fa fa-institution"></i> City</label>

            <input type="text" id="city" name="city" placeholder="New York">


            <div class="row">

              <div class="col-50">

                <label for="state">State</label>

                <input type="text" id="state" name="state" placeholder="NY">

              </div>

              <div class="col-50">

                <label for="zip">Zip</label>

                <input type="text" id="zip" name="zip" placeholder="10001">

              </div>

            </div>

          </div>


          <div class="col-50">

            <h3>Payment</h3>

            <label for="fname">Accepted Cards</label>

            <div class="icon-container">

              <i class="fa fa-cc-visa" style="color:navy;"></i>

              <i class="fa fa-cc-amex" style="color:blue;"></i>

              <i class="fa fa-cc-mastercard" style="color:red;"></i>

              <i class="fa fa-cc-discover" style="color:orange;"></i>

            </div>

            <label for="cname">Name on Card</label>

            <input type="text" id="cname" name="cardname" placeholder="John More Doe">

            <label for="ccnum">Credit card number</label>

            <input type="text" id="ccnum" name="cardnumber" placeholder="1111-2222-3333-4444">

            <label for="expmonth">Exp Month</label>

            <input type="text" id="expmonth" name="expmonth" placeholder="September">

            <div class="row">

              <div class="col-50">

                <label for="expyear">Exp Year</label>

                <input type="text" id="expyear" name="expyear" placeholder="2018">

              </div>

              <div class="col-50">

                <label for="cvv">CVV</label>

                <input type="text" id="cvv" name="cvv" placeholder="352">

              </div>

            </div>

          </div>

          

        </div>

        <label>

          <input type="checkbox" checked="checked" name="sameadr"> Shipping address same as billing

        </label>

        <input type="submit" value="Continue to checkout" class="btn">

      </form>

    </div>

  </div>

  <div class="col-25">

    <div class="container">

      <h4>Cart <span class="price" style="color:black"><i class="fa fa-shopping-cart"></i> <b>4</b></span></h4>

      <p><a href="#">Product 1</a> <span class="price">$15</span></p>

      <p><a href="#">Product 2</a> <span class="price">$5</span></p>

      <p><a href="#">Product 3</a> <span class="price">$8</span></p>

      <p><a href="#">Product 4</a> <span class="price">$2</span></p>

      <hr>

      <p>Total <span class="price" style="color:black"><b>$30</b></span></p>

    </div>

  </div>

</div>


</body>

</html>


#adityasskk

html Responsive Checkout Form

Responsive Checkout Form

Resize the browser window to see the effect. When the screen is less than 800px wide, make the two columns stack on top of each other instead of next to each other.

Billing Address

Payment

Cart 4

Product 1 $15

Product 2 $5

Product 3 $8

Product 4 $2


Total $30

#adityasskk

html clock codes


 

<!DOCTYPE html>

<html>

<body>


<canvas id="canvas" width="400" height="400"

style="background-color:#333">

</canvas>


<script>

var canvas = document.getElementById("canvas");

var ctx = canvas.getContext("2d");

var radius = canvas.height / 2;

ctx.translate(radius, radius);

radius = radius * 0.90

setInterval(drawClock, 1000);


function drawClock() {

  drawFace(ctx, radius);

  drawNumbers(ctx, radius);

  drawTime(ctx, radius);

}


function drawFace(ctx, radius) {

  var grad;

  ctx.beginPath();

  ctx.arc(0, 0, radius, 0, 2*Math.PI);

  ctx.fillStyle = 'white';

  ctx.fill();

  grad = ctx.createRadialGradient(0,0,radius*0.95, 0,0,radius*1.05);

  grad.addColorStop(0, '#333');

  grad.addColorStop(0.5, 'white');

  grad.addColorStop(1, '#333');

  ctx.strokeStyle = grad;

  ctx.lineWidth = radius*0.1;

  ctx.stroke();

  ctx.beginPath();

  ctx.arc(0, 0, radius*0.1, 0, 2*Math.PI);

  ctx.fillStyle = '#333';

  ctx.fill();

}


function drawNumbers(ctx, radius) {

  var ang;

  var num;

  ctx.font = radius*0.15 + "px arial";

  ctx.textBaseline="middle";

  ctx.textAlign="center";

  for(num = 1; num < 13; num++){

    ang = num * Math.PI / 6;

    ctx.rotate(ang);

    ctx.translate(0, -radius*0.85);

    ctx.rotate(-ang);

    ctx.fillText(num.toString(), 0, 0);

    ctx.rotate(ang);

    ctx.translate(0, radius*0.85);

    ctx.rotate(-ang);

  }

}


function drawTime(ctx, radius){

    var now = new Date();

    var hour = now.getHours();

    var minute = now.getMinutes();

    var second = now.getSeconds();

    //hour

    hour=hour%12;

    hour=(hour*Math.PI/6)+

    (minute*Math.PI/(6*60))+

    (second*Math.PI/(360*60));

    drawHand(ctx, hour, radius*0.5, radius*0.07);

    //minute

    minute=(minute*Math.PI/30)+(second*Math.PI/(30*60));

    drawHand(ctx, minute, radius*0.8, radius*0.07);

    // second

    second=(second*Math.PI/30);

    drawHand(ctx, second, radius*0.9, radius*0.02);

}


function drawHand(ctx, pos, length, width) {

    ctx.beginPath();

    ctx.lineWidth = width;

    ctx.lineCap = "round";

    ctx.moveTo(0,0);

    ctx.rotate(pos);

    ctx.lineTo(0, -length);

    ctx.stroke();

    ctx.rotate(-pos);

}

</script>


</body>

</html>


#adityasskk

html clock

#adityasskk

html game codes



 <!DOCTYPE html>

<html>

<head>

<meta name="viewport" content="width=device-width, initial-scale=1.0"/>

<style>

canvas {

    border:1px solid #d3d3d3;

    background-color: #000;

}

</style>

</head>

<body onload="startGame()">

<script>


var myGamePiece;

var myObstacles = [];

var myScore;


function startGame() {

    myGamePiece = new component(30, 30, "red", 10, 120);

    myGamePiece.gravity = 0.05;

    myScore = new component("30px", "Consolas", "black", 280, 40, "text");

    myGameArea.start();

}


var myGameArea = {

    canvas : document.createElement("canvas"),

    start : function() {

        this.canvas.width = 480;

        this.canvas.height = 270;

        this.context = this.canvas.getContext("2d");

        document.body.insertBefore(this.canvas, document.body.childNodes[0]);

        this.frameNo = 0;

        this.interval = setInterval(updateGameArea, 20);

        },

    clear : function() {

        this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);

    }

}


function component(width, height, color, x, y, type) {

    this.type = type;

    this.score = 0;

    this.width = width;

    this.height = height;

    this.speedX = 0;

    this.speedY = 0;    

    this.x = x;

    this.y = y;

    this.gravity = 0;

    this.gravitySpeed = 0;

    this.update = function() {

        ctx = myGameArea.context;

        if (this.type == "text") {

            ctx.font = this.width + " " + this.height;

            ctx.fillStyle = color;

            ctx.fillText(this.text, this.x, this.y);

        } else {

            ctx.fillStyle = color;

            ctx.fillRect(this.x, this.y, this.width, this.height);

        }

    }

    this.newPos = function() {

        this.gravitySpeed += this.gravity;

        this.x += this.speedX;

        this.y += this.speedY + this.gravitySpeed;

        this.hitBottom();

    }

    this.hitBottom = function() {

        var rockbottom = myGameArea.canvas.height - this.height;

        if (this.y > rockbottom) {

            this.y = rockbottom;

            this.gravitySpeed = 0;

        }

    }

    this.crashWith = function(otherobj) {

        var myleft = this.x;

        var myright = this.x + (this.width);

        var mytop = this.y;

        var mybottom = this.y + (this.height);

        var otherleft = otherobj.x;

        var otherright = otherobj.x + (otherobj.width);

        var othertop = otherobj.y;

        var otherbottom = otherobj.y + (otherobj.height);

        var crash = true;

        if ((mybottom < othertop) || (mytop > otherbottom) || (myright < otherleft) || (myleft > otherright)) {

            crash = false;

        }

        return crash;

    }

}


function updateGameArea() {

    var x, height, gap, minHeight, maxHeight, minGap, maxGap;

    for (i = 0; i < myObstacles.length; i += 1) {

        if (myGamePiece.crashWith(myObstacles[i])) {

            return;

        } 

    }

    myGameArea.clear();

    myGameArea.frameNo += 1;

    if (myGameArea.frameNo == 1 || everyinterval(150)) {

        x = myGameArea.canvas.width;

        minHeight = 20;

        maxHeight = 200;

        height = Math.floor(Math.random()*(maxHeight-minHeight+1)+minHeight);

        minGap = 50;

        maxGap = 200;

        gap = Math.floor(Math.random()*(maxGap-minGap+1)+minGap);

        myObstacles.push(new component(10, height, "green", x, 0));

        myObstacles.push(new component(10, x - height - gap, "green", x, height + gap));

    }

    for (i = 0; i < myObstacles.length; i += 1) {

        myObstacles[i].x += -1;

        myObstacles[i].update();

    }

    myScore.text="SCORE: " + myGameArea.frameNo;

    myScore.update();

    myGamePiece.newPos();

    myGamePiece.update();

}


function everyinterval(n) {

    if ((myGameArea.frameNo / n) % 1 == 0) {return true;}

    return false;

}


function accelerate(n) {

    myGamePiece.gravity = n;

}

</script>

<br>

<button onmousedown="accelerate(-0.2)" onmouseup="accelerate(0.05)">ACCELERATE</button>

<p>Use the ACCELERATE button to stay in the air</p>

<p>How long can you stay alive?</p>

</body>

</html>

#adityasskk

html inputs codes

  <DOCTYPE html> <html> <head> <title> INPUT TYPES</title> </head> <body> <p>hi helo</p...