Skip to content

Commit

Permalink
add task solution
Browse files Browse the repository at this point in the history
  • Loading branch information
YuliiaShatkovska committed Aug 13, 2024
1 parent afacaf6 commit 53b9103
Show file tree
Hide file tree
Showing 3 changed files with 150 additions and 19 deletions.
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://YuliiaShatkovska.github.io/layout_search-bar-airbnb/)
- [TEST REPORT LINK](https://YuliiaShatkovska.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)
48 changes: 37 additions & 11 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,43 @@
href="style.css"
/>
</head>
<body>
<input
type="text"
data-qa="keypress"
placeholder="Try “Los Angeles“"
/>
<body class="page">
<div class="page__form-container">
<form
method="post"
class="form form--big"
data-qa="big"
>
<div class="form__container">
<div class="form__icon form__icon--big"></div>

<input
type="text"
data-qa="hover"
placeholder="Try “Los Angeles“"
/>
<input
type="text"
data-qa="keypress"
placeholder="Try &#34;Los Angeles&#34;"
class="form__search-bar form__search-bar--big"
/>
</div>
</form>
</div>

<div class="page__form-container">
<form
method="post"
class="form form--small"
data-qa="small"
>
<div class="form__container">
<div class="form__icon form__icon--small"></div>

<input
type="text"
data-qa="keypress"
placeholder="Try &#34;Los Angeles&#34;"
class="form__search-bar form__search-bar--small"
/>
</div>
</form>
</div>
</body>
</html>
101 changes: 100 additions & 1 deletion src/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,100 @@
/* add styles here */
/* #region PAGE */
* {
box-sizing: border-box;
}

@font-face {
font-family: Avenir, sans-serif;
src: url(./fonts/Avenir-Book.ttf);
font-weight: 300;
}

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

html {
--border-color: #e1e7ed;
--main-color: #3d4e61;
--background-color: #fff;
--box-shadow-color: rgba(61, 78, 97, 0.1);
}

.page {
font-family: Avenir, sans-serif;
}

.page__form-container {
margin-top: 20px;
}

/* #endregion */
.form__container {
position: relative;
}

.form__search-bar {
width: 100%;
display: block;
border-radius: 4px;
border: 1px solid var(--border-color);
background-color: var(--background-color);
box-shadow: 0 1px 8px 0 var(--box-shadow-color);
font-family: inherit;
outline: none;
font-weight: 400;
font-size: 16px;
color: var(--main-color);
}

.form__search-bar::placeholder {
color: var(--main-color);
}

.form__search-bar--big {
height: 70px;
padding-left: 62px;
}

.form__search-bar--small {
height: 42px;
padding-left: 33px;
font-size: 14px;
}

.form__search-bar--small:hover {
box-shadow: 0 3px 8px 0 var(--box-shadow-color);
}

.form__search-bar--big:hover,
.form__search-bar--big:focus {
box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
}

.form__search-bar:focus {
border-radius: 3px;
font-weight: 900;
background: linear-gradient(180deg, var(--background-color) 0%, #f6f6f7 100%);
}

.form__icon {
position: absolute;
background-image: url(./images/Search.svg);
}

.form__icon--big {
width: 19px;
height: 19px;
top: 26px;
left: 26px;
}

.form__icon--small {
width: 11px;
height: 11px;
background-size: 11px;
top: 16px;
left: 13px;
}

0 comments on commit 53b9103

Please sign in to comment.