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

Open
wants to merge 2 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: 9 additions & 0 deletions .hintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": [
"development"
],
"hints": {
"meta-viewport": "off",
"highest-available-document-mode": "off"
}
}
18 changes: 17 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,22 @@
/>
</head>
<body>
<h1>Moyo header</h1>
<header>
<a href = "#" class="logo">

Choose a reason for hiding this comment

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

There is an extra space around the = in the href attribute. It should be href="#" for consistency and to avoid potential issues.

<img src="images/logo.png" alt="Moyo Logo">
</a>
<nav>
<ul>
<li><a href="#" class ="is-active">Apple</a></li>

Choose a reason for hiding this comment

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

There is an extra space around the = in the class attribute. It should be class="is-active" for consistency.

<li><a href="#">Samsung</a></li>
<li><a href="#">Smartphones</a></li>
<li><a href="#" class ="hover">Laptops & Computers</a></li>

Choose a reason for hiding this comment

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

The .hover class is not functioning as intended. Please check the CSS file to ensure that the class is defined correctly and that the styles are applied as expected.

<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>
</body>
</html>
80 changes: 80 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,83 @@
/* stylelint-disable font-family-name-quotes */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

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

/* header */
header {
background-color: #fff;
display: flex;
align-items: center;
padding: 0 20px;
border-bottom: 1px solid #e0e0e0;
}

.logo {
margin-right: 50px;
}

.logo img {
max-height: 40px;
}

/* style */
nav ul {
display: flex;
list-style: none;
margin: 0;
padding: 0;
}

nav ul li:not(:first-child) {
margin-left: 20px;
}

nav a {
text-decoration: none;
color: #333;
display: inline-block;
line-height: 60px;
text-align: center;
text-transform: uppercase;
font-weight: 700;
position: relative;
}

nav a.is-active {
position: relative;
color: #007bff;
}

nav a.is-active::after {
content: '';
position: absolute;
left: 0;
bottom: -2px;
width: 100%;
height: 2px;
background-color: #007bff;
}

nav a.hover {
position: relative;
color: #007bff;
}
Comment on lines +67 to +70

Choose a reason for hiding this comment

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

The .hover class is defined, but it might not work as expected because it's not associated with any hover state or JavaScript interaction. Consider using the :hover pseudo-class if you intend to change the style on hover.

Comment on lines +67 to +70

Choose a reason for hiding this comment

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

The .hover class is defined here, but it seems to be intended for hover effects. Consider using the :hover pseudo-class instead to apply styles when the user hovers over the element. For example, nav a:hover { color: #007bff; }.


nav {
flex-grow: 1;
}

/* stylelint-disable-next-line no-duplicate-selectors */
nav ul li:first-child {
margin-left: 0;
}

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