Skip to content

Commit

Permalink
Added QR Code Calculator (#586)
Browse files Browse the repository at this point in the history
  • Loading branch information
SohanRC authored Feb 15, 2024
1 parent cc05183 commit 58abde8
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Calculators/QR-Code-Generator-Calculator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# <p align="center">QR Code Generator Calculator</p>

## Description :-

Generates the QR Code according to the given input.

## Tech Stacks :-

- HTML
- CSS
- JavaScript

## Screenshots :-

![image](https://github.com/Rakesh9100/CalcDiverse/assets/73993775/31af8b35-48c1-41ec-ade2-705aade649c5)
20 changes: 20 additions & 0 deletions Calculators/QR-Code-Generator-Calculator/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>QR CODE GENERATOR</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<div class="box">
<h2 class="heading">QR CODE GENERATOR</h2>
<input type="text" name="" id="" class="input-box">
<button class="submit">Generate Qr Code</button>
<img src="" alt="" height="200" width="200" class="hidden">
</div>
<script src="script.js"></script>
</div>
</body>
</html>
18 changes: 18 additions & 0 deletions Calculators/QR-Code-Generator-Calculator/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
let input = document.querySelector('.input-box');
let submit = document.querySelector('.submit');
let img = document.querySelector('.box img');

submit.addEventListener('click' , ()=> {
img.classList.add('hidden');
if(input.value == "") {
alert('Please Provide Valid Details !');
img.classList.add('hidden');
} else {
submit.innerHTML = "Generating Qr Code...";
setTimeout(()=> {
submit.innerHTML = "Generate Qr Code";
img.classList.remove('hidden');
img.setAttribute('src' , `https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${input.value}`);
} , 500);
}
})
68 changes: 68 additions & 0 deletions Calculators/QR-Code-Generator-Calculator/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

.container {
width: 100%;
min-height: 100vh;
background: linear-gradient(160deg, #0093E9 0%, #80D0C7 100%);
display: flex;
justify-content: center;
align-items: center;
letter-spacing: 1.2px;
}

.box {
width: 100%;
max-width: 350px;
min-width: 240px;
box-shadow: 0px 0px 10px #0093E9 , 0px 0px 20px #0093E9 , 0px 0px 40px #ffffff;
display: flex;
flex-direction: column;
text-align: center;
gap: 20px;
padding: 20px 10px 40px;
}

.heading {
font-size: 30px;
padding: 0 5px;
color: #ffffff;
}

.input-box {
font-size: 28px;
outline: none;
border: none;
border-radius: 5px;
padding: 5px 10px 5px;
letter-spacing: 1px;
}

.submit {
font-size: 24px;
border: none;
outline: none;
box-sizing: border-box;
background-color: #252B4880;
color: white;
padding: 4px 10px;
border-radius: 5px;
transition: all 0.1s ease-in-out;
}

.submit:hover {
background-color: #252B4895;
transform: scale(1.02);
transition: all 0.1s ease-in-out;
}

img {
margin: 0 auto;
}

.hidden {
display: none;
}
14 changes: 14 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1807,6 +1807,20 @@ <h3>Calculates the aspect ratio of the specified height and width.</h3>
</div>
</div>
</div>
<div class="box">
<div class="content">
<h2>QR Code Generator Calculator</h2>
<h3>Generates the QR Code according to the given input.</h3>
<div class="card-footer">
<a href="./Calculators/QR-Code-Generator-Calculator/index.html" target="_blank">
<button>Try Now</button>
</a>
<a href="https://github.com/Rakesh9100/CalcDiverse/tree/main/Calculators/QR-Code-Generator-Calculator" title="Source Code" target="_blank">
<img src="./assets/images/github.png" alt="Source Code"></img>
</a>
</div>
</div>
</div>
</div>

<!-- Calculator Section Ends Here -->
Expand Down

0 comments on commit 58abde8

Please sign in to comment.