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

Open
wants to merge 2 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://MissDragi.github.io/layout_product-cards/)
- [TEST REPORT LINK](https://MissDragi.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
47 changes: 45 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,51 @@
rel="stylesheet"
href="./styles/index.scss"
/>

<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"
/>
</head>
<body>
<h1>Product cards</h1>

<body class="page">
<div
class="card"
data-qa="card"
>
<h1 class="card__name">
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)
</h1>
<p class="card__name-code">Product code: 195434</p>
<div class="card__rate">
<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>
<p class="card__review">Reviews: 5</p>
</div>
<div class="card__price">
<div class="card__price-name">Price:</div>
<div class="card__price-value">$2,199</div>
</div>
<div
data-qa="hover"
class="card__button-action"
>
Buy
</div>
</div>
</body>
</html>
98 changes: 98 additions & 0 deletions src/styles/blocks/card.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
* {
margin: 0;
}
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.

The use of a universal selector (*) for resetting margins is generally not recommended as it can lead to performance issues. Consider using a more specific selector or a CSS reset/normalize file.


.page {
font-family: Roboto, sans-serif;
font-weight: 400;
font-size: 14px;
}

.card {
display: flex;
flex-direction: column;
box-sizing: border-box;
width: 200px;
height: 408px;
background-color: #fff;
background-image: url(../images/imac.jpeg);

Choose a reason for hiding this comment

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

The background-image: url() should be relative to the index.scss and start with ../images. Please ensure the path is correct as per the task requirements.

background-size: 160px 134px;
background-repeat: no-repeat;
background-position: center 32px;
border: 1px solid #f3f3f3;
border-radius: 5px;
padding: 32px 16px 16px;

&__name {
display: flex;
margin-top: 174px;
margin-bottom: 4px;
font-weight: 500;
font-size: 12px;
line-height: 18px;
color: #060b35;
}

&__name-code {
color: #616070;
font-size: 10px;
line-height: 14px;
margin-bottom: 16px;
}

&__rate {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 24px;
}

&__review {
font-size: 10px;
color: #060b35;
line-height: 14px;
}

&__price {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16px;
}

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

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

&__button-action {
display: flex;
box-sizing: border-box;
justify-content: center;
align-items: center;
background-color: #00acdc;
color: #fff;
width: 166px;
height: 40px;
border: 0 solid transparent;
border-radius: 5px;
text-transform: uppercase;
font-weight: 700;
font-size: 14px;
line-height: 16px;
}

&__button-action:hover {
background-color: transparent;
color: #00acdc;
border: 1px solid #00acdc;
}
}
21 changes: 21 additions & 0 deletions src/styles/blocks/stars.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.stars {
display: flex;

&__star {
display: flex;
background-image: url(../images/star.svg);
background-repeat: no-repeat;
background-position: center;
width: 16px;
height: 16px;
margin-right: 4px;
}

&__star:last-child {
margin-right: 0;
}
}

.stars--4 .stars__star:nth-child(-n + 4) {
background-image: url(../images/star-active.svg);
}
122 changes: 122 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.

5 changes: 2 additions & 3 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
body {
margin: 0;
}
@import './blocks/card';
@import './blocks/stars';
Loading