diff --git a/package-lock.json b/package-lock.json index 6aaf3bc..486f987 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,6 +5,7 @@ "requires": true, "packages": { "": { + "name": "tables-and-forms", "version": "1.0.0", "license": "ISC", "dependencies": { diff --git a/static/index.html b/static/index.html index 514b62f..ff65844 100644 --- a/static/index.html +++ b/static/index.html @@ -11,6 +11,71 @@

Найди себе друга!

+
+
+ Какого питомца вы хотите? + + + + + + + +
+ +
+ Информация о вас + + + + + + + + + + +
+ + +
+ \ No newline at end of file diff --git a/static/styles.css b/static/styles.css index ef86c9a..2faf631 100644 --- a/static/styles.css +++ b/static/styles.css @@ -3,6 +3,7 @@ body { } main { + font-size: 20px; box-sizing: border-box; width: 100%; max-width: 1000px; @@ -28,4 +29,46 @@ h1 { .orders { margin: 20px 0; +} + +fieldset { + display: flex; + flex-direction: column; + border: 1px solid #8C8C8C; + border-radius: 5px; + margin: 10px; +} + +label { + flex-basis: 50px; + vertical-align: middle; +} + +legend { + font-size: 32px; + border: 1px solid #8C8C8C; + border-radius: 5px; + color: #383838; +} + +input { + border: 1px solid #8C8C8C; + border-radius: 5px; + font-size: 20px; +} + +input[type="color"] { + width: 100px; + height: 30px; +} + +input[type="checkbox"] { + width: 20px; + height: 20px; +} + +select { + font-size: 20px; + border-radius: 5px; + padding: 5px 10px; } \ No newline at end of file diff --git a/static/validation.js b/static/validation.js new file mode 100644 index 0000000..004ceaa --- /dev/null +++ b/static/validation.js @@ -0,0 +1,23 @@ +const name = document.querySelector('#name'); +const phone = document.querySelector('#phone'); +const form = document.querySelector('form'); + +function validatePhone() { + return phone.value.length > 10 && phone.value.length < 13; +} +function validateName() { + return name.value.length > 3 && name.value.length < 50; +} + +form.addEventListener('submit', (event) => { + let phoneIsValid = validatePhone(); + let nameIsValid = validateName(); + if (!phoneIsValid) { + alert("Номер телефона не валиден"); + event.preventDefault(); + } + if (!nameIsValid) { + alert("Имя введено некорректно"); + event.preventDefault(); + } +}); \ No newline at end of file