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 task solution #4875

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -20,8 +20,8 @@ Create a pages with product card using `flexbox`, `BEM` and `SCSS` based on [thi

❗️ Replace `<your_account>` with your Github username and copy the links to `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://Welbrn.github.io/layout_product-cards/)
- [TEST REPORT LINK](https://Welbrn.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
55 changes: 54 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,65 @@
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"
/>
<link
href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="./styles/index.scss"

Choose a reason for hiding this comment

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

The stylesheet link should point to a CSS file, not an SCSS file. SCSS files need to be compiled to CSS before they can be linked in HTML.

/>
</head>
<body>
<h1>Product cards</h1>
<div
class="product-card"
data-qa="card"
>
<img
src="/src/images/imac.jpeg"
alt="prodact img"

Choose a reason for hiding this comment

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

There is a typo in the alt attribute. It should be 'product img' instead of 'prodact img'.

Choose a reason for hiding this comment

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

alt attribute should describe the image content
image

class="product-card__image"
/>
<div class="product-card__product-title">
<span>APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)</span>
</div>

<div class="product-card__product-code">
<span class="product-card__code">Product code: 195434</span>
</div>

<div class="product-card__reviews">
<div class="product-card__stars">
<span class="product-card__star"></span>
<span class="product-card__star"></span>
<span class="product-card__star"></span>
<span class="product-card__star"></span>
<span class="product-card__star"></span>

<span class="product-card__reviws-count">Reviews: 5</span>

Choose a reason for hiding this comment

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

There is a typo in the class name 'product-card__reviws-count'. It should be 'product-card__reviews-count'.

</div>
</div>

<div class="product-card__cost">
<span class="product-card__price-label">Price:</span>
<span class="product-card__price">$2,199</span>
</div>
<a
href="#"
class="product-card__button-buy"
data-qa="hover"
>
Buy
</a>
<section></section>
</div>
</body>
</html>
120 changes: 120 additions & 0 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,123 @@
* {
box-sizing: border-box;
}

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

.product-card {
width: 200px;
height: 408px;
border: 1px solid #f3f3f3;
border-radius: 5px;
background-color: #fff;

&__image {
display: flex;
margin: 32px 19px 40px;
width: 160px;
height: 134px;
}

&__product-title {
margin: 0 16px 4px;
font-size: 12px;
line-height: 18px;
font-weight: 500;
}

&__product-code {
display: flex;
margin: 0 0 16px 16px;
}

&__code {
font-weight: 400;
font-size: 10px;
line-height: 14px;
color: #616070;
}

&__stars {
display: flex;
margin-left: 16px;
}

&__star {
background-image: url(/src/images/star-active.svg);
width: 16px;
height: 16px;
background-size: contain;
background-repeat: no-repeat;
}

&__star:not(:first-child) {
margin-left: 4px;
}

&__star:nth-child(n + 5) {
background-image: url(/src/images/star.svg);
}

&__reviws-count {

Choose a reason for hiding this comment

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

There is a typo in the class name &__reviws-count. It should be &__reviews-count to correctly reflect the word 'reviews'.

display: flex;
align-items: center;
margin: 0 16px 0 17px;
font-weight: 400;
font-size: 10px;
line-height: 14px;
}

&__cost {
display: flex;
justify-content: space-between;
margin: 24px 16px 0;
}

&__price-label {
font-weight: 400;
font-size: 12px;
line-height: 18px;
color: #616070;
}

&__price {
font-weight: 700;
font-size: 16px;
line-height: 18px;
color: #060b35;
}

&__button-buy {
display: flex;
align-items: center;
margin: 16px;
padding: 12px 70px;
border-radius: 5px;
background-color: #00acdc;
text-transform: uppercase;
text-decoration: none;
color: #fff;
font-weight: 700;
font-size: 14px;
line-height: 16px;
}

&__button-buy:hover {
display: flex;
margin: 16px;
padding: 12px 70px;
border-radius: 5px;
border: 1px solid #00acdc;
background-color: #fff;
text-transform: uppercase;
text-decoration: none;
color: #00acdc;
font-weight: 700;
font-size: 14px;
line-height: 16px;
}
}
Loading