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

first commit #4823

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
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
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Create HTML page with catalog. Develop semantic page structure as shown on [the
- add `data-qa="card-hover"` (not just `hover`) to the link `Buy` inside the first card
- nav links color is not `black` any more (nav links should have `#060b35` color)
- add class `is-active` to the first link (`Apple`) in navigation
- use `<main>` tag for cards container
- use `<main>` tag for cards container
- use grid for cards with different number of columns:
- 1 for the smaller screens
- 2 starting at `488px`
Expand Down
98 changes: 98 additions & 0 deletions src/blocks/card.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
.card {
box-sizing: border-box;
display: flex;
flex-direction: column;
width: 200px;

font-family: Roboto, sans-serif;
font-weight: 400;
font-style: normal;
border: 1px solid #f3f3f3;

Choose a reason for hiding this comment

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

Consider using a variable for the border color instead of a hardcoded value #f3f3f3. This will improve maintainability and consistency across your styles.

border-radius: 5px;
transition: all 0.3s ease;

&:hover {
transform: scale(1.2);
}

&:hover .card__title {
color: #34568b;

Choose a reason for hiding this comment

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

Consider using a variable for the hover color #34568b to maintain consistency with other color definitions.

}

&__logo {
background-image: url(../images/imac.jpeg);

Choose a reason for hiding this comment

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

Ensure that the image path is correct and the image exists at the specified location. This is more of a reminder to verify assets.

background-size: contain;
background-repeat: no-repeat;
width: 160px;
height: 134px;
margin: 32px 19px 40px;
}

&__content {
margin: 0 16px 16px;
}

&__header {
font-weight: 500;
font-size: 12px;
line-height: 18px;
color: $main-text-color;
}

&__code {
font-size: 10px;
line-height: 14px;
color: $secondary-color;
margin-top: 4px;
}

&__evaluation {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 16px;
}

&__reviews {
font-size: 10px;
color: $main-text-color;
}

&__price {
display: flex;
justify-content: space-between;
margin-top: 24px;

&-title {
font-size: 12px;
line-height: 18px;
color: $secondary-color;
}

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

&__buy-button {
height: 40px;
width: 166px;
border-radius: 5px;
border: none;
background-color: $blue-accent;
color: #fff;
font-weight: 700;
font-size: 14px;
line-height: 16px;
margin-top: 16px;

&:hover {
background-color: #fff;

Choose a reason for hiding this comment

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

Consider using a variable for the hover background color #fff to maintain consistency with other color definitions.

color: #00acdc;

Choose a reason for hiding this comment

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

Consider using a variable for the hover text color #00acdc to maintain consistency with other color definitions.

border: 1px solid $blue-accent;
cursor: pointer;
}
}
}
26 changes: 26 additions & 0 deletions src/blocks/catalog.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.catalog {
padding: 50px 40px;
display: grid;
grid-template-rows: repeat(2, 1fr);
grid-template-columns: repeat(1, 1fr);
gap: 46px 48px;
justify-items: center;
}

@media (min-width: 488px) {
.catalog {
grid-template-columns: repeat(2, 1fr);
}
}

@media (min-width: 768px) {
.catalog {
grid-template-columns: repeat(3, 1fr);
}
}

@media (min-width: 1024px) {
.catalog {
grid-template-columns: repeat(4, 1fr);
}
}
7 changes: 7 additions & 0 deletions src/blocks/header.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 50px;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.05);
}
55 changes: 55 additions & 0 deletions src/blocks/nav.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.nav {
display: flex;
background-color: $bg-color;

&__item {
margin: 0 10px;
text-decoration: none;
list-style: none;
}

&__link {
font-family: Roboto, sans-serif;
font-size: 12px;
position: relative;
text-decoration: none;
text-transform: uppercase;
font-weight: 500;
color: #060b35;

Choose a reason for hiding this comment

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

Consider using a variable for the color #060b35 to maintain consistency with other color definitions and improve maintainability.

display: block;
line-height: 60px;

&:hover {
color: $blue-accent;
}
}

&__list {
display: flex;
margin: 0;
padding: 0;

& :first-child {
margin-left: 0;
}

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

.is-active {
color: $blue-accent;
}

.is-active::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
right: 0;
background-color: $blue-accent;
height: 4px;
border-radius: 8px;
}
19 changes: 19 additions & 0 deletions src/blocks/stars.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.stars {
display: flex;

&--4 :nth-child(-n + 4) {

Choose a reason for hiding this comment

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

The selector &--4 :nth-child(-n + 4) might be too specific and could lead to unexpected styling if not used carefully. Ensure that this class is applied correctly in the HTML to avoid styling issues. Consider using a more descriptive class name if possible.

background-image: url(/src/images/star-active.svg);
}

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

&:not(:last-child) {
margin-right: 4px;
}
}
}
Loading
Loading