Skip to content
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
83 changes: 72 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,77 @@
<!DOCTYPE html>
<html>
<head lang="uk">
<meta charset="UTF-8">
<title>My Page</title>


<link rel="stylesheet" type="text/css" href="main.css" />
<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="main.css">
</head>
<body>
<span class="product-item">
Apple
<span class="amount">4</span>
</span>
<div class="app">
<div class="card">
<div class="input-group">
<input type="text" placeholder="Назва товару">
<button>Додати</button>
</div>

<div class="item">

</div>

<div class="item">
<div class="item-row">
<span class="item-name">Печиво</span>
<div class="counter-wrapper">
<div class="counter-controls">
<button data-tooltip="Зменшити" class="btn red">−</button>
<span class="qty">2</span>
<button class="btn green" data-tooltip="Збільшити">+</button>
</div>
</div>
<div class="actions">
<button class="status-btn" data-tooltip="Позначити як куплене">Куплено</button>
<button class="btn remove" data-tooltip="Видалити">×</button>
</div>
</div>
</div>

<div class="item">
<div class="item-row">
<input type="text" value="Сир" class="item-name" style="padding: 5px; background: #f1f1f1; border: 1px solid #ccc; border-radius: 4px; width: 150px;">
<div class="counter-wrapper">
<div class="counter-controls">
<button data-tooltip="Зменшити" class="btn red">−</button>
<span class="qty">1</span>
<button class="btn green" data-tooltip="Збільшити">+</button>
</div>
</div>
<div class="actions">
<button class="status-btn" data-tooltip="Позначити як куплене">Куплено</button>
<button class="btn remove" data-tooltip="Видалити">×</button>
</div>
</div>
</div>
</div>

<div class="card">
<h3>Залишилося</h3>
<div class="badge-list">
<div class="badge">
<span>Печиво</span>
<span class="count">2</span>
</div>
<div class="badge">
<span>Сир</span>
<span class="count">1</span>
</div>
</div>
<h3>Куплено</h3>
<div class="badge-list">
<div class="badge"><span><s>Помідори</s></span> <span class="count">2</span></div>
</div>
</div>
</div>
<div class="footer-badge"><span>BuyList</span></div>
<script src="script.js"></script>
</body>
</html>
221 changes: 205 additions & 16 deletions main.css
Original file line number Diff line number Diff line change
@@ -1,17 +1,206 @@
.product-item {
background-color: gray;
display: inline-block;
height: 25px;
padding: 5px;
border-radius: 5px;
}
* {box-sizing: border-box;}
body {
font-family: sans-serif;
background: #eee;
margin: 0;
padding: 20px;
}
.app {
display: flex;
gap: 20px;
flex-wrap: wrap;
align-items: flex-start;
}
.card {
background: white;
padding: 20px;
border-radius: 6px;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.card:first-child {
flex: 1 1 450px;
}
.card:last-child {
flex: 0 1 300px;
}
.input-group {
display: flex;
width: 100%;
margin-bottom: 20px;
}
.input-group input[type="text"] {
flex: 1;
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px 0 0 4px;
background: #f1f1f1;
}
.input-group button {
padding: 10px 20px;
background: #0d6efd;
color: white;
border: none;
border-radius: 0 4px 4px 0;
cursor: pointer;
}
.item {
border-bottom: 1px solid #ccc;
padding: 10px 0;
}
.item-row {
display: grid;
grid-template-columns: 1fr auto 1fr auto;
align-items: center;
gap: 10px;
}
.item-name {
min-width: 120px;
}
.item-name.bought {
text-decoration: line-through;
}
.counter-wrapper {
display: flex;
justify-content: center;
width: 100px;
margin: 0 auto;
}
.counter-controls {
display: flex;
align-items: center;
gap: 4px;
}
.qty {
width: 30px;
text-align: center;
padding: 5px;
background: #f1f1f1;
border-radius: 4px;
font-weight: bold;
}
.actions {
display: flex;
align-items: center;
gap: 10px;
justify-content: flex-end;
}
.btn {
width: 32px;
height: 32px;
border: none;
color: white;
font-size: 18px;
font-weight: bold;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
}
.btn.green {
background: #28a745;
border-radius: 50%;
}
.btn.red {
background: #dc3545;
border-radius: 50%;
}
.btn.remove {
background: #dc3545;
border-radius: 4px;
}
.status-btn {
background: #f8f9fa;
border: 1px solid #ccc;
padding: 6px 12px;
border-radius: 6px;
cursor: pointer;
white-space: nowrap;
}
.badge-list {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-top: 10px;
}
.badge {
background: #f1f1f1;
color: black;
border-radius: 12px;
padding: 6px 12px;
font-size: 14px;
display: flex;
align-items: center;
gap: 5px;
}
.badge .count {
background: #ff6f00;
color: white;
border-radius: 50%;
padding: 2px 8px;
font-size: 13px;
}
.footer-badge {
position: fixed;
bottom: 0;
left: 0;
background-color: #4a148c;
color: white;
padding: 10px 20px;
border-top-right-radius: 20px;
transition: all 0.5s ease;
cursor: pointer;
}
.footer-badge:hover {
bottom: 20px;
background-color: #082384;
}
.footer-badge::after {
content: 'Kovalenko Yevhenii';
display: block;
font-size: 12px;
opacity: 0;
transition: opacity 0.5s ease;
}
.footer-badge:hover::after {
opacity: 1;
}

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

display: inline-block;
height: 20px;
width: 20px;
text-align: center;
}
@media (max-width: 500px) {
.app {
flex-direction: column;
}
.item-row {
grid-template-columns: 1fr;
}
.counter-wrapper {
justify-content: flex-start;
margin: 0;
}
.actions {
justify-content: flex-start;
}
}
button[data-tooltip] {
position: relative;
}
button[data-tooltip]::after {
content: attr(data-tooltip);
position: absolute;
bottom: 100%;
left: 50%;
transform: translateX(-50%) translateY(10px) scale(0.95);
background: #6a0dad;
color: white;
padding: 4px 8px;
border-radius: 8px;
font-size: 12px;
white-space: nowrap;
opacity: 0;
transition: all 0.3s;
pointer-events: none;
}
button[data-tooltip]:hover::after {
opacity: 1;
transform: translateX(-50%) translateY(0) scale(1);
}

Loading