-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
100 lines (88 loc) · 2.37 KB
/
Copy pathindex.html
File metadata and controls
100 lines (88 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Shop</title>
<style>
:root {
color: #222;
font-family: Arial;
}
.shop {
max-width: 900px;
margin: auto;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 1rem;
}
.product {
border: 1px solid #ddd;
border-radius: 5px;
padding: 1rem;
}
.product h2 {
margin: 0;
}
.price {
font-size: 1.2rem;
font-family: 'Courier New', Courier, monospace;
font-weight: 700;
letter-spacing: 1px;
}
button {
padding: 0.5rem 1rem;
background-color: #eee;
border: none;
border-radius: 5px;
}
button:hover {
background-color: #ddd;
}
#basket-items {
display: flex;
flex-direction: column;
align-items: center;
}
ul {
list-style: none;
padding: 0;
border: 1px solid #ddd;
border-radius: 5px;
width: 300px;
margin: auto;
}
li {
text-decoration: underline;
line-height: 1.8;
}
</style>
</head>
<body>
<div class="shop">
<div class="product">
<h2>Lenovo Yoga</h2>
<p>Price: <span class="price">3000</span></p>
<button onclick="addToBasket(1)">Buy</button>
</div>
<div class="product">
<h2>Acer Aspire</h2>
<p>Price: <span class="price">1800</span></p>
<button onclick="addToBasket(2)">Buy</button>
</div>
<div class="product">
<h2>Dell Vostro</h2>
<p>Price: <span class="price">3400</span></p>
<button onclick="addToBasket(3)">Buy</button>
</div>
</div>
<hr>
<div class="basket">
<h2 style="text-align: center;">Cart</h2>
<ul id="basket-items"></ul>
<h3 style="text-align: center;">Total price: <span id="total">0</span></h3>
</div>
<script src="app.js"></script>
</body>
</html>