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-cards #5140

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
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://greyhoundIlya.github.io/layout_product-cards/)
- [TEST REPORT LINK](https://greyhoundIlya.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
Binary file added src/images/Star-png.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/images/Star-star.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/img-imac-png.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
120 changes: 119 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,126 @@
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.

Linking SCSS files directly in HTML is not recommended as the Parcel bundler should handle the compilation. Ensure that the SCSS files are compiled into CSS files by Parcel.

/>
<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/change.scss"

Choose a reason for hiding this comment

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

Similar to the previous comment, ensure that SCSS files are compiled into CSS by the Parcel bundler instead of linking them directly in HTML.

/>
</head>

<body>
<h1>Product cards</h1>
<div
data-qa="card"
class="card"
>
<img
class="card-image"
src="/src/images/img-imac-png.png"
alt="Appleimac"
/>
<h2 class="card-name">
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)
</h2>
<p class="card-product-code">Product code: 195434</p>

<div class="card-stars">
<div class="stars">
<div class="stars-star">
<svg
xmlns="http://www.w3.org/2000/svg"
width="13"
height="12"
fill="none"
viewBox="0 0 13 12"
>
<path
fill="#FFDE6A"
d="M5.792.356a.515.515 0 0 1 .98 0l1.13 3.477a.515.515 0 0 0 .49.356h3.656c.499 0 .707.639.303.932l-2.958 2.15a.515.515 0 0 0-.187.575l1.13 3.477a.515.515 0 0 1-.793.576L6.585 9.75a.515.515 0 0 0-.606 0L3.022 11.9a.515.515 0 0 1-.793-.577l1.13-3.477a.515.515 0 0 0-.188-.576L.213 5.121a.515.515 0 0 1 .303-.932h3.656a.515.515 0 0 0 .49-.356L5.792.356z"
/>
</svg>
</div>
<div class="stars-star">
<svg
xmlns="http://www.w3.org/2000/svg"
width="13"
height="12"
fill="none"
viewBox="0 0 13 12"
>
<path
fill="#FFDE6A"
d="M5.792.356a.515.515 0 0 1 .98 0l1.13 3.477a.515.515 0 0 0 .49.356h3.656c.499 0 .707.639.303.932l-2.958 2.15a.515.515 0 0 0-.187.575l1.13 3.477a.515.515 0 0 1-.793.576L6.585 9.75a.515.515 0 0 0-.606 0L3.022 11.9a.515.515 0 0 1-.793-.577l1.13-3.477a.515.515 0 0 0-.188-.576L.213 5.121a.515.515 0 0 1 .303-.932h3.656a.515.515 0 0 0 .49-.356L5.792.356z"
/>
</svg>
</div>
<div class="stars-star">
<svg
xmlns="http://www.w3.org/2000/svg"
width="13"
height="12"
fill="none"
viewBox="0 0 13 12"
>
<path
fill="#FFDE6A"
d="M5.792.356a.515.515 0 0 1 .98 0l1.13 3.477a.515.515 0 0 0 .49.356h3.656c.499 0 .707.639.303.932l-2.958 2.15a.515.515 0 0 0-.187.575l1.13 3.477a.515.515 0 0 1-.793.576L6.585 9.75a.515.515 0 0 0-.606 0L3.022 11.9a.515.515 0 0 1-.793-.577l1.13-3.477a.515.515 0 0 0-.188-.576L.213 5.121a.515.515 0 0 1 .303-.932h3.656a.515.515 0 0 0 .49-.356L5.792.356z"
/>
</svg>
</div>
<div class="stars-star">
<svg
xmlns="http://www.w3.org/2000/svg"
width="13"
height="12"
fill="none"
viewBox="0 0 13 12"
>
<path
fill="#FFDE6A"
d="M5.792.356a.515.515 0 0 1 .98 0l1.13 3.477a.515.515 0 0 0 .49.356h3.656c.499 0 .707.639.303.932l-2.958 2.15a.515.515 0 0 0-.187.575l1.13 3.477a.515.515 0 0 1-.793.576L6.585 9.75a.515.515 0 0 0-.606 0L3.022 11.9a.515.515 0 0 1-.793-.577l1.13-3.477a.515.515 0 0 0-.188-.576L.213 5.121a.515.515 0 0 1 .303-.932h3.656a.515.515 0 0 0 .49-.356L5.792.356z"
/>
</svg>
</div>
<div class="stars-star">
<svg
xmlns="http://www.w3.org/2000/svg"
width="13"
height="12"
fill="none"
viewBox="0 0 13 12"
>
<path
fill="#E5E5E5"
d="M5.792.356a.515.515 0 0 1 .98 0l1.13 3.477a.515.515 0 0 0 .49.356h3.656c.499 0 .707.639.303.932l-2.958 2.15a.515.515 0 0 0-.187.575l1.13 3.477a.515.515 0 0 1-.793.576L6.585 9.75a.515.515 0 0 0-.606 0L3.022 11.9a.515.515 0 0 1-.793-.577l1.13-3.477a.515.515 0 0 0-.188-.576L.213 5.121a.515.515 0 0 1 .303-.932h3.656a.515.515 0 0 0 .49-.356L5.792.356z"
/>
</svg>
</div>
</div>
<p class="card_reviews">Reviews: 5</p>
</div>

<div class="card-price">
<p class="price">Price:</p>
<p class="total">$2,199</p>
</div>

<button
class="card-button"
data-qa="hover"
>
BUY
</button>
</div>
</body>
</html>
4 changes: 4 additions & 0 deletions src/styles/change.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$colors-btn: #00acdc;
$colors-backgraund: #f3f3f3;

Choose a reason for hiding this comment

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

There's a typo in the variable name $colors-backgraund. It should be $colors-background to ensure clarity and consistency.

$color-grey: #616070;
$color-dark-blue: #060b35;
102 changes: 102 additions & 0 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,105 @@
@import './change';

body {
margin: 8px;
padding: 0;
font-family: Roboto, sans-serif;
box-sizing: border-box;
display: block;
}

.card {
border: 1px solid $colors-backgraund;

Choose a reason for hiding this comment

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

The variable $colors-backgraund contains a typo. It should be $colors-background to match the corrected variable name in change.scss.

width: 200px;
padding: 32px 16px 16px;
box-sizing: border-box;
background-color: #fff;

&-image {
display: block;
width: 160px;
height: 134px;
margin: 0 auto 40px;
}

&-product-code {
color: $color-grey;
font-size: 10px;
font-weight: 400;
}

&-name {
line-height: 18px;
color: $color-dark-blue;
font-size: 12px;
font-weight: 500;
margin-bottom: 4px;
}

&-button {
color: white;
background-color: #00acdc;
width: 166px;
height: 40px;
border: none;
border-radius: 5px;
}

&_reviews {
color: $color-dark-blue;
font-size: 10px;
font-weight: 400;
line-height: 14px;
}

&-stars {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 16px;
margin-bottom: 24px;
}

&-price {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16px;
}
}

p {
margin: 0;
}

.card-button:hover {
color: $colors-btn;
background-color: $colors-backgraund;

Choose a reason for hiding this comment

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

Ensure the variable $colors-backgraund is corrected to $colors-background to apply the intended background color.

border: 1px solid $colors-btn;
}

.stars {
display: flex;
}

.stars-star {
display: flex;
align-items: center;
width: 16px;
height: 16px;
margin-left: 4px;
}

.price {
font-size: 12px;
line-height: 18px;
color: $color-grey;
font-weight: 400;
}

.total {
font-weight: 700;
line-height: 18px;
font-size: 16px;
color: $color-dark-blue;
}
Loading