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

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 @@ -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://amir-al-mohamad.github.io/layout_product-cards/)
- [TEST REPORT LINK](https://amir-al-mohamad.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
51 changes: 50 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,57 @@
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.

Ensure that the SCSS file is correctly compiled to CSS by the Parcel bundler, as browsers do not interpret SCSS directly.

/>

<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@300;400;500;700&display=swap"
rel="stylesheet"
/>
</head>
<body>
<h1>Product cards</h1>
<div
class="card"
data-qa="card"
>
<img
class="card__img"
src="/src/images/imac.jpeg"
alt="imac"
/>

<h2 class="card__name">
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)
<p class="card__code">Product code: 195434</p>
</h2>
Comment on lines +40 to +43

Choose a reason for hiding this comment

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

The BEM naming convention is used here. Ensure that all elements and modifiers follow this convention consistently throughout your project.


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

<div class="card__price">
Price:
<div class="card__price-value">$2,199</div>
</div>

<button
class="card__button-buy"
data-qa="hover"
>
BUY
</button>
</div>
</body>
</html>
128 changes: 128 additions & 0 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,131 @@
body {
margin: 0;
font-family: Roboto, sans-serif;
}

:root {
--font-family: 'Roboto', sans-serif;
--main-accent: #060b35;
--secondary: #616070;
--white: #fff;
--blue-accent: #00acdc;
--gray-elements: #f3f3f3;
--yellow-stars: #ffde6a;
}

.card {
border: 1px solid var(--gray-elements);
border-radius: 5px;
width: 198px;
height: 406px;
background-color: var(--white);
justify-content: center;
}

.card__img {
width: 160px;
height: 134px;
margin: 32px 19px 36px;
}

.card__name {
font-weight: 500;
font-size: 12px;
line-height: 150%;
color: #060b35;
margin: 0 16px 4px;
}

.card__code {
font-weight: 400;
font-size: 10px;
line-height: 140%;
color: #616070;
margin-top: 4px;
}

.stars {
gap: 4px;
margin-top: 16px;
display: flex;
margin-left: 16px;
margin-bottom: 24px;

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

&__reviews {
font-family: var(--font-family);
margin-top: 1.7px;
margin-left: 18px;
margin-right: 16px;
font-weight: 400;
font-size: 10px;
line-height: 140%;
color: var(--main-accent);
text-align: right;
}
}

.stars__star:nth-child(-n + 4) {
background-image: url(/src/images/star-active.svg);
background-repeat: no-repeat;
}

.card__price {
display: flex;
font-weight: 400;
font-size: 12px;
line-height: 150%;
color: var(--secondary);
margin-left: 16px;
margin-bottom: 16px;
}

.card__price-value {
display: block;
font-weight: 700;
font-size: 16px;
line-height: 112%;
text-align: right;
margin-left: 85px;
color: var(--main-accent);
}

button {
display: block;
width: 166px;
height: 40px;
margin: 0 16px 16px;
}

.card__button-buy {
font-family: var(--font-family);
font-size: 14px;
line-height: 16px;
font-weight: 700;
text-transform: uppercase;
text-align: center;
border-radius: 5px;
border: 1px solid var(--blue-accent);
color: #fff;
background-color: var(--blue-accent);
}

.card__button-buy:hover {
font-family: var(--font-family);
font-size: 14px;
line-height: 16px;
font-weight: 700;
text-transform: uppercase;
text-align: center;
border-radius: 5px;
border: 1px solid var(--blue-accent);
color: var(--blue-accent);
background-color: var(--white);
}
Loading