-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add solution #5082
base: master
Are you sure you want to change the base?
add solution #5082
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -1,3 +1,4 @@ | ||||||||||
<!-- #region head --> | ||||||||||
<!doctype html> | ||||||||||
<html lang="en"> | ||||||||||
<head> | ||||||||||
|
@@ -7,12 +8,70 @@ | |||||||||
content="width=device-width, initial-scale=1.0" | ||||||||||
/> | ||||||||||
<title>Product cards</title> | ||||||||||
<link | ||||||||||
rel="preconnect" | ||||||||||
href="https://fonts.googleapis.com" | ||||||||||
/> | ||||||||||
<link | ||||||||||
rel="preconnect" | ||||||||||
href="https://fonts.gstatic.com" | ||||||||||
crossorigin="anonymous" | ||||||||||
/> | ||||||||||
<link | ||||||||||
href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" | ||||||||||
rel="stylesheet" | ||||||||||
/> | ||||||||||
<link | ||||||||||
rel="stylesheet" | ||||||||||
href="./styles/index.scss" | ||||||||||
/> | ||||||||||
</head> | ||||||||||
<body> | ||||||||||
<h1>Product cards</h1> | ||||||||||
<!-- #endregion --> | ||||||||||
<body class="page"> | ||||||||||
<div | ||||||||||
class="card" | ||||||||||
data-qa="card" | ||||||||||
> | ||||||||||
<section class="card__top"> | ||||||||||
<div class="card__top-image"></div> | ||||||||||
|
||||||||||
<div class="card__top-text"> | ||||||||||
<h1 class="card__top-title"> | ||||||||||
APPLE A1419 iMac 27" Retina | ||||||||||
<br /> | ||||||||||
5K Monoblock (MNED2UA/A) | ||||||||||
</h1> | ||||||||||
<p class="card__top-subtitle">Product code: 195434</p> | ||||||||||
</div> | ||||||||||
</section> | ||||||||||
|
||||||||||
<section class="stars"> | ||||||||||
<div class="stars__wrapper"> | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add the modifier classes for active stars
Suggested change
|
||||||||||
<div class="stars__star"></div> | ||||||||||
<div class="stars__star"></div> | ||||||||||
<div class="stars__star"></div> | ||||||||||
<div class="stars__star"></div> | ||||||||||
<div class="stars__star"></div> | ||||||||||
</div> | ||||||||||
|
||||||||||
<div class="stars__text">Reviews: 5</div> | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use the semantic tag for text
Suggested change
|
||||||||||
</section> | ||||||||||
|
||||||||||
<section class="price"> | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Redundant
Suggested change
|
||||||||||
<div class="price__wrapper"> | ||||||||||
<p class="price__text">Price:</p> | ||||||||||
|
||||||||||
<p class="price__money">$2,199</p> | ||||||||||
</div> | ||||||||||
|
||||||||||
<a | ||||||||||
href="#" | ||||||||||
class="price__link" | ||||||||||
data-qa="hover" | ||||||||||
> | ||||||||||
<button class="price__button">Buy</button> | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
</a> | ||||||||||
</section> | ||||||||||
</div> | ||||||||||
</body> | ||||||||||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
.card { | ||
box-sizing: border-box; | ||
width: 200px; | ||
background-color: $background-color-special-white; | ||
border-radius: 5px; | ||
border: 1px solid #f3f3f3; | ||
|
||
text-align: center; | ||
padding-block: 32px 16px; | ||
|
||
&__top-image { | ||
box-sizing: border-box; | ||
background-image: url(../images/imac.jpeg); | ||
width: 160px; | ||
height: 134px; | ||
background-size: cover; | ||
margin-left: auto; | ||
margin-right: auto; | ||
} | ||
|
||
&__top-text { | ||
margin: 40px 16px 16px; | ||
text-align: left; | ||
} | ||
|
||
&__top-title { | ||
margin: 0; | ||
font-weight: 500; | ||
line-height: 18px; | ||
font-size: 12px; | ||
} | ||
|
||
&__top-subtitle { | ||
margin: 4px 0 0 0; | ||
font-size: 10px; | ||
line-height: 14px; | ||
color: $other-text-color; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.page { | ||
margin: 0; | ||
margin-inline: 10px; | ||
|
||
font-family: 'Roboto', sans-serif; | ||
font-weight: 400; | ||
color: $main-text-color; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
.price { | ||
margin-inline: $margin-inline; | ||
|
||
&__wrapper { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
|
||
align-items: center; | ||
margin: 24px 0 16px; | ||
} | ||
|
||
&__text { | ||
margin: 0; | ||
font-size: 12px; | ||
font-weight: 400; | ||
line-height: 18px; | ||
color: $other-text-color; | ||
} | ||
|
||
&__money { | ||
margin: 0; | ||
font-size: 16px; | ||
font-weight: 700; | ||
line-height: 18px; | ||
} | ||
|
||
&__link { | ||
display: block; | ||
} | ||
|
||
&__button { | ||
padding: 0; | ||
background-color: $button-color; | ||
width: 166px; | ||
height: 40px; | ||
border-radius: 5px; | ||
|
||
font-family: Roboto; | ||
font-size: 14px; | ||
font-weight: 700; | ||
line-height: 16px; | ||
text-align: center; | ||
color: $background-color-special-white; | ||
text-transform: uppercase; | ||
|
||
border: none; | ||
outline: none; | ||
box-shadow: none; | ||
|
||
&:hover { | ||
color: $button-color; | ||
background-color: $background-color-special-white; | ||
border: 1px solid $button-color; | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
.stars { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
margin-inline: $margin-inline; | ||
align-items: end; | ||
|
||
&__wrapper { | ||
display: flex; | ||
justify-content: space-between; | ||
width: 96px; | ||
} | ||
|
||
&__star { | ||
background-image: url(../images/star-active.svg); | ||
background-repeat: no-repeat; | ||
background-position: 50%; | ||
width: 16px; | ||
height: 16px; | ||
} | ||
|
||
&__star:last-child { | ||
background-image: url(../images/star.svg); | ||
} | ||
|
||
&__text { | ||
font-size: 10px; | ||
font-weight: 400; | ||
line-height: 14px; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
body { | ||
margin: 0; | ||
} | ||
@import './utils/variables'; | ||
@import './blocks/page'; | ||
@import './blocks/card'; | ||
@import './blocks/stars'; | ||
@import './blocks/price'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
$margin-inline: 16px; | ||
|
||
$main-text-color: #060b35; | ||
$other-text-color: #616070; | ||
$button-color: #00acdc; | ||
$background-color-special-white: #ffffff; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This image isn't background, so you need to add image with the
img
tag