Skip to content
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

upt #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Binary file added docs/lab4.pdf
Binary file not shown.
27 changes: 27 additions & 0 deletions projects/checkbox/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<p>Выберите товары</p>

<div>
<input type="checkbox" id="Choice1" name="food" value="120">
<label for="Choice1">Пирог с яблоком - 120р</label>
</div>
<div>
<input type="checkbox" id="Choice2" name="food" value="80">
<label for="Choice2">Шоколадный кекс - 80р</label>
</div>
<div>
<input type="checkbox" id="Choice3" name="food" value="180">
<label for="Choice3">Чискейк - 180р</label>
</div>
<button class="btn">Отправить</button>
<p>Общая стоймость: <span class="result"></span></p>
<script src="main.js"></script>
</body>
</html>
13 changes: 13 additions & 0 deletions projects/checkbox/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
checkBoxes = document.querySelectorAll('[name=food]');
btnElement = document.querySelector('.btn');
result = document.querySelector('.result');

btnElement.addEventListener('click', function(){
total = 0;
for (const checkBox of checkBoxes){
if(checkBox.checked){
total=total + parseInt(checkBox.value)
}
}
result.textContent = `${total} руб.`;
})
21 changes: 21 additions & 0 deletions projects/checkbox/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
*{

font-family: "Oswald", sans-serif;

}

header{
width: 100%;
height: 110px;
display: flex;
}
.coffeehouse{

font-size: 36px;
font-weight: 500px;
line-height: 53.35px;
margin: auto;



}
20 changes: 20 additions & 0 deletions projects/form/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">



</head>
<body>

<p>Имя: <input type="text" name="inputName" ></p>
<p>Фамилия: <input type="text" name="inputSurname" ></p>
<button id="button">Отправить</button>
<p>Ответ: <span id="result"></span></p>
<script src="main.js"></script>
</body>
</html>
8 changes: 8 additions & 0 deletions projects/form/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
btn = document.querySelector("#button")
result= document.querySelector("#result")
inputName = document.querySelector("[name=inputName]")
inputSurname = document.querySelector("[name=inputSurname]")

btn.addEventListener("click",function(){
result.textContent = `Здравствуйте, ${inputName.value} ${inputSurname.value}`;
})
Empty file added projects/form/style.css
Empty file.
67 changes: 67 additions & 0 deletions projects/store/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>Coffee order</title>
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/css2?family=Oswald:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
</head>

<body>
<header class="header">
<h1>COFFEE HOUSE</h1>
</header>
<main class="main">
<div class="person">
<input class="fio" type="text" name="lastname" id="lastname" placeholder="Введите Фамилию">
<input class="fio" type="text" name="name" id="name" placeholder="Введите Имя">
</div>
<div class="goods">
<div class="goods_column">
<div class="goods_row">
<input type="checkbox" class="checkbox" name="goods" id="checkbox1" data-goods="expresso" value="80">
<label for="checkbox1">Эспрессо 80р.</label>
<input type="number" name="goodsCount" id="expresso" value="0" min="0">
</div>
<div class="goods_row">
<input type="checkbox" class="checkbox" name="goods" id="checkbox2" data-goods="americano" value="110">
<label for="checkbox2">Американо 110 р.</label>
<input type="number" name="goodsCount" id="americano" value="0" min="0">
</div>
<div class="goods_row">
<input type="checkbox" class="checkbox" name="goods" id="checkbox3" data-goods="latte" value="120">
<label for="checkbox3">Латте 120 р.</label>
<input type="number" name="goodsCount" id="latte" value="0" min="0">
</div>
<div class="goods_row">
<input type="checkbox" class="checkbox" name="goods" id="checkbox4" data-goods="capuchino" value="90">
<label for="checkbox4">Капучино 90 р.</label>
<input type="number" name="goodsCount" id="capuchino" value="0" min="0">
</div>
</div>
<div class="goods_column">
<div class="goods_row">
<input type="checkbox" class="checkbox" name="goods" id="checkbox5" data-goods="chocolate_muffin" value="80">
<label for="checkbox5">Шоколадный кекс 80 р.</label>
<input type="number" name="goodsCount" id="chocolate_muffin" value="0" min="0">
</div>
<div class="goods_row">
<input type="checkbox" class="checkbox" name="goods" id="checkbox6" data-goods="blueberry_muffin" value="90">
<label for="checkbox6">Черничный кекс 90 р.</label>
<input type="number" name="goodsCount" id="blueberry_muffin" value="0" min="0">
</div>
<div class="goods_row">
<input type="checkbox" class="checkbox" name="goods" id="checkbox7" data-goods="apple_tart" value="100">
<label for="checkbox7">Яблочный тарт 100 р.</label>
<input type="number" name="goodsCount" id="apple_tart" value="0" min="0">
</div>
</div>
</div>
<p>Итого: <span>0</span> р.</p>
<button class="btn">ОФОРМИТЬ ЗАКАЗ</button>
</main>
<script src="main.js"></script>
</body>

