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

product card #4891

Closed
wants to merge 1 commit into from
Closed
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 @@ -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://StricTGod.github.io/layout_product-cards/)
- [TEST REPORT LINK](https://StricTGod.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
59 changes: 57 additions & 2 deletions 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=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"
href="/src/styles/index.scss"

Choose a reason for hiding this comment

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

The href attribute is pointing to a SCSS file. Typically, browsers cannot directly interpret SCSS files. You should link to a compiled CSS file instead.

Choose a reason for hiding this comment

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

The href attribute should link to a CSS file, not a SCSS file. Browsers cannot directly interpret SCSS files, so you need to compile your SCSS into CSS and link to the resulting CSS file.

/>
</head>
<body>
<h1>Product cards</h1>
<div
class="card"
data-qa="card"
>
<img
src="/src/images/imac.jpeg"
alt="imac"
class="card__img"
/>

<h2 class="card__text">
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)
</h2>

<h3 class="card__code">Product code: 195434</h3>

<div class="stars">
<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">
<span class="card__price-text">Price:</span>
<span class="card__price-value">$2,199</span>
</div>

<div
class="card__link"
data-qa="hover"
>
<a
href="#"

Choose a reason for hiding this comment

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

The href attribute of the anchor tag is set to '#'. This is generally used as a placeholder and should be replaced with a valid URL or removed if not needed.

class="card__link-button"
>
Buy
</a>
</div>
</div>
</body>
</html>
127 changes: 127 additions & 0 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,130 @@
html {
font-family: Roboto, sans-serif;
}

body {
box-sizing: border-box;
margin: 0;
padding: 0;
}

.card {
width: 166px;
border-radius: 5px;
border: 1px solid #f3f3f3;
padding: 32px 16px 16px;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;

&__img {
display: flex;
flex-direction: column;
width: 160px;
height: 134px;
margin-bottom: 40px;
}

&__text {
line-height: 18px;
font-size: 12px;
font-weight: 500;
color: #060b35;
width: 100%;
height: 36px;
margin-bottom: 0;
}

&__code {
line-height: 14px;
font-size: 10px;
font-weight: 400;
color: #616070;
width: 100%;
height: 14px;
text-align: left;
margin-bottom: 24px;
}

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

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

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

&__link {
width: 166px;

&-button {
display: flex;
justify-content: center;
align-items: center;
text-transform: uppercase;
text-decoration: none;
width: 166px;
height: 40px;
font-weight: 700;
border-radius: 5px;
background-color: #00acdc;
color: #fff;
}

&-button:hover {
border: 1px solid #00acdc;
background-color: #fff;
color: #00acdc;
}
}
}

.stars {
display: flex;
align-items: center;
width: 166px;
margin-bottom: 24px;

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

&__star:nth-child(-n + 4) {

Choose a reason for hiding this comment

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

The selector &__star:nth-child(-n + 4) might not be clear in terms of its intent. Consider adding a comment to explain that it targets the first four child elements, or use a more descriptive class name if possible.

background-image: url(/src/images/star-active.svg);
}

&__reviews {
display: flex;
text-align: center;
justify-content: right;
line-height: 14px;
font-size: 10px;
font-weight: 400;
color: #060b35;
}
}

/*# sourceMappingURL=index.css.map */
Loading