-
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 task solution product card #5132
base: master
Are you sure you want to change the base?
Changes from all commits
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 |
---|---|---|
|
@@ -11,8 +11,57 @@ | |
rel="stylesheet" | ||
href="./styles/index.scss" | ||
/> | ||
<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=Poppins&family=Roboto:wght@400;500;700&display=swap" | ||
rel="stylesheet" | ||
/> | ||
</head> | ||
<body> | ||
<h1>Product cards</h1> | ||
<div | ||
data-qa="card" | ||
class="card" | ||
> | ||
<img | ||
src="./images/imac.jpeg" | ||
alt="product iMAC" | ||
class="card__image" | ||
/> | ||
<h1 class="card__title"> | ||
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) | ||
</h1> | ||
<p class="card__text">Product code: 195434</p> | ||
<div class="allstars"> | ||
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. The class |
||
<div class="stars"> | ||
<div class="stars__star stars__star--active"></div> | ||
<div class="stars__star stars__star--active"></div> | ||
<div class="stars__star stars__star--active"></div> | ||
<div class="stars__star stars__star--active"></div> | ||
<div class="stars__star stars__star--active"></div> | ||
</div> | ||
<p class="allstars__text">Reviews: 5</p> | ||
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. The class |
||
</div> | ||
<div class="price"> | ||
<div class="price__text">Price:</div> | ||
<div class="price__amount">$2,199</div> | ||
</div> | ||
<div class="buy"> | ||
<a | ||
href="#" | ||
data-qa="hover" | ||
class="buy__button" | ||
> | ||
BUY | ||
</a> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
.card { | ||
background-color: #fff; | ||
border: 1px solid #fff; | ||
border-radius: 5px; | ||
width: 200px; | ||
padding: 0 16px 16px; | ||
|
||
&__image { | ||
width: 160px; | ||
height: 134px; | ||
margin: 32px auto 0; | ||
display: flex; | ||
} | ||
|
||
&__title { | ||
color: #060b35; | ||
margin: 40px 0 0; | ||
font-size: 12px; | ||
font-weight: 500; | ||
line-height: 18px; | ||
} | ||
|
||
&__text { | ||
color: #616070; | ||
margin: 4px 0 0; | ||
font-size: 10px; | ||
font-weight: 400; | ||
line-height: 14px; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,56 @@ | ||
body { | ||
@import './variables'; | ||
@import './card'; | ||
@import './stars'; | ||
|
||
* { | ||
margin: 0; | ||
font-family: $font; | ||
box-sizing: border-box; | ||
} | ||
|
||
.price { | ||
justify-content: space-between; | ||
align-items: center; | ||
height: 18px; | ||
margin: 24px 0 0; | ||
display: flex; | ||
|
||
&__text { | ||
color: #616070; | ||
font-size: 12px; | ||
font-weight: 400; | ||
line-height: 18px; | ||
} | ||
|
||
&__amount { | ||
color: #060b35; | ||
font-size: 16px; | ||
font-weight: 700; | ||
line-height: 18px; | ||
} | ||
} | ||
|
||
.buy__button { | ||
font-family: $font; | ||
margin-top: 16px; | ||
cursor: pointer; | ||
text-align: center; | ||
color: #fff; | ||
text-transform: uppercase; | ||
background-color: #00acdc; | ||
border: none; | ||
border-radius: 5px; | ||
width: 100%; | ||
height: 40px; | ||
font-size: 14px; | ||
font-weight: 700; | ||
line-height: 40px; | ||
text-decoration: none; | ||
display: inline-block; | ||
} | ||
|
||
.buy__button:hover { | ||
color: #00acdc; | ||
background-color: #fff; | ||
border: 1px solid #00acdc; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
.allstars { | ||
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. The class |
||
justify-content: space-between; | ||
align-items: center; | ||
height: 16px; | ||
margin: 16px 0 0; | ||
display: flex; | ||
|
||
.stars { | ||
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. The class |
||
margin: 0; | ||
padding: 0; | ||
display: flex; | ||
|
||
&__star { | ||
background-repeat: no-repeat; | ||
background-position: 50%; | ||
width: 16px; | ||
height: 16px; | ||
margin-right: 4px; | ||
|
||
&--active { | ||
background-image: url(../images/star.svg); | ||
} | ||
|
||
&--active:nth-child(-n + 4) { | ||
background-image: url(../images/star-active.svg); | ||
} | ||
|
||
&:last-child { | ||
margin-right: 0; | ||
} | ||
} | ||
} | ||
|
||
&__text { | ||
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. The class |
||
color: #060b35; | ||
font-size: 10px; | ||
font-weight: 400; | ||
line-height: 14px; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$font: Roboto, serif; |
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.
Ensure that the SCSS file
index.scss
is correctly structured and organized as per the task requirements, with separate files for different BEM blocks.