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

add task solution #5742

Open
wants to merge 5 commits 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.

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": "^1.9.12",
"@mate-academy/stylelint-config": "latest",
"backstopjs": "6.3.23",
"jest": "^29.7.0",
Expand Down
4 changes: 2 additions & 2 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 `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://ValentynaD.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://ValentynaD.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 Down
42 changes: 42 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,50 @@
rel="stylesheet"
href="./style.css"
/>
<link
href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap"
rel="stylesheet"
/>
</head>
<body>
<h1>Moyo header</h1>
<header>

Choose a reason for hiding this comment

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

Consider adding a <h1> tag within the header to provide a main heading for the page. This is important for accessibility and SEO, as it helps screen readers and search engines understand the main topic of the page.

<div class="logo">
<a href="http://localhost:8080/">
<img
src="./images/logo.png"
alt="Moyo_shop_Gadgets"
width="40px"
height="40px"
/>
</a>
</div>
<nav aria-label="Main navigation">
<ul>
<li>
<a
href="#"
class="is-active"
>
APPLE
</a>
</li>
<li><a href="#">SAMSUNG</a></li>
<li><a href="#">SMARTPHONES</a></li>
<li>
<a
href="#"
data-qa="hover"
>
LAPTOPS & COMPUTERS
</a>
</li>
<li><a href="#">GADGETS</a></li>
<li><a href="#">TABLETS</a></li>
<li><a href="#">PHOTO</a></li>
<li><a href="#">VIDEO</a></li>
</ul>
</nav>
</header>
Comment on lines +25 to +62

Choose a reason for hiding this comment

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

Consider adding more ARIA attributes or roles to improve accessibility, especially for the navigation menu. This can help users with assistive technologies better understand the structure and purpose of the navigation elements.

</body>
</html>
88 changes: 88 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,91 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
Comment on lines +1 to +5

Choose a reason for hiding this comment

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

Using the universal selector * for resetting margins and paddings can significantly impact performance and is against the guidelines. Please replace it with a more specific reset method.


body {
font-family: Roboto, sans-serif;

Choose a reason for hiding this comment

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

Consider setting a default font-size for the body to ensure consistent text sizing across different browsers and devices.

font-size: 12px;
}

header {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
}

.logo {
height: 60px;
display: flex;
align-items: center;
margin-left: 50px;
}

.logo img {
height: 40px;

Choose a reason for hiding this comment

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

The display: flex; and align-items: center; properties on the .logo img selector are unnecessary since images are not flex containers. These properties should be applied to the parent container if needed.

margin: 0;
}

nav {
display: flex;
align-items: center;
margin-right: 50px;
}

nav a {
height: 100%;
display: flex;
align-items: center;
color: #000;
text-decoration: none;
font-family: Roboto, sans-serif;
font-weight: 500;
font-size: 12px;
}

nav ul {
display: flex;
list-style: none;
align-items: center;
gap: 20px;

Choose a reason for hiding this comment

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

The gap property is not supported in tests. Please use margins for spacing instead.

}

nav ul li {
height: 60px;
display: flex;
align-items: center;
}

nav ul li:first-child {
margin-left: 0;
margin-top: 0;
}

nav ul li:last-child {
margin-right: 0;
}

nav a:hover {
color: #00acdc;

Choose a reason for hiding this comment

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

Consider defining a CSS variable for the blue color #00acdc to improve maintainability and comply with the task requirements.

}

nav a.is-active {
color: #00acdc;

Choose a reason for hiding this comment

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

Consider defining a CSS variable for the blue color #00acdc to improve maintainability and comply with the task requirements.

text-transform: uppercase;
position: relative;
}
Comment on lines +74 to +78

Choose a reason for hiding this comment

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

The .is-active class is used to style the active link. Ensure that this class is applied correctly in the HTML to reflect the current page or section.


nav a.is-active::after {
content: '';
display: block;
width: 37px;
height: 4px;
background-color: #00acdc;

Choose a reason for hiding this comment

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

Consider defining a CSS variable for the blue color #00acdc to improve maintainability and comply with the task requirements.

border-radius: 8px;
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
}