Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 59 additions & 0 deletions lab/calculator.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
body {
font-family: Arial, sans-serif;
background: #f6e6ee;
text-align: center;
padding-top: 50px;
}

.calculator__title {
margin: 0 0 20px;
}

.calculator {
background: #ffffff;
padding: 25px;
width: 320px;
margin: 0 auto;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.calculator__input,
.calculator__select,
.calculator__button {
width: 100%;
margin-bottom: 12px;
padding: 10px;
font-size: 16px;

border: 1px solid #cccccc;
border-radius: 6px;
box-sizing: border-box;
}

.calculator__input:focus,
.calculator__select:focus {
outline: none;
border-color: #ed92bf;
}

.calculator__button {
background: #ed92bf;
color: white;
border: none;
cursor: pointer;
}

.calculator__button:hover {
background: #da7abc;
}

.calculator__result {
margin-top: 10px;
font-weight: bold;
}
.calculator__error {
color: red;
font-weight: 500;
margin-top: 8px;
}
32 changes: 32 additions & 0 deletions lab/calculator.html
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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,32 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>Калькулятор</title>
<link rel="stylesheet" href="calculator.css">
</head>
<body>

<h1 class="calculator__title">Простой калькулятор</h1>

<div class="calculator">
<input class="calculator__input" type="number" id="num1" placeholder="Первое число">

<select class="calculator__select" id="operation">
<option value="+">+</option>
<option value="-">−</option>
<option value="*">×</option>
<option value="/">÷</option>
</select>

<input class="calculator__input" type="number" id="num2" placeholder="Второе число">

<button class="calculator__button" type="button" onclick="calculate()">Вычислить</button>

<p class="calculator__result" id="result">Результат:</p>
<p class="calculator__error" id="error"></p>
</div>

<script src="calculator.js"></script>
</body>
</html>
53 changes: 53 additions & 0 deletions lab/calculator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
function calculate() {
const num1El = document.getElementById("num1");
const num2El = document.getElementById("num2");
const operationEl = document.getElementById("operation");
const resultEl = document.getElementById("result");
const errorEl = document.getElementById("error");

if (!num1El || !num2El || !operationEl || !resultEl || !errorEl) {
return;
}

errorEl.textContent = "";
resultEl.textContent = "Результат:";

if (num1El.value === "" || num2El.value === "") {
errorEl.textContent = "Ошибка: заполните оба поля";
return;
}

const num1 = Number(num1El.value);
const num2 = Number(num2El.value);
const operation = operationEl.value;

let result;

switch (operation) {
case "+":
result = num1 + num2;
break;

case "-":
result = num1 - num2;
break;

case "*":
result = num1 * num2;
break;

case "/":
if (num2 === 0) {
errorEl.textContent = "Ошибка: деление на ноль";
return;
}
result = num1 / num2;
break;

default:
errorEl.textContent = "Неизвестная операция";
return;
}

resultEl.textContent = "Результат: " + result;
}
Binary file added lab/funny cat.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 78 additions & 0 deletions lab/l1b.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
:root{
--v6_text: #118905;
--v6_bg: #768A3A;
}

*{ box-sizing: border-box; }
body{ margin:0; font-family: Arial, sans-serif; line-height:1.6; }
.page{ max-width:980px; margin:0 auto; padding:24px; }
.task__title{ margin:24px 0 12px; font-size:20px; }


.text{
background: var(--v6_bg);
color: var(--v6_text);
text-align: left;
padding: 16px 20px;
max-width: 820px;
border: 3px solid #000;
}
.text__p{ margin:0 0 12px; }
.text__p:last-child{ margin-bottom:0; }

.overlay{
position: relative;
display: inline-block;
width: 500px;
}

.overlay__img{
display: block;
max-width: 100%;
height: auto;
}

.overlay__img--top{
position: absolute;
top: 50%; left: 50%;
transform: translate(-50%, -50%);
width: 200px;
z-index: 2;
}

.traffic-light{
width: 120px;
padding: 12px 0;
background:#222;
margin:12px 0;
display:flex;
flex-direction: column;
align-items:center;
gap:12px;
}
.traffic-light__lamp{
width:64px; height:64px;
border-radius:50%;
border:4px solid #111;
}
.traffic-light__lamp--red{ background:#d62d20; }
.traffic-light__lamp--yellow{ background:#ffa700; }
.traffic-light__lamp--green{ background:#008744; }

.maze {
display: grid;
grid-template-columns: repeat(3, 80px);
grid-template-rows: repeat(3, 80px);
gap: 0;
margin: 12px 0;
}
.maze__cell {
width: 80px; height: 80px;
border: 3px solid black;
}
.cut-t { border-top: none; }
.cut-r { border-right: none; }
.cut-b { border-bottom: none; }
.cut-l { border-left: none; }

.path { background: #fca3d2; }
94 changes: 94 additions & 0 deletions lab/lab2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>Лабораторная работа 2. Вариант 6</title>
<link rel="stylesheet" href="lb2.css">
</head>
<h2 class="task__title">Задание 1</h2>
<h2>Популярные стриминговые сервисы</h2>
<ul class="streams">
<li class="streams__item">Netflix</li>
<li class="streams__item">YouTube Premium</li>
<li class="streams__item">Spotify</li>
<li class="streams__item">Disney+</li>
<li class="streams__item">Twitch</li>
</ul>

<h2 class="task__title">Задание 2</h2>
<div class="family">
<div class="family__parent-1">
<p class="family__parent-1__title"><b>Parent 1</b></p>
<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>

<div class="family__parent-3">
<p class="family__parent-3__title"><b>Parent 3</b></p>
<div class="parent-3__child">child 1</div>
<div class="parent-3__child">child 2</div>
</div>

<div class="family__parent-2">
<p class="family__parent-2__title"><b>Parent 2</b></p>
<div class="parent-2__child">child 1</div>
<div class="parent-2__child">child 2</div>
</div>

<div class="family__parent-3 parent-3-green">
<p class="parent__title"><b>Parent 3</b></p>
<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>
</div>

<h2 class="task__title">Задание 3</h2>
<section class="languages">
<h2 class="languages__title">Языки программирования</h2>

<p class="languages__intro">
Языки программирования — это инструменты, с помощью которых разработчики создают программное обеспечение,
веб-приложения, игры, алгоритмы и многое другое. Каждый язык имеет свои особенности, синтаксис и сферу применения.
Ниже представлены некоторые из наиболее известных языков:
</p>

<ul class="languages__lang-list">
<li class="lang-list__item">
<a class="item__link" href="#">Python</a> – высокоуровневый язык с простым синтаксисом, популярный в Data Science, веб-разработке и автоматизации.
</li>
<li class="lang-list__item">
<a class="item__link" href="#">JavaScript</a> – основной язык для фронтенд-разработки, работает в браузерах и на сервере (Node.js).
</li>
<li class="lang-list__item">
<a class="item__link" href="#">Java</a> – объектно-ориентированный язык, широко используется в корпоративных приложениях и Android-разработке.
</li>
<li class="lang-list__item">
<a class="item__link" href="#">C++</a> – мощный язык для системного программирования, игр и высокопроизводительных приложений.
</li>
<li class="lang-list__item">
<a class="item__link" href="#">C#</a> – язык от Microsoft, применяется в разработке под Windows, играх (Unity) и веб-приложениях.
</li>
<li class="lang-list__item">
<a class="item__link" href="#">Go (Golang)</a> – созданный Google, язык для высоконагруженных сетевых сервисов и облачных технологий.
</li>
<li class="lang-list__item">
<a class="item__link" href="#">Ruby</a> – известен благодаря фреймворку Ruby on Rails для веб-разработки.
</li>
<li class="lang-list__item">
<a class="item__link" href="#">Swift</a> – язык Apple для разработки под iOS и macOS.
</li>
<li class="lang-list__item">
<a class="item__link" href="#">Kotlin</a> – современный язык, официально поддерживаемый для Android-разработки.
</li>
<li class="lang-list__item">
<a class="item__link" href="#">Rust</a> – язык системного программирования с акцентом на безопасность и производительность.
</li>
</ul>
<p class="languages__note">
Это лишь малая часть из множества существующих языков, и выбор зависит от задач, которые нужно решить.
</p>
</section>
</body>
</html>
Loading