diff --git a/lab4/164648-kot-kotenok-privlekatelnost-golova-glaz-3840x2160.jpg b/lab4/164648-kot-kotenok-privlekatelnost-golova-glaz-3840x2160.jpg new file mode 100644 index 00000000..413a7e8f Binary files /dev/null and b/lab4/164648-kot-kotenok-privlekatelnost-golova-glaz-3840x2160.jpg differ diff --git a/lab4/avatarka.jpg b/lab4/avatarka.jpg new file mode 100644 index 00000000..7755e157 Binary files /dev/null and b/lab4/avatarka.jpg differ diff --git a/lab4/cd16121609a79d95dffbfa28a326331e.jpg b/lab4/cd16121609a79d95dffbfa28a326331e.jpg new file mode 100644 index 00000000..4aaefb6c Binary files /dev/null and b/lab4/cd16121609a79d95dffbfa28a326331e.jpg differ diff --git a/lab4/lab1.css b/lab4/lab1.css new file mode 100644 index 00000000..3cbb08a8 --- /dev/null +++ b/lab4/lab1.css @@ -0,0 +1,67 @@ +.text_task { + background-color: #FEB431; + text-align: center; + color: #85A1B7; +} + +.cats_task { + position: relative; +} + +.cats_task_second { + position: absolute; + top: 120px; +} + +.trafficlight_task { + background-color: #49433d; + width: 100px; +} + +.traficlight_size { + width: 100px; + height: 100px; + border-radius: 100px; +} + +.trafficlight_red { + background-color: red; +} + +.trafficlight_yellow { + background-color: yellow; +} + +.trafficlight_green { + background-color: green; +} + +.labyrinth { + display: grid; + grid-template-columns: repeat(3, 120px); + grid-template-rows: repeat(3, 120px); + width: 360px; +} + +.labyrinth_cell { + border: 4px solid black; + box-sizing: border-box; + width: 120px; + height: 120px; +} + +.labyrinth_cell_no-left { + border-left: none; +} + +.labyrinth_cell_no-right { + border-right: none; +} + +.labyrinth_cell_no-top { + border-top: none; +} + +.labyrinth_cell_no-bottom { + border-bottom: none; +} \ No newline at end of file diff --git a/lab4/lab1.html b/lab4/lab1.html new file mode 100644 index 00000000..a203a3b0 --- /dev/null +++ b/lab4/lab1.html @@ -0,0 +1,60 @@ + + + + + + lab1 + + + +

Задание №1

+
+ JavaScript (аббр. JS) — мультипарадигменный язык программирования. + Поддерживает объектно-ориентированный, императивный и функциональный + стили. Является реализацией спецификации ECMAScript (стандарт ECMA-262). + JavaScript обычно используется как встраиваемый язык для программного + доступа к объектам приложений. Наиболее широкое применение находит в + браузерах как язык сценариев для придания интерактивности + веб-страницам. +
+

Задание №2

+
+
+ +
+ +
+
+
+

Задание №3

+
+
+
+
+
+

Задание №4

+
+
+
+
+
+
+
+
+
+
+
+
+
+ + \ No newline at end of file diff --git a/lab4/lab2.css b/lab4/lab2.css new file mode 100644 index 00000000..c3469ad3 --- /dev/null +++ b/lab4/lab2.css @@ -0,0 +1,97 @@ +.main-container { + text-align: center; +} + +.unordered-list { + list-style-type: none; + padding: 0; +} + +.unordered-list li { + padding: 8px 12px; + margin: 4px 0; + transition: color 1.2s ease, background-color 1.2s ease; +} + +.unordered-list li:hover { + color: #f99665; + background-color: #f0f0f0; +} + +.parent_2 { + color: #f4bc92; +} + +.parent_1 .parent__child { + color: red; + width: 50px; +} + +.parent_2 .parent__child { + color: #b4005a; + border-style: dotted; + border-color: #f4bc92; + width: 50px; +} + +.parent_2 ~ .parent_3, +.parent_2 ~ .parent_3 .parent__child { + color: green; +} + +.parent_2 ~ .parent_3 .parent__child_guest-from-2 { + color: purple; +} + +.text { + width: 700px; + text-align: left; +} + +.programming-language { + text-decoration: none; + color: black; + padding-right: 5px; + font-weight: bold; +} + +.languages-list li { + text-align: left; +} + +.languages-list li::before{ + content: "🌐"; +} + +.text::after{ + content: ""; + display: block; + width: 260px; + height: 120px; + margin: 30px auto; + background-image: url('https://ssau.ru/i/logo/logo-white-ru.svg'); + background-size: contain; + background-repeat: no-repeat; + background-position: center; + background-color: #2780e3; + padding: 20px; + border-radius: 5px; +} + +.task { + margin-bottom: 30px; + padding: 20px; + border: 1px solid #ddd; + border-radius: 5px; +} + +.parent { + margin: 10px 0; + padding: 10px; + border: 1px solid #ccc; +} + +.parent__child { + margin: 5px 0; + padding: 5px; +} \ No newline at end of file diff --git a/lab4/lab2.html b/lab4/lab2.html new file mode 100644 index 00000000..e2831302 --- /dev/null +++ b/lab4/lab2.html @@ -0,0 +1,120 @@ + + + + + + lab2 + + + +
+

Лабораторная работа №2

+

Миндубаев Руслан 6212

+
+ +
+
+

Задание 1

+

Популярные музыкальные жанры:

+ +
+ +
+

Задание 2

+
+

Parent 1

+
child 1
+
child 2
+
child 3
+
child 4
+
+
+

Parent 3

+
child 1
+
child 2
+
+
+

Parent 2

+
child 1
+
child 2
+
+
+

Parent 3

+
child 1
+
child 2
+
child 2
+
+
+ +
+

Задание 3

+
+ Языки программирования — это инструменты, с помощью которых + разработчики создают программное обеспечение, веб-приложения, игры, + алгоритмы и многое другое. Каждый язык имеет свои особенности, + синтаксис и сферу применения. Ниже представлены некоторые из + наиболее известных языков: + +
    +
  • + Python + – высокоуровневый язык с простым синтаксисом, популярный в Data + Science, веб-разработке и автоматизации. +
  • +
  • + JavaScript + – основной язык для фронтенд-разработки, работает в браузерах и + на сервере (Node.js). +
  • +
  • + Java + – объектно-ориентированный язык, широко используется в + корпоративных приложениях и Android-разработке. +
  • +
  • + C++ + – мощный язык для системного программирования, игр и высокопроизводительных приложений. +
  • +
  • + C# + – язык от Microsoft, применяется в разработке под Windows, играх + (Unity) и веб-приложениях. +
  • +
  • + Go (Golang) + – созданный Google, язык для высоконагруженных сетевых сервисов и + облачных технологий. +
  • +
  • + Ruby + – известен благодаря фреймворку Ruby on Rails для веб-разработки. +
  • +
  • + Swift + – язык Apple для разработки под iOS и macOS. +
  • +
  • + Kotlin + – современный язык, официально поддерживаемый для + Android-разработки. +
  • +
  • + Rust + – язык системного программирования с акцентом на безопасность и + производительность. +
  • +
+ + Это лишь малая часть из множества существующих языков, и выбор зависит + от задач, которые нужно решить. +
+
+
+ + diff --git a/lab4/lab3.css b/lab4/lab3.css new file mode 100644 index 00000000..414a2696 --- /dev/null +++ b/lab4/lab3.css @@ -0,0 +1,418 @@ +* { + margin: 0; + padding: 0; + box-sizing: border-box; + font-family: 'Arial', sans-serif; +} + +.page { + background-color: #34495e; + color: #333; + line-height: 1.6; + padding: 20px; + min-height: 100vh; +} + +.container { + max-width: 900px; + margin: 20px auto; + background: white; + padding: 30px; + border-radius: 10px; + box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1); + border: 3px solid #2c3e50; +} + +.header { + display: flex; + align-items: center; + margin-bottom: 30px; + padding-bottom: 20px; + border-bottom: 3px solid #2c3e50; +} + +.header__photo { + width: 150px; + height: 150px; + border-radius: 8px; + margin-right: 30px; +} + +.header__image { + width: 100%; + height: 100%; + border-radius: 8px; + object-fit: cover; + border: 3px solid #2c3e50; +} + +.header__title { + color: #2c3e50; + margin-bottom: 10px; +} + +.header__text { + margin-bottom: 5px; +} + +.main__grid { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 30px; + margin-bottom: 30px; +} + +.section { + margin-bottom: 25px; + padding: 20px; + background: #f8f9fa; + border-radius: 8px; + border: 2px solid #bdc3c7; +} + +.section:hover { + background: #f0f3f5; + border-color: #95a5a6; +} + +.section__title { + color: #2c3e50; + margin-bottom: 15px; + padding-bottom: 8px; + border-bottom: 2px solid #bdc3c7; +} + +.section__list { + list-style: none; + padding-left: 0; +} + +.section__item { + margin-bottom: 8px; + padding-left: 15px; + position: relative; +} + +.section__item::before { + content: "•"; + color: #3498db; + position: absolute; + left: 0; +} + +.section__item-title { + color: #2c3e50; +} + +.section__text { + margin-bottom: 10px; +} + +.section--hobbies { + border-left: 4px solid #9b59b6; +} + +.section--contacts { + border-left: 4px solid #2ecc71; +} + +.section--about { + border-left: 4px solid #f39c12; +} + +.contacts__item { + margin-bottom: 10px; + padding: 8px; + border: 1px solid #ecf0f1; + border-radius: 4px; +} + +.contacts__item:hover { + background: white; + border-color: #bdc3c7; +} + +.contacts__label { + color: #2c3e50; +} + +.contacts__link { + display: inline-block; + background: #2c3e50; + color: white; + padding: 8px 16px; + border-radius: 4px; + text-decoration: none; + margin-top: 10px; + border: 1px solid #34495e; +} + +.contacts__link:hover { + background: #34495e; +} + +.qr { + margin-top: 15px; + text-align: left; + padding: 15px; + background: white; + border-radius: 6px; + border: 2px solid #bdc3c7; +} + +.qr:hover { + background: #f0f3f5; + border-color: #95a5a6; +} + +.qr__label { + font-weight: bold; + color: #2c3e50; + margin-bottom: 10px; +} + +.qr__code { + display: flex; + justify-content: left; + margin-bottom: 8px; +} + +.qr__image { + width: 140px; + height: 140px; + border: 2px solid #2c3e50; + border-radius: 6px; + padding: 5px; + background: white; +} + +.qr__description { + margin-top: 8px; + font-size: 12px; + color: #666; +} + +.skills { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 20px; +} + +.skills__column { + padding: 15px; + border-radius: 6px; + background: white; + border: 2px solid #bdc3c7; +} + +.skills__column:hover { + background: #f8f9fa; + border-color: #95a5a6; +} + +.skills__column--hard { + border-left: 5px solid #3498db; +} + +.skills__column--soft { + border-left: 5px solid #e74c3c; +} + +.skills__title { + color: #2c3e50; + margin-bottom: 10px; +} + +.skills__column--hard .skills__title { + color: #2980b9; +} + +.skills__column--soft .skills__title { + color: #c0392b; +} + +.skills__list { + list-style: none; + padding-left: 0; +} + +.skills__item { + margin-bottom: 8px; + padding-left: 15px; + position: relative; +} + +.skills__item::before { + content: "•"; + position: absolute; + left: 0; +} + +.skills__column--hard .skills__item::before { + color: #3498db; +} + +.skills__column--soft .skills__item::before { + color: #e74c3c; +} + +.resume__section { + margin-bottom: 25px; + padding: 20px; + background: #f8f9fa; + border-radius: 8px; + border: 2px solid #bdc3c7; + border-left: 4px solid #3498db; +} + +.resume__section:hover { + background: #f0f3f5; + border-color: #95a5a6; +} + +.resume__section-title { + color: #2c3e50; + margin-bottom: 15px; + padding-bottom: 8px; + border-bottom: 2px solid #bdc3c7; + font-size: 1.5em; +} + +.projects-grid { + display: flex; + flex-direction: column; + gap: 15px; +} + +.project-item { + padding: 15px; + background: white; + border: 2px solid #bdc3c7; + border-radius: 6px; + display: flex; + align-items: center; + justify-content: space-between; + transition: all 0.3s ease; +} + +.project-item:hover { + background: #f8f9fa; + border-color: #3498db; + transform: translateY(-2px); + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); +} + +.project-item__content { + flex: 1; + padding-right: 15px; +} + +.project-item__title { + color: #2c3e50; + font-size: 1.2em; + margin-bottom: 5px; + font-family: "Arial", sans-serif; +} + +.project-item__description { + color: #7f8c8d; + margin: 0; + font-size: 0.95em; +} + +.project-item__link { + display: inline-block; + color: white; + background-color: #3498db; + text-decoration: none; + font-weight: bold; + padding: 8px 16px; + border-radius: 4px; + border: 2px solid #2980b9; + transition: all 0.3s ease; + white-space: nowrap; + font-size: 0.9em; +} + +.project-item__link:hover { + background-color: #2980b9; + transform: scale(1.05); +} + +@media (max-width: 768px) { + .container { + margin: 10px; + padding: 15px; + border-width: 2px; + } + + .main__grid { + grid-template-columns: 1fr; + gap: 20px; + } + + .skills { + grid-template-columns: 1fr; + gap: 15px; + } + + .header { + flex-direction: column; + text-align: center; + margin-bottom: 20px; + } + + .header__photo { + margin-right: 0; + margin-bottom: 15px; + width: 120px; + height: 120px; + } + + .header__image { + width: 120px; + height: 120px; + } + + .section { + padding: 15px; + margin-bottom: 20px; + } + + .section__item { + font-size: 14px; + line-height: 1.4; + } + + .qr__image { + width: 120px; + height: 120px; + } + + .contacts__link { + padding: 6px 12px; + font-size: 14px; + } + + .resume__section { + padding: 15px; + margin-bottom: 20px; + } + + .project-item { + flex-direction: column; + align-items: flex-start; + gap: 10px; + } + + .project-item__content { + padding-right: 0; + width: 100%; + } + + .project-item__link { + align-self: flex-end; + width: 100%; + text-align: center; + } +} \ No newline at end of file diff --git a/lab4/lab3.html b/lab4/lab3.html new file mode 100644 index 00000000..d8770f77 --- /dev/null +++ b/lab4/lab3.html @@ -0,0 +1,153 @@ + + + + + + Миндубаев Руслан - Резюме + + + +
+
+
+ Миндубаев Руслан +
+
+

Миндубаев Руслан Наильевич

+

Дата рождения: 25 мая 2006 г.

+

Место учебы: Самарский национальный исследовательский университет имени академика С.П. Королева.

+
+
+ +
+
+
+

Любимые увлечения

+
    +
  • + Плавание + В школьные годы принимал участие в соревнованиях. Сейчас занимаюсь для себя. +
  • +
  • + Дачный отдых + Люблю проводить время в теплое время года на даче. +
  • +
  • + Вождение + Получаю удовольствие от катания на мопедах, самокатах, велосипедах. +
  • +
  • + Отдых с друзьями + Нравится проводить время в кругу своих знакомых и друзей. +
  • +
  • + Компьютерные игры + Раньше проводил довольно много времени в играх. Сейчас захожу довольно редко. +
  • +
  • + Монтаж видео + Нравится создавать контент. +
  • +
  • + Reels и мессенджеры + Я так же как и 90% людей зависим от подобного контента. Стараюсь как можно меньше времени на это тратить. +
  • +
+
+ +
+

Контакты

+
+
+ Email: + ruslanformail@gmail.com +
+
+ Телефон: + +7 (939) 753-03-99 +
+
+ Город: + Самара +
+
+ GitHub: + github.com/ruslan0063 +
+ +
+
QR Code GitHub
+
+ QR код GitHub +
+

Отсканируйте для перехода на GitHub

+
+
+
+
+ +
+

Навыки

+
+
+

Hard-скилы

+
    +
  • Python, C++, C
  • +
  • HTML, CSS
  • +
  • Adobe Photoshop
  • +
  • Linux, Git
  • +
+
+
+

Soft-скилы

+
    +
  • Аналитическое мышление
  • +
  • Работа в команде
  • +
  • Тайм-менеджмент
  • +
  • Способность к быстрому обучению
  • +
+
+
+
+ +
+

О себе

+

+ Я открытый, ответственный, терпеливый. Стараюсь саморазвиваться и узнавать что-то новое. + Ставлю перед собой цели, достигаю их и самосовершенствуюсь. +

+

+ В данный момент учусь в Самарском Университете на втором курсе по специальности ИБАС. + Также занимаюсь активными видами спорта, свободное время провожу в кругу друзей. +

+
+
+

Мои проекты

+
+
+
+

Лабораторная работа №1

+

Первая HTML-страница

+
+ Open +
+
+
+

Лабораторная работа №2

+

Стилизация страницы

+
+ Open +
+
+
+

Лабораторная работа №4

+

Калькулятор

+
+ Open +
+
+
+
+
+ + diff --git a/lab4/lab4.css b/lab4/lab4.css new file mode 100644 index 00000000..1f308be0 --- /dev/null +++ b/lab4/lab4.css @@ -0,0 +1,311 @@ +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + font-family: "Arial", sans-serif; + background: linear-gradient(135deg, #1a365d 0%, #2d3748 100%); + min-height: 100vh; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: center; + padding: 20px; +} + +.main-container { + text-align: center; + color: white; + margin-bottom: 30px; + padding: 20px 0; + width: 100%; +} + +.main-container h1 { + font-family: "Georgia", serif; + font-size: 2.5em; + margin-bottom: 10px; + letter-spacing: 2px; + text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); + color: #e2e8f0; +} + +.main-container h2 { + font-size: 1.2em; + font-weight: normal; + opacity: 0.9; + letter-spacing: 1px; + color: #cbd5e0; +} + +.calculator { + background: #ffffff; + border: 3px solid #2c5282; + border-radius: 20px; + padding: 40px; + box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2); + width: 650px; + margin-top: 20px; + background: linear-gradient(145deg, #ffffff, #f7fafc); +} + +.calculator__title { + font-family: "Georgia", serif; + font-size: 2.8em; + color: #2d3748; + text-align: center; + margin-bottom: 35px; + letter-spacing: 3px; + position: relative; + padding-bottom: 15px; +} + +.calculator__title::after { + content: ''; + position: absolute; + bottom: 0; + left: 25%; + width: 50%; + height: 3px; + background: linear-gradient(to right, transparent, #4fd1c7, transparent); +} + +.calculator__inputs { + display: flex; + gap: 25px; + margin-bottom: 35px; +} + +.calculator__number-inputs { + flex: 1; + display: flex; + flex-direction: column; + gap: 20px; +} + +.calculator__input { + width: 100%; + padding: 18px 20px; + border: 3px solid #2c5282; + border-radius: 10px; + font-size: 1.1em; + background: #f7fafc; + height: 60px; + transition: all 0.3s ease; + font-family: "Arial", sans-serif; + color: #2d3748; +} + +.calculator__input:focus { + outline: none; + border-color: #4fd1c7; + background: white; + box-shadow: 0 0 0 3px rgba(79, 209, 199, 0.2); +} + +.calculator__input::placeholder { + color: #718096; +} + +.calculator__operation { + width: 110px; + display: flex; + flex-direction: column; + justify-content: center; +} + +.calculator__operation-select { + width: 100%; + padding: 18px 12px; + border: 3px solid #2c5282; + border-radius: 10px; + font-size: 1.6em; + text-align: center; + background: #f7fafc; + cursor: pointer; + height: 135px; + font-weight: bold; + transition: all 0.3s ease; + appearance: none; + font-family: "Arial", sans-serif; + color: #2d3748; +} + +.calculator__operation-select:focus { + outline: none; + border-color: #4fd1c7; + box-shadow: 0 0 0 3px rgba(79, 209, 199, 0.2); +} + +.calculator__button { + width: 100%; + padding: 20px; + background: linear-gradient(to right, #2c5282, #2b6cb0); + color: white; + border: none; + border-radius: 10px; + font-size: 1.3em; + font-weight: bold; + cursor: pointer; + margin-bottom: 30px; + transition: all 0.3s ease; + font-family: "Arial", sans-serif; + letter-spacing: 1px; + box-shadow: 0 4px 15px rgba(44, 82, 130, 0.3); +} + +.calculator__button:hover { + background: linear-gradient(to right, #2b6cb0, #3182ce); + transform: translateY(-2px); + box-shadow: 0 6px 20px rgba(44, 82, 130, 0.4); +} + +.calculator__button:active { + transform: translateY(0); +} + +.calculator__result { + background: #f7fafc; + border: 3px solid #2c5282; + border-radius: 10px; + padding: 30px; + text-align: center; + min-height: 120px; + display: flex; + align-items: center; + justify-content: center; + transition: all 0.3s ease; +} + +.calculator__result-value { + font-size: 2.8em; + font-weight: bold; + color: #2c5282; + min-height: 1.2em; + word-wrap: break-word; + overflow-wrap: anywhere; + max-width: 100%; + font-family: "Georgia", serif; +} + +.calculator__error { + color: #c53030; + background: #fed7d7; + border: 2px solid #c53030; + padding: 18px; + border-radius: 10px; + margin-top: 25px; + text-align: center; + display: none; + font-size: 1em; + font-weight: 500; + line-height: 1.5; +} + +.calculator__error--visible { + display: block; + animation: fadeIn 0.3s ease; +} + +@keyframes fadeIn { + from { + opacity: 0; + transform: translateY(-10px); + } + to { + opacity: 1; + transform: translateY(0); + } +} + +@media (max-width: 700px) { + .main-container { + margin-bottom: 20px; + } + + .main-container h1 { + font-size: 2em; + } + + .main-container h2 { + font-size: 1em; + } + + .calculator { + width: 100%; + max-width: 500px; + padding: 30px 25px; + margin-top: 10px; + border-width: 2px; + } + + .calculator__title { + font-size: 2.2em; + margin-bottom: 25px; + } + + .calculator__inputs { + flex-direction: column; + gap: 20px; + } + + .calculator__operation { + width: 100%; + } + + .calculator__operation-select { + height: 80px; + font-size: 1.8em; + border-width: 2px; + } + + .calculator__input { + border-width: 2px; + } + + .calculator__result { + border-width: 2px; + } + + .calculator__result-value { + font-size: 2.2em; + } +} + +@media (max-width: 480px) { + body { + padding: 15px; + } + + .main-container { + margin-bottom: 15px; + } + + .main-container h1 { + font-size: 1.8em; + } + + .calculator { + padding: 25px 20px; + border-radius: 15px; + border-width: 2px; + } + + .calculator__title { + font-size: 1.8em; + margin-bottom: 20px; + } + + .calculator__button { + padding: 18px; + font-size: 1.2em; + } + + .calculator__input, + .calculator__operation-select, + .calculator__result { + border-width: 2px; + } +} \ No newline at end of file diff --git a/lab4/lab4.html b/lab4/lab4.html new file mode 100644 index 00000000..3ac0dfa1 --- /dev/null +++ b/lab4/lab4.html @@ -0,0 +1,45 @@ + + + + + + Lab 4 - Calculator + + + +
+

Лабораторная работа №4

+

Миндубаев Руслан 6212

+
+ +
+

CALCULATOR

+ +
+
+ + +
+ +
+ +
+
+ + + +
+
+
+ +
+
+ + + + diff --git a/lab4/lab4.js b/lab4/lab4.js new file mode 100644 index 00000000..2cdc2bd9 --- /dev/null +++ b/lab4/lab4.js @@ -0,0 +1,66 @@ +document.addEventListener('DOMContentLoaded', function() { + const num1 = document.querySelector('.calculator__input--first'); + const num2 = document.querySelector('.calculator__input--second'); + const operationSelect = document.querySelector('.calculator__operation-select'); + const calculateBtn = document.querySelector('.calculator__button'); + const resultValue = document.querySelector('.calculator__result-value'); + const errorMessage = document.querySelector('.calculator__error'); + + function hideError() { + errorMessage.classList.remove('calculator__error--visible'); + } + + function showError(message) { + errorMessage.textContent = message; + errorMessage.classList.add('calculator__error--visible'); + } + + + function calculate() { + hideError(); + + const a = parseFloat(num1.value); + const b = parseFloat(num2.value); + const operation = operationSelect.value; + + if (isNaN(a) || isNaN(b)) { + showError('Пожалуйста, введите оба числа'); + resultValue.textContent = '—'; + return; + } + + let result; + + switch(operation) { + case 'add': + result = a + b; + break; + case 'subtract': + result = a - b; + break; + case 'multiply': + result = a * b; + break; + case 'divide': + if (b === 0) { + showError('Делить на ноль нельзя'); + resultValue.textContent = '—'; + return; + } + result = a / b; + break; + } + + resultValue.textContent = Number.isInteger(result) ? result : result.toFixed(4); + } + + calculateBtn.addEventListener('click', calculate); + + [num1, num2, operationSelect].forEach(element => { + element.addEventListener('keypress', function(e) { + if (e.key === 'Enter') calculate(); + }); + }); + + num1.focus(); +}); \ No newline at end of file diff --git a/lab4/qr-code.png b/lab4/qr-code.png new file mode 100644 index 00000000..6051a816 Binary files /dev/null and b/lab4/qr-code.png differ diff --git a/lab4/readme.md b/lab4/readme.md new file mode 100644 index 00000000..78cfab32 --- /dev/null +++ b/lab4/readme.md @@ -0,0 +1,6 @@ +# Лабораторная работа 4 +Выполнил: Миндубаев.Р.Н + +Группа: 6212 + +Вариант: 18