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

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

Develop #5157

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
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
4,737 changes: 2,808 additions & 1,929 deletions package-lock.json

Large diffs are not rendered by default.

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
46 changes: 44 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,57 @@
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
content="width=device-width,
user-scalable=no,
initial-scale=1.0,
maximum-scale=1.0,
minimum-scale=1.0"
/>
<title>Product cards</title>
<link
rel="stylesheet"
href="./styles/index.scss"
/>
<link
href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap"
rel="stylesheet"
/>
</head>
<body>
<h1>Product cards</h1>
<div
class="card"
data-qa="card"
>
<img
class="card__image image"
src="images/imac.jpeg"
alt="APPLE A1419 iMac 27 Retina 5K Monoblock"
/>

<h3 class="card__device-name">
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)
</h3>
<p class="card__device-code">Product code: 195434</p>
<div class="card__reviews">
<div class="stars stars--4">
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__starN"></div>

Choose a reason for hiding this comment

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

The class name stars__starN seems inconsistent with the other class names like stars__star. If this is not intentional, consider renaming it to maintain consistency.

</div>
<p class="card__text">Reviews: 5</p>
</div>
<div class="card__price">
<p class="card__price-price">Price:</p>
<p class="card__price-price_2199">$2,199</p>
</div>
<button
class="card__button"
data-qa="hover"
>
BUY
</button>
</div>
</body>
</html>
10 changes: 10 additions & 0 deletions src/styles/blocks/base.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
body {
font-family: Roboto, sans-serif;
box-sizing: border-box;
margin: 0;
padding: 0;

* {
box-sizing: inherit;
}
}
92 changes: 92 additions & 0 deletions src/styles/blocks/card.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
.card {
width: 200px;
padding: 32px 16px 16px;
border: 1px solid #f3f3f3;

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

&__device-name {
@include font(12px, 500);

margin: 0 0 4px;
height: 36px;
line-height: 18px;
color: #060b35;
}

&__device-code {
@include font(10px, 400);

color: #616070;
height: 14px;
line-height: 14px;
margin: 0 0 16px;
}

&__reviews {
display: flex;
align-items: flex-end;
width: 166px;
height: 16px;
line-height: 14px;
justify-content: space-between;
margin: 0 0 24px;
}

&__text {
margin: 0;
color: #060b35;
text-align: right;

@include font(10px, 400);
}

&__price {
display: flex;
justify-content: space-between;
width: 166px;
height: 18px;
line-height: 18px;
margin: 0 0 16px;
}

&__price-price {
margin: 0;
color: #616070;

@include font(12px, 400);
}

&__price-price_2199 {
margin: 0;
color: #060b35;
text-align: right;

@include font(16px, 700);
}

&__button {
width: 166px;
height: 40px;
padding: 0;
margin: 0;
line-height: 16px;
font-family: Roboto, sans-serif;
border: 1px solid $primary-color;
border-radius: 5px;
color: $secondary-color;
background-color: $primary-color;

@include font(14px, 700);

&:hover {
background-color: transparent;
color: $primary-color;
}
}
}
21 changes: 21 additions & 0 deletions src/styles/blocks/stars.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.stars {
display: flex;
gap: 4px;
align-items: center;

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

&__starN {

Choose a reason for hiding this comment

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

The class name stars__starN might be inconsistent with the naming convention used for other elements like stars__star. If this is not intentional, consider renaming it to maintain consistency.

width: 16px;
height: 16px;
background-image: url(../images/star.svg);
background-position: center;
background-repeat: no-repeat;
}
}
8 changes: 5 additions & 3 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
body {
margin: 0;
}
@import './utils/variables';
@import './utils/mixins';
@import './blocks/base';
@import './blocks/stars';
@import './blocks/card';
4 changes: 4 additions & 0 deletions src/styles/utils/mixins.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@mixin font($size, $weight) {
font-size: $size;
font-weight: $weight;
}
2 changes: 2 additions & 0 deletions src/styles/utils/variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$primary-color: #00acdc;
$secondary-color: #fff;
Loading