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

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

Card #4876

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://SemenVodolazskij.github.io/layout_product-cards/)
- [TEST REPORT LINK](https://SemenVodolazskij.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
49 changes: 47 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,57 @@
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:wght@400;500;700&display=swap"
rel="stylesheet"
/>

<link
rel="stylesheet"
href="./styles/index.scss"
href="./styles/index.css"
/>
</head>
<body>
<h1>Product cards</h1>
<div
class="card"
data-qa="card"
>
<img
src="./images/imac.jpeg"
alt="Imac"
class="card_image card_image--imac"
/>
<div class="description">
Apple A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)
</div>
<div class="product_code">Product code: 195434</div>
<div class="star_review">
<div class="stars_active"></div>
<div class="stars_active"></div>
<div class="stars_active"></div>
<div class="stars_active"></div>
Comment on lines +43 to +46

Choose a reason for hiding this comment

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

It seems like you have multiple divs with the class 'stars_active'. If these are meant to represent individual stars in a rating system, consider using a more semantic approach, such as using a list or a span with appropriate ARIA attributes for better accessibility.

<div class="stars"></div>

<span class="reviews">Reviews: 5</span>
</div>
<div class="price">
<span class="text_price">Price:</span>
<span class="numeric_price">$2,199</span>
</div>
<button
class="button_buy"
data-qa="hover"
>
<span class="button_text">Buy</span>
</button>
</div>
</body>
</html>
95 changes: 95 additions & 0 deletions src/styles/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
body {
margin: 0;
font-family: Roboto, sans-serif, Arial;

Choose a reason for hiding this comment

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

The font-family property should list generic font families at the end. Consider placing 'Arial' before 'sans-serif'.

}

.card {
width: 200px;
padding: 32px 16px 16px;
}

.card_image {
display: flex;
width: 160px;
height: 134px;
margin-bottom: 40px;
}

.description {
font-weight: 500;
margin-bottom: 4px;
font-size: 12px;
}

.card_image--imac {
background-image: url(../images/imac.jpeg);
}

.product_code {

Choose a reason for hiding this comment

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

Class names should use hyphens instead of underscores according to the BEM naming convention. Consider renaming '.product_code' to '.product-code'.

margin-bottom: 16px;
font-size: 10px;
line-height: 14px;
}

.star_review {

Choose a reason for hiding this comment

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

Class names should use hyphens instead of underscores according to the BEM naming convention. Consider renaming '.star_review' to '.star-review'.

margin-bottom: 24px;
display: flex;
justify-content: space-between;
}

.reviews {

Choose a reason for hiding this comment

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

Class names should use hyphens instead of underscores according to the BEM naming convention. Consider renaming '.reviews' to '.review'.

display: flex;
white-space: nowrap;
font-size: 10px;
align-items: center;
}

.stars_active {

Choose a reason for hiding this comment

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

Class names should use hyphens instead of underscores according to the BEM naming convention. Consider renaming '.stars_active' to '.stars-active'.

background-image: url(../images/star-active.svg);
background-repeat: no-repeat;
background-position: center;
width: 16px;
height: 16px;
margin-right: 4px;
}

.stars {

Choose a reason for hiding this comment

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

Class names should use hyphens instead of underscores according to the BEM naming convention. Consider renaming '.stars' to '.star'.

background-image: url(../images/star.svg);
background-repeat: no-repeat;
background-position: center;
width: 16px;
height: 16px;
margin-right: 4px;
}

.price {

Choose a reason for hiding this comment

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

Class names should use hyphens instead of underscores according to the BEM naming convention. Consider renaming '.price' to '.pricing'.

display: flex;
justify-content: space-between;
margin-bottom: 16px;
}

.text_price {

Choose a reason for hiding this comment

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

Class names should use hyphens instead of underscores according to the BEM naming convention. Consider renaming '.text_price' to '.text-price'.

color: #616070;
}

.numeric_price {

Choose a reason for hiding this comment

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

Class names should use hyphens instead of underscores according to the BEM naming convention. Consider renaming '.numeric_price' to '.numeric-price'.

font-family: Roboto, sans-serif, Arial;
font-weight: 700;
}

.button_buy {

Choose a reason for hiding this comment

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

Class names should use hyphens instead of underscores according to the BEM naming convention. Consider renaming '.button_buy' to '.button-buy'.

display: flex;
justify-content: center;
align-items: center;
background-color: #00acdc;
color: white;
border-radius: 5px;
width: 100%;
height: 40px;
border: solid #00acdc;
}

.button_buy:hover {
background-color: white;
color: #00acdc;
}
3 changes: 0 additions & 3 deletions src/styles/index.scss

This file was deleted.

Loading