mirror of
https://github.com/Polaris-Entertainment/bytefy.git
synced 2026-04-11 10:29:37 +00:00
Add chrome extension
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Barcode</title>
|
||||
<script src="../../libraries/JsBarcode.all.min.js"></script>
|
||||
<script src="barcode.js"></script>
|
||||
<link rel="stylesheet" href="../page_styling.css">
|
||||
</head>
|
||||
<body>
|
||||
<a href="https://bytefy.net">
|
||||
<img class="logotype" src="https://bytefy.net/assets/logo-full-orange-beta-vectorized.svg" alt="QR Code">
|
||||
</a>
|
||||
<div class="wrapper">
|
||||
<h3>Barcode <span id="type"></span></h3> <svg id="barcode"></svg>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<footer>
|
||||
<p>This extension is created by bytefy. For more online tools visit <a href="https://bytefy.net">bytefy.net</a></p>
|
||||
</footer>
|
||||
</html>
|
||||
@@ -0,0 +1,16 @@
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const content = urlParams.get('content');
|
||||
const type = urlParams.get('type');
|
||||
generateBarcode(content, type);
|
||||
});
|
||||
|
||||
function generateBarcode(content, type) {
|
||||
if (type === "ean13") {
|
||||
JsBarcode("#barcode", content, { format: "EAN13" });
|
||||
document.getElementById("type").innerText = "EAN-13";
|
||||
} else if (type === "ean8") {
|
||||
JsBarcode("#barcode", content, { format: "EAN8" });
|
||||
document.getElementById("type").innerText = "EAN-8";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
html {
|
||||
background-color: #121212;
|
||||
overflow: hidden;
|
||||
}
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
padding: 10px;
|
||||
margin: 0px;
|
||||
}
|
||||
img {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100vh;
|
||||
color: #f0f0f0;
|
||||
}
|
||||
.logotype{
|
||||
width: 140px;
|
||||
position: absolute;
|
||||
}
|
||||
#content {
|
||||
border: 1px solid rgb(52, 211, 153);
|
||||
padding: 5px;
|
||||
margin: 10px;
|
||||
max-width: 500px;
|
||||
box-shadow: 0px 0px 10px 0px rgb(52, 211, 153);
|
||||
}
|
||||
#qrcode {
|
||||
margin: 10px;
|
||||
}
|
||||
footer {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
color: #f0f0f0;
|
||||
padding: 10px;
|
||||
}
|
||||
a {
|
||||
color: #f0f0f0;
|
||||
text-decoration: none;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>QR Code</title>
|
||||
<script src="../../libraries/qrcode.min.js"></script>
|
||||
<link rel="stylesheet" href="../page_styling.css">
|
||||
</head>
|
||||
<body>
|
||||
<a href="https://bytefy.net">
|
||||
<img class="logotype" src="https://bytefy.net/assets/logo-full-orange-beta-vectorized.svg" alt="QR Code">
|
||||
</a>
|
||||
<div class="wrapper">
|
||||
<div id="qrcode"></div>
|
||||
|
||||
<div id="content">
|
||||
</div>
|
||||
</div>
|
||||
<script src="qr.js"></script>
|
||||
</body>
|
||||
|
||||
<footer>
|
||||
<p>This extension is created by bytefy. For more online tools visit <a href="https://bytefy.net">bytefy.net</a></p>
|
||||
</footer>
|
||||
</html>
|
||||
@@ -0,0 +1,18 @@
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const content = urlParams.get('content');
|
||||
generateQRCode(content);
|
||||
});
|
||||
|
||||
function generateQRCode(content) {
|
||||
let qrCodeElement = document.getElementById('qrcode');
|
||||
qrCodeElement.innerHTML = "";
|
||||
|
||||
document.getElementById('content').innerText = content;
|
||||
new QRCode(qrCodeElement, {
|
||||
text: content,
|
||||
width: 256,
|
||||
height: 256,
|
||||
correctLevel: QRCode.CorrectLevel.L
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user