KarlKing
09/04/2024, 1:42 PMVapi
09/04/2024, 1:43 PMbuttonConfig
object to set the desired position and remove any animations that may cause it to wobble.
Here's how you can update the `buttonConfig`:
1. Set the position
to a value that places the button in the flow of your page. If you want it to be inline, you might not use the position
property at all and instead rely on your site's CSS to place it.
2. Remove or adjust any CSS that may be causing the wobble effect. This could be a CSS animation or transform applied to the button.
Since the buttonConfig
object does not directly support an 'inline' positioning, you would typically handle this with custom CSS on your website. You can add a class to the button and then style it accordingly in your CSS file.
Here's an example of how you might adjust the `buttonConfig`:
javascript
const buttonConfig = {
// Remove the position property to allow for standard document flow positioning
// Add a custom class to the button for styling
customClass: "my-vapi-button",
// Set any other properties you need
};
And in your CSS file:
css
.my-vapi-button {
/* Add your custom styles here */
display: inline-block; /* Example: makes the button inline with text */
margin: 10px; /* Example: adds some space around the button */
/* Remove any wobble effect */
animation: none;
}
Please adjust the CSS class name and styles according to your website's design and branding. If you need further assistance with the CSS or have specific requirements for the button's behavior, please let me know, and I'll be happy to help!Vapi
09/04/2024, 1:43 PMSahil
09/04/2024, 2:37 PMKarlKing
09/04/2024, 5:33 PMKarlKing
09/04/2024, 5:34 PM<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vapi Assistant Button</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 20px;
}
.container {
border: 1px solid black;
}
.vapi-btn {
display: inline-block;
margin: 10px;
animation: none !important;
transition: none !important;
}
/* Additional button states */
.vapi-btn.vapi-btn-is-active {
background-color: pink;
}
.vapi-btn.vapi-btn-is-loading {
background-color: blue;
}
</style>
</head>
<body>
<div class="container">
<!-- The Vapi button should appear here -->
<script>
const assistantId = "b6a3bb64-xxxxxxxxxxxx";
const apiKey = "0510bc6e-xxxxxxxxxx";
const buttonConfig = {};
(function(d, t) {
var g = document.createElement(t),
s = d.getElementsByTagName(t)[0];
g.src = "https://cdn.jsdelivr.net/gh/VapiAI/html-script-tag@latest/dist/assets/index.js";
g.defer = true;
g.async = true;
s.parentNode.insertBefore(g, s);
g.onload = function() {
window.vapiSDK.run({
apiKey: apiKey,
assistant: assistantId,
config: {
customClass: "vapi-btn",
}
});
};
})(document, "script");
</script>
</div>
</body>
</html>
KarlKing
09/04/2024, 5:35 PMSahil
09/05/2024, 4:56 PMShubham Bajaj
09/05/2024, 9:02 PMKarlKing
09/08/2024, 12:09 AMShubham Bajaj
09/09/2024, 6:59 PMShubham Bajaj
09/09/2024, 7:00 PM