Skip to content

Commit

Permalink
qr-code generator
Browse files Browse the repository at this point in the history
  • Loading branch information
tusuii authored Jun 2, 2023
1 parent a6c590f commit 40cb8a7
Show file tree
Hide file tree
Showing 7 changed files with 696 additions and 0 deletions.
11 changes: 11 additions & 0 deletions qrgenerator/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"manifest_version": 2,
"name": "QR Code Generator",
"version": "1.0",
"browser_action": {
"default_popup": "popup.html",
"default_icon": {
}
},
"permissions": ["activeTab"]
}
21 changes: 21 additions & 0 deletions qrgenerator/popup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<title>QR Generator</title>
<link rel="stylesheet" href="styles.css" />
<script src="qrcode.js"></script>
<script src="popup.js"></script>
</head>
<body>
<div class="button-container">
<input
type="text"
id="inputText"
placeholder="Enter text / Link"
class="input"
/>
<button id="generateButton" class="button">Generate</button>
</div>
<div id="qrcode" class="qrcode"></div>
</body>
</html>
13 changes: 13 additions & 0 deletions qrgenerator/popup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
document.addEventListener("DOMContentLoaded", function () {
var generateButton = document.getElementById("generateButton");

generateButton.addEventListener("click", function () {
var inputText = document.getElementById("inputText").value;
if (inputText) {
var qrcodeDiv = document.getElementById("qrcode");
qrcodeDiv.innerHTML = "";
new QRCode(qrcodeDiv, inputText);
}
});
});

Binary file added qrgenerator/qr_generation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
614 changes: 614 additions & 0 deletions qrgenerator/qrcode.js

Large diffs are not rendered by default.

Binary file added qrgenerator/start-screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions qrgenerator/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
body {
border: 1px solid black;
padding: 8px;
}
.button-container {
display: flex;
}

.input {
width: auto;
margin-bottom: 5px;
margin-top: 5px;
font-size: 18px;
padding: 2px 2px;
}

.button {
display: inline-block;
margin-left: 5px;
padding: 2px 2px;
background: linear-gradient(to bottom, #004c63, #077379);
color: white;
font-size: 18px;
border-radius: 4px;
transition: background 0.3s ease;
}

.button:hover {
background: linear-gradient(to bottom, #022b2e, #074779);
}

.qrcode {
display: flex;
justify-content: center;
align-items: center;
margin-top: 15px;
}

0 comments on commit 40cb8a7

Please sign in to comment.