Skip to content

Commit

Permalink
add task solution
Browse files Browse the repository at this point in the history
  • Loading branch information
anastasiiadns committed Jan 9, 2025
1 parent 606dc21 commit 5b47e21
Show file tree
Hide file tree
Showing 12 changed files with 225 additions and 13 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/test.yml-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test

on:
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
- name: Upload HTML report(backstop data)
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: report
path: backstop_data
9 changes: 5 additions & 4 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@mate-academy/backstop-config": "latest",
"@mate-academy/bemlint": "latest",
"@mate-academy/linthtml-config": "latest",
"@mate-academy/scripts": "^1.8.6",
"@mate-academy/scripts": "^1.9.12",
"@mate-academy/stylelint-config": "latest",
"@parcel/transformer-sass": "^2.12.0",
"backstopjs": "6.3.23",
Expand Down
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://anastasiiadns.github.io/layout_product-cards/)
- [TEST REPORT LINK](https://anastasiiadns.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
60 changes: 57 additions & 3 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<!doctype html>
<html lang="en">
<html
lang="en"
class="page"
>
<head>
<meta charset="UTF-8" />
<meta
Expand All @@ -11,8 +14,59 @@
rel="stylesheet"
href="./styles/index.scss"
/>
<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=Cinzel:wght@700&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"
/>
</head>
<body>
<h1>Product cards</h1>
<body class="page__body">
<div
class="card"
data-qa="card"
>
<img
class="card__background"
src="images/imac.jpeg"
alt="APPLE A1419 iMac 27"
/>

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

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

<p class="stars__reviews">Reviews: 5</p>
</div>

<div class="cost">
<p class="cost__text">Price:</p>
<p class="cost__price">$2,199</p>
</div>

<div
class="button"
data-qa="hover"
>
<button class="button__link">BUY</button>
</div>
</body>
</html>
25 changes: 25 additions & 0 deletions src/styles/blocks/button.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.button {
margin-left: $retreat-margin-left;
margin-top: 16px;

&__link {
width: $tablet-min-width;
height: 40px;
background-color: $main-butter-color;
border: 1px solid $main-butter-color;
border-radius: 5px;
cursor: pointer;

font-size: 14px;
font-weight: 700;
line-height: 16px;
text-align: center;
color: white;

&:hover {
background-color: white;
color: $main-butter-color;
border: 1px solid $main-butter-color;
}
}
}
35 changes: 35 additions & 0 deletions src/styles/blocks/card.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.card {
&__background {
margin-top: 33px;
margin-left: 20px;
margin-right: 20px;
width: 160px;
height: 134px;
background-size: contain;
background-repeat: no-repeat;
}

&__text {
margin-left: $retreat-margin-left;
}

&__text--name {
margin: 0;
padding-bottom: 4px;
padding-top: 35px;
font-size: 12px;
width: $tablet-min-width;
height: 36px;
font-weight: 500;
line-height: 18px;
}

&__text--description {
margin: 0;
font-size: 10px;
color: #616070;
height: 14px;
font-weight: 400;
line-height: 14px;
}
}
22 changes: 22 additions & 0 deletions src/styles/blocks/cost.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.cost {
display: flex;
justify-content: space-between;
margin-left: $retreat-margin-left;
margin-top: 24px;
width: $tablet-min-width;

&__text {
margin: 0;
font-size: 12px;
line-height: 18px;
font-weight: 400;
}

&__price {
margin: 0;
font-size: 16px;
line-height: 18px;
font-weight: 700;
text-align: right;
}
}
10 changes: 10 additions & 0 deletions src/styles/blocks/page.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.page {
font-family: Roboto, sans-serif;
display: flex;
justify-content: center;

&__body {
padding: 0;
box-sizing: border-box;
}
}
27 changes: 27 additions & 0 deletions src/styles/blocks/stars.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.stars {
display: flex;
margin-left: $retreat-margin-left;
margin-top: 16px;
width: $tablet-min-width;

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

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

&__reviews {
margin: 0;
font-size: 10px;
font-weight: 400;
line-height: 14px;
text-align: right;
padding-left: 17px;
}
}
10 changes: 7 additions & 3 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
body {
margin: 0;
}
@import './utils/variables';

@import './blocks/page';
@import './blocks/card';
@import './blocks/stars';
@import './blocks/cost';
@import './blocks/button';
5 changes: 5 additions & 0 deletions src/styles/utils/variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$main-butter-color: #00acdc;

$tablet-min-width: 166px;

$retreat-margin-left: 17px;

0 comments on commit 5b47e21

Please sign in to comment.