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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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 @@ -20,8 +20,8 @@ Create a pages with product card using `flexbox`, `BEM` and `SCSS` based on [thi

❗️ Replace `<your_account>` with your Github username and copy the links to `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://IlMarauder.github.io/layout_product-cards/)
- [TEST REPORT LINK](https://IlMarauder.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
9 changes: 9 additions & 0 deletions src/images/Rectangle 4.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/mac.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 48 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,55 @@
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: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"
/>
</head>
<body>
<h1>Product cards</h1>
<!-- <h1>Product cards</h1> -->
<div
class="block"
data-qa="card"
>
<div class="image"></div>
<div class="product-name">
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)
</div>
<div class="product-code">Product code: 195434</div>
<div class="review">
<div class="review__stars">
<span class="review__stars-star"></span>
<span class="review__stars-star"></span>
<span class="review__stars-star"></span>
<span class="review__stars-star"></span>
<span class="review__stars-star"></span>
</div>
<span class="review__number">Reviews: 5</span>
</div>
<div class="price">
<span class="price__title">Price:</span>
<span class="price__cost">$2,199</span>
</div>

<div class="buy-button">
<a
href="#"
class="buy-button__link"
data-qa="hover"
>
BUY
</a>
</div>
</div>
</body>
</html>
21 changes: 21 additions & 0 deletions src/styles/blocks/stars
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
&__stars {
align-items: center;
display: flex;

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

&:not(:last-child) {
margin-right: 4px;
}
}

& :nth-child(-n + 4) {
background-image: url(/src/images/star-active.svg);
}
}
114 changes: 114 additions & 0 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,117 @@
@import './utils/variable';

html {
font-family: Roboto, Arial, Helvetica, sans-serif;
}

body {
margin: 0;
}

/* #region card */

.block {
box-sizing: border-box;
display: flex;
width: 200px;
background-color: #fff;
flex-direction: column;
border: 1px solid #f3f3f3;
border-radius: 5px;
}

.image {
display: flex;
background-image: url(/src/images/imac.jpeg);

Choose a reason for hiding this comment

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

The URL for the background image seems incorrect. Ensure the path is correct relative to the CSS file location. It should be './images/imac.jpeg' if the image is in the 'images' folder within the 'src' directory.

Choose a reason for hiding this comment

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

The file path in the background-image URL seems incorrect. Ensure the path is correct and points to an existing image file.

background-size: cover;
background-position: center;
height: 134px;
width: 160px;
margin: 32px auto 0;
}

.product-name {
display: flex;
font-weight: 500;
padding-inline: $padding;
color: $main-text-color;
margin-top: 40px;
font-size: 12px;
line-height: 18px;
}

.product-code {
margin-top: 4px;
display: flex;
font-weight: 400;
color: $additional-text-color;
font-size: 10px;
padding-left: $padding;
line-height: 14px;
}

.review {
display: flex;
padding-inline: $padding;
justify-content: space-between;
margin-top: 16px;
align-items: flex-end;

@import '/src/styles/blocks/stars';

Choose a reason for hiding this comment

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

The import statement for '/src/styles/blocks/stars' seems incorrect. Ensure the path is correct relative to the current file location. It should be './blocks/stars' if the 'stars' file is in the 'blocks' folder within the 'styles' directory.

Choose a reason for hiding this comment

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

The import statement for '/src/styles/blocks/stars' should not be inside a CSS rule. Consider moving it to the top of the file or outside any CSS rules.


&__number {
font-size: 10px;
font-weight: 400;
color: $main-text-color;
line-height: 14px;
}
}

.price {
display: flex;
padding-inline: $padding;
justify-content: space-between;
line-height: 18px;
align-items: center;
margin-top: 24px;

&__title {
font-weight: 400;
font-size: 12;

Choose a reason for hiding this comment

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

The 'font-size' property value should include a unit (e.g., 'px', 'em'). It seems to be missing here.

Choose a reason for hiding this comment

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

The font-size value should have a unit (e.g., 'px', 'em'). Currently, it is missing a unit.

color: $additional-text-color;
}

&__cost {
font-size: 16px;
font-weight: 700;
color: $main-text-color;
}
}

.buy-button {
display: flex;
margin: 16px;
background-color: #00acdc;
height: 39px;
align-items: center;
border-radius: 5px;
border: 1px solid #00acdc;

&__link {
text-decoration: none;
color: #fff;
font-weight: 700;
font-size: 14px;
line-height: 16px;
margin: 0 auto;
}

&:hover {
background-color: #fff;

.buy-button__link {
color: #00acdc;
}
}
}
/* #endregion */
3 changes: 3 additions & 0 deletions src/styles/utils/variable.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$main-text-color: #060b35;
$additional-text-color: #616070;
$padding: 16px;
Loading