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

header design #5386

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

header design #5386

wants to merge 9 commits into from

Conversation

skrudj98
Copy link

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.

While you've made some great efforts in your code, there are a few critical issues that need addressing before we can move forward. The incorrect use of CSS properties and values, such as display: inline block; and size instead of font-size, can cause visual and functional problems. Also, the lack of responsive design considerations and descriptive class names could impact the maintainability and accessibility of your project. Let's fix these to ensure your code is solid! 🛠️ Remember, these changes are part of the learning process and will help you write more robust and clean code in the future! 💪

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

src/index.html Outdated Show resolved Hide resolved
src/index.html Outdated Show resolved Hide resolved
class="nav__link link2"
>
LAPTOPS & COMPUTERS
</a>

Choose a reason for hiding this comment

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

Avoid using spaces and special characters in URL fragments. The href attribute value #laptops-computers should be something like #laptops-computers or #laptops_and_computers.

src/index.html Outdated
<li class="nav__item">
<a
href="#apple"
class="nav__link link1 is-active"

Choose a reason for hiding this comment

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

Class names should represent the meaning of the content, not the styles or tag names. The class name 'link1' does not describe the content or function of the element. Consider using a name that reflects its role or state, such as 'nav__link--active' if it's meant to indicate the active link.

<a
href="#laptops-computers"
data-qa="hover"
class="nav__link link2"

Choose a reason for hiding this comment

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

Similar to the previous comment, 'link2' is not a descriptive class name. It's better to use a name that conveys the meaning or purpose of the element.

src/style.css Outdated Show resolved Hide resolved
src/style.css Outdated Show resolved Hide resolved
src/style.css Outdated Show resolved Hide resolved
src/style.css Outdated Show resolved Hide resolved
src/style.css Outdated Show resolved Hide resolved
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.

It looks like there are a few issues that need your attention before we can move forward. Don't worry, though! The majority of the feedback is about keeping your code clean and maintainable, like avoiding redundant styles and using classes instead of tag names for styling. There's also a functional issue with the href attribute in the <a> tag. Just a bit of polishing up and you'll be all set! Keep up the good work, and remember, every improvement is a step towards becoming an even better developer! 🌟

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

Comment on lines +18 to +26
<link
rel="preconnect"
href="https://fonts.googleapis.com"
/>
<link
rel="preconnect"
href="https://fonts.gstatic.com"
crossorigin="anonymous"
/>

Choose a reason for hiding this comment

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

The attributes of the link element should also follow the correct formatting as mentioned above.

Comment on lines +27 to +30
<link
href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap"
rel="stylesheet"
/>

Choose a reason for hiding this comment

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

The attributes of the link element should be formatted correctly as mentioned above.

</head>
<body>
<h1>Moyo header</h1>
<header class="header">
<a href="#logo">

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. If you meant to link to the top of the page, use href="#".

src/index.html Outdated
Comment on lines 69 to 74
href="##laptops_and_computers"
data-qa="hover"
class="nav__link link2"
>
LAPTOPS & COMPUTERS
</a>

Choose a reason for hiding this comment

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

There is an error in the href attribute of the <a> tag. It contains two # symbols. It should have only one to work correctly as an anchor link.

class="logo"
/>
</a>
<nav class="nav">

Choose a reason for hiding this comment

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

Consider adding an empty line before the nav element for better readability between sibling elements.

line-height: 14px;
}

* {

Choose a reason for hiding this comment

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

Don't use * selector as it impacts performance. It's better to set styles only for elements that require them.

background-color: gray;
}

ul {

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. It's better to style elements using classes.

.header {
background-color: white;
display: flex;
max-width: auto;

Choose a reason for hiding this comment

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

Don't fix container size with max-width: auto; and max-height: auto;, as it's better to let the content size dictate it. This can help avoid overflow or accidental scroll bars.

src/style.css Outdated
align-items: center;
height: 60px;
justify-content: flex-end;
font-family: Roboto, Arial, sans-serif;

Choose a reason for hiding this comment

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

The font-family declaration is redundant here since it's already defined in the html selector. You can safely remove it to avoid repetition and to keep your CSS DRY (Don't Repeat Yourself).

}

