-
Notifications
You must be signed in to change notification settings - Fork 98
6214 Михайлов ВН Лаб. 4 #423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f770902
8d14456
2375775
7b7d562
495af90
d14eead
38af520
7644b51
9aa12f0
5409448
f64ddf0
2155dfa
8d17e1d
f7200eb
519f20c
cc61350
ed2ee90
c64ef5a
2b72103
0ff29b5
01d7de2
9032748
5f60762
483498a
8c9a5ef
b0c9b18
eef33b6
6fe8cd9
88b8efd
e92d07d
f39192a
ff0751f
7ca5495
a5172b1
2fbc35d
89566f8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="ru"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>Калькулятор - Лабораторная работа 4</title> | ||
| <link rel="stylesheet" href="style.css" /> | ||
| </head> | ||
| <body> | ||
| <div class="container"> | ||
| <header class="header"> | ||
| <h1 class="header__title">Калькулятор</h1> | ||
| <p class="header__subtitle">Лабораторная работа 4</p> | ||
| </header> | ||
|
|
||
| <div class="calculator-container"> | ||
| <div class="calculator"> | ||
| <div class="calculator__input-group"> | ||
| <div class="calculator__input-field"> | ||
| <label for="num1" class="calculator__label">Первое число:</label> | ||
| <input type="number" id="num1" class="calculator__input" placeholder="Введите число" /> | ||
| </div> | ||
| <div class="calculator__input-field"> | ||
| <label for="num2" class="calculator__label">Второе число:</label> | ||
| <input type="number" id="num2" class="calculator__input" placeholder="Введите число" /> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="calculator__operation-group"> | ||
| <label for="operation" class="calculator__label">Операция:</label> | ||
| <select id="operation" class="calculator__select"> | ||
| <option value="add">Сложение (+)</option> | ||
| <option value="subtract">Вычитание (-)</option> | ||
| <option value="multiply">Умножение (×)</option> | ||
| <option value="divide">Деление (÷)</option> | ||
| </select> | ||
| </div> | ||
|
|
||
| <button class="calculator__calculate-btn" id="calculate">Вычислить</button> | ||
|
|
||
| <div class="calculator__result-container"> | ||
| <div class="calculator__result-label">Результат:</div> | ||
| <div class="calculator__result" id="result">-</div> | ||
| <div class="calculator__error" id="error"></div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <script src="script.js"></script> | ||
| </body> | ||
| </html> |
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Нет ссылок на 3 других лабы
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Я не понимаю, как их нужно добавить
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Добавить блок в резюме "Мои проекты" и там что-то типо <div class="my-projects">
<a class="my-projects__item" href="ссылка на лабу">Лабораторная работ 1</a>
<a class="my-projects__item" href="ссылка на лабу">Лабораторная работ 2</a>
<a class="my-projects__item" href="ссылка на лабу">Лабораторная работ 4</a>
</div>
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Спасибо большое, но все также непонятно какие именно ссылки на лабы нужны
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. не пойму откуда их брать |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="ru"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>Резюме студента</title> | ||
| <link rel="stylesheet" href="style.css" /> | ||
| </head> | ||
| <body class="page"> | ||
| <div class="container"> | ||
| <header class="header"> | ||
| <img src="img.jpg" alt="Фото студента" class="header__photo" /> | ||
| <h1 class="header__title">Михайлов Виктор Николаевич</h1> | ||
| <p class="header__subtitle">Студент 2-го курса направления ИБАС</p> | ||
| </header> | ||
|
|
||
| <div class="content"> | ||
| <aside class="sidebar"> | ||
| <div class="info-card"> | ||
| <h3 class="info-card__title">Личная информация</h3> | ||
| <div class="info-card__item"> | ||
| <span class="item__label">Дата рождения</span> | ||
| <span class="item__value">17.09.2006</span> | ||
| </div> | ||
|
|
||
| <div class="info-card__item"> | ||
| <span class="item__label">Контактная информация</span> | ||
| <span class="item__value"> | ||
| Email: <a href="mailto:erwinrommel1313@gmail.com" class="contact-link">erwinrommel1313@gmail.com</a> | ||
| </span> | ||
| <span class="item__value"> | ||
| Telegram: <a href="https://t.me/erwinrommel1313 " class="contact-link">@erwinrommel1313</a> | ||
| </span> | ||
| </div> | ||
|
|
||
| <div class="info-card__item"> | ||
| <span class="item__label">GitHub</span> | ||
| <a | ||
| href="https://github.com/R0mmel2006 " | ||
| class="link link--github" | ||
| target="_blank" | ||
| >Посмотреть профиль</a | ||
| > | ||
| </div> | ||
| </div> | ||
| </aside> | ||
|
|
||
| <main class="main"> | ||
| <section class="section section_about"> | ||
| <h2 class="section__title">О себе</h2> | ||
| <div class="about"> | ||
| <p class="about__text"> | ||
| Я студент 2-го курса ИБACа. | ||
| Не боюсь ничего, потому что неудачи закаляют характер. | ||
| Упорство и умение взаимодействовать с людьми помогает мне добиваться поставленных целей. | ||
| В свободное время я занимаюсь боксом и играю в танки. | ||
| </p> | ||
| </div> | ||
| </section> | ||
|
|
||
| <section class="section"> | ||
| <h2 class="section__title">Навыки</h2> | ||
| <div class="skills"> | ||
| <div class="skills_category"> | ||
| <h3 class="category__subtitle">Hard-skills</h3> | ||
| <div class="category__list"> | ||
| <span class="list__tag">HTML/CSS</span> | ||
| <span class="list__tag">Python</span> | ||
| <span class="list__tag">С++</span> | ||
| <span class="list__tag">С</span> | ||
| <span class="list__tag">Git</span> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="skills_category"> | ||
| <h3 class="category__subtitle">Soft-skills</h3> | ||
| <div class="category__list"> | ||
| <span class="list__tag">Целеустремленность</span> | ||
| <span class="list__tag">Отвественность</span> | ||
| <span class="list__tag">Дисциплинированность</span> | ||
| <span class="list__tag">Амбициозность</span> | ||
| <span class="list__tag">Коммуникабельность</span> | ||
| <span class="list__tag">Концентрация</span> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </section> | ||
| </main> | ||
| </div> | ||
| </div> | ||
| </body> | ||
| </html> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="ru"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| <title>Лабораторная работа 2</title> | ||
| <link rel="stylesheet" href="style_lab2.css"> | ||
| </head> | ||
| <body> | ||
| <h1>Лабораторная работа 2. Вариант 15</h1> | ||
|
|
||
| <section class="list"> | ||
| <h2 class="list_title">Задание 1. Популярные языки программирования:</h2> | ||
| <ul class="list_items"> | ||
| <li class="items__item">Python</li> | ||
| <li class="items__item">JavaScript</li> | ||
| <li class="items__item">Java</li> | ||
| <li class="items__item">C++</li> | ||
| <li class="items__item">Go</li> | ||
| </ul> | ||
| </section> | ||
|
|
||
| <section class="family"> | ||
| <h2>Задание 2. Родители и дети.</h2> | ||
|
|
||
| <div class="parent parent--1"> | ||
| <h3 class="parent__title">Parent 1</h3> | ||
| <div class="parent--1__child">child 1</div> | ||
| <div class="parent--1__child">child 2</div> | ||
| <div class="parent--1__child">child 3</div> | ||
| <div class="parent--1__child">child 4</div> | ||
| </div> | ||
|
|
||
| <div class="parent parent--2"> | ||
| <h3 class="parent__title">Parent 2</h3> | ||
| <div class="parent--2__child">child 1</div> | ||
| <div class="parent--2__child">child 2</div> | ||
| </div> | ||
|
|
||
| <div class="parent parent--3"> | ||
| <h3 class="parent__title">Parent 3</h3> | ||
| <div class="parent--3__child">child 1</div> | ||
| <div class="parent--3__child">child 2</div> | ||
| </div> | ||
|
|
||
| <div class="parent parent--3"> | ||
| <h3 class="parent__title">Parent 3</h3> | ||
| <div class="parent--3__child">child 1</div> | ||
| <div class="parent--3__child">child 2</div> | ||
| <div class="parent--2__child">child 2 (гость)</div> | ||
| </div> | ||
| </section> | ||
|
|
||
| <section class="languages"> | ||
| <h2>Задание 3. Тест из приложения.</h2> | ||
| <p class="languages_text"> | ||
| Язык программирования — это инструменты, с помощью которых разработчики создают программное обеспечение, веб-приложения, игры, алгоритмы и многое другое. | ||
| Каждый язык имеет свои особенности, синтаксис и сферу применения. | ||
| Ниже представлены некоторые из наиболее известных языков: | ||
| </p> | ||
| <ul class="languages_list"> | ||
| <li class="list_item"> | ||
| <a href="https://ru.wikipedia.org/wiki/Python" class="item__link">Python</a> — высокоуровневый язык с простым синтаксисом, популярный в Data Science, веб-разработке и автоматизации. | ||
| </li> | ||
| <li class="list_item"> | ||
| <a href="https://ru.wikipedia.org/wiki/JavaScript" class="item__link">JavaScript</a> — основной язык для фронтенд-разработки, работает в браузерах и на сервере (Node.js). | ||
| </li> | ||
| <li class="list_item"> | ||
| <a href="https://ru.wikipedia.org/wiki/Java" class="item__link">Java</a> — объектно-ориентированный язык, широко используется в корпоративных приложениях и Android-разработке. | ||
| </li> | ||
| <li class="list_item"> | ||
| <a href="https://ru.wikipedia.org/wiki/C%2B%2B" class="item__link">C++</a> — мощный язык для системного программирования, игр и высокопроизводительных приложений. | ||
| </li> | ||
| <li class="list_item"> | ||
| <a href="https://ru.wikipedia.org/wiki/C_Sharp" class="item__link">C#</a> — язык от Microsoft, применяется в разработке под Windows, играх и веб-приложениях. | ||
| </li> | ||
| <li class="list_item"> | ||
| <a href="https://ru.wikipedia.org/wiki/Go_(язык_программирования)" class="item__link">Go (Golang)</a> — созданный Google, язык для высоконагруженных сетевых сервисов и облачных технологий. | ||
| </li> | ||
| <li class="list_item"> | ||
| <a href="https://ru.wikipedia.org/wiki/Ruby" class="item__link">Ruby</a> — известен благодаря фреймворку Ruby on Rails для веб-разработки. | ||
| </li> | ||
| <li class="list_item"> | ||
| <a href="https://ru.wikipedia.org/wiki/Swift_(язык_программирования)" class="item__link">Swift</a> — язык Apple для разработки под iOS и macOS. | ||
| </li> | ||
| <li class="list_item"> | ||
| <a href="https://ru.wikipedia.org/wiki/Kotlin" class="item__link">Kotlin</a> — современный язык, официально поддерживаемый для Android-разработки. | ||
| </li> | ||
| <li class="list_item"> | ||
| <a href="https://ru.wikipedia.org/wiki/Rust_(язык_программирования)" class="item__link">Rust</a> — язык системного программирования с акцентом на безопасность и производительность. | ||
| </li> | ||
| </ul> | ||
| <p class="languages_text"> | ||
| Это лишь малая часть из множества существующих языков, и выбор зависит от задач, которые нужно решить. | ||
| </p> | ||
| </section> | ||
| </body> | ||
| </html> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| document.addEventListener('DOMContentLoaded', function () { | ||
| const num1Input = document.getElementById('num1'); | ||
| const num2Input = document.getElementById('num2'); | ||
| const operationSelect = document.getElementById('operation'); | ||
| const calculateBtn = document.getElementById('calculate'); | ||
| const resultDiv = document.getElementById('result'); | ||
| const errorDiv = document.getElementById('error'); | ||
|
Comment on lines
+2
to
+7
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. А если какой-то элемент не найден? |
||
|
|
||
| if (!num1Input || !num2Input || !operationSelect || !calculateBtn || !resultDiv || !errorDiv) { | ||
| return; | ||
| } | ||
|
|
||
| calculateBtn.addEventListener('click', handleCalculation); | ||
|
|
||
| function handleCalculation() { | ||
| clearDisplay(); | ||
|
|
||
| const num1 = parseFloat(num1Input.value); | ||
| const num2 = parseFloat(num2Input.value); | ||
| const operation = operationSelect.value; | ||
|
|
||
| if (!validateInput(num1, num2)) { | ||
| displayError('Введите корректные числа в оба поля'); | ||
| return; | ||
| } | ||
|
|
||
| const calculationResult = performCalculation(num1, num2, operation); | ||
|
|
||
| if (calculationResult.success) { | ||
| displayResult(calculationResult.value); | ||
| } else { | ||
| displayError(calculationResult.error); | ||
| } | ||
| } | ||
|
|
||
| function clearDisplay() { | ||
| errorDiv.textContent = ''; | ||
| resultDiv.textContent = '-'; | ||
| } | ||
|
|
||
| function validateInput(num1, num2) { | ||
| return !isNaN(num1) && !isNaN(num2); | ||
| } | ||
|
|
||
| function performCalculation(num1, num2, operation) { | ||
| let result; | ||
|
|
||
| switch (operation) { | ||
| case 'add': | ||
| result = num1 + num2; | ||
| break; | ||
| case 'subtract': | ||
| result = num1 - num2; | ||
| break; | ||
| case 'multiply': | ||
| result = num1 * num2; | ||
| break; | ||
| case 'divide': | ||
| if (num2 === 0) { | ||
| return { | ||
| success: false, | ||
| error: 'Деление на ноль невозможно' | ||
| }; | ||
| } | ||
| result = num1 / num2; | ||
| break; | ||
| default: | ||
| return { | ||
| success: false, | ||
| error: 'Неизвестная операция' | ||
| }; | ||
| } | ||
|
|
||
| return { | ||
| success: true, | ||
| value: result | ||
| }; | ||
| } | ||
|
|
||
| function displayResult(result) { | ||
| const roundedResult = Math.round(result * 1e10) / 1e10; | ||
| resultDiv.textContent = parseFloat(roundedResult.toFixed(10)); | ||
| } | ||
|
|
||
| function displayError(errorMessage) { | ||
| errorDiv.textContent = errorMessage; | ||
| } | ||
| }); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А где БЭМ?