Skip to content

Commit 7771dd2

Browse files
authored
fix: qr code scan
1 parent 7d5a716 commit 7771dd2

File tree

5 files changed

+62
-58
lines changed

5 files changed

+62
-58
lines changed

apps/resplice/public/favicon.ico

914 Bytes
Binary file not shown.

apps/resplice/src/modules/invite/pages/QrInvitePage.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
async function initQr(attributeIds: Set<number>) {
2222
const qrInvite = await protocol.invite.createQr({ attributeIds: Array.from(attributeIds) })
2323
url = `${config.appUrl}/#/invite/qr/${qrInvite.uuid}`
24-
console.log(url)
24+
2525
timer = TIMEOUT_SECONDS
2626
interval = setInterval(() => {
2727
timer--

apps/resplice/src/modules/invite/pages/ScanQrPage.svelte

+1-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111
if (!qrData) return
1212
1313
const url = new URL(qrData)
14-
console.log(url)
1514
16-
push(url.pathname)
15+
push(url.hash.replace('#', ''))
1716
}
1817
1918
$: handleQr(qrCode?.data)
@@ -39,7 +38,6 @@
3938
inversionAttempts: 'dontInvert'
4039
})
4140
if (code) {
42-
console.log(code)
4341
clearInterval(streamInterval)
4442
qrCode = code
4543
}

sites/viz/index.html

