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

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

Develop #6111

Show file tree
Hide file tree
Changes from 2 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://<kristinareypashi>.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://<kristinareypashi>.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
100 changes: 98 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,109 @@
http-equiv="X-UA-Compatible"
content="ie=edge"
/>
<title>Moyo header</title>
<title>Flexbox Header</title>
<link
rel="preconnect"
href="https://fonts.googleapis.com"
/>
<link
rel="preconnect"
href="https://fonts.gstatic.com"
/>
<link
href="https://fonts.googleapis.com/css2?family=Roboto&display=swap"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="./style.css"
/>
</head>
<body>
<h1>Moyo header</h1>
<header class="header">
<a
href="#"
class="logo"
>
<img
class="logo__img"
src="images/logo.png"
alt="logo"
/>
</a>
<nav>
<ul class="nav-list">
<li>
<a
href="/apple"
class="nav-link is-active"
>
APPLE
</a>
</li>
<li>
<a
href="/samsung"
class="nav-link"
>
SAMSUNG
</a>
</li>
<li>
<a
href="/smartphones"
class="nav-link"
>
Smartphones
</a>
</li>
<li>
<a
class="nav-link"
data-qa="hover"
href="/laptops"
>
Laptops & Computers
</a>
</li>
<li>
<a
href="/gadgets"
class="nav-link"
>
Gadgets
</a>
</li>
<li>
<a
href="/tablets"
class="nav-link"
>
Tablets
</a>
</li>
<li>
<a
href="/photo"
class="nav-link"
>
Photo
</a>
</li>
<li>
<a
href="/video"
class="nav-link"
>
Video
</a>
</li>
</ul>
</nav>
</header>
<main>
<h1></h1>

Choose a reason for hiding this comment

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

The <h1> tag is currently empty. It's important to provide meaningful content within this tag for accessibility and SEO purposes. Consider adding a relevant heading here.

Choose a reason for hiding this comment

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

The <h1> tag is currently empty. It's important to add meaningful content to this tag for accessibility and SEO purposes.

</main>
<footer></footer>
</body>
</html>
117 changes: 116 additions & 1 deletion src/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,118 @@
body {
html {
box-sizing: border-box;

Choose a reason for hiding this comment

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

The html selector sets box-sizing: border-box;, which is a good practice. However, this is repeated in the universal selector * on line 44, which is redundant. Consider removing the redundant box-sizing: border-box; from the universal selector to avoid unnecessary repetition.

font-size: 12px;
}

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

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
ol,
ul {
margin: 0;
padding: 0;
font-weight: normal;
}

ol,
ul {
list-style: none;
}

img {
max-width: 100%;
height: auto;
}

:root {
--blue: #007bff;
}

* {
margin: 0;
padding: 0;
box-sizing: border-box;
Comment on lines +42 to +43

Choose a reason for hiding this comment

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

The universal selector * resets margin and padding to 0, which is already done for specific elements like body, h1, h2, etc., on lines 12-23. This redundancy can be removed to streamline the CSS.

}

body {
font-family: Roboto, sans-serif;
font-size: 12px;

Choose a reason for hiding this comment

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

Ensure that the font-family 'Roboto' is consistent with the Google Fonts configuration in your HTML file. Verify that the font weights and styles match the requirements specified in the task description.

}

.header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 50px;
width: 100%;
}

.logo img {
height: auto;
width: 100%;
}

Choose a reason for hiding this comment

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

The .logo img selector sets width: 100%;, which might stretch the image if the container size is not controlled. Ensure that the parent container has a defined width to prevent unexpected stretching of the logo image.


.nav-list {
display: flex;
align-items: center;
justify-content: center;
height: 60px;
font-weight: 500;
}

.nav-link {
display: inline-block;
height: 60px;
line-height: 60px;
text-decoration: none;
text-transform: uppercase;
color: black;
}

.nav-link:hover {
color: var(--blue);
}

.nav-link.is-active {
color: var(--blue);
position: relative;
}

.nav-list li:not(:last-child) {
margin-right: 20px;
}

.nav-list li:first-child .nav-link {
padding-left: 0;
}

.nav-list li:last-child .nav-link {
padding-right: 0;
}

.nav-link.is-active::after {
content: '';
background-color: var(--blue);
border-radius: 4px;
width: 100%;
height: 4px;
display: block;
position: absolute;
left: 0;
bottom: 0;
}

[data-qa='hover'] {
position: relative;
top: 0;
}
Loading