Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added QR Code Calculator #586

Merged
merged 6 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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