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 solution #5082

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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 @@ -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://NataliiaVdovyna.github.io/layout_product-cards/)
- [TEST REPORT LINK](https://NataliiaVdovyna.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
63 changes: 61 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,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>

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


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

Choose a reason for hiding this comment

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

Add the modifier classes for active stars

Suggested change
<section class="stars">
<div class="stars__wrapper">
<section class="card__review">
<div class="stars stars--4">

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

Choose a reason for hiding this comment

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

Use the semantic tag for text

Suggested change
<div class="stars__text">Reviews: 5</div>
<p class="stars__text">Reviews: 5</p>

</section>

<section class="price">

Choose a reason for hiding this comment

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

Redundant

Suggested change
<section class="price">

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

Choose a reason for hiding this comment

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

Suggested change
<button class="price__button">Buy</button>
Buy

</a>
</section>
</div>
</body>
</html>
39 changes: 39 additions & 0 deletions src/styles/blocks/card.scss
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;
}
}
8 changes: 8 additions & 0 deletions src/styles/blocks/page.scss
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;
}
57 changes: 57 additions & 0 deletions src/styles/blocks/price.scss
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;
}
}
}
31 changes: 31 additions & 0 deletions src/styles/blocks/stars.scss
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;
}
}
8 changes: 5 additions & 3 deletions src/styles/index.scss
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';
6 changes: 6 additions & 0 deletions src/styles/utils/variables.scss
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;
Loading