Add chrome extension

This commit is contained in:
Myx
2024-11-15 02:42:25 +01:00
parent 8792699c7c
commit 1b58440d4d
19 changed files with 409 additions and 0 deletions

View File

@@ -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>

View File

@@ -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";
}
}