Skip to content
Open

Develop #7740

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": "^2.1.3",
"@mate-academy/stylelint-config": "latest",
"backstopjs": "6.3.23",
"jest": "^29.7.0",
Expand Down
22 changes: 11 additions & 11 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ 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://punana990.github.io/MOYO-Header/)
- [TEST REPORT LINK](https://punana990.github.io/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.

- [ ] Header height is set in 1 place (for the links)
- [ ] Content is vertically centered (for any header height)
- [ ] CSS is used to show all letters in Uppercase (don't type them in HTML)
- [ ] Logo is an image wrapped with a link
- [ ] **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)
- [x] Header height is set in 1 place (for the links)
- [x] Content is vertically centered (for any header height)
- [x] CSS is used to show all letters in Uppercase (don't type them in HTML)
- [x] Logo is an image wrapped with a link
- [x] **CSS Variable** is used for a blue color
- [x] Pseudo-element is used for a blue line below the active link
- [x] Code follows all the [Code Style Rules ❗️](./checklist.md)
- [x] The Google Fonts Configuration follows requirements.
![alt text](./assets/image.png)
105 changes: 103 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
content="width=device-width, user-scalable=no,
initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
Comment on lines +7 to +8
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates CHECKLIST ITEM #44: "In src/index.html, break the <meta name="viewport" ...> tag and the Google Fonts <link> tag so that: each attribute starts on its own line, and each resulting line is under 80 characters (e.g., place href, rel, and name / content on separate wrapped lines)."

The viewport meta's attributes/content currently produce a line that still exceeds the required 80-character limit / are not wrapped as requested. Please ensure each attribute starts on its own line and wrap long attribute values so every source line is <= 80 chars.

/>
<meta
http-equiv="X-UA-Compatible"
Expand All @@ -15,8 +16,108 @@
rel="stylesheet"
href="./style.css"
/>
<link
rel="preconnect"
href="https://fonts.googleapis.com"
/>
<link
rel="preconnect"
href="https://fonts.gstatic.com"
crossorigin="anonymous"
/>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates CHECKLIST ITEM #44: "In src/index.html, break the <meta name="viewport" ...> tag and the Google Fonts <link> tag so that: each attribute starts on its own line, and each resulting line is under 80 characters (e.g., place href, rel, and name / content on separate wrapped lines)."

The Google Fonts <link> href is on a single long line (this line) and likely exceeds 80 characters. Wrap the href (or break it across lines) and place each attribute (e.g., rel, href, crossorigin) on its own line so no line exceeds 80 characters.

/>
</head>
<body>
<h1>Moyo header</h1>
<header class="header">
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates CHECKLIST ITEM #46: "Update the Pull Request description to include the provided Checklist block, with each item marked - [x] after verification, so the review process and automated checks can rely on it."

Please update the PR description to include the DEMO and TEST REPORT links and copy the full Checklist block into the PR body, marking completed items with - [x].

<a
href="#image"
class="image"
>
<img
src="./images/logo.png"
class="logo"
alt="MOYO-logo"
/>
</a>
<nav class="nav">
<ul class="nav_list">
<li class="list_item">
<a
class="nav__link is-active"
href="#apple"
>
Apple
</a>
</li>

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

<li class="list_item">
<a
class="nav__link"
href="#smartphones"
Comment on lines +65 to +68
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This rule uses a tag selector: a.is-active. Checklist item #38 states: "Don't use tag names for styling (except html and body); style all elements using .class.... Change this to a class-only selector such as .nav__link.is-activeor.is-active`.

>
Smartphones
</a>
</li>
Comment on lines +71 to +72
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #9 requires: "Link color should be changed on :hover." Currently only the element with data-qa='hover' has a hover color. Add a hover rule for all nav links (for example .nav__link:hover { color: var(--blue); }) so every link changes color on hover.


<li class="list_item">
<a
class="nav__link"
href="#laptops&computers"
data-qa="hover"
>
Laptops & Computers
</a>
Comment on lines +67 to +81
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #26 requires a CSS variable for the blue color: "A CSS variable is used for the blue color". Right now the blue hex #00acdc is hard-coded in multiple places (color and background-color). Define a variable (for example :root { --blue: #00acdc; }) and replace direct hex values with var(--blue).

</li>

Comment on lines +75 to +83
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This pseudo-element rule uses a tag selector a.is-active::after. Per checklist item #38 avoid tag selectors; change to .nav__link.is-active::after or .is-active::after. Also ensure it uses the CSS variable for the blue color per item #26.

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

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

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

<li class="list_item">
<a
class="nav__link"
href="#video"
>
Video
</a>
</li>
</ul>
</nav>
</header>
</body>
</html>
85 changes: 85 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,88 @@
body {
margin: 0;
box-sizing: border-box;
font-family: Roboto, sans-serif;
font-size: 12px;
text-transform: uppercase;
font-weight: 500;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item "Lines of code have 80 chars max" and the checklist section "Keep your attributes correctly formatted" — the meta viewport tag value is split across lines and creates long lines. Wrap long attribute values and keep each attribute on its own line (see the Good Example in the checklist).

}

Comment on lines +5 to +9
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The tag spans multiple lines but some resulting lines are still too long. Per checklist item #44 break this tag so each attribute starts on its own line and ensure no line exceeds 80 characters (wrap long attribute values accordingly).

:root {
--blue: #00acdc;
}

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

.image {
display: flex;
justify-content: center;
align-items: center;
padding-left: 50px;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item "Lines of code have 80 chars max" and the checklist section "Keep your attributes correctly formatted" — the long Google Fonts href should be wrapped across lines (start each attribute on a new line as in the Good Example). Break the href/rel attributes so no line exceeds 80 characters.


.logo {
Comment on lines +28 to +31
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The Google Fonts currently places the long href URL on a single line which exceeds the 80-character limit. Per checklist items #44 and #45 put each attribute (including href) on its own line and wrap the long URL so each line is under 80 characters.

width: 40px;
height: 40px;
}

.nav {
margin-right: 50px;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #14: "Logo is an image wrapped with a link" — the anchor wrapping the logo has no href attribute. Make the logo anchor a real link (for example: href="/" or href="#") so it's a proper link element.


.nav_list {
display: flex;
justify-content: space-between;
list-style: none;
margin: 0;
padding: 0;
}

.list_item {
margin-left: 20px;
}

.list_item:first-child {
margin-left: 0;
}

.nav__link {
display: flex;
text-decoration: none;
color: black;
line-height: 60px;
align-items: center;
position: relative;
}

.nav__link.is-active {
display: flex;
color: var(--blue);
position: relative;
}

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

[data-qa='hover']:hover {
color: var(--blue);
}
Comment on lines +75 to +77
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #9: "Link color should be changed on :hover." Currently only the 4th link (via [data-qa='hover']) changes color on hover. Add a general hover rule for navigation links (for example .nav__link:hover { color: var(--blue); }) so links change color on :hover while keeping the data-qa attribute for tests.


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