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
62 changes: 56 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,64 @@
<head lang="uk">
<meta charset="UTF-8">
<title>My Page</title>


<link rel="stylesheet" type="text/css" href="main.css" />
</head>
<body>
<span class="product-item">
Apple
<span class="amount">4</span>
</span>
<main>
<figure class = "main-block">
<input type = "text" required placeholder="Назва товару" class="name-enter">
<button type="submit" class="add-item">Додати</button>
<hr>
<section class="inner-box">
<p class="tomato">Помідори</p>
<figure class="number-buy">2</figure>
<button type="submit" class="buy-no">Не куплено</button>
</section>
<hr>
<section class="inner-box">
<p class="biscuts">Печиво</p>
<button type="submit" class="sub-count">-</button>
<figure class="number">2</figure>
<button type="submit" class="add-count">+</button>
<button type="submit" class="buy">Куплено</button>
<button type="submit" class="cancel">X</button>
</section>
<hr>
<section class="inner-box">
<p class="biscuts">Сир</p>
<button type="submit" class="sub-count-dis">-</button>
<figure class="number">1</figure>
<button type="submit" class="add-count">+</button>
<button type="submit" class="buy">Куплено</button>
<button type="submit" class="cancel">X</button>
</section>
</figure>
</main>
<aside>
<figure class="additional-block">
<h3 class="header">Залишилося</h3>
<hr>
<section id="wait">
<figure class="buy-show">
<p class="small-font">Печиво</p>
<label class="small-label">2</label>
</figure>
<figure class="buy-show">
<p class="small-font">Сир</p>
<label class="small-label">1</label>
</figure>
</section>
<hr>
<h3 class="header">Куплено</h3>
<hr>
<section id="bought">
<figure class="buy-show">
<p class="small-font-dis">Помідори</p>
<label class="small-label-dis">2</label>
</figure>
</section>
</figure>
</aside>
<script src="script.js"></script>
</body>
</html>
248 changes: 232 additions & 16 deletions main.css
Original file line number Diff line number Diff line change
@@ -1,17 +1,233 @@
.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;



*{
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: Arial, Helvetica, sans-serif;
}

body{
background: #dcdcdc;
padding: 35px 25px;
display: flex;
gap: 40px;
align-items: flex-start;
}

.main-block{
flex: 1;
min-width: 700px;
background: white;
border-radius: 6px;
box-shadow: 0 2px 6px rgba(0,0,0,0.15);
overflow: hidden;
}

.inner-box{
display: flex;
align-items: center;
gap: 14px;
padding: 18px 24px;
flex-wrap: nowrap;
}

.name-enter{
width: 76%;
height: 62px;
border: 1px solid #d7d7d7;
border-right: none;
padding-left: 22px;
font-size: 20px;
outline: none;
margin: 28px 0 28px 24px;
}

input::placeholder{
color: #a0a0a0;
font-size: 18px;
}

.add-item{
width: 18%;
height: 62px;
border: none;
background: #2f93d9;
color: white;
font-size: 20px;
font-weight: bold;
cursor: pointer;
margin: 20px 20px 20px 0px;
}

hr{
border: none;
border-top: 1px solid #e6e6e6;
}

.tomato,
.biscuts,
.product-add{
width: 260px;
font-size: 20px;
margin: 0;
flex-shrink: 0;
font-size: 20px;
vertical-align: middle;
}

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

.product-add{
border: 1px solid #58aafc;
height: 38px;
padding-left: 10px;
border-radius: 3px;
outline: none;
margin-top: 18px;
margin-bottom: 18px;
}

.number,
.number-buy{
display: inline-flex;
align-items: center;
justify-content: center;
width: 48px;
height: 42px;
background: #efefef;
border-radius: 6px;
font-size: 30px;
font-weight: bold;
color: #666;
vertical-align: middle;
flex-shrink: 0;
}

.sub-count,
.add-count,
.sub-count-dis{
width: 54px;
height: 54px;
border-radius: 50%;
border: none;
color: white;
font-size: 34px;
font-weight: bold;
vertical-align: middle;
cursor: pointer;
margin-right: 10px;
margin-left: 10px;
flex-shrink: 0;
}

.sub-count{
background: #de2d2d;
}

.add-count{
background: #31c54b;
}

.sub-count-dis{
background: #f1a6a6;
cursor: default;
pointer-events: none;
}

.buy,
.buy-no{
width: 160px;
height: 52px;
background: #efefef;
border: 1px solid #d6d6d6;
border-radius: 6px;
font-size: 18px;
font-weight: bold;
color: #666;
cursor: pointer;
margin-left: auto;
}

.cancel{
width: 56px;
height: 52px;
margin-left: 10px;
margin-right: 10px;
background: #e93030;
border: none;
border-radius: 6px;
color: white;
font-size: 28px;
font-weight: bold;
cursor: pointer;
flex-shrink: 0;
}

.additional-block{
width: 420px;
flex-shrink: 0;
background: white;
border-radius: 6px;
box-shadow: 0 2px 6px rgba(0,0,0,0.15);
overflow: hidden;
margin-right: 50px;
}

.header{
font-size: 28px;
font-weight: 800;
padding: 24px;
}

.buy-show{
display: inline-flex;
align-items: center;
background: #efefef;
border-radius: 6px;
padding: 10px 14px;
margin: 24px 0 24px 20px;
}

.small-font,
.small-font-dis{
font-size: 20px;
color: #555;
}

.small-font-dis{
text-decoration: line-through;
}

.small-label,
.small-label-dis{
width: 28px;
height: 28px;
margin-left: 10px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
background: #ff7b16;
color: white;
font-size: 16px;
font-weight: bold;
}

.small-label-dis{
text-decoration: line-through;
}

@media (max-width: 500px){
body{
flex-direction: column;
padding: 15px;
}
.main-block,
.additional-block{
width: 100%;
}
}
Loading