.nav__item {
margin: 0 10px;

Choose a reason for hiding this comment

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

Be consistent with your vertical margins. It's better to add only top or only bottom margin, but not both, to avoid collapsing margins in some cases.

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.

Summary: Great work on your Pull Request! 🌟 You've made some progress, but there are a few important aspects to consider for future improvement. Remember to avoid unnecessary CSS properties like max-width: auto; and max-height: auto; as they can lead to unintended layout issues. Use fallback fonts to ensure text is always displayed properly. Be mindful of your naming conventions and aim for meaningful class names that reflect the content's purpose. Watch out for link formatting and text transformation practices for better accessibility. Lastly, pay attention to your code's formatting with proper indentation and spacing for better readability. Keep learning and refining your skills! 👍

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

src/index.html Outdated
Comment on lines 23 to 26
<header class="header">
<a href="#logo">
<img src="images/logo.png" alt="Moyo logo" class="logo"/>
</a>

Choose a reason for hiding this comment

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

Remember about correct indentation between parent and child elements. Each level of nesting should have a 2-space offset.

src/index.html Outdated
Comment on lines 28 to 55
<nav class="nav">
<ul class="nav__list">
<li class="nav__item">
<a href="#apple" class="nav__link link1 is-active">APPLE</a>
</li>
<li class="nav__item">
<a href="#samsung" class="nav__link">SAMSUNG</a>
</li>
<li class="nav__item">
<a href="#smartphones" class="nav__link">SMARTPHONES</a>
</li>
<li class="nav__item">
<a href="#laptops_and_computers" data-qa="hover" class="nav__link link2 ">LAPTOPS & COMPUTERS</a>
</li>
<li class="nav__item">
<a href="#gadgets" class="nav__link">GADGETS</a>
</li>
<li class="nav__item">
<a href="#tablets" class="nav__link">TABLETS</a>
</li>
<li class="nav__item">
<a href="#photo" class="nav__link">PHOTO</a>
</li>
<li class="nav__item">
<a href="#video" class="nav__link">VIDEO</a>
</li>
</ul>
</nav>

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.

src/index.html Outdated
Comment on lines 30 to 31
<li class="nav__item">
<a href="#apple" class="nav__link link1 is-active">APPLE</a>

Choose a reason for hiding this comment

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

The text inside the 'a' tag should not be in uppercase due to accessibility concerns. Use CSS to transform text appearance.

src/index.html Outdated
<a href="#smartphones" class="nav__link">SMARTPHONES</a>
</li>
<li class="nav__item">
<a href="#laptops_and_computers" data-qa="hover" class="nav__link link2 ">LAPTOPS & COMPUTERS</a>

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 the 'a' tag's 'href' property. The 'href' for 'LAPTOPS & COMPUTERS' should be '#laptops_and_computers' without spaces.

src/index.html Outdated
<a href="#smartphones" class="nav__link">SMARTPHONES</a>
</li>
<li class="nav__item">
<a href="#laptops_and_computers" data-qa="hover" class="nav__link link2 ">LAPTOPS & COMPUTERS</a>

Choose a reason for hiding this comment

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

The class 'link2' does not represent the meaning of the content. Class names should represent the meaning of the content, not the styles or tag names.

Comment on lines +19 to +20
ul {
list-style: none;

Choose a reason for hiding this comment

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

Don't use tag names for styling. Style all elements using .class and if needed with :pseudo-class, pseudo-element and [attribute].

Comment on lines +30 to +34
.header {
background-color: white;
display: flex;
max-width: auto;
max-height: auto;

Choose a reason for hiding this comment

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

Avoid fixing container sizes using max-width: auto; and max-height: auto;. Let the content size dictate the container size to prevent overflow or accidental scrollbars.

@@ -1,3 +1,95 @@
html {
font-family: Roboto, Arial, sans-serif;

Choose a reason for hiding this comment

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

Remember to use fallback fonts - alternative font-family in case the main one doesn't work. For example, font-family: Roboto, Arial, sans-serif;.

.header {
background-color: white;
display: flex;
max-width: auto;

Choose a reason for hiding this comment

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

The max-width: auto; is not necessary here. By default, block-level elements like div take up the full width available to them. If you need to constrain the width, use a specific value or percentage.

background-color: white;
display: flex;
max-width: auto;
max-height: auto;

Choose a reason for hiding this comment

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

Similarly, max-height: auto; is the default behavior for elements, and it's not needed unless you're explicitly setting a max-height value.

src/index.html Outdated
Comment on lines 24 to 26
<a href="#logo">
<img src="images/logo.png" alt="Moyo logo" class="logo"/>
</a>

Choose a reason for hiding this comment

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

Suggested change
<a href="#logo">
<img src="images/logo.png" alt="Moyo logo" class="logo"/>
</a>
<a href="#logo">
<img src="images/logo.png" alt="Moyo logo" class="logo"/>
</a>

src/index.html Outdated
Comment on lines 30 to 32
<li class="nav__item">
<a href="#apple" class="nav__link link1 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.

fix tabulation

Suggested change
<li class="nav__item">
<a href="#apple" class="nav__link link1 is-active">APPLE</a>
</li>
<li class="nav__item">
<a href="#apple" class="nav__link is-active">APPLE</a>
</li>

class link1 is redundant

src/style.css Outdated
Comment on lines 60 to 63
.link1 {
position: relative;
color: #00acdc;
}

Choose a reason for hiding this comment

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

Suggested change
.link1 {
position: relative;
color: #00acdc;
}
.is-active {
position: relative;
color: #00acdc;
}

color: #00acdc;
}

.link2:hover {

Choose a reason for hiding this comment

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

Suggested change
.link2:hover {
.nav__link:hover {

Copy link

@etojeDenys etojeDenys left a comment

Choose a reason for hiding this comment

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

good job

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.

3 participants