Skip to content
Open

Hw2 #184

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
53 changes: 43 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,49 @@
<!DOCTYPE html>
<html>
<head lang="uk">
<html lang="uk">
<head>
<meta charset="UTF-8">
<title>My Page</title>


<link rel="stylesheet" type="text/css" href="main.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Homework</title>
<link rel="stylesheet" href="main.css">
<script src="script.js" defer></script>
</head>
<body>
<span class="product-item">
Apple
<span class="amount">4</span>
</span>
<header>
<h1>Кошик</h1>
</header>

<main>
<section class="left-side">

<fieldset>
<legend>Каталог товарів</legend>
<form action="/search" method="GET" id="add-field">
<label for="q">Назва товару</label>
<input type="text" id="q" name="q" required>
<button type="submit">Додати</button>
</form>
</fieldset>

<ul>

</ul>

</section>

<section class="right-side">

<h2>Залишилося</h2>
<hr>
<div class="left-items-section" id="left-items">
</div>

<h2>Куплено</h2>
<hr>
<div class="left-items-section" id="bought-items">
</div>

</section>
<div class="badge">Buy List</div>
</main>
</body>
</html>
276 changes: 263 additions & 13 deletions main.css
Original file line number Diff line number Diff line change
@@ -1,17 +1,267 @@
.product-item {
background-color: gray;
display: inline-block;
height: 25px;
padding: 5px;
border-radius: 5px;
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}

body {
background-color: lightgrey;
font-family: Arial, sans-serif;
padding: 20px;
}

header {
display: none;
}

main {
display: flex;
gap: 40px;
max-width: 900px;
margin: 0 auto;
align-items: flex-start;
}

.katalog {
display: flex;
align-items: center;
padding: 15px 20px;
border-bottom: 1px solid #c2c2c2;
}

.katalog:last-child {
border-bottom: none;
}

.item-amount {
display: flex;
align-items: center;
justify-content: center;
gap: 5px;
width: 30%;
}

.item-amount button {
width: 30px;
height: 30px;
border-radius: 50%;
border: none;
color: white;
display: flex;
justify-content: center;
align-items: center;
}

.item-name {
width: 40%;
}


.left-side {
width: 65%;
background-color: white;
border-radius: 4px;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.right-side {
width: 35%;
background-color: white;
border-radius: 4px;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

fieldset {
border: none;
padding: 15px 20px;
}

legend, label {
display: none;
}

form {
display: flex;
}

form input {
flex-grow: 1;
padding: 10px;
border: 1px solid lightgrey;
border-radius: 3px 0 0 3px;
}


form button {
background-color:rgb(42, 86, 182);
color: white;
padding: 10px 20px;
border: none;
border-radius: 0 3px 3px 0;
font-weight: bold;
}

ul {
list-style: none;
}

.minus {
background-color: red;
}

.plus {
background-color: rgb(0, 194, 0);
}

.amount {
background-color: yellow;
border-radius: 10px;

display: inline-block;
height: 20px;
width: 20px;
text-align: center;
background-color: rgb(207, 207, 207);
padding: 5px 10px;
border-radius: 4px;
}

.item-functions {
display: flex;
justify-content: flex-end;
gap: 5px;
width: 30%;
}

.item-functions button {
border: none;
padding: 5px 10px;
border-radius: 4px;
}

.status {
background-color: lightgrey;
border: 1px solid white;
}

.delete {
background-color: red;
color: white;
}

.right-side h2 {
padding: 15px 20px;
font-size: 20px;
}

.right-side hr {
border: none;
border-bottom: 1px solid #d4d4d4;
}

h2:nth-of-type(2) ~ .left-items-section .left-item {
text-decoration: line-through;
}

.left-items-section {
padding: 15px 20px;
}


@media (max-width: 500px) {
main {
flex-direction: column;
}
.left-side, .right-side {
width: 100%;
}
}

.left-item {
background-color: #d4d4d4;
display: inline-block;
height: 25px;
padding: 3px 5px;
border-radius: 5px;
margin-right: 5px;
margin-bottom: 5px;
}

.left-item-amount {
background-color:orange;
color: white;
border-radius: 10px;
display: inline-block;
height: 20px;
width: 20px;
text-align: center;
line-height: 20px;
}

.badge {
background-color: purple;
position: fixed;
bottom: -30px;
left: 0;
color: white;
padding: 15px 20px;
border-radius: 15px 15px 0 0;
font-weight: bold;
font-size: 24px;
display: flex;
flex-direction: column;
align-items: center;
transition: all 0.5s;
z-index: 100;
}

.badge::after {
content: "Created by: Damir Shakhin-Krupchan";
font-size: 14px;
margin-top: 10px;
opacity: 0;
}

.badge:hover {
bottom: 0;
background-color: #5d0c9b;
}

.badge:hover::after {
opacity: 1;
}

[data-tooltip] {
position: relative;
}

[data-tooltip]::before {
content: attr(data-tooltip);
position: absolute;
bottom: 130%;
left: 50%;
transform: translateX(-50%) scale(0.5);
transform-origin: bottom center;
background-color: #5e1f8a;
color: #ffffff;
padding: 5px;
border-radius: 4px;
font-size: 12px;
white-space: nowrap;
opacity: 0;
visibility: hidden;
transition: all 0.5s ease;
}

[data-tooltip]:hover::before {
opacity: 1;
visibility: visible;
transform: translateX(-50%) scale(1);
}

@media print {
.badge {
background-color: white !important;
color: black !important;
border: 2px solid purple;
font-size: 0;
bottom: 0;
}
.badge::after {
font-size: 24px;
opacity: 1;
}
}
Loading