-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathhtml-chat-box-bubble-form.html
275 lines (263 loc) · 7.7 KB
/
html-chat-box-bubble-form.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
<div class="formbold-main-wrapper">
<!-- Author: FormBold Team -->
<!-- Learn More: https://formbold.com -->
<div class="w-full">
<div class="formbold-form-wrapper">
<div class="formbold-form-header">
<h3>Let's chat? - Online</h3>
<button onclick="chatboxToogleHandler()">
<svg width="17" height="17" viewBox="0 0 17 17" fill="white">
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M0.474874 0.474874C1.10804 -0.158291 2.1346 -0.158291 2.76777 0.474874L16.5251 14.2322C17.1583 14.8654 17.1583 15.892 16.5251 16.5251C15.892 17.1583 14.8654 17.1583 14.2322 16.5251L0.474874 2.76777C-0.158291 2.1346 -0.158291 1.10804 0.474874 0.474874Z"
/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M0.474874 16.5251C-0.158291 15.892 -0.158291 14.8654 0.474874 14.2322L14.2322 0.474874C14.8654 -0.158292 15.892 -0.158291 16.5251 0.474874C17.1583 1.10804 17.1583 2.1346 16.5251 2.76777L2.76777 16.5251C2.1346 17.1583 1.10804 17.1583 0.474874 16.5251Z"
/>
</svg>
</button>
</div>
<form
action="https://formbold.com/s/FORM_ID"
method="POST"
class="formbold-chatbox-form"
>
<div class="formbold-mb-5">
<label for="name" class="formbold-form-label"> Your Name </label>
<input
type="text"
name="name"
id="name"
placeholder="Your Name"
class="formbold-form-input"
/>
</div>
<div class="formbold-mb-5">
<label for="email" class="formbold-form-label"> Email Address </label>
<input
type="email"
name="email"
id="email"
placeholder="[email protected]"
class="formbold-form-input"
/>
</div>
<div class="formbold-mb-5">
<label for="message" class="formbold-form-label"> Message </label>
<textarea
rows="6"
name="message"
id="message"
placeholder="Explain you queries"
class="formbold-form-input"
></textarea>
</div>
<div>
<button class="formbold-btn w-full">Submit</button>
</div>
</form>
</div>
<div class="formbold-action-buttons">
<button class="formbold-action-btn" onclick="chatboxToogleHandler()">
<span class="formbold-cross-icon">
<svg
width="17"
height="17"
viewBox="0 0 17 17"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M0.474874 0.474874C1.10804 -0.158291 2.1346 -0.158291 2.76777 0.474874L16.5251 14.2322C17.1583 14.8654 17.1583 15.892 16.5251 16.5251C15.892 17.1583 14.8654 17.1583 14.2322 16.5251L0.474874 2.76777C-0.158291 2.1346 -0.158291 1.10804 0.474874 0.474874Z"
fill="white"
/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M0.474874 16.5251C-0.158291 15.892 -0.158291 14.8654 0.474874 14.2322L14.2322 0.474874C14.8654 -0.158292 15.892 -0.158291 16.5251 0.474874C17.1583 1.10804 17.1583 2.1346 16.5251 2.76777L2.76777 16.5251C2.1346 17.1583 1.10804 17.1583 0.474874 16.5251Z"
fill="white"
/>
</svg>
</span>
<span class="formbold-chat-icon">
<svg
width="28"
height="28"
viewBox="0 0 28 28"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M19.8333 14.0002V3.50016C19.8333 3.19074 19.7103 2.894 19.4915 2.6752C19.2728 2.45641 18.976 2.3335 18.6666 2.3335H3.49992C3.1905 2.3335 2.89375 2.45641 2.67496 2.6752C2.45617 2.894 2.33325 3.19074 2.33325 3.50016V19.8335L6.99992 15.1668H18.6666C18.976 15.1668 19.2728 15.0439 19.4915 14.8251C19.7103 14.6063 19.8333 14.3096 19.8333 14.0002ZM24.4999 7.00016H22.1666V17.5002H6.99992V19.8335C6.99992 20.1429 7.12284 20.4397 7.34163 20.6585C7.56042 20.8772 7.85717 21.0002 8.16659 21.0002H20.9999L25.6666 25.6668V8.16683C25.6666 7.85741 25.5437 7.56066 25.3249 7.34187C25.1061 7.12308 24.8093 7.00016 24.4999 7.00016Z"
fill="white"
/>
</svg>
</span>
</button>
</div>
</div>
</div>
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: "Inter", sans-serif;
}
.formbold-mb-5 {
margin-bottom: 20px;
}
.formbold-pt-3 {
padding-top: 12px;
}
.formbold-main-wrapper {
display: flex;
align-items: center;
justify-content: center;
padding: 48px;
}
.formbold-form-wrapper {
margin: 0 auto;
max-width: 550px;
width: 100%;
background: white;
border: 1px solid #e0e0e0;
border-radius: 8px;
display: none;
}
.formbold-form-wrapper.active {
display: block;
}
.formbold-form-label {
display: block;
font-weight: 500;
font-size: 16px;
color: #07074d;
margin-bottom: 12px;
}
.formbold-form-label-2 {
font-weight: 600;
font-size: 20px;
margin-bottom: 20px;
}
.formbold-form-input {
width: 100%;
padding: 12px 24px;
border-radius: 6px;
border: 1px solid #e0e0e0;
background: white;
font-weight: 500;
font-size: 16px;
color: #6b7280;
outline: none;
resize: none;
}
.formbold-form-input:focus {
border-color: #6a64f1;
box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.05);
}
.formbold-btn {
text-align: center;
font-size: 16px;
border-radius: 6px;
padding: 14px 32px;
border: none;
font-weight: 600;
background-color: #6a64f1;
color: white;
cursor: pointer;
}
.formbold-btn:hover {
box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.05);
}
.formbold--mx-3 {
margin-left: -12px;
margin-right: -12px;
}
.formbold-px-3 {
padding-left: 12px;
padding-right: 12px;
}
.flex {
display: flex;
}
.flex-wrap {
flex-wrap: wrap;
}
.w-full {
width: 100%;
}
.formbold-form-header {
background: #6a64f1;
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 36px;
border-radius: 8px 8px 0px 0px;
}
.formbold-form-header h3 {
font-weight: 700;
font-size: 20px;
color: white;
}
.formbold-form-header button {
color: white;
background: transparent;
border: none;
}
.formbold-chatbox-form {
padding: 32px 36px;
}
.formbold-action-buttons {
max-width: 550px;
margin-left: auto;
margin-right: auto;
display: flex;
align-items: center;
justify-content: flex-end;
margin-top: 48px;
}
.formbold-action-btn {
width: 70px;
height: 70px;
background: #6a64f1;
color: white;
border-radius: 50%;
margin-left: 20px;
border: none;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
}
.formbold-action-btn .formbold-cross-icon {
display: none;
}
.formbold-action-btn.active .formbold-cross-icon {
display: block;
}
.formbold-action-btn.active .formbold-chat-icon {
display: none;
}
@media (min-width: 540px) {
.sm\:w-half {
width: 50%;
}
}
</style>
<script>
const formWrapper = document.querySelector(".formbold-form-wrapper");
const formActionButton = document.querySelector(".formbold-action-btn");
function chatboxToogleHandler() {
formWrapper.classList.toggle("active");
formActionButton.classList.toggle("active");
}
</script>