Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ This is possible because [we use the Parcel library](https://en.parceljs.org/scs

❗️ Replace `<your_account>` with your GitHub username and copy the links to the `Pull Request` description:

- [DEMO LINK](https://<your_account>.github.io/layout_product-cards/)
- [TEST REPORT LINK](https://<your_account>.github.io/layout_product-cards/report/html_report/)
- [DEMO LINK](https://serhii-lesik.github.io/layout_product-cards/)
- [TEST REPORT LINK](https://serhii-lesik.github.io/layout_product-cards/report/html_report/)

❗️ Copy this `Checklist` to the `Pull Request` description after links, and put `- [x]` before each point after you checked it.

Expand Down
30 changes: 28 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- #region head -->
<!doctype html>
<html lang="en">
<head>
Expand All @@ -7,12 +8,37 @@
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"
href="./styles/index.css"
/>
</head>
<!-- #endregion -->
<body>
<h1>Product cards</h1>
<div class="card" data-qa="card">
<div class="card__image"></div>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use semantic tag image to display card picture

<div class="card__info">

Choose a reason for hiding this comment

The 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>

Choose a reason for hiding this comment

The 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>

Choose a reason for hiding this comment

The 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

Choose a reason for hiding this comment

The 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>
115 changes: 115 additions & 0 deletions src/styles/index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/styles/index.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/styles/index.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/styles/index.min.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

127 changes: 127 additions & 0 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,130 @@
$font-size: 10px;

body {
margin: 0;
font-family: Roboto, sans-serif;
}

.card {

Choose a reason for hiding this comment

The 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;

Choose a reason for hiding this comment

The 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;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
padding: 32px 16px 16px;

&__image {
margin-top: 32px;
box-sizing: border-box;
background-image: url(../images/imac.jpeg);
background-size: cover;
width: 160px;
height: 134px;
}

&__info {
box-sizing: border-box;
display: flex;
flex-direction: column;
margin-left: 17px;
margin-right: 17px;
Comment on lines +29 to +30

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This margins should be removed. Just use padding for card element instead

}

&__name {
margin-top: 40px;
font-size: $font-size * 1.2;
font-weight: 500;
line-height: $font-size * 1.8;
text-align: left;
color: #000000;
}

&__code {
font-size: 10px;
font-weight: 400;
line-height: $font-size * 1.4;
text-align: left;
color: #616070;
margin-top: 4px;
}

.&__rating {
margin-top: 16px;
display: flex;
justify-content: space-between;
}

&__stars {
display: flex;
flex-direction: row;
justify-content: space-between;
}

.&__star {
box-sizing: border-box;
width: 16px;
height: 16px;
background-image: url(../images/star.svg);
background-repeat: no-repeat;
background-size: cover;
display: flex;
flex-direction: row;
margin-right: 4px;
}

.&__reviews {
font-size: $font-size;
font-weight: 400;
line-height: $font-size * 1.4;
text-align: right;
}

.&__price {
margin-top: 24px;
display: flex;
flex-direction: row;
justify-content: space-between;
}

.&__priceText {
font-size: $font-size * 1.2;
font-weight: 400;
line-height: $font-size * 1.8;
color: #616070;
}

.&__priceValue {
font-size: $font-size * 1.6;
font-weight: 700;
line-height: $font-size * 1.8;
color: #060B35;
}

&__button {
box-sizing: border-box;
margin-top: 16px;
background-color: #00ACDC;
font-size: $font-size * 1.4;
line-height: $font-size * 1.6;
width: 166px;
height: 40px;
border-radius: 5px;
display: flex;
justify-content: center;
align-items: center;
color: #FFFFFF;
text-transform: uppercase;
}
}

.card .card__star:nth-child(-n+4) {
background-image: url(../images/star-active.svg);
}
Comment on lines +120 to +122

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reuse styles for stars from previous task. Also use separate file for them


.card__button:hover {
box-sizing: border-box;
background-color: #FFFFFF;
color: #00ACDC;
border-radius: 5px;
border: 1px solid #00ACDC
}
Loading