Skip to main content

How To Make A Glassmorphism Calculator Using HTML CSS & Vanilla Javascript

HOW TO MAKE A GLASSMORPHISM CALCULATOR USING                         HTML CSS & VANILLA JAVASCRIPT





Calculator:

The first solid-state electronic calculator was created in the early 1960s. Pocket-sized devices became available in the 1970s, especially after the Intel 4004, the first microprocessor, was developed by Intel for the Japanese calculator company Busicom. They later became used commonly within the petroleum industry(oil and gas)

In this post, we will create a simple calculator for use on the web with the help of HTML, CSS, and javascript

















                                         [ HTML ]

<!DOCTYPE html>
<html lang="en">
<head>
<!-- Designed By Coding Bihar -->
 <meta charset="UTF-8">
    <title>Calculator Example | Coding Bihar </title>
</head>
<body>
    <div class="container">
        <form class="calculator" name="calc">
            <input type="text" readonly class="value"
            name="txt"/>
            <span class="num clear" onclick="calc.txt.value =''">C</span>
               <span class="num clear" onclick="calc.txt.value =''">DEL</span>
            <span class="num" onclick="document.calc.txt.value +='/'">/</span>
             <span class="num" onclick="document.calc.txt.value +='*'">×</span>
              <span class="num" onclick="document.calc.txt.value +='7'">7</span>
               <span class="num" onclick="document.calc.txt.value +='8'">8</span>
                <span class="num" onclick="document.calc.txt.value +='9'">9</span>
                 <span class="num" onclick="document.calc.txt.value +='-'">-</span>
                  <span class="num" onclick="document.calc.txt.value +='4'">4</span>
                  <span class="num" onclick="document.calc.txt.value +='5'">5</span>
                  <span class="num" onclick="document.calc.txt.value +='6'">6</span>
                  <span class="num plus" onclick="document.calc.txt.value +='+'">+</span>
                  
                  <span class="num" onclick="document.calc.txt.value +='1'">1</span>
                  <span class="num" onclick="document.calc.txt.value +='2'">2</span>
                  <span class="num" onclick="document.calc.txt.value +='3'">3</span>
                          <span class="num" onclick="document.calc.txt.value +='%'">%</span>
                  <span class="num" onclick="document.calc.txt.value +='0'">0</span>
                  <span class="num" onclick="document.calc.txt.value +='00'">00</span>
                   <span class="num" onclick="document.calc.txt.value +='.'">.</span>
                   <span class="num equal" onclick="document.calc.txt.value =eval(calc.txt.value)">=</span>
                 
                     
        </form>
    </div>
    <script type="text/javascript" src="vanilla-tilt.js"</script>
     <script type="text/javascript">
         VanillaTilt.init(document.querySelector(".container"),{
             max: 15,
             speed: 400
             glare: true
             max-glare: 0.5
         });
     </script>
</body>
</html>













                                       [ CSS ]

   *{
           margin: 0;
           padding: 0;
           box-sizing: border-box;
           font-family: Quicksand, sans-serif;
                  }
          body{
             display: flex;
             justify-content: center;
             align-items: center;
             min-height: 100vh;
             background: #091921;
          }
          body::before{
              content: '';
              position: absolute;
              top: 0;
              left: 0;
              width: 100%;
              height: 100%;
              background: linear-gradient(#e91e63,#ffc10f);
              clip-path: circle(22% at 30% 20% );
          }
          body::after{
              content: '';
              position: absolute;
              top: 0;
              left: 0;
              width: 100%;
              height: 100%;
              background: linear-gradient(#ffffff,#da00ff);
              clip-path: circle(20% at 70% 90% );
          }
          .container{
              position: relative;
              background: rgba(255,255,255,0.05,);
              border-radius: 6px;
              overflow: hidden;
              z-index: 10;
              backdrop-filter: blur(15px);
              border-top: 1px solid rgba(255,255,255,0.2,);
              border-left: 1px solid rgba(255,255,255,0.2,);
              box-shadow: 5px 5px 30px rgba(0,0,0,0.2,);
              border: 2px solid #fff;
          }
          .container .calculator{
              position: relative;
              display: grid;
       
          }
          .container .calculator .value{
              grid-column: span 4;
              height: 140px;
              width: 300px;
              text-align: right;
              border: none;
              outline: none;
              padding: 10px;
              font-size: 30px;
              background: transparent;
              color: white;
              border-bottom: 1px solid rgba(255,255,255,0.5,);
              border-right: 1px solid rgba(255,255,255,0.5,);
          }
          .container .calculator span{
              display: grid;
              place-items: center;
              width: 75px;
              height: 75px;
              color: white;
              font-weight: 400;
              cursor: pointer;
              font-size: 20px;
              user-select: none;
              border-bottom: 1px solid rgba(255,255,255,0.5,);
              border-right: 1px solid rgba(255,255,255,0.5,);
          }
          .container .calculator span:hover{
              transition: 0%;
              background: rgba(255,255,255,0.05);
          }
          .container .calculator span:active{
              background: #14ff47;
              color: #192f00;
              font-size: 24px;
              font-weight: 500;
          }
          .container .calculator .clear{
              
              width: 100px;
              background: rgba(255,255,255,0.05);
          }
          .container .calculator .plus{
            
              height: 100px;
          }
          .equal{
              background: rgba(255,255,255,0.05);
          }








 I AM NOT GIVING JAVASCRIPT FILE BECAUSE I INCLUDED JAVASCRIPT FILE IN HTML FILE FOR YOUR EASE.











JOIN US ON TELEGRAM - https://t.me/codingbihar
SUBSCRIBE ON YOUTUBE - 





Popular posts from this blog

How To Make A Digital Clock Using HTML CSS & JS With Glowing Effect

Each minute is a little thing, and yet, with respect to our personal productivity, to manage the minute is the secret of success.Each minute is a little thing, and yet, with respect to our personal productivity, to manage the minute is the secret of success.Each minute is a little thing, and yet, with respect to our personal productivity, to manage the minute is the secret of success.Each minute is a little thing, and yet, with respect to our personal productivity, to manage the minute is the secret of success.Each minute is a little thing, and yet, with respect to our personal productivity, to manage the minute is the secret of success.Each minute is a little thing, and yet, with respect to our personal productivity, to manage the minute is the secret of success.Each minute is a little thing, and yet, with respect to our personal productivity, to manage the minute is the secret of success.Each minute is a little thing, and yet, with respect to our personal productivity, to

How To Learn Coding || Coding कैसे सीखें || हिन्दी में

YouTube

Typing Speed Test Game in HTML CSS & JS

        Typing Speed Test Game in HTML CSS & JS Typing :> Stimulate your mind as you test your typing speed with this standard English paragraph typing test. Watch your typing speed and accuracy increase as you learn about a variety of new topics! Over 40 typing test selections available. If you don't like a test prompt, you can get a different (random) prompt with the "change test" button - or select a specific paragraph to type from the list below. To find out how fast you type, just start typing in the blank textbox on the right of the test prompt. You will see your progress, including errors on the left side as you type. In order to complete the test and save your score, you need to get 100% accuracy. You can fix errors as you go, or correct them at the end with the help of the spell checker.                  <HTML> + (JS) <!DOCTYPE html> <html lang="en" dir="ltr">   <head>     <meta charset="utf-8