Skip to content

Commit d5699f2

Browse files
authored
html,css,js rm update
1 parent 50c96bd commit d5699f2

File tree

1 file changed

+97
-0
lines changed

1 file changed

+97
-0
lines changed

5. QR Code Generator/README.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,99 @@
11
# QR Code Generator _(HTML, CSS, and Js)_ <br>
22
![alt text](https://github.com/AkashKobal/web-development/blob/main/5.%20QR%20Code%20Generator/qr%20code%20generator.png)
3+
```html
4+
<!DOCTYPE html>
5+
<html lang="en">
6+
7+
<head>
8+
<meta charset="UTF-8">
9+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
10+
<title>Generate QR</title>
11+
<link rel="stylesheet" href="style.css">
12+
<script src="script.js"></script>
13+
</head>
14+
15+
<body>
16+
<div class="container">
17+
<p>Enter your Text or URL</p>
18+
<input type="text" placeholder="Text or URL" id="userInput" /><br>
19+
<div id="qrBox">
20+
<img id="qrImage" src="" />
21+
</div> <!--to display the QR code -->
22+
<button class="generateBtn" id="generateBtn" onclick="generateQRCode()">Generate</button>
23+
</div>
24+
</body>
25+
26+
</html>
27+
```
28+
```js
29+
function generateQRCode() {
30+
let userInput = document.getElementById('userInput');
31+
let qrBox = document.getElementById('qrBox');
32+
let qrImage = document.getElementById('qrImage');
33+
34+
if(userInput.value ==""){
35+
alert("Please enter a Text or URL");
36+
}else{
37+
38+
qrImage.src = "https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=" + userInput.value;
39+
}
40+
41+
42+
}
43+
```
44+
```css
45+
body {
46+
background-color: rgba(39, 105, 219, 0.693);
47+
}
48+
49+
.container {
50+
position: absolute;
51+
top: 50%;
52+
left: 50%;
53+
transform: translate(-50%, -50%);
54+
background-color: rgba(255, 255, 255, 0.824);
55+
padding: 20px;
56+
border-radius: 20px;
57+
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.5);
58+
text-align: center;
59+
60+
}
61+
62+
.container p {
63+
font-size: 20px;
64+
font-weight: bold;
65+
font-family: Georgia, 'Times New Roman', Times, serif;
66+
}
67+
68+
.container input {
69+
padding: 5px;
70+
margin-top: 10px;
71+
margin-bottom: 10px;
72+
border-radius: 8px;
73+
border: 1px solid #000;
74+
font-size: 20px;
75+
font-family: Georgia, 'Times New Roman', Times, serif;
76+
}
77+
78+
.container button {
79+
padding: 10px;
80+
margin-top: 10px;
81+
margin-bottom: 10px;
82+
border-radius: 8px ;
83+
border-color: transparent;
84+
/* border: 1px solid #000; */
85+
font-size: 20px;
86+
font-family: Georgia;
87+
letter-spacing: 1px;
88+
background-color: #3e66f6ea;
89+
color: white;
90+
cursor: pointer;
91+
}
92+
93+
.container button:hover {
94+
background-color: #1a3fc7;
95+
}
96+
body:hover{
97+
background-color: rgb(10, 24, 66);
98+
}
99+
```

0 commit comments

Comments
 (0)