-
Notifications
You must be signed in to change notification settings - Fork 1
/
qr.js
39 lines (29 loc) · 922 Bytes
/
qr.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//qr code
let codigoqr = captura('img');
let texto = captura('textarea');
let botao = capturar('button');
botao.addEventListener('click', generate);
function generate() {
let tamanho = "930x930";
let textoqr = texto.value;
let baseURL = "http://api.qrserver.com/v1/create-qr-code/";
let url = `${baseURL}?data=${textoqr}&size=${tamanho}`;
codigoqr.src = url;
};
function captura(el) {
return document.querySelector(el);
};
//button sass animation
var animateButton = function(e) {
e.preventDefault;
//reset animation
e.target.classList.remove('animate');
e.target.classList.add('animate');
setTimeout(function() {
e.target.classList.remove('animate');
}, 700);
};
var bubblyButtons = document.getElementsByClassName("bubbly-button");
for (var i = 0; i < bubblyButtons.length; i++) {
bubblyButtons[i].addEventListener('click', animateButton, false);
}