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

Open
wants to merge 1 commit 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
14 changes: 7 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ ___
- a search bar has 3 state default, `hover` and `focus`
- don't use JavaScript
- use `@font-face` for fonts
- add attribute `data-qa="big"` for big search form, and `data-qa="small"` for small
- add attribute `data-qa="big"` for big search form, and `data-qa="big"` 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://CNegruzzi.github.io/layout_search-bar-airbnb/)
- [TEST REPORT LINK](https://CNegruzzi.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)
44 changes: 31 additions & 13 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<!doctype html>
<html lang="en">
<html
lang="en"
class="page"
>
<!-- #region head -->
<head>
<meta charset="UTF-8" />
<meta
Expand All @@ -10,23 +14,37 @@
http-equiv="X-UA-Compatible"
content="ie=edge"
/>
<title>Document</title>
<title>Search</title>
<link
rel="stylesheet"
href="style.css"
/>
</head>
<body>
<input
type="text"
data-qa="keypress"
placeholder="Try “Los Angeles“"
/>
<!-- #endregion -->

<input
type="text"
data-qa="hover"
placeholder="Try “Los Angeles“"
/>
<body class="page__body">
<form
class="search"
data-qa="big"
>
<input
class="search__input search__input--big"
type="text"
data-qa="keypress"
placeholder="Try “Los Angeles“"
/>
</form>

<form
class="search"
data-qa="small"
>
<input
class="search__input search__input--small"
type="text"
data-qa="hover"
placeholder="Try “Los Angeles“"
/>
</form>
</body>
</html>
100 changes: 99 additions & 1 deletion src/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,99 @@
/* add styles here */
/* #region page */
@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;
}

/* #endregion */

/* #region search */

.search {
margin-top: 20px;
}

.search__input {
width: 100%;
box-sizing: border-box;
box-shadow: 0 3px 8px 0 rgba(61, 78, 97, 0.1);
border: 1px solid rgba(225, 231, 237, 1);
border-radius: 4px;
font-family: inherit;
color: rgba(61, 78, 97, 1);
}

.search__input:focus {
outline: none;
font-weight: 800;
border-radius: 3px;
box-shadow: 0 4px 4px 0 #00000040;
}

.search__input:hover {
box-shadow: 0 3px 8px 0 rgba(61, 78, 97, 0.2);
}

.search__input::placeholder {
font-family: inherit;
color: rgba(61, 78, 97, 1);
font-weight: 300;
}

/* #endregion */

/* #region big */

.search__input--big {
height: 70px;
padding-left: 62px;
font-size: 16px;
background-image: url(images/Search.svg);
background-repeat: no-repeat;
background-position: 26px 50%;
background-size: 19px;
}

.search__input--big:focus {
background: linear-gradient(180deg, #fff 0%, #f6f6f7 100%);
background-image: url(images/Search.svg);
background-repeat: no-repeat;
background-position: 26px 50%;
background-size: 19px;
}

/* #endregion */

/* #region small */

.search__input--small {
height: 42px;
padding-left: 33px;
font-size: 14px;
background-image: url(images/Search.svg);
background-size: 11px;
background-position: 13px 50%;
background-repeat: no-repeat;
}

.search__input--small:focus {
background: linear-gradient(180deg, #fff 0%, #f6f6f7 100%);
background-image: url(images/Search.svg);
background-size: 11px;
background-position: 13px 50%;
background-repeat: no-repeat;
}

/* #endregion */
Loading