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

Develop #5286

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Develop #5286

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://Cr1staliss.github.io/layout_product-cards/)
- [TEST REPORT LINK](https://Cr1staliss.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
59 changes: 58 additions & 1 deletion 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 @@ -11,8 +12,64 @@
rel="stylesheet"
href="./styles/index.scss"
/>
<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:ital,wght@0,100..900;1,100..900&display=swap"
rel="stylesheet"
/>
</head>
<!-- #endregion -->
<body>
<h1>Product cards</h1>
<div
class="card"
data-qa="card"
>
<div class="card__top">
<img
class="card__image"
src="./images/imac.jpeg"
alt="imac-photo"
/>
</div>

<div class="card__bottom">
<div class="product-name">
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)
</div>

Product code: 195434

<div class="stars-reviews">
<div class="stars">
<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="reviews">Reviews: 5</div>
</div>

<div class="price">
Price:
<div class="price-cost">$2,199</div>
</div>

<a
href="#"
data-qa="hover"
class="button"
>
BUY
</a>
</div>
</div>
</body>
</html>
130 changes: 130 additions & 0 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,133 @@
$main-accent: #060b35;
$secondary: #616070;
$blue-accent: #00acdc;
Comment on lines +1 to +3

Choose a reason for hiding this comment

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

Consider moving these SCSS variables to a separate file for better organization and maintainability, as per the task requirements.


html {
color: $secondary;
font-family: Roboto, sans-serif;
font-size: 10px;
font-weight: 400;
line-height: 14px;
}

body {
margin: 0;
}

.card {
box-sizing: border-box;
width: 200px;
background-color: #fff;
border: 1px #f3f3f3 solid;
border-radius: 5px;

&__top {
width: 160px;
height: 134px;

margin: 32px 19px 40px;
}

&__image {
width: 100%;
height: 100%;
}

&__bottom {
margin: 0 16px 16px;
}
}

.product-name {
margin-bottom: 4px;
color: $main-accent;
font-size: 12px;
font-weight: 500;
line-height: 18px;
text-align: left;
}

.stars-reviews {
margin-top: 16px;
height: 16px;
justify-content: space-between;
display: flex;
flex-direction: row;

color: $main-accent;
text-align: right;
}

.stars {
display: flex;
flex-direction: row;

&_star {
background-image: url(../images/star-active.svg);
background-position: center;
background-repeat: no-repeat;
display: block;
margin-right: 4px;

width: 16px;
height: 16px;
}

& > :nth-child(5) {
background-position: center;
background-repeat: no-repeat;

background-image: url(../images/star.svg);
}
}
Comment on lines +61 to +82

Choose a reason for hiding this comment

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

The task requires implementing modifiers like stars--N to highlight the first N stars. Consider adding these modifiers to meet the task requirements.


.reviews {
width: 53px;
margin-top: 2px;
}

.price {
margin-top: 24px;
margin-bottom: 16px;

display: flex;
flex-direction: row;
justify-content: space-between;

font-size: 12px;
font-weight: 400;
line-height: 18px;

&-cost {
color: $main-accent;

font-size: 16px;
font-weight: 700;
line-height: 18px;
text-align: right;
}
}

.button {
display: block;

width: 166px;
height: 40px;

border: $blue-accent 1px solid;
border-radius: 5px;

background-color: #00acdc;
color: #fff;

font-weight: 700;
text-align: center;
line-height: 40px;
text-decoration: none;
font-size: 14px;

&:hover {
background-color: #fff;
color: $blue-accent;
}
}