</html>
Empty file added projects/store/main.js
Empty file.
202 changes: 202 additions & 0 deletions projects/store/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
* {
margin: 0;
padding: 0;
}

body {
font-family: "Oswald", sans-serif;
height: 100%;
}

.header {
height: 110px;
width: 100%;
background-color: #fff;
display: flex;
}

h1 {
margin: auto;
font-style: normal;
font-weight: 500;
font-size: 36px;
line-height: 53px;
text-transform: uppercase;
color: #000000;
}

.main {
background: #817070;
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
}

.person {

display: flex;
flex-direction: row;
width: 70%;
min-width: 650px;
justify-content: space-evenly;
margin: 50px 0;
}

.fio {
font-family: "Oswald", sans-serif;
box-sizing: border-box;
background: #817070;
border: 3px solid #ffffff;
box-shadow: none;
width: 40%;
max-width: 300px;
height: 55px;
color: white;
font-style: normal;
font-weight: 300;
font-size: 20px;
line-height: 30px;
outline: none;
text-align: center;
}

.fio:focus {
border: 3px solid #ffffff;
box-shadow: none;
cursor: pointer;
}

input:focus::placeholder {
color: transparent;
}

.fio:hover {
cursor: pointer;
}

.fio::placeholder {
font-family: "Oswald", sans-serif;
font-style: normal;
font-weight: 300;
font-size: 20px;
line-height: 30px;
text-align: center;
color: #ffffff;
}

.goods {
display: flex;
justify-content: space-around;
width: 60%;
min-width: 650px;
}

.goods_column {
display: flex;
flex-direction: column;
width: 37%;
background: #817070;
}

.goods_row {
margin-bottom: 20px;
display: flex;
align-items: center;
}

label {
font-size: 20px;
line-height: 30px;
color: white;
min-width: 180px;
margin-right: 8%;
display: inline-block;
}

input[name="goodsCount"] {
font-family: "Oswald", sans-serif;
background: #817070;
border: 3px solid #ffffff;
box-shadow: none;
max-width: 70px;
height: 50px;
color: white;
font-style: normal;
font-weight: 300;
font-size: 20px;
line-height: 30px;
outline: none;
text-align: center;
display: inline-block;
margin-left: auto;
margin-right: 0;
cursor: pointer;
}

input[name="goodsCount"]:hover {
cursor: pointer;
}

.checkbox {
position: absolute;
z-index: -1;
opacity: 0;
}

.checkbox + label {
position: relative;
padding: 0 0 0 40px;
cursor: pointer;
}

.checkbox + label:before {
content: "";
position: absolute;
top: 2px;
left: 0;
width: 26px;
height: 26px;
background: #ebe2e2;
}

.checkbox + label:after {
content: "";
position: absolute;
top: 6px;
left: 4px;
width: 18px;
height: 18px;
background: #817070;
}

.checkbox:checked + label:after {
background: #6a4646;
}

p {
font-size: 25px;
line-height: 30px;
color: white;
margin: 39px auto 26px;
}

.btn {
font-family: "Oswald", sans-serif;
text-transform: uppercase;
width: 190px;
height: 55px;
background-color: white;
font-size: 20px;
line-height: 30px;
color: #817070;
border: 3px solid #ffffff;
outline: none;
margin-bottom: 35px;
}

.btn:hover {
color: #fff;
background: #817070;
cursor: pointer;
}