-
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 tast solution #5192
base: master
Are you sure you want to change the base?
add tast solution #5192
Changes from 2 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
<!-- #region head --> | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
|
@@ -7,12 +8,41 @@ | |
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> | ||
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet"> | ||
<link | ||
rel="stylesheet" | ||
href="./styles/index.scss" | ||
/> | ||
<link | ||
rel="stylesheet" | ||
href="./styles/index.css" | ||
/> | ||
</head> | ||
<!-- #endregion --> | ||
<body> | ||
<h1>Product cards</h1> | ||
<div class="card" data-qa="card"> | ||
<div class="card__image"></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 semantic tag image to display card picture |
||
<div class="card__info"> | ||
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. remove this redundant container |
||
<div class="card__name">APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)</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 h3 tag for card title |
||
<div class="card__code">Product code: 195434</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 paragraph tag for other text |
||
<div class="card__rating"> | ||
<div class="card__stars"> | ||
<div class="card__star"></div> | ||
<div class="card__star"></div> | ||
<div class="card__star"></div> | ||
<div class="card__star"></div> | ||
<div class="card__star"></div> | ||
</div> | ||
Comment on lines
+27
to
+33
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. reuse stars block from previous task |
||
<div class="card__reviews">Reviews: 5</div> | ||
</div> | ||
<div class="card__price"> | ||
<div class="card__priceText">Price:</div> | ||
<div class="card__priceValue">$2,199</div> | ||
</div> | ||
<div class="card__button" data-qa="hover">Buy</div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,3 +1,129 @@ | ||||||
body { | ||||||
margin: 0; | ||||||
font-family: Roboto, sans-serif; | ||||||
} | ||||||
|
||||||
.card { | ||||||
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 border for card element. |
||||||
box-sizing: border-box; | ||||||
width: 200px; | ||||||
height: 408px; | ||||||
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. Remove hardcoded height. It should be setted by elements inside card |
||||||
display: flex; | ||||||
flex-direction: column; | ||||||
align-items: center; | ||||||
} | ||||||
|
||||||
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
|
||||||
.card__image { | ||||||
margin-top: 32px; | ||||||
box-sizing: border-box; | ||||||
background-image: url(/src/images/imac.jpeg); | ||||||
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 |
||||||
background-size: cover; | ||||||
width: 160px; | ||||||
height: 134px; | ||||||
} | ||||||
|
||||||
.card__info { | ||||||
box-sizing: border-box; | ||||||
display: flex; | ||||||
flex-direction: column; | ||||||
margin-left: 17px; | ||||||
margin-right: 17px; | ||||||
} | ||||||
|
||||||
.card__name { | ||||||
margin-top: 40px; | ||||||
font-size: 12px; | ||||||
font-weight: 500; | ||||||
line-height: 18px; | ||||||
text-align: left; | ||||||
color: #000000; | ||||||
} | ||||||
|
||||||
.card__code { | ||||||
font-size: 10px; | ||||||
font-weight: 400; | ||||||
line-height: 14px; | ||||||
text-align: left; | ||||||
color: #616070; | ||||||
margin-top: 4px; | ||||||
} | ||||||
|
||||||
.card__rating { | ||||||
margin-top: 16px; | ||||||
display: flex; | ||||||
justify-content: space-between; | ||||||
} | ||||||
|
||||||
.card__stars { | ||||||
display: flex; | ||||||
flex-direction: row; | ||||||
justify-content: space-between; | ||||||
} | ||||||
|
||||||
.card__star { | ||||||
box-sizing: border-box; | ||||||
width: 16px; | ||||||
height: 16px; | ||||||
background-image: url(/src/images/star.svg); | ||||||
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 |
||||||
background-repeat: no-repeat; | ||||||
background-size: cover; | ||||||
display: flex; | ||||||
flex-direction: row; | ||||||
margin-right: 4px; | ||||||
} | ||||||
|
||||||
.card__reviews { | ||||||
font-size: 10px; | ||||||
font-weight: 400; | ||||||
line-height: 14px; | ||||||
text-align: right; | ||||||
} | ||||||
|
||||||
.card__price { | ||||||
margin-top: 24px; | ||||||
display: flex; | ||||||
flex-direction: row; | ||||||
justify-content: space-between; | ||||||
} | ||||||
|
||||||
.card__priceText { | ||||||
font-size: 12px; | ||||||
font-weight: 400; | ||||||
line-height: 18px; | ||||||
color: #616070; | ||||||
} | ||||||
|
||||||
.card__priceValue { | ||||||
font-size: 16px; | ||||||
font-weight: 700; | ||||||
line-height: 18px; | ||||||
color: #060B35; | ||||||
} | ||||||
|
||||||
.card__button { | ||||||
box-sizing: border-box; | ||||||
margin-top: 16px; | ||||||
background-color: #00ACDC; | ||||||
font-size: 14px; | ||||||
line-height: 16px; | ||||||
width: 166px; | ||||||
height: 40px; | ||||||
border-radius: 5px; | ||||||
display: flex; | ||||||
justify-content: center; | ||||||
align-items: center; | ||||||
color: #FFFFFF; | ||||||
text-transform: uppercase; | ||||||
} | ||||||
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. Consider using SCSS variables for repeated values like colors, font sizes, and dimensions. This will make your code more maintainable and easier to update. 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. Implement SCSS nesting to better organize your styles. For example, nest the styles for |
||||||
|
||||||
.card .card__star:nth-child(-n+4) { | ||||||
background-image: url(/src/images/star-active.svg); | ||||||
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. Similarly, update the |
||||||
transition: transform 0.3s ease; | ||||||
} | ||||||
|
||||||
.card__button:hover { | ||||||
box-sizing: border-box; | ||||||
background-color: #FFFFFF; | ||||||
color: #00ACDC; | ||||||
border-radius: 5px; | ||||||
border: 1px solid #00ACDC | ||||||
} |
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.
Linking to the SCSS file directly in HTML is unnecessary if you are already linking to the compiled CSS file. The Parcel bundler should handle the SCSS compilation, so you can remove this line to avoid redundancy.