- Added very basic bootstrap styling - Added functioning QR Code Generator - Formatted site.webmanifest - Removed unused dependency injections from pages
34 lines
903 B
JavaScript
34 lines
903 B
JavaScript
// Please see documentation at https://learn.microsoft.com/aspnet/core/client-side/bundling-and-minification
|
|
// for details on configuring this project to bundle and minify static web assets.
|
|
|
|
// Write your JavaScript code.
|
|
|
|
$(function(){
|
|
|
|
const qrCode = new QRCode(document.getElementById("qrcode"), "https://plugarii.com");
|
|
const input = document.getElementById("qrcode-input");
|
|
|
|
const remakeQRCode = (text)=>{
|
|
qrCode.clear();
|
|
qrCode.makeCode(text);
|
|
}
|
|
|
|
var text = input.value;
|
|
|
|
const processChanges = debounceLeading(() => {
|
|
text = input.value;
|
|
remakeQRCode(text)
|
|
});
|
|
input.addEventListener("keydown",processChanges);
|
|
});
|
|
|
|
function debounceLeading(func, timeout = 300){
|
|
let timer;
|
|
return (...args) => {
|
|
clearTimeout(timer);
|
|
timer = setTimeout(() => {
|
|
func.apply(this, args);
|
|
}, timeout);
|
|
};
|
|
}
|
|
|