-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlos-angeles.html
46 lines (41 loc) · 1.6 KB
/
los-angeles.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Los Angeles Listing</title>
</head>
<body>
<h1>Los Angeles Listing</h1>
<script type="module">
import Typebot from 'https://cdn.jsdelivr.net/npm/@typebot.io/[email protected]/dist/web.js'
Typebot.initBubble({
typebot: "vr-listing-demo-711ammo",
prefilledVariables: {
"filename": getFilenameFromUrl(),
"page_title": formatCurrentTitle()
},
theme: {
button: { backgroundColor: "#0042DA", iconColor: "#FFFFFF" },
previewMessage: { backgroundColor: "#ffffff", textColor: "black" },
chatWindow: { backgroundColor: "#ffffff" }
},
});
function getFilenameFromUrl() {
const path = window.location.pathname;
const filenameWithExtension = path.substring(path.lastIndexOf('/')+1);
const filename = filenameWithExtension.replace('.html', '');
return filename;
}
function formatCurrentTitle() {
const path = window.location.pathname;
const filename = path.substring(path.lastIndexOf('/') + 1);
const words = filename.replace(/-/g, ' ').replace('.html', '').split(' ');
const capitalizedWords = words.map(word => word.charAt(0).toUpperCase() + word.slice(1));
const formattedTitle = capitalizedWords.join(' ');
return formattedTitle;
}
</script>
</body>
</html>