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

solution #4487

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
20 changes: 13 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# Search bar for Airbnb

> Here are the [Layout Tasks Instructions](https://mate-academy.github.io/layout_task-guideline/#how-to-solve-the-layout-tasks-on-github)
___

---

## The task

> Create HTML page with two search bars as designed in [the mockup](https://www.figma.com/file/kf3AWulK9elrNk34wtpjPw/Airbnb-Search-bar?node-id=0%3A1). This search bar will be part of big project.

![screenshot](./references/search-bar-example.png)

### Requirements:

- use images from [src/images](src/images)
- there must be two search bars
- search bar must stretch the full width
Expand All @@ -20,17 +24,19 @@ ___
- use `@font-face` for fonts
- add attribute `data-qa="big"` for big search form, and `data-qa="small"` for small
- add attribute `data-qa="keypress"` to input in big search form

---

## Checklist

❗️ 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://MakksymSly.github.io/layout_search-bar-airbnb/)
- [TEST REPORT LINK](https://MakksymSly.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.

- [ ] Icon implemented using background-image CSS property
- [ ] Inputs are written inside of 'form' tag with correctly passed attributes
- [ ] All `Typical Mistakes` from `BEM` lesson theory are checked.
- [ ] Code follows all the [Code Style Rules ❗️](./checklist.md)
- [x] Icon implemented using background-image CSS property
- [x] Inputs are written inside of 'form' tag with correctly passed attributes
- [x] All `Typical Mistakes` from `BEM` lesson theory are checked.
- [x] Code follows all the [Code Style Rules ❗️](./checklist.md)
33 changes: 22 additions & 11 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,27 @@
/>
</head>
<body>
<input
type="text"
data-qa="keypress"
placeholder="Try “Los Angeles“"
/>

<input
type="text"
data-qa="hover"
placeholder="Try “Los Angeles“"
/>
<form
class="big-search-form"
data-qa="big"
Comment on lines +20 to +22

Choose a reason for hiding this comment

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

The class name big-search-form does not represent the meaning of the content. Consider using a name that reflects the function of the form rather than its appearance. For example, search-form or main-search-form could be more appropriate if this form is intended for searching content.

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

Choose a reason for hiding this comment

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

Remember to use 2 spaces for indentation in your file. The <input> element nested within the <form> element should be indented with 2 spaces relative to its parent.

</form>
<form
class="small-seach-form"
data-qa="small"
Comment on lines +31 to +33

Choose a reason for hiding this comment

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

There seems to be a typo in the class name small-seach-form. It should be small-search-form to maintain consistency and correct naming.

>
<input
class="search-form__input search-form__input--small"
type="text"
data-qa="small"
placeholder="Try “Los Angeles“"
/>
Comment on lines +31 to +40

Choose a reason for hiding this comment

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

The indentation here is inconsistent with the rest of the file. Ensure that the <input> element is indented with 2 spaces relative to its parent <form> element.

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

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

* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
Comment on lines +11 to +14

Choose a reason for hiding this comment

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

Don't use * selector (it impacts performance). Set styles only for elements that require them.


body {
margin: 8px;
}

html {
font-weight: 300;

--placeholder-color: #3d4e61;
}

.big-search-form {
margin-top: 20px;
}

.search-form__input--big {
height: 70px;
background-position-x: 26px;
background-position-y: 26px;

padding-left: 62px;
font-size: 16px;
line-height: 22px;
background-size: 19px 19px;
}

.search-form__input {
width: 100%;
outline: none;

background-image: url(images/Search.svg);
background-repeat: no-repeat;

border-radius: 4px;
border: 1px solid #e1e7ed;
box-shadow: 0 1px 8px 0 rgba(61, 78, 97, 0.1);

color: #3d4e61;

font-family: Avenir-Book, 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: Avenir-Book, Arial, sans-serif;.


.search-form__input::placeholder {
font-family: Avenir-Book, sans-serif;
color: var(--placeholder-color);

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: Avenir-Book, Arial, sans-serif;.

}

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

.search-form__input--small::placeholder {
font-size: 14px;
line-height: 19px;
}

.search-form__input:hover {
box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
}

.small-seach-form {
margin-top: 20px;

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 .small-seach-form, it should be .small-search-form.

}

.search-form__input--small {
height: 42px;

padding-left: 33px;

line-height: 19px;

background-size: 11px 11px;
background-position-x: 13px;
background-position-y: 15px;
}

.search-form__input:focus {
font-family: Avenir-Heavy, serif;
box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);

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: Avenir-Heavy, Arial, sans-serif;.

}

.search-form__input--small:focus {
background:
url('./images/Search.svg') no-repeat 13px 15px/11px 11px,
linear-gradient(180deg, transparent, #f6f6f7);
}
Loading