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

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

Develop #5822

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
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.
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://anastasiiadns.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://anastasiiadns.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
Binary file added src/images/Menu/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.
47 changes: 46 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
<!doctype html>
<html lang="en">
<head>
<link
rel="preconnect"
href="https://fonts.googleapis.com"
/>
<link
rel="preconnect"
href="https://fonts.gstatic.com"
crossorigin="anonymous"
/>
<link
href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap"
rel="stylesheet"
/>
<meta charset="UTF-8" />
<meta
name="viewport"
Expand All @@ -17,6 +30,38 @@
/>
</head>
<body>
<h1>Moyo header</h1>
<header class="header">
<img
src="images/logo.png"
alt="logo"
class="image"
/>
Comment on lines +34 to +38

Choose a reason for hiding this comment

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

The logo image should be wrapped in an anchor tag to meet the task requirements. This will make the logo clickable and usually links back to the homepage.

<nav class="flex-text">
<ul>
<li>
<a
href="https://example.com/apple"
class="is-active"
>
Apple
</a>
</li>
<li><a href="https://example.com/samsung">Samsung</a></li>
<li><a href="https://example.com/smartphones">Smartphones</a></li>
<li>
<a
href="https://example.com/laptops-computers"
data-qa="hover"
>
Laptops & Computers
</a>
</li>
<li><a href="https://example.com/gadgets">Gadgets</a></li>
<li><a href="https://example.com/tablets">Tablets</a></li>
<li><a href="https://example.com/photo">Photo</a></li>
<li><a href="https://example.com/video">Video</a></li>
</ul>
</nav>
</header>
</body>
</html>
64 changes: 64 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,67 @@
* {
margin: 0;
padding: 0;
}

body {
margin: 0;
font-family: Roboto, sans-serif;
}

.header {
display: flex;
padding: 0 50px;
align-items: center;
}

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

nav {
display: block;
font-size: 12px;
font-weight: 500;
line-height: 60px;
text-transform: uppercase;
}

nav ul {
list-style: none;
display: flex;
}

nav ul li a {
display: flex;
text-decoration: none;
color: #000;
margin-right: 20px;
}

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

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

nav ul li a.is-active::after {
content: '';
position: absolute;
Comment on lines +51 to +53

Choose a reason for hiding this comment

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

The ::after pseudo-element in the .is-active class uses position: absolute; but there is no position: relative; set on a parent element. This might cause the pseudo-element to be positioned incorrectly. Consider setting position: relative; on the parent element to ensure correct positioning.

height: 4px;
width: 37px;
top: 56px;
background-color: #00acdc;
border-radius: 8px;
}
Comment on lines +51 to +59

Choose a reason for hiding this comment

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

The ::after pseudo-element is positioned absolutely. To ensure it is positioned correctly relative to its parent, the parent element (in this case, the anchor tag) should have position: relative; applied. This will ensure the pseudo-element is positioned correctly under the active link.


nav ul li a:hover {
color: #00acdc;
}

.flex-text {
margin-left: auto;
}
Loading