From 804f47612248271b8334588450bbe9d2541c7ace Mon Sep 17 00:00:00 2001 From: JuliaAbramova Date: Mon, 11 Nov 2024 18:25:23 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D1=8F?= =?UTF-8?q?=D0=B5=D1=82=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 420 ++++++++++++++++++++++++------------------------ js/functions.js | 24 +++ 2 files changed, 235 insertions(+), 209 deletions(-) create mode 100644 js/functions.js diff --git a/index.html b/index.html index 9fb6740..2cdcdaf 100644 --- a/index.html +++ b/index.html @@ -1,231 +1,232 @@ - - - - - - - Кекстаграм - - - -
- - -
-

Фильтр фотографий

-
- - - -
-
- - -
-

Фотографии других пользователей

- - -
-
-

Загрузка фотографии

-
- - -
- - -
- - -
- + + - - - +
- - - - - - - - - - - - - - - - + + + + + + + + + + + + - diff --git a/js/functions.js b/js/functions.js new file mode 100644 index 0000000..ca455c0 --- /dev/null +++ b/js/functions.js @@ -0,0 +1,24 @@ +function checkStringLength(str, maxLength) { + return str.length <= maxLength; +} +function checkPalindrom (str) { + const check = str.replaceAll(' ', '').toLowerCase(); + for(let i = 0; i < check.length; i++) { + const isEqual = check.at(i) === check.at(-i - 1); + if(!isEqual){ + return false; + } + } + return true; +} +function getNumber(str){ + const checked = str.toString(); + let numbers = ''; + for(let i = 0; i < checked.length; i++) { + const check = parseInt(checked[i], 10); + if (!Number.isNaN(check)) { + numbers += checked[i]; + } + } + return parseInt(numbers, 10); +}