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

Develop #5133

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

Develop #5133

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://KristinaMelnyk.github.io/layout_product-cards/)
- [TEST REPORT LINK](https://KristinaMelnyk.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
53 changes: 51 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,59 @@
<title>Product cards</title>
<link
rel="stylesheet"
href="./styles/index.scss"
href="styles/index.css"
/>
<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"
/>
</head>
<body>
<h1>Product cards</h1>
<section class="page">
<div
class="product-card"
data-qa="card"
>
<div class="product-card__image">
<img
src="images/imac.jpeg"
alt="photo of iMac 27"
/>
</div>
<h3 class="product-card__title">
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)
</h3>
<p class="product-card__code">Product code: 195434</p>
<div class="product-card__rating">
<div class="product-card__stars">
<div class="product-card__star"></div>
<div class="product-card__star"></div>
<div class="product-card__star"></div>
<div class="product-card__star"></div>
<div class="product-card__star"></div>
</div>
<p class="product-card__reviews">Reviews: 5</p>
</div>
<div class="product-card__price-section">
<span class="product-card__price">Price:</span>
<span class="product-card__amount">$2,199</span>
</div>
<a
href="#"
class="product-card__button"
data-qa="hover"
>
BUY
</a>
</div>
</section>
</body>
</html>
134 changes: 134 additions & 0 deletions src/styles/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
font-family: Roboto, sans-serif;
background-color: rgb(255, 255, 255);
display: flex;
justify-content: center;
align-items: center;
}

.page {
display: flex;
justify-content: center;
align-items: center;
}

.product-card {
padding: 16px;
background-color: #fff;
border: 1px solid rgb(243, 243, 243);
border-radius: 5px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
width: 200px;
height: 408px;
}

.product-card__image {
width: 160px;
height: 134px;
margin: 16px auto 40px;
}

.product-card__image img {
width: 100%;
border-radius: 8px;
}

.product-card__title {
width: 166px;
height: 36px;
font-size: 12px;
line-height: 18px;
margin-bottom: 4px;
color: rgb(6, 11, 53);
font-weight: 500;
}

.product-card__code {
width: 98px;
font-size: 10px;
line-height: 14px;
margin-bottom: 16px;
color: rgb(97, 96, 112);
font-weight: 400;
}

.product-card__rating {
width: 166px;
height: 16px;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 24px;
}

.product-card__stars {
display: flex;
}

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

.product-card__star:nth-child(-n + 4) {
background-image: url(../images/star-active.svg);
}

.product-card__reviews {
font-size: 10px;
line-height: 14px;
color: rgb(6, 11, 53);
margin-left: auto;
}

.product-card__price-section {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 16px;
}

.product-card__price {
font-size: 12px;
color: rgb(97, 96, 112);
}

.product-card__amount {
font-size: 16px;
font-weight: 700;
color: rgb(6, 11, 53);
}

.product-card__button {
display: flex;
justify-content: center;
align-items: center;
width: 166px;
height: 40px;
font-size: 14px;
font-weight: 700;
color: rgb(255, 255, 255);
background-color: rgb(0, 172, 220);
border: none;
border-radius: 5px;
text-decoration: none;
transition:
background-color 0.3s,
color 0.3s;
}

.product-card__button:hover {
background-color: rgb(255, 255, 255);
color: rgb(0, 172, 220);
border: 1px solid rgb(0, 172, 220);
} /*# sourceMappingURL=index.css.map */
1 change: 1 addition & 0 deletions src/styles/index.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

133 changes: 132 additions & 1 deletion src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,134 @@
body {
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
font-family: Roboto, sans-serif;
background-color: rgba(255, 255, 255, 1);
display: flex;
justify-content: center;
align-items: center;
}

.page {
display: flex;
justify-content: center;
align-items: center;
}

.product-card {
padding: 16px;
background-color: #fff;
border: 1px solid rgba(243, 243, 243, 1);
border-radius: 5px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
width: 200px;
height: 408px;

&__image {
width: 160px;
height: 134px;
margin: 16px auto 40px;

img {
width: 100%;
border-radius: 8px;
}
}

&__title {
width: 166px;
height: 36px;
font-size: 12px;
line-height: 18px;
margin-bottom: 4px;
color: rgba(6, 11, 53, 1);
font-weight: 500;
}

&__code {
width: 98px;
font-size: 10px;
line-height: 14px;
margin-bottom: 16px;
color: rgba(97, 96, 112, 1);
font-weight: 400;
}

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

&__stars {
display: flex;
}

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

&:nth-child(-n + 4) {
background-image: url(../images/star-active.svg);
}
}

&__reviews {
font-size: 10px;
line-height: 14px;
color: rgba(6, 11, 53, 1);
margin-left: auto;
}

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

&__price {
font-size: 12px;
color: rgba(97, 96, 112, 1);
}

&__amount {
font-size: 16px;
font-weight: 700;
color: rgba(6, 11, 53, 1);
}

&__button {
display: flex;
justify-content: center;
align-items: center;
width: 166px;
height: 40px;
font-size: 14px;
font-weight: 700;
color: rgba(255, 255, 255, 1);
background-color: rgba(0, 172, 220, 1);
border: none;
border-radius: 5px;
text-decoration: none;
transition:
background-color 0.3s,
color 0.3s;

&:hover {
background-color: rgba(255, 255, 255, 1);
color: rgba(0, 172, 220, 1);
border: 1px solid rgba(0, 172, 220, 1);
}
}
}
Loading