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

card #5261

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

card #5261

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://dvdmsk.github.io/layout_product-cards/)
- [TEST REPORT LINK](https://dvdmsk.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
48 changes: 47 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,54 @@
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:wght@400;500;700&display=swap"
rel="stylesheet"
/>
</head>
<body>
<h1>Product cards</h1>
<div
class="card"
data-qa="card"
>
<img
src="./images/imac.jpeg"
alt="card image"
class="card__image"
/>
<h2 class="card__title">
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)
</h2>
<p class="card__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="review">Reviews: 5</p>
</div>
<p class="card__price">
Price:
<span>$2,199</span>
</p>
<a
class="card__btn"
href="#"
data-qa="hover"
>
Buy
</a>
</div>
</body>
</html>
131 changes: 131 additions & 0 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,134 @@
:root {
--main-black: #060b35;
--main-grey: #616070;
}

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 to improve maintainability and organization, as suggested in the previous review.


body {
margin: 0;
background-color: #ccc;
font-family: Roboto, serif;
color: var(--main-black);
}

*,
*::before,
*::after {
box-sizing: border-box;
}

p {
margin: 0;
}

a {
text-decoration: none;
}

.card {
width: 200px;
margin: 10px auto;
background-color: #fff;
padding: 32px 16px 16px;
border-radius: 5px;
border: 1px solid #f3f3f3;

&__image {
display: block;
width: 160px;
margin-bottom: 40px;
margin-right: auto;
margin-left: auto;
}

&__title {
font-weight: 500;
font-size: 12px;
line-height: 18px;
margin-bottom: 4px;
}

&__code {
font-weight: 400;
font-size: 10px;
line-height: 14px;
color: var(--main-grey);
margin-bottom: 16px;
}

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

.review {
padding-top: 1px;
font-weight: 400;
font-size: 10px;
line-height: 14px;
text-align: right;
display: flex;
align-items: center;
align-self: center;
}
}

&__price {
display: flex;
justify-content: space-between;
font-weight: 400;
font-size: 12px;
line-height: 18px;
color: var(--main-grey);
margin-bottom: 16px;

& span {
font-weight: 700;
font-size: 16px;
line-height: 18px;
color: var(--main-black);
}
}

&__btn {
display: block;
height: 40px;
font-weight: 700;
font-size: 14px;
line-height: 16px;
padding: 12px 70px 12px 69px;
background-color: #00acdc;
color: #fff;
border-radius: 5px;
text-transform: uppercase;
box-sizing: border-box;
transition: none;

&:hover {
border: 1px solid #00acdc;
background-color: #fff;
color: #00acdc;
height: 40px;
padding: 11px 69px 11px 68px;
}
}
}

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

@for $i from 1 through 5 {
&--#{$i} :nth-child(-n + #{$i}) {
background-image: url(../images/star-active.svg);
}
}

Choose a reason for hiding this comment

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

Consider creating a separate SCSS file for the stars BEM block to enhance maintainability and adhere to the task requirements.

}
Loading