Skip to content
Open

dz 2 #200

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


<link rel="stylesheet" type="text/css" href="main.css" />
<title>Buy List</title>
<link rel="stylesheet" href="main.css">
</head>
<body>
<span class="product-item">
Apple
<span class="amount">4</span>
</span>

<div class="container">
<div class="left-column">
<div class="add-form">
<input type="text" id="add-input" placeholder="Назва товару">
<button id="add-btn" data-tooltip="Додати новий товар">Додати</button>
</div>

<div id="items-list"></div>
</div>

<div class="right-column">
<div class="stat-box">
<h2>Залишилося</h2>
<div id="left-to-buy-list"></div>
</div>

<div class="stat-box">
<h2>Куплено</h2>
<div id="bought-list"></div>
</div>
</div>
</div>

<div class="badge">
<div class="badge-title">Buy List</div>
<div class="badge-author">Created by:<br>Пожаров Костянтин</div>
</div>

<script src="script.js"></script>
</body>
</html>
252 changes: 236 additions & 16 deletions main.css
Original file line number Diff line number Diff line change
@@ -1,17 +1,237 @@
.product-item {
background-color: gray;
display: inline-block;
height: 25px;
padding: 5px;
border-radius: 5px;
}

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

display: inline-block;
height: 20px;
width: 20px;
text-align: center;
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: Arial, sans-serif;
}

body {
background-color: #d1d5db;
padding: 20px;
}

.container {
display: flex;
width: 900px;
margin: 0 auto;
}

.left-column {
width: 600px;
background-color: white;
border-radius: 5px;
margin-right: 20px;
}

.right-column {
width: 280px;
}

@media (max-width: 650px) {
.container {
display: block;
width: 100%;
}
.left-column {
width: 100%;
margin-right: 0;
margin-bottom: 20px;
}
.right-column {
width: 100%;
}
}

.add-form {
display: flex;
padding: 15px;
border-bottom: 1px solid #ccc;
}

.add-form input {
width: 80%;
padding: 10px;
border: 1px solid #ccc;
}

.add-form button {
width: 20%;
background-color: #3085d6;
color: white;
border: none;
cursor: pointer;
}

.item {
display: flex;
align-items: center;
padding: 15px;
border-bottom: 1px solid #ccc;
}

.item-name {
width: 40%;
font-size: 16px;
}

.bought-text {
text-decoration: line-through;
}

.item-controls {
display: flex;
width: 30%;
}

.btn-circle {
width: 30px;
height: 30px;
border-radius: 50%;
border: none;
color: white;
cursor: pointer;
}

.btn-minus { background-color: #d33; }
.btn-plus { background-color: #28a745; }

.number {
background-color: #eee;
padding: 5px 15px;
margin: 0 5px;
border-radius: 5px;
}

.btn-status {
padding: 5px 10px;
border: 1px solid #ccc;
cursor: pointer;
}

.btn-delete {
background-color: #d33;
color: white;
border: none;
padding: 5px 10px;
margin-left: 5px;
cursor: pointer;
}

.stat-box {
background-color: white;
border-radius: 5px;
margin-bottom: 20px;
padding: 15px;
}

.stat-box h2 {
font-size: 18px;
margin-bottom: 10px;
border-bottom: 1px solid #ccc;
padding-bottom: 10px;
}

.tag {
background-color: #eee;
display: inline-block;
padding: 5px;
border-radius: 5px;
margin-right: 5px;
font-size: 14px;
}

.tag-number {
background-color: orange;
color: white;
border-radius: 50%;
padding: 2px 6px;
font-size: 12px;
}

[data-tooltip] {
position: relative;
}

[data-tooltip]::before {
content: attr(data-tooltip);
position: absolute;
bottom: 40px;
left: 0;
background-color: purple;
color: white;
padding: 5px 10px;
border-radius: 10px;
font-size: 12px;
opacity: 0;
transform: scale(0.5);
transition: 0.3s;
pointer-events: none;
}

[data-tooltip]:hover::before {
opacity: 1;
transform: scale(1);
}

.badge {
position: fixed;
bottom: -40px;
left: 20px;
width: 160px;
height: 100px;
background-color: #800080;
color: white;
border-top-left-radius: 15px;
border-top-right-radius: 15px;
text-align: center;
padding-top: 15px;
transition: 0.5s;
}

.badge-author {
margin-top: 25px;
font-size: 14px;
display: none;
}

.badge:hover {
bottom: 0;
background-color: #4b0082;
}

.badge:hover .badge-author {
display: block;
}

@media print {
body {
background-color: white;
}

.badge {
position: static;
background-color: white;
border: 2px solid purple;
color: black;
}

.badge-title {
display: none;
}

.badge-author {
display: block;
margin-top: 0;
}
}

.edit-input {
width: 90%;
padding: 5px;
font-size: 16px;
}

.btn-minus[disabled] {
opacity: 0.5;
cursor: not-allowed;
}
Loading