+50-52
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,42 @@
77
<link rel="icon" href="/favicon.ico" />
88
<title>Resplice</title>
99
</head>
10-
<body class="dark">
11-
<div id="graph"></div>
12-
<nav class="fixed top-0 left-0 w-full flex items-center justify-between">
10+
<body class="dark flex flex-col">
11+
<nav class="fixed top-0 left-0 w-full flex items-center justify-between z-10">
1312
<div class="p-6 flex space-x-4 items-center">
1413
<img src="./logo.png" width="48" height="48" />
1514
<h1 class="font-semibold text-2xl text-gray-200">Resplice</h1>
1615
</div>
16+
17+
<div class="p-4">
18+
<a
19+
class="flex items-center space-x-2 whitespace-nowrap bg-brand-primary text-zinc-800 font-semibold rounded-lg py-2 px-4 transform transition duration-75 ease-in-out shadow-md focus:ring-4 focus:ring-green-200 focus:outline-none active:shadow-none"
20+
href="https://app.resplice.com"
21+
>
22+
<span>Go to App</span>
23+
<svg
24+
height="24px"
25+
width="24px"
26+
xmlns="http://www.w3.org/2000/svg"
27+
class="fill-current"
28+
viewBox="0 0 512 512"
29+
>
30+
<path
31+
fill="none"
32+
stroke="currentColor"
33+
stroke-linecap="round"
34+
stroke-linejoin="round"
35+
stroke-width="48"
36+
d="M184 112l144 144-144 144"
37+
/>
38+
</svg>
39+
</a>
40+
</div>
41+
</nav>
42+
<div class="w-full flex-1 overflow-hidden">
43+
<div id="graph" class="w-full h-full"></div>
44+
</div>
45+
<footer class="flex-none w-full flex items-center justify-between p-4 border-t border-zinc-700">
1746
<div class="rounded-lg overflow-hidden">
1847
<iframe
1948
src="https://resplice.instatus.com/embed-status/4035c9ee/dark-sm"
@@ -25,55 +54,24 @@ <h1 class="font-semibold text-2xl text-gray-200">Resplice</h1>
2554
>
2655
</iframe>
2756
</div>
28-
29-
<div class="p-4">
30-
<!-- <div id="node-ctx" class="bg-black rounded-lg shadow-md p-4 w-72">
31-
<p class="text-gray-400 text-center">Select an account to see their details</p>
32-
</div> -->
33-
<div class="flex bg-zinc-900 rounded-lg shadow-md p-4 space-x-4">
34-
<a
35-
class="w-full flex items-center space-x-2 bg-brand-primary text-zinc-800 font-semibold rounded-lg py-2 px-4 transform transition duration-75 ease-in-out shadow-md focus:ring-4 focus:ring-green-200 focus:outline-none active:shadow-none"
36-
href="https://faq.resplice.com"
37-
>
38-
<span>FAQ</span>
39-
<svg
40-
height="24px"
41-
width="24px"
42-
xmlns="http://www.w3.org/2000/svg"
43-
class="fill-current"
44-
viewBox="0 0 512 512"
45-
>
46-
<path
47-
d="M256 64C150 64 64 150 64 256s86 192 192 192 192-86 192-192S362 64 256 64zm-6 304a20 20 0 1120-20 20 20 0 01-20 20zm33.44-102C267.23 276.88 265 286.85 265 296a14 14 0 01-28 0c0-21.91 10.08-39.33 30.82-53.26C287.1 229.8 298 221.6 298 203.57c0-12.26-7-21.57-21.49-28.46-3.41-1.62-11-3.2-20.34-3.09-11.72.15-20.82 2.95-27.83 8.59C215.12 191.25 214 202.83 214 203a14 14 0 11-28-1.35c.11-2.43 1.8-24.32 24.77-42.8 11.91-9.58 27.06-14.56 45-14.78 12.7-.15 24.63 2 32.72 5.82C312.7 161.34 326 180.43 326 203.57c0 33.83-22.61 49.02-42.56 62.43z"
48-
/>
49-
</svg>
50-
</a>
51-
52-
<a
53-
class="w-full flex items-center space-x-2 whitespace-nowrap bg-brand-primary text-zinc-800 font-semibold rounded-lg py-2 px-4 transform transition duration-75 ease-in-out shadow-md focus:ring-4 focus:ring-green-200 focus:outline-none active:shadow-none"
54-
href="https://app.resplice.com"
55-
>
56-
<span>Go to App</span>
57-
<svg
58-
height="24px"
59-
width="24px"
60-
xmlns="http://www.w3.org/2000/svg"
61-
class="fill-current"
62-
viewBox="0 0 512 512"
63-
>
64-
<path
65-
fill="none"
66-
stroke="currentColor"
67-
stroke-linecap="round"
68-
stroke-linejoin="round"
69-
stroke-width="48"
70-
d="M184 112l144 144-144 144"
71-
/>
72-
</svg>
73-
</a>
74-
</div>
75-
</div>
76-
</nav>
57+
<a
58+
class="flex items-center space-x-2 bg-brand-primary text-zinc-800 font-semibold rounded-lg py-2 px-4 transform transition duration-75 ease-in-out shadow-md focus:ring-4 focus:ring-green-200 focus:outline-none active:shadow-none"
59+
href="https://faq.resplice.com"
60+
>
61+
<svg
62+
height="24px"
63+
width="24px"
64+
xmlns="http://www.w3.org/2000/svg"
65+
class="fill-current"
66+
viewBox="0 0 512 512"
67+
>
68+
<path
69+
d="M256 64C150 64 64 150 64 256s86 192 192 192 192-86 192-192S362 64 256 64zm-6 304a20 20 0 1120-20 20 20 0 01-20 20zm33.44-102C267.23 276.88 265 286.85 265 296a14 14 0 01-28 0c0-21.91 10.08-39.33 30.82-53.26C287.1 229.8 298 221.6 298 203.57c0-12.26-7-21.57-21.49-28.46-3.41-1.62-11-3.2-20.34-3.09-11.72.15-20.82 2.95-27.83 8.59C215.12 191.25 214 202.83 214 203a14 14 0 11-28-1.35c.11-2.43 1.8-24.32 24.77-42.8 11.91-9.58 27.06-14.56 45-14.78 12.7-.15 24.63 2 32.72 5.82C312.7 161.34 326 180.43 326 203.57c0 33.83-22.61 49.02-42.56 62.43z"
70+
/>
71+
</svg>
72+
<span>View FAQ</span>
73+
</a>
74+
</footer>
7775

7876
<script type="module" src="/src/main.ts"></script>
7977
</body>

sites/viz/src/main.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,15 @@ const stats = await res.json()
1212

1313
console.log(stats)
1414

15+
const graphElement = document.getElementById('graph') as HTMLElement
16+
17+
console.log(graphElement.getBoundingClientRect())
18+
1519
// Build Graph
1620
const graph = ForceGraph({ controlType: 'orbit', rendererConfig: { antialias: true, alpha: true } })
17-
graph(document.getElementById('graph') as HTMLElement)
21+
graph(graphElement)
22+
.width(graphElement.getBoundingClientRect().width)
23+
.height(graphElement.getBoundingClientRect().height)
1824
.graphData(graphData)
1925
.dagMode('radialout')
2026
.dagLevelDistance(75)
@@ -48,6 +54,8 @@ graph(document.getElementById('graph') as HTMLElement)
4854

4955
// Events
5056
window.addEventListener('resize', () => {
51-
graph.width(window.innerWidth).height(window.innerHeight)
57+
graph
58+
.width(graphElement.getBoundingClientRect().width)
59+
.height(graphElement.getBoundingClientRect().height)
5260
})
5361
// graph.onNodeClick((node) => renderNodeContext(node as Node))

0 commit comments

Comments
 (0)