Shopping page
Task
Create the same page as on the picture above

Result

Pure HTML + CSS flexbox + React JS / TS
body {
font-family: Arial, sans-serif;
background-color: #f7f7f7;
padding: 20px;
}
.product-page {
display: flex;
background-color: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
max-width: 900px;
margin: 0 auto;
}
.product-image {
position: relative;
display: flex;
align-items: center;
justify-content: center;
flex: 1;
}
.product-image img {
max-width: 400px;
border-radius: 8px;
}
.favorite-button {
position: absolute;
top: 15px;
right: 15px;
background: none;
border: none;
font-size: 24px;
cursor: pointer;
color: #aaa;
}
.favorite-button.active {
color: red;
}
.product-details {
display: flex;
flex-direction: column;
flex: 1;
margin-left: 20px;
}
.product-details h1 {
font-size: 24px;
margin-bottom: 10px;
}
.product-details .brand {
color: gray;
margin-bottom: 10px;
}
.product-details .rating {
display: flex;
align-items: center;
margin-bottom: 10px;
}
.product-details .stars {
font-size: 24px;
color: gray; /* Цвет звездочек */
margin-right: 5px;
}
.product-details .rating-number {
font-size: 18px;
margin-right: 5px;
color: #333;
}
.product-details .review-count {
font-size: 16px;
color: gray;
}
.product-details .price {
display: flex;
align-items: center;
margin-bottom: 5px;
}
.product-details .current-price {
color: red;
font-weight: bold;
font-size: 24px;
margin-right: 10px;
}
.product-details .original-price {
text-decoration: line-through;
color: gray;
font-size: 18px;
}
.product-details .sale {
margin-bottom: 10px;
font-size: 14px;
color: red;
}
.product-details .affirm {
margin-bottom: 20px;
}
.product-details .shipping {
margin-bottom: 20px;
}
.product-details .shipping p {
margin: 5px 0;
font-size: 14px;
}
.product-details .shipping input {
padding: 5px;
border-radius: 4px;
border: 1px solid #ddd;
margin-right: 5px;
}
.product-details .shipping button {
padding: 5px 10px;
background-color: #333;
color: white;
border: none;
cursor: pointer;
border-radius: 5px;
}
.product-details .quantity {
display: flex;
align-items: center;
margin-bottom: 20px;
}
.product-details .quantity button {
width: 30px;
height: 30px;
background-color: #ddd;
border: none;
cursor: pointer;
font-size: 18px;
}
.product-details .quantity input {
width: 40px;
height: 30px;
text-align: center;
margin: 0 10px;
border: 1px solid #ddd;
border-radius: 4px;
}
.product-details .add-to-cart {
padding: 15px;
background-color: #333;
color: white;
border: none;
cursor: pointer;
border-radius: 5px;
font-size: 16px;
}
.product-details .add-to-cart:hover {
background-color: #555;
}
Pure HTML + CSS grid + React JS / TS
body {
font-family: Arial, sans-serif;
background-color: #f7f7f7;
padding: 20px;
}
.product-page {
display: grid;
grid-template-columns: 1fr 1fr;
background-color: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
max-width: 900px;
margin: 0 auto;
gap: 20px;
}
.product-image {
position: relative;
display: flex;
align-items: center;
justify-content: center;
}
.product-image img {
max-width: 100%;
border-radius: 8px;
}
.favorite-button {
position: absolute;
top: 15px;
right: 15px;
background: none;
border: none;
font-size: 24px;
cursor: pointer;
color: #aaa;
}
.favorite-button.active {
color: red;
}
.product-details {
display: grid;
grid-template-rows: auto;
gap: 10px;
}
.product-details h1 {
font-size: 24px;
}
.product-details .brand {
color: gray;
}
.product-details .rating {
display: flex;
align-items: center;
margin-bottom: 10px;
}
.product-details .stars {
font-size: 24px;
color: gray;
margin-right: 5px;
}
.product-details .rating-number {
font-size: 18px;
margin-right: 5px;
color: #333;
}
.product-details .review-count {
font-size: 16px;
color: gray;
}
.product-details .price {
display: flex;
align-items: center;
margin-bottom: 5px;
}
.product-details .current-price {
color: red;
font-weight: bold;
font-size: 24px;
margin-right: 10px;
}
.product-details .original-price {
text-decoration: line-through;
color: gray;
font-size: 18px;
}
.product-details .sale {
font-size: 14px;
color: red;
}
.product-details .affirm {
margin-bottom: 20px;
}
.product-details .shipping {
margin-bottom: 20px;
}
.product-details .shipping p {
margin: 5px 0;
font-size: 14px;
}
.product-details .shipping input {
padding: 5px;
border-radius: 4px;
border: 1px solid #ddd;
margin-right: 5px;
}
.product-details .shipping button {
padding: 5px 10px;
background-color: #333;
color: white;
border: none;
cursor: pointer;
border-radius: 5px;
}
.product-details .quantity {
display: flex;
align-items: center;
margin-bottom: 20px;
}
.product-details .quantity button {
width: 30px;
height: 30px;
background-color: #ddd;
border: none;
cursor: pointer;
font-size: 18px;
}
.product-details .quantity input {
width: 40px;
height: 30px;
text-align: center;
margin: 0 10px;
border: 1px solid #ddd;
border-radius: 4px;
}
.product-details .add-to-cart {
padding: 15px;
background-color: #333;
color: white;
border: none;
cursor: pointer;
border-radius: 5px;
font-size: 16px;
}
.product-details .add-to-cart:hover {
background-color: #555;
}