Skip to content
Closed
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
63 changes: 63 additions & 0 deletions index_moyo_header_error.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My First Page</title>
<link rel="stylesheet" href="style_moyo_header_error.css">
<link rel="icon" href="ma.png">
<link rel="stylesheet" href="normalize.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@0500&display=swap" rel="stylesheet">

Choose a reason for hiding this comment

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

This line has a few issues. First, the font weight in the URL, wght@0500, is incorrect. It should be wght@500 to match the requirement for 'medium (500) weight'. This violates checklist item #8. Second, according to the code style guide, when a tag has more than two attributes, each attribute should be on a new line. This also helps with the line length, which currently exceeds 80 characters.


</head>

<body>
<header class="header">
<a class="logo__img" href="logo.html">
<img src="moyo_1.png" alt="logotype" />

Choose a reason for hiding this comment

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

The alt text 'logotype' is too generic. Per the task checklist, it's better to be more descriptive for accessibility, for example, 'Moyo website logo'.

</a>
<nav class="nav">
<ul class="nav__list">
<li class="nav__item">
<a class="nav__link blue is-active" href="#">Apple</a>

Choose a reason for hiding this comment

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

The blue class here is redundant. The is-active class should be sufficient to apply all styles for the active state, including the color. Using class names that describe appearance (like 'blue') is also discouraged by the style guide. Lastly, please format attributes on new lines as this tag has more than two.

</li>

<li class="nav__item">
<a class="nav__link" href="#">Samsung</a>
</li>

<li class="nav__item">
<a class="nav__link" href="#">Smartphones</a>
</li>

<li class="nav__item">
<a class="nav__link" data-qa="hover" href="#">Laptops & Computers</a>
</li>

<li class="nav__item">
<a class="nav__link" href="#">Gadgets</a>
</li>

<li class="nav__item">
<a class="nav__link" href="#">Tablets</a>
</li>

<li class="nav__item">
<a class="nav__link" href="#">Photo</a>
</li>

<li class="nav__item">
<a class="nav__link" href="#">Video</a>
</li>
</ul>
</nav>
</header>

<div class="pad"> </div>

</body>

</html>
Binary file added ma.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added moyo_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions normalize.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
html {
font-family: Arial, Helvetica, sans-serif;
}

body {
margin: 0;
padding: 0;
}
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.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@
"keywords": [],
"author": "Mate Academy",
"license": "GPL-3.0",
"dependencies": {},
"devDependencies": {
"@linthtml/linthtml": "^0.9.6",
"@mate-academy/backstop-config": "latest",
"@mate-academy/bemlint": "latest",
"@mate-academy/linthtml-config": "latest",
"@mate-academy/scripts": "^1.8.6",
"@mate-academy/scripts": "^2.1.2",
"@mate-academy/stylelint-config": "latest",
"backstopjs": "6.3.23",
"jest": "^29.7.0",
Expand Down
8 changes: 4 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ The page should match the design Pixel Perfect: all the sizes, colors and distan

❗️ Replace `<your_account>` with your GitHub username and copy the links to the `Pull Request` description:

- [DEMO LINK](https://<your_account>.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://<your_account>.github.io/layout_moyo-header/report/html_report/)
- [DEMO LINK](https://Andrij1.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://Andrij1.github.io/layout_moyo-header/report/html_report/)

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

Expand All @@ -39,5 +39,5 @@ The page should match the design Pixel Perfect: all the sizes, colors and distan
- [ ] **CSS Variable** is used for a blue color
- [ ] Pseudo-element is used for a blue line below the active link
- [ ] Code follows all the [Code Style Rules ❗️](./checklist.md)
- [ ] The Google Fonts Configuration follows requirements.
![alt text](./assets/image.png)
- [ ] The Google Fonts Configuration follows requirements.
![alt text](./assets/image.png)
94 changes: 94 additions & 0 deletions style_moyo_header_error.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
:root {
--secondary-color: #00ACDC;
}

body {
margin: 0;
padding: 0;
font-family: "Roboto", sans-serif;
font-weight: 500;
}

.header {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
padding: 0 20px;
text-wrap: nowrap;
box-sizing: border-box;
}


.logo__img {
display: flex;
align-items: center;
}

.nav {
display: flex;
}

@media (min-width: 1024px) {
.nav {
padding-left: 333px;
padding-right: 20px;
}
}

@media (min-width: 1200px) {
.nav {
padding-left: 505px;
padding-right: 20px;
}
Comment on lines +32 to +43

Choose a reason for hiding this comment

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

Using hardcoded padding-left values within media queries to position the navigation is not a robust solution. This will easily break if the viewport width is different or if the content changes. A better approach would be to let flexbox handle the alignment. For example, you could remove justify-content: space-between from the .header and add margin-left: auto; to the .nav selector to push it to the right.

}

.nav__list {
display: flex;
align-items: center;
margin: 0;
padding: 0;
list-style: none;
}

.nav__item + .nav__item {
margin-left: 20px;
}

.nav__link {
text-decoration: none;
color: #000;
font-size: 12px;
text-transform: uppercase;
display: flex;
align-items: center;
height: 60px;
position: relative;
}
Comment on lines +58 to +67

Choose a reason for hiding this comment

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

The requirement states that 'Nav Links should have their text centered'. While align-items: center handles vertical centering, the text is not horizontally centered. You should add justify-content: center to this rule to center the text horizontally within the link area.


.nav__link:hover {
color: var(--secondary-color);
text-decoration: underline;

Choose a reason for hiding this comment

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

The task requires the implementation to be 'Pixel Perfect' according to the Figma mockup. The design shows that the link's color changes on hover, but it does not become underlined. Please remove this text-decoration property to match the design.

}

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

.blue {
color: var(--secondary-color);
}
Comment on lines +78 to +80

Choose a reason for hiding this comment

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

This .blue class is redundant because the color is already being set by the .nav__link.is-active selector. Additionally, class names should represent the content's meaning, not its style (e.g., 'blue'). It's best to remove this class from both the CSS and the HTML.


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

[data-qa="hover"]:hover {
background-color: yellow;
}
Loading