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 solution #5350

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

add solution #5350

wants to merge 11 commits into from

Conversation

oandriitsiv
Copy link

  • DEMO LINK
  • TEST REPORT LINK
  • 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
  • [x Pseudo-element is used for a blue line below the active link
  • Code follows all the [Code Style Rules ❗️]

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Hey there! Good effort on the code, but we've got a few important issues to address before we can merge your pull request. 🛠️ There are some typos and best practices that need to be corrected, like the class names and the use of tag names for styling. These changes are crucial for maintaining code consistency and readability. Also, don't forget to add a fallback font-family and to keep an eye on the line length for better readability. Keep up the good work, and with these adjustments, your code will be in great shape! 👍

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

src/index.html Outdated
Comment on lines 20 to 28
<header class="container">
<a
href="index.html"
class="logo"
>
<img
src="./images/logo.png"
alt="Logo"
/>

Choose a reason for hiding this comment

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

Add empty lines between multiline sibling blocks of HTML to add some 'air' and simplify reading. For example, add an empty line before the

element on line 30.

Copy link
Author

Choose a reason for hiding this comment

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

Add empty line before the element on line 30.

src/index.html Outdated Show resolved Hide resolved
src/index.html Outdated
<li class="nav__item">
<a
href="#"
class="is-activ nav__link"

Choose a reason for hiding this comment

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

Don't use spaces in <a> tag's href property. Also, ensure that class names represent the meaning of the content. The class name 'is-activ' seems to be a typo and should be 'is-active' if it's meant to indicate the active state.

Copy link
Author

Choose a reason for hiding this comment

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

Delete spaces in tag's href property. Fixed the error in the class name 'is-active'

class="nav__link"
data-qa="hover"
>
LAPTOPS & COMPUTERS

Choose a reason for hiding this comment

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

Lines of code should have 80 characters max for better readability. The text inside the tag on line 62 is too long and should be broken into multiple lines if necessary.

Copy link
Author

Choose a reason for hiding this comment

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

Text inside the tag on line 62 cannot be broken.

@@ -1,3 +1,70 @@
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 adding a fallback font-family in case 'Roboto' fails to load for some reason. For example, 'sans-serif' can be a good fallback.

src/style.css Outdated
margin: 0;
}

.logo.png {

Choose a reason for hiding this comment

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

Avoid using tag names for styling. Use class selectors instead. The .logo.png looks like a filename, not a class name.

Copy link
Author

Choose a reason for hiding this comment

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

changed name class .logo

src/style.css Outdated
margin-left: 50px;
}

.nav_item {

Choose a reason for hiding this comment

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

It seems there is a typo in the class name .nav_item. According to the naming convention used in the rest of the file, it should be .nav__item.

Copy link
Author

Choose a reason for hiding this comment

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

Corrected the typo in the class .nav__item

src/style.css Outdated
position: relative;
}

