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

Open
wants to merge 3 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
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://miroshnykow.github.io/layout_search-bar-airbnb/)
- [TEST REPORT LINK](https://miroshnykow.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
54 changes: 43 additions & 11 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,55 @@
http-equiv="X-UA-Compatible"
content="ie=edge"
/>
<title>Document</title>
<title>Search bar</title>
<link
rel="stylesheet"
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“"
/>
<form
action="#"
data-qa="big"
>
Comment on lines +21 to +24

Choose a reason for hiding this comment

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

Keep your attributes correctly formatted. If the element has more than 2 attributes, start each one on a new line with a 2-space indentation related to the tag.


<label>

<div>

Choose a reason for hiding this comment

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

Redundant

Suggested change
<div>


<input
class="search-bar search-bar--big" type="text"
data-qa="keypress"
placeholder="Try “Los Angeles“"
/>

</div>

</label>

</form>

<form
action="#"
data-qa="small"
>
Comment on lines +42 to +45

Choose a reason for hiding this comment

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

Keep your attributes correctly formatted. If the element has more than 2 attributes, start each one on a new line with a 2-space indentation related to the tag.


<label>

<div>

Choose a reason for hiding this comment

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

Suggested change
<div>


<input
class="search-bar search-bar--small" type="text"
data-qa="hover"
placeholder="Try “Los Angeles“"
/>

</div>

</label>

</form>

</body>
</html>
85 changes: 84 additions & 1 deletion src/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,84 @@
/* add styles here */
@font-face {
font-family: Avenir;
src: url(fonts/Avenir-Book.ttf);
font-weight: 300;
}

@font-face {
font-family: Avenir;
src: url(fonts/Avenir-Heavy.ttf);
font-weight: bold;
}

.search-bar {
font-family: Avenir, sans-serif;
display: block;

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 after 'Avenir'. If 'Avenir' fails to load for some reason, the browser will use the fallback font instead.

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 Avenir in case it fails to load. For example, 'font-family: Avenir, Arial, sans-serif;'. This ensures text is still readable with a default font.

box-sizing: border-box;
width: 100%;

margin-top: 20px;
border: 1px solid #e1e7ed;

Choose a reason for hiding this comment

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

According to the checklist, be consistent with your margins. Choose either top or bottom margins for elements, but not both, to avoid potential margin collapse issues.

Choose a reason for hiding this comment

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

According to the checklist, be consistent with your margins. It's recommended to add margins only to the top or bottom of elements, not both, to avoid potential margin collapse.

Choose a reason for hiding this comment

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

The .search-bar class has a fixed margin-top, which might not be flexible for different contexts. Consider using a more responsive design approach unless a fixed size is a specific requirement.

border-radius: 4px;
box-shadow: 0 1px 8px 0 #3d4e611a;
color: #3d4e61;
}

.search-bar::placeholder {
color: #3d4e61;
}

.search-bar--big {
height: 70px;
background-image: url(/src/images/Search.svg);
background-repeat: no-repeat;
background-size: 19px 19px;
font-size: 16px;
padding-left: 62px;
background-position: 26px center;
background-color: #ffff;
}

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

.search-bar--big:focus {
border: 1px solid #e1e7ed;
box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);

background-image: url(/src/images/Search.svg),
linear-gradient(180deg, transparent, #f6f6f7);

background-repeat: no-repeat;
background-position: 26px 25px;
background-size: 19px 19px;
text-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
font-weight: bold;
}

.search-bar--small {
height: 42px;
background-image: url(/src/images/Search.svg);
background-repeat: no-repeat;
background-size: 11px 11px;
font-size: 14px;
font-weight: 400;
padding-left: 33px;
background-position: 13px center;
}

.search-bar--small:hover {
box-shadow: 0 3px 8px 0 #3d4e61;
text-shadow: none;
}

.search-bar--small:focus {
border: 1px solid #e1e7ed;
text-shadow: none;
background-image: url(/src/images/Search.svg),
linear-gradient(180deg, transparent, #f6f6f7);

Choose a reason for hiding this comment

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

Make sure the path to the image is consistent across the CSS file. Here, the path starts with '/src/images/Search.svg', while elsewhere it is 'images/Search.svg'. Use a consistent path to ensure the image loads correctly in all cases.


background-repeat: no-repeat;
background-position: 13px center;
background-size: 11px 11px;
}
Loading