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

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
8 changes: 4 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Product cards

Create a page with product card using `flexbox`, `BEM` and `SCSS` based on [this mockup](https://www.figma.com/file/ojkArVazq7vsX0nbpn9CxZ/Moyo-%2F-Catalog-(ENG)?node-id=11325%3A2287&mode=dev).
Create a page with product card using `flexbox`, `BEM` and `SCSS` based on [this mockup](<https://www.figma.com/file/ojkArVazq7vsX0nbpn9CxZ/Moyo-%2F-Catalog-(ENG)?node-id=11325%3A2287&mode=dev>).

> Here are the [Layout Tasks Instructions](https://mate-academy.github.io/layout_task-guideline)

Expand All @@ -16,15 +16,15 @@ Create a page with product card using `flexbox`, `BEM` and `SCSS` based on [this
- Rewrite the `stars` block from the [Stars task](https://github.com/mate-academy/layout_stars) with SCSS and use it
- Find the required font on [google fonts](https://fonts.google.com/) and use.

*Important note*: In this task, you are allowed to link `*.scss` files directly in HTML `<link>` tags using `href` attribute.
_Important note_: In this task, you are allowed to link `*.scss` files directly in HTML `<link>` tags using `href` attribute.
This is possible because [we use the Parcel library](https://en.parceljs.org/scss.html) to bundle your solution's source code.

## Checklist

❗️ 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://in4ik1303.github.io/layout_product-cards/)
- [TEST REPORT LINK](https://in4ik1303.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
57 changes: 56 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,67 @@
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"
/>
<link
href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap"
rel="stylesheet"
/>
<link
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 your build process correctly compiles SCSS to CSS. Linking SCSS files directly in HTML is only valid if you are using a tool like Parcel that handles SCSS compilation.

/>
</head>
<body>
<h1>Product cards</h1>
<div
class="container"
data-qa="card"
>
<div class="header">
<img
class="header__img"
src="../src/images/imac.jpeg"
alt="imac"
/>
</div>
<div class="menu">
<h1 class="menu__h1">
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)
</h1>
<h2 class="menu__h2">Product code: 195434</h2>

<div class="menu__stars">
<div class="stars">
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
</div>
<div class="menu__stars-text">Reviews: 5</div>
</div>

<div class="menu__price">
<div class="menu__price-text">Price:</div>
<div class="menu__price-many">$2,199</div>
</div>
</div>

<div class="footer">
<button
data-qa="hover"
type="button"
class="footer__button"
>
Buy
</button>
</div>
</div>
</body>
</html>
4 changes: 4 additions & 0 deletions src/styles/blocks/body.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
body {
margin: 0;
font-family: Roboto, sans-serif;
}
3 changes: 3 additions & 0 deletions src/styles/blocks/container.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.container {
width: 200px;
}
26 changes: 26 additions & 0 deletions src/styles/blocks/footer.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.footer {
padding-inline: 16.67px;
padding-top: 16px;

&__button {
padding: 0;
width: 166px;
height: 40px;
border: 1px solid #00acdc;
border-radius: 5px;
background: #00acdc;

color: #fff;
font-size: 14px;
font-weight: 700;
line-height: 16px;
text-transform: uppercase;
text-align: center;
align-items: center;

Choose a reason for hiding this comment

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

The align-items: center; property will only have an effect if the button is a flex container. Ensure that the button or its parent is set to display: flex; if you intend to use this property.


&:hover {
background: #fff;
color: #00acdc;
}
}
}
7 changes: 7 additions & 0 deletions src/styles/blocks/header.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.header__img {
margin: 0 auto;
width: 160px;
height: 134px;
padding-top: 32.67px;
padding-inline: 19.67px;
}
80 changes: 80 additions & 0 deletions src/styles/blocks/menu.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
.menu {
padding-top: 40px;
padding-inline: 16.67px;

&__h1 {
margin: 0;
padding: 0;
font-size: 12px;
font-weight: 500;
line-height: 18px;
text-align: left;
color: #060b35;
}

&__h2 {
margin: 0;
padding-top: 4px;
font-size: 10px;
font-weight: 400;
line-height: 14px;
text-align: left;
color: #616070;
}

&__stars {
display: flex;
justify-content: space-between;
padding-top: 16px;
width: 166px;
height: 16px;
gap: 17px;

&-text {
font-size: 10px;
font-weight: 400;
line-height: 19px;
text-align: right;
color: #060b35;
align-content: center;

Choose a reason for hiding this comment

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

The align-content: center; property will only have an effect if the element is a flex container. Ensure that the parent element is set to display: flex; if you intend to use this property.

}
}
&__price {
padding-top: 24px;
display: flex;
justify-content: space-between;

&-text {
color: #616070;
font-size: 12px;
font-weight: 400;
line-height: 18px;
text-align: left;
}

&-many {
color: #060b35;
font-size: 16px;
font-weight: 700;
line-height: 18px;
text-align: right;
}
}
}

.stars {
display: flex;
gap: 4px;

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

&:nth-child(-n + 4) {
background-image: url(../images/star-active.svg);
}
}
}
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 'blocks/menu';
@import 'blocks/header';
@import 'blocks/footer';
@import 'blocks/container';
@import 'blocks/body';
Loading