@textback/notification-widget 2.0.0 → 2.0.1-102913
Sign up to get free protection for your applications and to get access to all the features.
- package/.eslintrc.js +291 -291
- package/build/index.js +12 -0
- package/build/sdk.js +9 -0
- package/package.json +70 -68
- package/promote_tag.sh +1 -1
- package/readme.md +569 -490
- package/server.js +8 -4
- package/src/libraries/ai.1.0.11.js +4088 -4088
- package/src/libraries/localization/locales/cs.js +14 -12
- package/src/libraries/localization/locales/en.js +14 -12
- package/src/libraries/localization/locales/index.js +8 -8
- package/src/libraries/localization/locales/pl.js +14 -12
- package/src/libraries/localization/locales/ro.js +14 -12
- package/src/libraries/localization/locales/ru.js +13 -12
- package/src/libraries/localization/locales/uk.js +14 -12
- package/src/libraries/localization/text.js +9 -9
- package/src/libraries/t.js +82 -82
- package/src/sdk/channels/channel.js +30 -30
- package/src/sdk/channels/facebook.js +13 -13
- package/src/sdk/channels/factory.js +3 -3
- package/src/sdk/channels/skype.js +12 -12
- package/src/sdk/channels/telegram.js +18 -18
- package/src/sdk/channels/viber.js +12 -12
- package/src/sdk/channels/vk-modal/vk-modal.html +17 -17
- package/src/sdk/channels/vk-modal/vk-modal.js +25 -25
- package/src/sdk/channels/vk-modal/vk-modal.scss +116 -116
- package/src/sdk/channels/vk.js +195 -184
- package/src/sdk/channels/whatsapp.js +16 -10
- package/src/sdk/channels/whatsappb.js +27 -0
- package/src/sdk/events/observer.js +46 -46
- package/src/sdk/index.js +5 -5
- package/src/sdk/sdk.js +67 -30
- package/src/sdk/utils/apiErrorHandler.js +11 -11
- package/src/sdk/utils/appInsights.js +88 -88
- package/src/sdk/utils/browserInfo.js +8 -8
- package/src/sdk/utils/constants.js +17 -17
- package/src/sdk/utils/cookies.js +67 -50
- package/src/sdk/utils/find.js +7 -7
- package/src/sdk/utils/loadConfig.js +20 -20
- package/src/sdk/utils/loadDeepLink.js +48 -21
- package/src/sdk/utils/loadScript.js +25 -25
- package/src/sdk/utils/loadSubscriptions.js +6 -6
- package/src/sdk/utils/parseQueryString.js +33 -33
- package/src/sdk/utils/windowHelper.js +25 -25
- package/src/sdk/widget/widget.js +192 -140
- package/src/widget/components/index.js +6 -2
- package/src/widget/components/tb-notification-button/facebook.js +9 -2
- package/src/widget/components/tb-notification-button/index.js +34 -34
- package/src/widget/components/tb-notification-button/styles.scss +657 -433
- package/src/widget/components/tb-notification-button/telegram.js +9 -2
- package/src/widget/components/tb-notification-button/viber.js +9 -2
- package/src/widget/components/tb-notification-button/vk.js +59 -50
- package/src/widget/components/tb-notification-button/whatsapp.js +15 -8
- package/src/widget/components/tb-notification-button/whatsappb.js +58 -0
- package/src/widget/components/tb-notification-widget/index.js +589 -384
- package/src/widget/components/tb-notification-widget/normalize.scss +395 -394
- package/src/widget/components/tb-notification-widget/styles.scss +502 -139
- package/src/widget/components/tb-nw-wahunter/index.js +259 -0
- package/src/widget/components/tb-nw-wahunter/styles.scss +471 -0
- package/src/widget/config.js +5 -5
- package/src/widget/icons/icon_chat_window.svg +1 -0
- package/src/widget/icons/icon_close.svg +1 -0
- package/src/widget/icons/icon_facebook.svg +7 -7
- package/src/widget/icons/icon_facebook_circle.svg +7 -9
- package/src/widget/icons/icon_instagram_circle.svg +95 -95
- package/src/widget/icons/icon_skype.svg +44 -44
- package/src/widget/icons/icon_skype_circle.svg +46 -46
- package/src/widget/icons/icon_skype_new.svg +113 -113
- package/src/widget/icons/icon_tg.svg +25 -25
- package/src/widget/icons/icon_tg_circle.svg +17 -27
- package/src/widget/icons/icon_viber.svg +75 -75
- package/src/widget/icons/icon_viber_circle.svg +67 -77
- package/src/widget/icons/icon_viber_new.svg +102 -102
- package/src/widget/icons/icon_vk.svg +14 -14
- package/src/widget/icons/icon_vk_circle.svg +16 -16
- package/src/widget/icons/icon_whatsapp.svg +147 -147
- package/src/widget/icons/icon_whatsapp_circle.svg +3 -3
- package/src/widget/icons/icon_whatsapp_hollow.svg +128 -0
- package/src/widget/icons/icon_whatsapp_new.svg +127 -127
- package/src/widget/icons/icon_whatsappb.svg +147 -0
- package/src/widget/icons/icon_whatsappb_circle.svg +4 -0
- package/src/widget/icons/icon_whatsappb_new.svg +127 -0
- package/src/widget/icons/paper-plane-arrow.svg +3 -0
- package/src/widget/icons/tb-logo.svg +21 -0
- package/src/widget/index.js +28 -28
- package/src/widget/locales/cs.js +42 -0
- package/src/widget/locales/en.js +42 -20
- package/src/widget/locales/index.js +2 -2
- package/src/widget/locales/pl.js +41 -19
- package/src/widget/locales/ro.js +41 -20
- package/src/widget/locales/ru.js +40 -19
- package/src/widget/locales/uk.js +40 -19
- package/src/widget/utils/cookiesEx.js +41 -41
- package/src/widget/utils/getLocale.js +4 -2
- package/src/widget/utils/stringifyAttributes.js +19 -19
- package/src/widget/utils/text.js +2 -1
- package/src/widget/utils/widgetsStorage.js +28 -28
- package/src/widget/widget.entry.js +3 -4
- package/tests/gf.html +35 -35
- package/tests/gf.js +21 -21
- package/tests/index.js +61 -61
- package/views/examples.ejs +7 -3
- package/views/sdk.html +274 -256
- package/webpack.common.js +72 -72
- package/webpack.dev.js +15 -15
- package/webpack.prod.js +10 -10
- package/src/widget/components/tb-notification-button/skype.js +0 -47
- package/src/widget/icons/text-back-badge.png +0 -0
- package/src/widget/locales/cz.js +0 -20
@@ -0,0 +1,259 @@
|
|
1
|
+
import Component from '../index.js';
|
2
|
+
import arrowIcon from '../../icons/paper-plane-arrow.svg';
|
3
|
+
import waIcon from '../../icons/icon_whatsapp_new.svg';
|
4
|
+
import iconTbLogo from '../../icons/tb-logo.svg';
|
5
|
+
|
6
|
+
import './styles.scss';
|
7
|
+
|
8
|
+
const parsePhoneNumber = (phoneString) => phoneString.replace(/[^\d]/g, '');
|
9
|
+
|
10
|
+
export default class Wahunter extends Component {
|
11
|
+
constructor() {
|
12
|
+
super(...arguments);
|
13
|
+
}
|
14
|
+
|
15
|
+
|
16
|
+
render() {
|
17
|
+
this.lang = this.widgetAPI.config.lang || this.parentElement.getAttribute('lang');
|
18
|
+
|
19
|
+
super.render();
|
20
|
+
this.submitFormElem = this.element.querySelector(`.${Wahunter.tagName}__submit-form`);
|
21
|
+
this.addListeners();
|
22
|
+
}
|
23
|
+
|
24
|
+
addListeners() {
|
25
|
+
this.submitFormElem.addEventListener('submit', (e) => {
|
26
|
+
e.preventDefault();
|
27
|
+
this.submit();
|
28
|
+
});
|
29
|
+
|
30
|
+
this.submitFormElem.phoneNumber.addEventListener('input', (e) => {
|
31
|
+
const target = e.target;
|
32
|
+
let selectionPos = target.selectionStart;
|
33
|
+
let newValue = parsePhoneNumber(target.value);
|
34
|
+
|
35
|
+
if (['7', '8'].includes(newValue[0]) || newValue.slice(0, 2) === '+7') {
|
36
|
+
newValue = newValue.slice(0, 11);
|
37
|
+
newValue = (newValue + '_'.repeat(11 - newValue.length)).replace(/(.{1})(.{3})(.{3})(.{2})(.{2})/, "+7 ($2) $3-$4-$5");
|
38
|
+
|
39
|
+
const indexOfFirstUnderscore = newValue.indexOf('_');
|
40
|
+
const indexOfLastNumber = newValue.lastIndexOf(newValue.match(/\d/g).pop());
|
41
|
+
|
42
|
+
if (target.value[selectionPos] === "_") {
|
43
|
+
selectionPos = indexOfLastNumber + 1;
|
44
|
+
} else {
|
45
|
+
selectionPos = indexOfFirstUnderscore;
|
46
|
+
}
|
47
|
+
|
48
|
+
target.value = newValue;
|
49
|
+
return target.setSelectionRange(selectionPos, selectionPos);
|
50
|
+
}
|
51
|
+
|
52
|
+
if (target.value[0] === '+') {
|
53
|
+
newValue = `+${newValue}`;
|
54
|
+
}
|
55
|
+
|
56
|
+
target.value = newValue;
|
57
|
+
});
|
58
|
+
|
59
|
+
this.submitFormElem.tryAgain.addEventListener('click', (e) => {
|
60
|
+
if (this.widgetAPI.config.displayMode !== 'inline') {
|
61
|
+
this.element.querySelector(`.${Wahunter.tagName}__text-content`).style = null;
|
62
|
+
}
|
63
|
+
|
64
|
+
this.changeSubmitFormState('initial');
|
65
|
+
});
|
66
|
+
}
|
67
|
+
|
68
|
+
getTbBrandBadge({ displayMode }) {
|
69
|
+
const utmMedium = 'hunter';
|
70
|
+
return `
|
71
|
+
<a target="_blank"
|
72
|
+
href="//textback.ru/?utm_source=TextBack_tool&utm_medium=${utmMedium}&utm_campaign=${window.location.origin}${window.location.pathname}&utm_content=${displayMode}"
|
73
|
+
|
74
|
+
id="tb-notification-brand-badge"
|
75
|
+
style="${displayMode === 'inline' ? 'fill:inherit; color: inherit;' : ''}"
|
76
|
+
>
|
77
|
+
${this.text('worksFor')} ${iconTbLogo}
|
78
|
+
</a>
|
79
|
+
`;
|
80
|
+
}
|
81
|
+
|
82
|
+
|
83
|
+
submit() {
|
84
|
+
const phoneNumber = +parsePhoneNumber(this.submitFormElem.phoneNumber.value);
|
85
|
+
|
86
|
+
if (this.widgetAPI.config.displayMode !== 'inline') {
|
87
|
+
this.element.querySelector(`.${Wahunter.tagName}__text-content`).style.display = 'none';
|
88
|
+
}
|
89
|
+
|
90
|
+
this.changeSubmitFormState('pending');
|
91
|
+
|
92
|
+
setTimeout(() => {
|
93
|
+
this.widgetAPI.runWahunter(phoneNumber)
|
94
|
+
.then(() => this.changeSubmitFormState('success'))
|
95
|
+
.catch((error) => {
|
96
|
+
if (error.status === 400) return this.changeSubmitFormState('notFound');
|
97
|
+
|
98
|
+
this.changeSubmitFormState('error');
|
99
|
+
});
|
100
|
+
}, 1500);
|
101
|
+
}
|
102
|
+
|
103
|
+
|
104
|
+
changeSubmitFormState(stateName) {
|
105
|
+
const submitFormElem = this.submitFormElem;
|
106
|
+
let messageText = '';
|
107
|
+
let tryAgainText = '';
|
108
|
+
let emoji = '';
|
109
|
+
|
110
|
+
switch (stateName) {
|
111
|
+
case 'pending': {
|
112
|
+
submitFormElem.dataset.state = 'pending';
|
113
|
+
messageText = this.text('sendMessage');
|
114
|
+
emoji = '⏳';
|
115
|
+
break;
|
116
|
+
}
|
117
|
+
case 'success': {
|
118
|
+
submitFormElem.dataset.state = 'success';
|
119
|
+
messageText = this.text('answerSuccessful');
|
120
|
+
emoji = '👍';
|
121
|
+
break;
|
122
|
+
}
|
123
|
+
case 'notFound': {
|
124
|
+
submitFormElem.dataset.state = 'notFound';
|
125
|
+
messageText = this.text('numberNotFound');
|
126
|
+
emoji = '🕵️♂️';
|
127
|
+
tryAgainText = this.text('tryAgain');
|
128
|
+
break;
|
129
|
+
}
|
130
|
+
case 'error': {
|
131
|
+
submitFormElem.dataset.state = 'error';
|
132
|
+
messageText = this.text('somethingWentWrong');
|
133
|
+
emoji = '👨🔧';
|
134
|
+
tryAgainText = this.text('errorTryAgain');
|
135
|
+
break;
|
136
|
+
}
|
137
|
+
default: {
|
138
|
+
submitFormElem.dataset.state = 'initial';
|
139
|
+
break;
|
140
|
+
}
|
141
|
+
}
|
142
|
+
|
143
|
+
submitFormElem.querySelector(`.${Wahunter.tagName}__state-report-emoji`).textContent = emoji;
|
144
|
+
submitFormElem.querySelector(`.${Wahunter.tagName}__state-report-message`).innerHTML = messageText;
|
145
|
+
submitFormElem.tryAgain.textContent = tryAgainText;
|
146
|
+
}
|
147
|
+
|
148
|
+
|
149
|
+
get template() {
|
150
|
+
const {
|
151
|
+
displayMode,
|
152
|
+
markUp: {
|
153
|
+
image,
|
154
|
+
header,
|
155
|
+
description,
|
156
|
+
},
|
157
|
+
} = this.widgetAPI.config;
|
158
|
+
|
159
|
+
if (displayMode === 'inline') return this.submitFormTemplate;
|
160
|
+
|
161
|
+
if (displayMode === 'popup') {
|
162
|
+
return `
|
163
|
+
<div class="${Wahunter.tagName}__top-img" style="background-image: url(${image.url})"></div>
|
164
|
+
|
165
|
+
<div class="${Wahunter.tagName}__img">
|
166
|
+
<img src="${image.url}">
|
167
|
+
</div>
|
168
|
+
|
169
|
+
<div class="${Wahunter.tagName}__main-content">
|
170
|
+
<div class="${Wahunter.tagName}__text-content">
|
171
|
+
<div class="${Wahunter.tagName}__headline" style="color:${header.color}">
|
172
|
+
${header.value}
|
173
|
+
</div>
|
174
|
+
<div class="${Wahunter.tagName}__description" style="color:${description.color}">
|
175
|
+
${description.value}
|
176
|
+
</div>
|
177
|
+
</div>
|
178
|
+
|
179
|
+
${this.submitFormTemplate}
|
180
|
+
</div>
|
181
|
+
`;
|
182
|
+
}
|
183
|
+
|
184
|
+
if (displayMode === 'corner-popup') {
|
185
|
+
return `
|
186
|
+
<div class="${Wahunter.tagName}__text-content">
|
187
|
+
<div class="${Wahunter.tagName}__headline" style="color:${header.color}">
|
188
|
+
${header.value}
|
189
|
+
</div>
|
190
|
+
</div>
|
191
|
+
${this.submitFormTemplate}
|
192
|
+
`
|
193
|
+
}
|
194
|
+
}
|
195
|
+
|
196
|
+
|
197
|
+
get submitFormTemplate() {
|
198
|
+
let {
|
199
|
+
displayMode,
|
200
|
+
showWahunterAgreement,
|
201
|
+
markUp: {
|
202
|
+
wahunterButton,
|
203
|
+
header,
|
204
|
+
},
|
205
|
+
} = this.widgetAPI.config;
|
206
|
+
|
207
|
+
|
208
|
+
const landingPlacesUrls = [
|
209
|
+
'lp.textback.ru',
|
210
|
+
'lp.textback.io',
|
211
|
+
'lp-dev.textback.ru',
|
212
|
+
'tb-opsrv-dev.textback.io/messaging.html#!/mini-landings',
|
213
|
+
'my.textback.io/messaging.html#!/mini-landings',
|
214
|
+
'landings.textback.io',
|
215
|
+
];
|
216
|
+
|
217
|
+
const isTBMiniLanding = landingPlacesUrls.some((url) => location.href.includes(url));
|
218
|
+
|
219
|
+
return `
|
220
|
+
<form class="${Wahunter.tagName}__submit-form" data-state="initial">
|
221
|
+
<div class="${Wahunter.tagName}__submit-form-controls">
|
222
|
+
<div class="${Wahunter.tagName}__phone-input-container">
|
223
|
+
<input type="text" class="${Wahunter.tagName}__phone-input" name="phoneNumber" placeholder="${this.text('enterNumber')}" required>
|
224
|
+
|
225
|
+
<button class="${Wahunter.tagName}__submit-button" style="color:${wahunterButton.textColor};background-color:${wahunterButton.color}">
|
226
|
+
${wahunterButton.text}
|
227
|
+
<div class="${Wahunter.tagName}__submit-button-icon">
|
228
|
+
${arrowIcon}
|
229
|
+
</div>
|
230
|
+
</button>
|
231
|
+
</div>
|
232
|
+
|
233
|
+
<div class="${Wahunter.tagName}__submit-form-footer" style="${showWahunterAgreement ? '' : 'display:none'}">
|
234
|
+
<label class="${Wahunter.tagName}__agreement">
|
235
|
+
<input type="checkbox" required checked>
|
236
|
+
<span class="${Wahunter.tagName}__agreement-text">${this.text('getAnswer')}<span class="${Wahunter.tagName}__agreement-wa-icon">${waIcon}</span>WhatsApp</span>
|
237
|
+
</label>
|
238
|
+
</div>
|
239
|
+
</div>
|
240
|
+
|
241
|
+
<div class="${Wahunter.tagName}__state-report">
|
242
|
+
<div class="${Wahunter.tagName}__state-report-emoji"></div>
|
243
|
+
|
244
|
+
<div class="${Wahunter.tagName}__state-report-message-container"
|
245
|
+
style="${displayMode === 'inline' ? ('color:' + header.color + ';' + 'fill:' + header.color) : ''}">
|
246
|
+
<div class="${Wahunter.tagName}__state-report-message"></div>
|
247
|
+
<button class="${Wahunter.tagName}__try-again-button" type="button" name="tryAgain"></button>
|
248
|
+
${displayMode === 'inline' && !isTBMiniLanding ? this.getTbBrandBadge(this.widgetAPI.config) : ''}
|
249
|
+
</div>
|
250
|
+
</div>
|
251
|
+
</form>
|
252
|
+
`
|
253
|
+
}
|
254
|
+
|
255
|
+
|
256
|
+
static get tagName() {
|
257
|
+
return 'tb-nw-wahunter';
|
258
|
+
}
|
259
|
+
};
|
@@ -0,0 +1,471 @@
|
|
1
|
+
$base-class-name: tb-nw-wahunter;
|
2
|
+
$font-family: 'Montserrat',
|
3
|
+
'Open Sans',
|
4
|
+
'Droid Sans',
|
5
|
+
Arial,
|
6
|
+
sans-serif;
|
7
|
+
|
8
|
+
$color-green: #25D366;
|
9
|
+
$color-light-gray: #F2F2F2;
|
10
|
+
$color-dark-gray: darken($color-light-gray, 5%);
|
11
|
+
|
12
|
+
tb-notification-widget #tb-notification-widget-inner.tb-notification-widget-inner tb-nw-wahunter {
|
13
|
+
font-size: 12px;
|
14
|
+
font-family: $font-family;
|
15
|
+
|
16
|
+
* {
|
17
|
+
box-sizing: border-box;
|
18
|
+
}
|
19
|
+
|
20
|
+
// TODO: Move reset to level of entire widget. Now I’m not sure that this will not break anything in normal notif widget
|
21
|
+
a,
|
22
|
+
label,
|
23
|
+
button,
|
24
|
+
input {
|
25
|
+
margin: 0;
|
26
|
+
padding: 0;
|
27
|
+
border: none;
|
28
|
+
box-shadow: none;
|
29
|
+
outline: none;
|
30
|
+
font-family: inherit;
|
31
|
+
font-size: inherit;
|
32
|
+
color: inherit;
|
33
|
+
background: transparent;
|
34
|
+
}
|
35
|
+
|
36
|
+
button,
|
37
|
+
label {
|
38
|
+
cursor: pointer;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
|
43
|
+
tb-notification-widget #tb-notification-widget-inner.tb-notification-widget-inner .tb-nw-wahunter {
|
44
|
+
|
45
|
+
/**** All modes ****/
|
46
|
+
&__headline {
|
47
|
+
font-weight: 600;
|
48
|
+
line-height: 1.3;
|
49
|
+
}
|
50
|
+
|
51
|
+
&__text-content {
|
52
|
+
margin-bottom: 1.4em;
|
53
|
+
}
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
/**** Popup mode only ****/
|
58
|
+
&__top-img {
|
59
|
+
padding: 20% 0;
|
60
|
+
background-size: cover;
|
61
|
+
background-position: center;
|
62
|
+
background-repeat: no-repeat;
|
63
|
+
border-radius: 4px 4px 0px 0px;
|
64
|
+
}
|
65
|
+
|
66
|
+
&__img {
|
67
|
+
display: none;
|
68
|
+
align-items: center;
|
69
|
+
width: 280px;
|
70
|
+
flex-shrink: 0;
|
71
|
+
|
72
|
+
img {
|
73
|
+
width: 100%;
|
74
|
+
}
|
75
|
+
}
|
76
|
+
|
77
|
+
&__main-content {
|
78
|
+
padding: 1.4em 10%;
|
79
|
+
padding-bottom: 4em;
|
80
|
+
}
|
81
|
+
|
82
|
+
&__description {
|
83
|
+
font-size: 1.3em;
|
84
|
+
line-height: 1.5;
|
85
|
+
}
|
86
|
+
|
87
|
+
&_without-image {
|
88
|
+
|
89
|
+
.#{$base-class-name}__top-img,
|
90
|
+
.#{$base-class-name}__img {
|
91
|
+
display: none;
|
92
|
+
}
|
93
|
+
|
94
|
+
.#{$base-class-name}__main-content {
|
95
|
+
padding-top: 3em;
|
96
|
+
}
|
97
|
+
}
|
98
|
+
|
99
|
+
&_mode_popup {
|
100
|
+
.#{$base-class-name}__headline {
|
101
|
+
font-size: 1.9em;
|
102
|
+
margin-bottom: 0.4em;
|
103
|
+
}
|
104
|
+
}
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
/**** Inline mode only ****/
|
109
|
+
&_mode_inline {
|
110
|
+
display: flex;
|
111
|
+
|
112
|
+
.#{$base-class-name}__submit-form {
|
113
|
+
margin: 0;
|
114
|
+
}
|
115
|
+
|
116
|
+
#tb-notification-brand-badge {
|
117
|
+
display: none;
|
118
|
+
font-size: 9px;
|
119
|
+
margin-top: 1.2em;
|
120
|
+
}
|
121
|
+
}
|
122
|
+
|
123
|
+
&_inline-mode-align_left {
|
124
|
+
justify-content: flex-start;
|
125
|
+
}
|
126
|
+
|
127
|
+
&_inline-mode-align_right {
|
128
|
+
justify-content: flex-end;
|
129
|
+
}
|
130
|
+
|
131
|
+
&_inline-mode-align_center {
|
132
|
+
justify-content: center;
|
133
|
+
}
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
/**** Corner-popup mode only ****/
|
138
|
+
&_mode_corner-popup {
|
139
|
+
.#{$base-class-name}__headline {
|
140
|
+
font-size: 1.7em;
|
141
|
+
margin-bottom: 0.4em;
|
142
|
+
}
|
143
|
+
}
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
/**** Submit-form ****/
|
148
|
+
&__submit-form {
|
149
|
+
padding: 0;
|
150
|
+
width: 100%;
|
151
|
+
max-width: 100%;
|
152
|
+
margin: auto;
|
153
|
+
}
|
154
|
+
|
155
|
+
&__phone-input,
|
156
|
+
&__submit-button {
|
157
|
+
height: 44px;
|
158
|
+
width: 100%;
|
159
|
+
border-radius: 22px;
|
160
|
+
padding: 0 40px !important;
|
161
|
+
}
|
162
|
+
|
163
|
+
&__phone-input {
|
164
|
+
font-size: 14px;
|
165
|
+
margin-bottom: 12px;
|
166
|
+
background: #F2F2F2;
|
167
|
+
border: 1px solid $color-dark-gray;
|
168
|
+
letter-spacing: 1px;
|
169
|
+
color: #333;
|
170
|
+
|
171
|
+
&:invalid {
|
172
|
+
letter-spacing: 0px;
|
173
|
+
}
|
174
|
+
}
|
175
|
+
|
176
|
+
&__submit-button {
|
177
|
+
position: relative;
|
178
|
+
background: $color-green;
|
179
|
+
color: #fff;
|
180
|
+
font-size: 9px;
|
181
|
+
font-weight: bold;
|
182
|
+
letter-spacing: 1px;
|
183
|
+
text-transform: uppercase;
|
184
|
+
transition: background ease 0.25s;
|
185
|
+
}
|
186
|
+
|
187
|
+
&__submit-button-icon {
|
188
|
+
position: absolute;
|
189
|
+
right: 13px;
|
190
|
+
top: 0;
|
191
|
+
height: 100%;
|
192
|
+
width: 20px;
|
193
|
+
|
194
|
+
svg {
|
195
|
+
position: absolute;
|
196
|
+
top: 0;
|
197
|
+
left: 0;
|
198
|
+
right: 0;
|
199
|
+
bottom: 0;
|
200
|
+
margin: auto;
|
201
|
+
}
|
202
|
+
}
|
203
|
+
|
204
|
+
&__submit-form-footer {
|
205
|
+
display: flex;
|
206
|
+
justify-content: space-between;
|
207
|
+
padding: 0 5px;
|
208
|
+
font-size: 12px;
|
209
|
+
margin-top: 10px;
|
210
|
+
}
|
211
|
+
|
212
|
+
&__agreement {
|
213
|
+
display: flex;
|
214
|
+
align-items: center;
|
215
|
+
}
|
216
|
+
|
217
|
+
&__agreement input[type="checkbox"] {
|
218
|
+
-webkit-appearance: none;
|
219
|
+
-moz-appearance: none;
|
220
|
+
-o-appearance: none;
|
221
|
+
appearance: none;
|
222
|
+
position: relative;
|
223
|
+
height: 14px;
|
224
|
+
width: 14px;
|
225
|
+
border: 1px solid rgb(207, 207, 207);
|
226
|
+
border-radius: 4px;
|
227
|
+
outline: none;
|
228
|
+
cursor: pointer;
|
229
|
+
|
230
|
+
&:checked {
|
231
|
+
background: $color-green;
|
232
|
+
border: none;
|
233
|
+
}
|
234
|
+
|
235
|
+
&:checked::before {
|
236
|
+
content: '\2714';
|
237
|
+
display: block;
|
238
|
+
text-align: center;
|
239
|
+
color: #fff;
|
240
|
+
position: absolute;
|
241
|
+
left: 3.5px;
|
242
|
+
top: 2px;
|
243
|
+
font-size: 9px;
|
244
|
+
}
|
245
|
+
}
|
246
|
+
|
247
|
+
&__agreement-text {
|
248
|
+
margin-left: 5px;
|
249
|
+
}
|
250
|
+
|
251
|
+
&__agreement-wa-icon {
|
252
|
+
display: inline-block;
|
253
|
+
position: relative;
|
254
|
+
width: 18px;
|
255
|
+
height: 14px;
|
256
|
+
vertical-align: middle;
|
257
|
+
|
258
|
+
svg {
|
259
|
+
position: absolute;
|
260
|
+
top: -7px;
|
261
|
+
left: -3px;
|
262
|
+
width: 25px;
|
263
|
+
}
|
264
|
+
}
|
265
|
+
|
266
|
+
&__state-report {
|
267
|
+
display: none;
|
268
|
+
flex-direction: column;
|
269
|
+
align-items: center;
|
270
|
+
line-height: 1.5;
|
271
|
+
}
|
272
|
+
|
273
|
+
&__state-report-emoji {
|
274
|
+
font-size: 40px;
|
275
|
+
margin-bottom: 10px;
|
276
|
+
}
|
277
|
+
|
278
|
+
&__state-report-message-container {
|
279
|
+
text-align: center;
|
280
|
+
}
|
281
|
+
|
282
|
+
&__state-report-message {
|
283
|
+
font-size: 18px;
|
284
|
+
font-weight: bold;
|
285
|
+
}
|
286
|
+
|
287
|
+
&__try-again-button {
|
288
|
+
display: none;
|
289
|
+
padding: 0;
|
290
|
+
margin: 0;
|
291
|
+
margin-top: 20px;
|
292
|
+
font-size: 16px;
|
293
|
+
}
|
294
|
+
|
295
|
+
&__try-again-button {
|
296
|
+
font-weight: bold;
|
297
|
+
text-decoration: underline;
|
298
|
+
}
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
/**** Submit-form state management ****/
|
303
|
+
&__submit-form:not([data-state="initial"]) {
|
304
|
+
.#{$base-class-name}__submit-form-controls {
|
305
|
+
display: none;
|
306
|
+
}
|
307
|
+
|
308
|
+
.#{$base-class-name}__state-report {
|
309
|
+
display: flex;
|
310
|
+
}
|
311
|
+
}
|
312
|
+
|
313
|
+
&__submit-form[data-state="success"] {
|
314
|
+
#tb-notification-brand-badge {
|
315
|
+
display: inline-flex;
|
316
|
+
}
|
317
|
+
}
|
318
|
+
|
319
|
+
&__submit-form[data-state="error"],
|
320
|
+
&__submit-form[data-state="notFound"] {
|
321
|
+
|
322
|
+
.#{$base-class-name}__state-report-message {
|
323
|
+
font-weight: normal;
|
324
|
+
}
|
325
|
+
|
326
|
+
.#{$base-class-name}__try-again-button {
|
327
|
+
display: inline-block;
|
328
|
+
}
|
329
|
+
}
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
@media only screen and (min-device-width: 481px) {
|
334
|
+
font-size: 13px;
|
335
|
+
|
336
|
+
&:not(.tb-nw-wahunter_mode_corner-popup) {
|
337
|
+
.#{$base-class-name}__phone-input-container {
|
338
|
+
padding: 5px;
|
339
|
+
background: #F2F2F2;
|
340
|
+
border-radius: 22px;
|
341
|
+
display: flex;
|
342
|
+
justify-content: space-between;
|
343
|
+
align-items: center;
|
344
|
+
}
|
345
|
+
|
346
|
+
.#{$base-class-name}__phone-input,
|
347
|
+
.#{$base-class-name}__submit-button {
|
348
|
+
height: auto;
|
349
|
+
width: auto;
|
350
|
+
flex-grow: 1;
|
351
|
+
}
|
352
|
+
|
353
|
+
.#{$base-class-name}__phone-input {
|
354
|
+
background: transparent;
|
355
|
+
border-radius: 0;
|
356
|
+
padding-left: 15px !important;
|
357
|
+
padding-right: 10px !important;
|
358
|
+
min-width: 150px;
|
359
|
+
margin: 0;
|
360
|
+
border: none;
|
361
|
+
}
|
362
|
+
|
363
|
+
.#{$base-class-name}__submit-button {
|
364
|
+
padding-top: 15px !important;
|
365
|
+
padding-bottom: 15px !important;
|
366
|
+
min-width: 49%;
|
367
|
+
}
|
368
|
+
|
369
|
+
.#{$base-class-name}__submit-form-footer {
|
370
|
+
margin-top: 6px;
|
371
|
+
}
|
372
|
+
}
|
373
|
+
|
374
|
+
&_mode_popup,
|
375
|
+
&_mode_inline {
|
376
|
+
.#{$base-class-name}__submit-form {
|
377
|
+
width: max-content;
|
378
|
+
}
|
379
|
+
}
|
380
|
+
|
381
|
+
&_mode_popup {
|
382
|
+
.#{$base-class-name}__submit-form {
|
383
|
+
min-width: 370px;
|
384
|
+
}
|
385
|
+
}
|
386
|
+
|
387
|
+
&_mode_inline {
|
388
|
+
.#{$base-class-name}__submit-form {
|
389
|
+
min-width: 420px;
|
390
|
+
}
|
391
|
+
}
|
392
|
+
}
|
393
|
+
|
394
|
+
|
395
|
+
|
396
|
+
@media only screen and (min-device-width: 768px) {
|
397
|
+
font-size: 14px;
|
398
|
+
|
399
|
+
&_image-align_right,
|
400
|
+
&_image-align_left {
|
401
|
+
display: flex;
|
402
|
+
justify-content: space-between;
|
403
|
+
align-items: center;
|
404
|
+
text-align: left;
|
405
|
+
padding: 7em 2.5em;
|
406
|
+
|
407
|
+
.#{$base-class-name}__submit-form {
|
408
|
+
min-width: unset;
|
409
|
+
width: 100%;
|
410
|
+
}
|
411
|
+
|
412
|
+
.#{$base-class-name}__top-img {
|
413
|
+
display: none;
|
414
|
+
}
|
415
|
+
|
416
|
+
.#{$base-class-name}__img {
|
417
|
+
display: flex;
|
418
|
+
}
|
419
|
+
|
420
|
+
.#{$base-class-name}__main-content {
|
421
|
+
padding: 0;
|
422
|
+
}
|
423
|
+
|
424
|
+
.#{$base-class-name}__state-report {
|
425
|
+
flex-direction: row;
|
426
|
+
}
|
427
|
+
|
428
|
+
.#{$base-class-name}__state-report-message-container {
|
429
|
+
text-align: left;
|
430
|
+
}
|
431
|
+
|
432
|
+
.#{$base-class-name}__state-report-emoji {
|
433
|
+
margin-bottom: 0;
|
434
|
+
margin-right: 10px;
|
435
|
+
}
|
436
|
+
|
437
|
+
.#{$base-class-name}__submit-form[data-state="notFound"],
|
438
|
+
.#{$base-class-name}__submit-form[data-state="error"] {
|
439
|
+
.#{$base-class-name}__state-report {
|
440
|
+
align-items: flex-start;
|
441
|
+
}
|
442
|
+
}
|
443
|
+
}
|
444
|
+
|
445
|
+
&_image-align_top,
|
446
|
+
&_without-image {
|
447
|
+
.#{$base-class-name}__submit-form {
|
448
|
+
min-width: 420px;
|
449
|
+
}
|
450
|
+
}
|
451
|
+
|
452
|
+
&_image-align_top {
|
453
|
+
.#{$base-class-name}__main-content {
|
454
|
+
padding-bottom: 6em;
|
455
|
+
}
|
456
|
+
}
|
457
|
+
|
458
|
+
&_image-align_right {
|
459
|
+
.#{$base-class-name}__img {
|
460
|
+
margin-left: 3em;
|
461
|
+
order: 1;
|
462
|
+
}
|
463
|
+
}
|
464
|
+
|
465
|
+
&_image-align_left {
|
466
|
+
.#{$base-class-name}__img {
|
467
|
+
margin-right: 3em;
|
468
|
+
}
|
469
|
+
}
|
470
|
+
}
|
471
|
+
}
|