Skip to content

Commit 009a7db

Browse files
committed
- playing around with the spotify API
1 parent 47d34fd commit 009a7db

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

tools/spotify_qr_scanner.html

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>QR Scanner</title>
5+
<script src="https://unpkg.com/html5-qrcode"></script>
6+
</head>
7+
<body>
8+
<div id="reader"></div>
9+
10+
<script>
11+
function onScanSuccess(decodedText) {
12+
if (decodedText.includes('gptgames.dev')) {
13+
window.location.href = decodedText;
14+
}
15+
}
16+
17+
let html5QrcodeScanner = new Html5QrcodeScanner(
18+
"reader",
19+
{ fps: 10 }
20+
);
21+
22+
html5QrcodeScanner.render(onScanSuccess);
23+
</script>
24+
25+
<style>
26+
#reader {
27+
width: 100vw;
28+
height: 100vh;
29+
}
30+
31+
body {
32+
margin: 0;
33+
padding: 0;
34+
}
35+
</style>
36+
</body>
37+
</html>

0 commit comments

Comments
 (0)