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

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

Develop #4849

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
18,527 changes: 13,797 additions & 4,730 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
"@mate-academy/backstop-config": "latest",
"@mate-academy/bemlint": "latest",
"@mate-academy/linthtml-config": "latest",
"@mate-academy/scripts": "^1.8.6",
"@mate-academy/scripts": "^1.2.8",
"@mate-academy/stylelint-config": "latest",
"@parcel/transformer-sass": "^2.12.0",
"backstopjs": "6.3.23",
"jest": "^29.7.0",
"parcel": "^2.12.0",
"parcel": "^1.12.3",
"prettier": "^3.3.2",
"stylelint": "^16.7.0",
"stylelint-scss": "^6.4.1"
Expand Down
18 changes: 9 additions & 9 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Create an HTML page with a catalog. Develop semantic page structure as shown on
- add `data-qa="card-hover"` (not just `hover`) to the link `Buy` inside the first card
- nav links color is not `black` anymore (nav links should have `#060b35` color)
- add the class `is-active` to the first link (`Apple`) in the navigation
- use `<main>` tag for cards container
- use `<main>` tag for cards container
- use the grid for cards with different numbers of columns:
- 1 for the smaller screens
- 2 starting at `488px`
Expand All @@ -33,14 +33,14 @@ This is possible because [we use the Parcel library](https://en.parceljs.org/scs
## 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_catalog/)
- [TEST REPORT LINK](https://<your_account>.github.io/layout_catalog/report/html_report/)
- [DEMO LINK](https://lopatkinss.github.io/layout_catalog/)
- [TEST REPORT LINK](https://lopatkinss.github.io/layout_catalog/report/html_report/)

❗️ Copy this `Checklist` to the `Pull Request` description after links, and put `- [x]` before each point after you checked it.

- [ ] All components follow BEM and use SCSS
- [ ] Repeated sizes and special colors are put to variables
- [ ] Grid is used for the columns
- [ ] Cards are shown in 1, 2, 3, or 4 columns based on screen resolution
- [ ] All changes on `:hover` are smooth
- [ ] Code follows all the [Code Style Rules ❗️](https://mate-academy.github.io/layout_task-guideline/html-css-code-style-rules)
- [x] All components follow BEM and use SCSS
- [x] Repeated sizes and special colors are put to variables
- [x] Grid is used for the columns
- [x] Cards are shown in 1, 2, 3, or 4 columns based on screen resolution
- [x] All changes on `:hover` are smooth
- [x] Code follows all the [Code Style Rules ❗️](https://mate-academy.github.io/layout_task-guideline/html-css-code-style-rules)
93 changes: 93 additions & 0 deletions src/blocks/card.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
body {
margin: 0;
font-family: Roboto, sans-serif;
font-weight: 400;
font-size: 10px;
line-height: 14px;
color: #060b35;
}

.card {
padding: 32px 16px 16px;
box-sizing: border-box;
width: 200px;
display: flex;
flex-direction: column;
align-items: center;
border: 1px solid #f3f3f3;
border-radius: 5px;
background-color: #fff;

&__image {
width: 160px;
height: 134px;
margin-bottom: 40px;

img {
width: 100%;
height: 100%;
}
}

&__title {
font-weight: 500;
font-size: 12px;
line-height: 18px;
margin: 0 0 4px;
}

&__code {
align-self: flex-start;
color: #616070;
margin: 0 0 16px;
}

&__assessment,
&__price {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 24px;

&:last-of-type {
margin-bottom: 16px;
}
}

&__price-text {
font-size: 12px;
color: #616070;
}

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

&__button {
width: 100%;
height: 40px;
font-family: Roboto, sans-serif;
font-weight: 700;
font-size: 14px;
line-height: 16px;
color: #fff;
background-color: #00acdc;
border: 1px solid #00acdc;
border-radius: 5px;
outline: none;
display: flex;
justify-content: center;
align-items: center;
text-transform: uppercase;
text-align: center;
cursor: pointer;

&:hover {
background-color: #fff;
color: #00acdc;
}
}
}
9 changes: 9 additions & 0 deletions src/blocks/catalog.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.catalog {
padding: 50px 40px;
display: grid;
grid-template-columns: repeat(4, 1fr);
justify-content: center;
gap: 46px 48px;
max-width: fit-content;
margin: 0 auto;
}
117 changes: 117 additions & 0 deletions src/blocks/navigation.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
body {
margin: 0;
}

.logo__image {
display: block;
width: 40px;
height: 40px;
}

:root {
--color-hover: #00acdc;
--color-default: #000;
}

.header {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 12px;
font-family: Roboto, serif;
font-weight: 500;
padding-inline: 50px;
box-shadow: 0 2px 4px 0 #0000000d;
}

.logo__link {
width: 40px;
height: 40px;
line-height: 60px;
}

.nav {
display: inline-block;
text-transform: uppercase;
}

.nav__list {
display: flex;
gap: 20px;
margin: 0;
padding: 0;
list-style: none;
}

.nav__item {
position: relative;
}

.nav__link {
box-sizing: border-box;
position: relative;
height: 60px;
display: flex;
align-items: center;
font-family: Roboto, sans-serif;
font-size: 12px;
line-height: 14.06px;
font-weight: 500;
white-space: nowrap;
text-decoration: none;
text-transform: uppercase;
color: #060b35;
transition: color 0.3s;
}

.nav__link.is-active {
text-decoration: none;
height: 60px;
line-height: 60px;
}

.nav__link.is-active:link {
color: var(--color-hover);
}

.nav__link.is-active::after {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 4px;
content: '';
background-color: var(--color-hover);
border-radius: 2px;
}

.nav__link.is-active:active {
color: var(--color-hover);
}

.nav__link:link {
color: var(--color-default);
}

.nav__link:visited {
color: var(--color-default);
}

.nav__link:hover {
color: var(--color-hover);
}

.nav__link:active {
color: var(--color-hover);
}

.nav__link:active::after {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 4px;
content: '';
background-color: var(--color-hover);
border-radius: 2px;
}
37 changes: 37 additions & 0 deletions src/blocks/stars.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
.stars {
display: flex;
margin: 0;
}

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

.stars__star:last-child {
margin-right: 0;
}

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

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

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

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

.stars--5 .stars__star:nth-child(-n + 5) {
background-image: url(../images/star-active.svg);
}
Loading
Loading