From 7983a28c7ae66341fd1bb6541146b5bd4afc879d Mon Sep 17 00:00:00 2001 From: Kirill Pet Date: Fri, 20 Dec 2024 13:57:31 +0300 Subject: [PATCH] =?UTF-8?q?fix=20(=D1=81=D0=BA=D1=80=D0=BE=D0=BB=20=D0=B1?= =?UTF-8?q?=D0=BB=D0=BE=D0=BA,=20=D0=BC=D0=B0=D1=81=D0=BA=D0=B0,=20=D1=82?= =?UTF-8?q?=D0=B5=D0=BB.=20=D0=BF=D0=BE=D0=B8=D1=81=D0=BA,=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=D0=BD=20=D1=81=D0=BE=D0=B3=D0=BB.)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/css/gp-style-tablet.css | 3 +++ assets/js/main.js | 36 +++++++++++++++++++++++++++++++++- index.html | 20 +++++++++---------- 3 files changed, 48 insertions(+), 11 deletions(-) diff --git a/assets/css/gp-style-tablet.css b/assets/css/gp-style-tablet.css index 3a0f5a6..ce4a139 100644 --- a/assets/css/gp-style-tablet.css +++ b/assets/css/gp-style-tablet.css @@ -626,6 +626,9 @@ main{ .form__checkbox-block{ align-items: start; } +.free .title-1{ + text-align: center; +} } /* reviews */ diff --git a/assets/js/main.js b/assets/js/main.js index 18d5b1e..6ea30e8 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -48,7 +48,7 @@ const projectsSwiper = new Swiper('.projects-swiper', { spaceBetween: 24, }, 996: { - slidesPerView: 1 + slidesPerView: 10 }, }, // Navigation arrows @@ -251,6 +251,40 @@ itemModels.forEach(item => { }) // open-modal end +// masks + +let phoneInputs = document.querySelectorAll('.input__field[type=phone]'); + +phoneInputs.forEach(phoneInput => { + phoneInput.onfocus = function (event) { + let value = phoneInput.value; + + if (value.length == 0) { + phoneInput.value += '+7 ' + } + } + + phoneInput.addEventListener('input', function(event) { + let value = phoneInput.value, + data = event.data, + length = value.length; + + if (value.charAt(0) == '+' && length == 1) return; + + if (isNaN(data)) { + phoneInput.value = data.slice(0, -1) + } + + if (typeof data != 'object') { + if (length == 6 || length == 10) { + phoneInput.value = value + ' '; + } + } + + }); +}) + + // resize window.addEventListener('resize', () => { let screenWidth = window.screen.width; diff --git a/index.html b/index.html index 1644757..3e92b7e 100644 --- a/index.html +++ b/index.html @@ -278,7 +278,7 @@
-
+
@@ -678,7 +678,7 @@
- + Телефон введен не верно
@@ -693,9 +693,9 @@

Загрузить свой проект на просчет

@@ -1124,17 +1124,17 @@

Загрузить свой проект на просчет

-
-