Skip to content

Commit

Permalink
add solution
Browse files Browse the repository at this point in the history
  • Loading branch information
KOliinyk committed Dec 16, 2024
1 parent 606dc21 commit 20cc5e4
Show file tree
Hide file tree
Showing 3 changed files with 190 additions and 6 deletions.
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://KOliinyk.github.io/layout_product-cards/)
- [TEST REPORT LINK](https://KOliinyk.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
56 changes: 54 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,64 @@
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"
crossorigin="anonymous"
/>
<link
href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="./styles/index.scss"
/>
</head>
<body>
<h1>Product cards</h1>
<body class="body">
<header class="header">
<div
class="header__cards"
data-qa="card"
></div>

<div class="header__content">
<p>APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)</p>
</div>
<div class="header__product">
<p>Product code:195434</p>
</div>

<div class="stars stars--0">
<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="price">
<div class="price__title">Price:</div>
<div class="price__number">$2,199</div>
</div>

<footer
class="footer"
data-qa="hover"
>
<a
class="footer__button"
href="#buy"
>
BUY
</a>
</footer>
</header>
</body>
</html>
136 changes: 134 additions & 2 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,135 @@
body {
margin: 0;
html {
font-family: Roboto, sans-serif;
}

.body {
margin: 0 10px;
padding: 0;
text-align: center;
}

.header {
width: 200px;
height: 406px;
border-radius: 5px;
border: 1px solid #f3f3f3;

&__cards {
margin-top: 32px;
margin-left: 19px;
background-image: url(../images/imac.jpeg);
background-size: 160px;
width: 160px;
height: 134px;
}

&__content {
width: 166px;
height: 36px;
margin-top: 40px;
font-weight: 500;
font-size: 12px;
line-height: 18px;
margin-left: 16px;
}

&__product {
width: 98px;
height: 14px;
margin-top: 4px;
font-weight: 400;
font-size: 10px;
line-height: 14px;
margin-left: 16px;
}
}

.stars {
margin-top: 16px;
width: 50%;
height: 16px;
display: flex;
justify-content: space-between;
margin-left: 16px;

&__reviews {
position: absolute;
height: 16px;
font-size: 10px;
font-weight: 400;
line-height: 14px;
display: flex;
justify-content: space-between;
margin-left: 120px;
}

&__star {
width: 96px;
height: 16px;
display: block;
background-size: 16px;
background-image: url(../images/star.svg);
background-repeat: no-repeat;
position: relative;
}

&--0 &__star:nth-child(-n + 4) {
background-image: url(../images/star-active.svg);
background-repeat: no-repeat;
background-size: 16px;
position: relative;
}
}

.price {
width: 166px;
height: 18px;
display: flex;
justify-content: space-between;
margin-top: 24px;
margin-left: 16px;

&__title {
font-size: 12px;
font-weight: 400;
line-height: 18px;
justify-content: space-between;
}

&__number {
font-size: 16px;
font-weight: 700;
line-height: 18px;
}
}

.footer {
margin: 16px;
width: 166px;
height: 40px;
background: #00acdc;
border-radius: 5px;

&__button {
margin: 12px 70px;
width: 27px;
height: 16px;
font-size: 14px;
font-weight: 700;
line-height: 16px;
display: inline-block;
color: #fff;
text-decoration: none;
}

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

&__button:hover {
color: #00acdc;
text-decoration: none;
}
}

0 comments on commit 20cc5e4

Please sign in to comment.