.nav__link.is-activ {

Choose a reason for hiding this comment

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

The class .nav__link.is-activ seems to have a typo. If it's meant to indicate the active state, it should be .nav__link.is-active.

Copy link
Author

Choose a reason for hiding this comment

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

Corrected the typo in the class .nav__link.is-active

src/style.css Outdated
height: 4px;
content: '';
background-color: #00acdc;
border-color: #00acdc;

Choose a reason for hiding this comment

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

The border-color property in .nav__link.is-activ::after is redundant since this pseudo-element does not have a border. You can remove this property.

Copy link
Author

Choose a reason for hiding this comment

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

delete property the border-color.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Great work on your Pull Request! 🌟 I've decided to approve it because there are no critical issues that impact the functionality or security of your code. However, please take note of the suggestions made to enhance your code's readability, maintainability, and responsiveness. Keep up the good coding practices, and remember to always consider fallback options and accessibility. Happy coding! 💻

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

src/index.html Outdated
<h1>Moyo header</h1>
<header class="container">
<a
href="index.html"

Choose a reason for hiding this comment

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

Don't use spaces in <a> tag's href property. Anchor links should start with the # symbol if they are meant to be page anchors. If this is meant to be a link to the homepage, consider using / for clarity.

>
<img
src="./images/logo.png"
alt="logo-moyo"

Choose a reason for hiding this comment

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

The alt attribute should describe the image content. Instead of 'logo-moyo', a more descriptive alternative text like 'Moyo company logo' would be more informative.

</a>

<nav class="nav">
<ul class="nav__list">

Choose a reason for hiding this comment

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

Add empty lines between multiline sibling blocks of HTML for better readability. In this case, add an empty line before the <nav> tag to separate it from the <header> tag.

@@ -1,3 +1,69 @@
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 adding a fallback font-family for Roboto to ensure text is displayed with a default sans-serif font if Roboto fails to load.

src/style.css Outdated

.container {
display: flex;
height: 60px;

Choose a reason for hiding this comment

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

Avoid fixing the container size unless it's a specific requirement. It's better to let the content determine the height to prevent overflow or accidental scroll bars.

src/style.css Outdated

.nav__list {
display: flex;
width: 1200px;

Choose a reason for hiding this comment

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

It's not recommended to set a fixed width for elements such as '.nav__list' unless it's a specific requirement. Consider using max-width or relative units like percentages to maintain responsiveness.

}

.nav__item {
display: block;

Choose a reason for hiding this comment

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

The '.nav__item' class has a 'display: block;' property which is unnecessary since

  • elements are block-level by default.

  • }

    .nav__link.is-active {
    display: inline-block;

    Choose a reason for hiding this comment

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

    The '.nav__link.is-active' class has a 'display: inline-block;' property which might not be necessary. If you're trying to override a previous 'display' value, ensure it's required; otherwise, it can be removed.

    Copy link

    @volodymyr-soltys97 volodymyr-soltys97 left a comment

    Choose a reason for hiding this comment

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

    Hi, you need to fix all tests, check my comments, if you have any questions feel free in the fe_chat
    image

    src/index.html Outdated
    @@ -17,6 +17,78 @@
    />
    </head>
    <body>
    <h1>Moyo header</h1>
    <header class="container">

    Choose a reason for hiding this comment

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

    Suggested change
    <header class="container">
    <header class="header">

    src/index.html Outdated
    Comment on lines 40 to 41
    </li>
    <li class="nav__item">

    Choose a reason for hiding this comment

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

    Add the blank line between the links

    Suggested change
    </li>
    <li class="nav__item">
    </li>
    <li class="nav__item">

    Comment on lines +2 to +3
    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.

    Move font styles to the html selector

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

    --hover-color: #00acdc;

    Choose a reason for hiding this comment

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

    Create a variable with :root selector

    src/style.css Outdated
    Comment on lines 8 to 14
    .container {
    display: flex;
    height: 60px;
    align-items: center;
    align-content: space-around;
    margin: 0;
    }

    Choose a reason for hiding this comment

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

    Suggested change
    .container {
    display: flex;
    height: 60px;
    align-items: center;
    align-content: space-around;
    margin: 0;
    }
    .header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 50px;
    box-sizing: border-box;
    }

    src/style.css Outdated
    Comment on lines 22 to 29
    .nav__list {
    display: flex;
    width: 1200px;
    justify-content: flex-end;
    list-style: none;
    padding: 0;
    margin-left: 50px;
    }

    Choose a reason for hiding this comment

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

    Suggested change
    .nav__list {
    display: flex;
    width: 1200px;
    justify-content: flex-end;
    list-style: none;
    padding: 0;
    margin-left: 50px;
    }
    .nav__list {
    display: flex;
    list-style: none;
    padding: 0;
    }

    Comment on lines +6 to +7
    }

    Choose a reason for hiding this comment

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

    Suggested change
    }
    }
    body {
    margin: 0;
    }

    src/style.css Outdated
    Comment on lines 35 to 43
    .nav__link {
    color: #000;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 12px;
    line-height: 14px;
    padding: 5px;
    position: relative;
    }

    Choose a reason for hiding this comment

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

    Suggested change
    .nav__link {
    color: #000;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 12px;
    line-height: 14px;
    padding: 5px;
    position: relative;
    }
    .nav__link {
    color: #000;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 12px;
    line-height: 60px;
    display: inline-block:
    height: 60px;
    }

    src/style.css Outdated
    }

    .nav__link:hover {
    color: #00acdc;

    Choose a reason for hiding this comment

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

    Create a variable for repeated color

    Copy link

    @anastasiiavorobiova anastasiiavorobiova left a comment

    Choose a reason for hiding this comment

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

    Try to pass all tests
    Screenshot 2024-09-18 at 17 02 35
    Links should have the height of the header
    Screenshot 2024-09-18 at 17 02 20
    Consider removing default margins here
    Screenshot 2024-09-18 at 17 02 13
    Check the size of the logo
    Screenshot 2024-09-18 at 17 01 36
    Links should be centered vertically
    Also, check font styles

    Comment on lines +22 to +23
    <a href="index.html"
    class="logo" >

    Choose a reason for hiding this comment

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

    Suggested change
    <a href="index.html"
    class="logo" >
    <a
    href="index.html"
    class="logo"
    >

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    4 participants