aboutsummaryrefslogtreecommitdiffstats
path: root/static/shopify.html
diff options
context:
space:
rgin = "auto";
- qr.style.marginTop = "40px";
- qr.style.border = "12px white solid";
- qr.style.zIndex = 10;
-
- new QRCode(qr, data.hash);
-
- let bg = document.getElementById("bg");
- bg.style.position = "absolute";
- bg.style.margin = "auto";
- bg.style.left = "0";
- bg.style.right = "0";
- bg.style.width = "400px";
- bg.style.height = "400px";
- bg.style.borderRadius = "50%";
- bg.style.background = "linear-gradient(to right, #F2F6FC, #E1E3FF)";
- bg.style.zIndex = "0";
-
- let ws = new WebSocket("wss://dev.coinos.io/ws");
- ws.onmessage = ({ data }) => {
- try {
- let { type, data: d } = JSON.parse(data);
- if (type === "payment") {
- main.innerHTML =
- '<img id="check" src="https://dev.coinos.io/icons/check.svg" alt="Check" />' +
- `<h1>Payment received!</h1>
- <h2>
- ${((d.amount * d.rate) / 100000000).toFixed(2)} CAD
- </h2>
- <h3>
- ⚡️${d.amount}
- </h3>`;
-
- var image = document.getElementById("check");
- image.addEventListener("load", function () {
- image.style.transform = "scale(1)";
- });
- }
- } catch (e) {
- console.log(e);
- }
- };
- ws.onopen = () => {
- ws.send(JSON.stringify({ type: "subscribe", data }));
- };
- });
-</script>