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

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

Develop #5078

Show file tree
Hide file tree
Changes from 3 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
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
8 changes: 4 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Product cards

Create a page with product card using `flexbox`, `BEM` and `SCSS` based on [this mockup](https://www.figma.com/file/ojkArVazq7vsX0nbpn9CxZ/Moyo-%2F-Catalog-(ENG)?node-id=11325%3A2287&mode=dev).
Create a page with product card using `flexbox`, `BEM` and `SCSS` based on [this mockup](<https://www.figma.com/file/ojkArVazq7vsX0nbpn9CxZ/Moyo-%2F-Catalog-(ENG)?node-id=11325%3A2287&mode=dev>).

> Here are the [Layout Tasks Instructions](https://mate-academy.github.io/layout_task-guideline)

Expand All @@ -16,15 +16,15 @@ Create a page with product card using `flexbox`, `BEM` and `SCSS` based on [this
- Rewrite the `stars` block from the [Stars task](https://github.com/mate-academy/layout_stars) with SCSS and use it
- Find the required font on [google fonts](https://fonts.google.com/) and use.

*Important note*: In this task, you are allowed to link `*.scss` files directly in HTML `<link>` tags using `href` attribute.
_Important note_: In this task, you are allowed to link `*.scss` files directly in HTML `<link>` tags using `href` attribute.
This is possible because [we use the Parcel library](https://en.parceljs.org/scss.html) to bundle your solution's source code.

## Checklist

❗️ 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://Gennadiy99.github.io/layout_product-cards/)
- [TEST REPORT LINK](https://Gennadiy99.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
51 changes: 50 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,61 @@
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: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/index.scss"
/>
</head>
<body>
<h1>Product cards</h1>
<div
class="card"
data-qa="card"
>
<img
class="card__img"
src="images/imac.jpeg"
alt="picture product"
/>
<div class="product card__prod">
<h3 class="product__title">
APPLE A1419 iMac 27" Retina 5K (MNED2UA/A)
</h3>
<p class="product__code">Product code: 195434</p>
</div>
<div class="rewiews card__rewie">

Choose a reason for hiding this comment

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

There is a typo in the class name 'rewiews'. It should be 'reviews' to maintain consistency and avoid potential issues with styling or JavaScript functionality.

Choose a reason for hiding this comment

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

There is a typographical error in the class name 'rewiews'. It should be 'reviews' to maintain consistency and avoid potential styling issues.

<div class="stars stars--4 rewiews__stars">

Choose a reason for hiding this comment

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

There is a typo in the class name 'rewiews__stars'. It should be 'reviews__stars'.

Choose a reason for hiding this comment

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

The class name 'rewiews__stars' contains a typographical error. It should be 'reviews__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>
</div>
<div class="rewiews__count">Reviews: 5</div>

Choose a reason for hiding this comment

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

There is a typo in the class name 'rewiews__count'. It should be 'reviews__count'.

Choose a reason for hiding this comment

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

The class name 'rewiews__count' contains a typographical error. It should be 'reviews__count'.

</div>
<div class="price card__price">
<p class="price__titel">Price:</p>

Choose a reason for hiding this comment

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

There is a typo in the class name 'price__titel'. It should be 'price__title'.

Choose a reason for hiding this comment

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

There is a typographical error in the class name 'price__titel'. It should be 'price__title'.

<div class="price__current">$2,199</div>
</div>
<a
class="btn-link btn-link--hover"
data-qa="hover"
href="#"
>
Buy
</a>
</div>
</body>
</html>
22 changes: 22 additions & 0 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
@use 'utils/variables' as v;
@import 'utils/stars-block';
@import 'utils/bem-block';

html {
box-sizing: border-box;
}

*,
*::after,
*::before {
box-sizing: inherit;
}

h3,
p {
margin: 0;
}

body {
margin: 0;
font-family: Roboto, sans-serif;
font-weight: 400;
font-style: normal;
}
100 changes: 100 additions & 0 deletions src/styles/utils/bem-block.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
.card {
max-width: 200px;
width: 100%;
padding: 32px 16px 16px;
border-radius: 5px;

&__img {
width: 100%;
margin-bottom: 40px;
}
&__prod {
margin-bottom: 16px;
}
&__rewie {

Choose a reason for hiding this comment

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

There is a typographical error in the class name 'rewie'. It should be 'review' to maintain consistency with the HTML and avoid potential styling issues.

margin-bottom: 24px;
}
&__price {
margin-bottom: 16px;
}
}

.product {
&__title {
font-weight: 500;
font-size: 12px;
line-height: 150%;
color: v.$col-blue;
margin-bottom: 4px;
}
&__code {
font-weight: 400;
font-size: 10px;
line-height: 140%;
color: v.$col-grey;
}
}

.rewiews {

Choose a reason for hiding this comment

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

The class name 'rewiews' contains a typographical error. It should be 'reviews'.

display: flex;
justify-content: space-between;
height: 16px;
min-width: 116px;
width: 100%;
gap: 17px;

&__stars {
flex-grow: 1;
}

&__count {
font-weight: 400;
font-size: 10px;
line-height: 140%;
text-align: right;
color: v.$col-blue;
}
}

.price {
display: flex;
justify-content: space-between;

&__titel {

Choose a reason for hiding this comment

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

There is a typographical error in the class name 'titel'. It should be 'title'.

font-weight: 400;
font-size: 12px;
line-height: 150%;
color: v.$col-grey;
}

&__current {
font-weight: 700;
font-size: 16px;
line-height: 112%;
text-align: right;
color: v.$col-blue;
}
}

.btn-link {
display: block;
border-radius: 5px;
width: 166px;
height: 40px;
background-color: #00acdc;

text-decoration: none;
color: #fff;
text-transform: uppercase;
text-align: center;
font-weight: 700;
font-size: 14px;
line-height: 40px;
transition: all 0.3s;

&--hover:hover {
background-color: #fff;
color: #00acdc;
border: solid 1px #00acdc;
}
}
24 changes: 24 additions & 0 deletions src/styles/utils/stars-block.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.stars {
display: flex;

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

&__star:last-child {
margin-right: 0;
}

&--1 &__star:nth-child(1),
&--2 &__star:nth-child(-n + 2),
&--3 &__star:nth-child(-n + 3),
&--4 &__star:nth-child(-n + 4),
&--5 &__star:nth-child(-n + 5) {
background-image: url(../images/star-active.svg);
}
}
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 @@
$col-blue: #060b35;
$col-grey: #616070;
Loading