Showing posts with label HTML & CSS. Show all posts
Showing posts with label HTML & CSS. Show all posts

Create QR Code Generater


HTML & JS

<!DOCTYPE html>
<html>
<head>
    <title>QR Code Generateor</title>
    <link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="container">
    <p>Enter Your  Text or URL</p>
    <input type="text" name="" placeholder="Text or URL" id="qrtxt">
    <div  id="img">
        <img src="" id="qrimg">
    </div>
    <button onclick="gq()">Generate QR Code</button>

</div>
<script type="text/javascript">
   
    let qrimg= document.getElementById("qrimg");
    let qrtxt= document.getElementById("qrtxt");
    function gq()
    {
        if(qrtxt.value.length > 0){
        qrimg.src=" https://api.qrserver.com/v1/create-qr-code/?size=150x150&data="+qrtxt.value;
       
    }
    else
    {
        alert("plese enter text or url");
    }
    }

</script>
</body>
</html>

                                                                       

CSS

*{
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
}
body
{
    background-color: #262a2f;
}
.container
{
    width: 400px;
    padding: 25px 35px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    background-color: #fff;
    border-radius: 10px;

}
.container p{
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 8px;

}
.container input{
    width: 100%;
    height: 50px;
    border: 1px solid #49eea;
    outline: 0;
    padding: 10px;
    margin: 10px 0 20px;
    border-radius: 5px;
}
.container button
{
    width: 100%;
    height: 50px;
    background: green;
    color: white;
    border:0;
    outline: 0;
    border-radius: 5px;
    box-shadow: 0 10px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    margin: 20px 0;
    font-weight: 500; }










HTML & CSS SLIDER





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>Image Slider</title>
    <link rel="stylesheet" type="text/css" href="style.css">
  </head>
  <body>
   
    <div class="carousel">
      <div class="carousel-content">
        <div class="carousel-item">
          <img src="C:\Users\91940\Pictures\nature.jpg" alt="pic" />
        </div>
        <div class="carousel-item">
          <img src="C:\Users\91940\Pictures\nature2.jpg" alt="pic" />
        </div>
        <div class="carousel-item">
          <img src="C:\Users\91940\Pictures\nature3.jpg" alt="pic" />
        </div>
        <div class="carousel-item">
          <img src="C:\Users\91940\Pictures\flower.webp" alt="pic" />
        </div>
        <div class="carousel-item">
          <img src="C:\Users\91940\Pictures\nature3.jpg" alt="pic" />
        </div>
        <div class="carousel-item">
          <img src="C:\Users\91940\Pictures\nature.jpg" alt="pic" />
        </div>
      </div>
    </div>
  </body>
</html>  



CSS

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: black;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .carousel {
    width: 400px;
    height: 400px;
    perspective: 800px;
  }

  .carousel-content {
    position: relative;
    width: 100%;
    height: 100%;
    transform: translateZ(-500px) rotateY(0);
    transform-style: preserve-3d;
    animation: carousel 10s infinite cubic-bezier(1, 0.015, 0.295, 1.225) forwards;
  }

  .carousel-item {
    width: 100%;
    height: 100%;
    border-radius: 5px;
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    -webkit-box-reflect: below 0px
      linear-gradient(transparent, transparent, #00000040);
  }

  .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
  }

  .carousel-item:nth-child(1) {
    transform: rotateY(0) translateZ(500px);
  }

  .carousel-item:nth-child(2) {
    transform: rotateY(60deg) translateZ(500px);
  }

  .carousel-item:nth-child(3) {
    transform: rotateY(120deg) translateZ(500px);
  }

  .carousel-item:nth-child(4) {
    transform: rotateY(180deg) translateZ(500px);
  }

  .carousel-item:nth-child(5) {
    transform: rotateY(240deg) translateZ(500px);
  }

  .carousel-item:nth-child(6) {
    transform: rotateY(300deg) translateZ(500px);}
  /* Create a carousel animation  */
  @keyframes carousel {
    0%,
    8.3% {
      transform: translateZ(-500px) rotateY(0);
    }
    16.6%,
    24.9% {
      transform: translateZ(-500px) rotateY(-60deg);
    }
    33.2%,
    41.5% {
      transform: translateZ(-500px) rotateY(-120deg);
    }
    49.8%,
    58.1% {
      transform: translateZ(-500px) rotateY(-180deg);
    }
    66.4%,
    74.7% {
      transform: translateZ(-500px) rotateY(-240deg);
    }
    83%,
    91.3% {
      transform: translateZ(-500px) rotateY(-300deg);
    }
    100% {
      transform: translateZ(-500px) rotateY(-360deg);
    }
  }













 

Dark & Light Mode


  1.  <html>
  2.      <head>
  3.         <meta name="color-scheme" content="light">
  4.     </head>
  5. </html>
  6. <body><br><br><br>
  7.      <h1>Dark & Light Mode </h1>
  8.     <select id="ab"  onchange="change()">
  9.        <div > <option value="light">Light</option>
  10.         <option value="dark">Dark</option></div>
  11.     </select>

  12. </body>
  13. </html>
  14. <script>
  15.     function change()
  16.     {
  17.         const ab= document.getElementById("ab").value;
  18.         document.getElementsByTagName("meta")[0].content = ab;
  19.     }
  20. </script>

Create Layout Of Your Website With HTML & CSS!!




1.HTML CODE:




  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title></title>
  5. <link rel="stylesheet" type="text/css"  href="stylegride.css">

  6. </head>
  7. <body>
  8. <main class="l">
  9. <div class="div1">Header</div>
  10. <div class="div2">Box1</div>
  11. <div class="div3">Box2</div>
  12. <div class="div4">Box3</div>
  13. <div class="div5">sidebar</div>
  14. <div class="div6">Maincontent</div>
  15. <div class="div7">Footer</div>

  16. </main>

  17. </body>
  18. </html>

2.CSS CODE:

  1. *{
  2. margin: 0;
  3. padding: 0;
  4. box-sizing: border-box;
  5. }
  6. main
  7. {
  8. width: 75%;
  9. margin: 50px auto;
  10. border: 1px solid black;
  11. display: grid;
  12. grid-template-rows: 60px 100px 200px 60px;
  13. grid-template-columns: repeat(3, 1fr) 150px;
  14. grid-gap: 20px;
  15. }
  16. .div1{background-color: red; color: white;
  17. grid-column: 1/-1}
  18. .div2{background-color: blue; color: white;}
  19. .div3{background-color: blue; color: white;}
  20. .div4{background-color: blue;color: white;}
  21. .div5{background-color: gray;color: white;
  22. grid-row: 2/4;
  23. grid-column: 4/5;
  24. }
  25. .div6{background-color: orange;color: white;
  26. grid-column: 1/4;
  27. }
  28. .div7{background-color: black;color: white;
  29. grid-column: 1/-1;
  30. }