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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ ___

❗️ Replace `<your_account>` with your Github username and copy the links to `Pull Request` description:

- [DEMO LINK](https://<your_account>.github.io/layout_search-bar-airbnb/)
- [TEST REPORT LINK](https://<your_account>.github.io/layout_search-bar-airbnb/report/html_report/)
- [DEMO LINK](https://RomanHasiuk.github.io/layout_search-bar-airbnb/)
- [TEST REPORT LINK](https://RomanHasiuk.github.io/layout_search-bar-airbnb/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
39 changes: 28 additions & 11 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,34 @@
href="style.css"
/>
</head>
<body>
<input
type="text"
data-qa="keypress"
placeholder="Try “Los Angeles“"
/>

<input
type="text"
data-qa="hover"
placeholder="Try “Los Angeles“"
/>
<body class="page">
<form
class="search-bar search-bar-big"
data-qa="big"
>
Comment on lines +23 to +26

Choose a reason for hiding this comment

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

The attributes for the form tag are correctly formatted since there are more than two attributes. However, ensure that the line length does not exceed 80 characters.

<label class="search-bar__label search-bar__lable-big">

Choose a reason for hiding this comment

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

There is a typo in the class name 'search-bar__lable-big'. It should be 'search-bar__label-big'.

<input
data-qa="keypress"
class="search-bar__input search-bar__input-big"
type="text"
placeholder="Try “Los Angeles“"
/>
Comment on lines +28 to +33

Choose a reason for hiding this comment

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

The attributes for the input tag are correctly formatted since there are more than two attributes. However, ensure that the line length does not exceed 80 characters.

</label>
</form>

<form

Choose a reason for hiding this comment

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

There should be an empty line between the sibling form elements to improve readability.

class="search-bar search-bar-small"
data-qa="small"
>
Comment on lines +37 to +40

Choose a reason for hiding this comment

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

The attributes for the form tag are correctly formatted since there are more than two attributes. However, ensure that the line length does not exceed 80 characters.

<label class="search-bar__label search-bar__lable-small">

Choose a reason for hiding this comment

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

There is a typo in the class name 'search-bar__lable-small'. It should be 'search-bar__label-small'.

<input
data-qa="hover"
class="search-bar__input search-bar__input-small"
type="text"
placeholder="Try “Los Angeles“"
/>
Comment on lines +42 to +47

Choose a reason for hiding this comment

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

The attributes for the input tag are correctly formatted since there are more than two attributes. However, ensure that the line length does not exceed 80 characters.

</label>
</form>
</body>
</html>
122 changes: 121 additions & 1 deletion src/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,121 @@
/* add styles here */
* {
padding: 0;

Choose a reason for hiding this comment

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

Using the universal selector '*' is not recommended as it impacts performance. Consider applying styles directly to specific elements or classes that require them.

box-sizing: border-box;
}

Choose a reason for hiding this comment

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

The use of the * selector is discouraged because it impacts performance. It is more efficient to set styles only for elements that require them.

@font-face {
font-family: Avenir;
font-weight: 300;
font-style: normal;
src: url(fonts/Avenir-Book.ttf) format('truetype');
}

@font-face {
font-family: Avenir;
font-weight: 600;
font-style: normal;
src: url(fonts/Avenir-Heavy.ttf) format('truetype');
}

.page {
font-family: Avenir, sans-serif;
font-size: 16px;

Choose a reason for hiding this comment

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

Good job on including a fallback font with the font-family property. This ensures that if the primary font fails to load, the text will still be displayed in a different font.

}

.search-bar {
display: flex;
justify-content: center;
margin: 20px auto 0;
}

Choose a reason for hiding this comment

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

It's a good practice to be consistent with your margins. Here you're using margin to add space at the top of the .search-bar. Make sure you're not adding bottom margins elsewhere in your code to avoid potential margin collapse.


.search-bar-big {
width: 100%;
height: 70px;
}

Choose a reason for hiding this comment

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

Avoid fixing container sizes unless it's a requirement. Here, you're setting a fixed height for .search-bar-big. Let the content size dictate the container size to avoid overflow or accidental scroll bars.


.search-bar-small {
width: 100%;
height: 42px;
}

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, avoid fixing container sizes unless it's a requirement. Here, you're setting a fixed height for .search-bar-small. Let the content size dictate the container size to avoid overflow or accidental scroll bars.


.search-bar__label {
position: relative;
display: block;
width: 100%;
}

.search-bar__label::after {
position: absolute;
content: '';
display: block;
}

.search-bar__lable-big::after {
background-image: url(./images/Search.svg);
background-repeat: no-repeat;
background-size: contain;
width: 19px;
height: 19px;
top: 25px;
left: 26px;
}

.search-bar__lable-small::after {
background-image: url(./images/Search.svg);
background-repeat: no-repeat;
background-size: contain;
width: 11px;
height: 11px;
top: 15px;
left: 13px;
}

.search-bar__input {
width: 100%;
height: 100%;
border: 1px solid #e1e7ed;
font-family: inherit;
border-radius: 4px;
font-weight: 300;
color: #3d4e61;
box-shadow: 0 1px 8px 0 #3d4e6133;
outline: none;
}

.search-bar__input:hover {
box-shadow: 0 3px 8px 0 #3d4e6133;
}

.search-bar__input:focus {
border: 1px solid #e1e7ed;
background: linear-gradient(180deg, #fff 0%, #f6f6f7 100%);
font-weight: 600;
color: #3d4e61;
}

.search-bar__input-big {
padding-left: 62px;
font-size: 16px;
line-height: 22;
}

Choose a reason for hiding this comment

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

The 'line-height' property should have a unit specified, such as 'px'. Without a unit, it may not render as expected.


.search-bar__input-small {
padding-left: 33px;
font-size: 14px;
line-height: 19;
}

Choose a reason for hiding this comment

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

The 'line-height' property should have a unit specified, such as 'px'. Without a unit, it may not render as expected.


.search-bar__input::placeholder {
color: inherit;
font-weight: 300;
}

.search-bar__input-big::placeholder {
font-size: 16px;
line-height: 22px;
}

.search-bar__input-small::placeholder {
font-size: 14px;
line-height: 22px;
}
Loading