-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
89 lines (87 loc) · 2.43 KB
/
index.html
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<html>
<head>
<title>🎸 Voiceflow QR Codes</title>
<style>
body {
background-color: #f9f9f9;
font-family: Arial, sans-serif;
color: #333;
text-align: center;
padding: 50px;
}
h1 {
font-size: 24px;
color: #333;
margin-bottom: 20px;
}
#flat-chat {
width: 100%;
height: 100vh;
position: absolute;
top: 0;
left: 0;
}
#voiceflow-chat-frame {
position: relative;
margin: 0 auto;
padding: 20px;
max-width: 500px;
background: #fff;
border-radius: 10px;
}
.repo-link {
display: inline-block;
padding: 10px 20px;
font-size: 16px;
color: #fff;
background-color: #007bff;
text-decoration: none;
border-radius: 5px;
transition: background-color 0.3s ease;
}
.repo-link:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<h1>Tap the chat button in the bottom right corner to get started</h1>
<a
href="https://github.com/valgaze/voiceflow-qrcode?tab=readme-ov-file#voiceflow-qr-code-extension"
class="repo-link"
target="_blank"
>🔗 View the Codebase</a
>
<script type="module">
import { checkProjectID, QRCodeExtension } from "./index.js";
// 🚨 IMPORTANT: Replace the text "__REPLACE__ME__" with your actual project ID in config.js (you cna find the project ID inside settings on the VF canvas)
import { projectID } from "./config.js";
(function (d, t) {
checkProjectID(projectID, window.document);
var v = d.createElement(t),
s = d.getElementsByTagName(t)[0];
v.onload = function () {
window.voiceflow.chat.load({
verify: { projectID },
url: "https://general-runtime.voiceflow.com",
versionID: "production",
user: {
name: "Demo User",
},
render: {
mode: "overlay",
},
autostart: true,
allowDangerousHTML: true,
assistant: {
extensions: [QRCodeExtension],
},
});
};
v.src = "https://cdn.voiceflow.com/widget/bundle.mjs";
v.type = "text/javascript";
s.parentNode.insertBefore(v, s);
})(document, "script");
</script>
</body>
</html>