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

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
12 changes: 9 additions & 3 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,13 +24,15 @@ ___
- 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://labelsavchuk.github.io/layout_search-bar-airbnb/)
- [TEST REPORT LINK](https://labelsavchuk.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
34 changes: 23 additions & 11 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<!doctype html>
<html lang="en">
<html
lang="en"
class="page"
>
<head>
<meta charset="UTF-8" />
<meta
Expand All @@ -17,16 +20,25 @@
/>
</head>
<body>
<input
type="text"
data-qa="keypress"
placeholder="Try “Los Angeles“"
/>
<form data-qa="big">
<label class="search-bar page__search">
<input
class="search-bar__input"
type="text"
data-qa="keypress"
placeholder="Try “Los Angeles“"
/>
</label>
</form>

<input
type="text"
data-qa="hover"
placeholder="Try “Los Angeles“"
/>
<form data-qa="small">
<label class="search-bar search-bar--small page__search">
<input
class="search-bar__input search-bar__input--small"
type="text"
placeholder="Try “Los Angeles“"
/>
</label>
</form>
</body>
</html>
82 changes: 82 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,83 @@
/* add styles here */

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

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

.page__search {
margin-top: 20px;

--back-color-focus: linear-gradient(180deg, #fff 0%, #f6f6f7 100%);
}

.search-bar {
box-sizing: border-box;
position: relative;
display: flex;
width: 100%;
height: 70px;
}

.search-bar::after {
position: absolute;

Choose a reason for hiding this comment

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

Pay attention to CSS properties order
https://9elements.com/css-rule-order/

display: block;
background-image: url(./images/Search.svg);
background-size: contain;
background-repeat: no-repeat;
background-position: center;
top: 25px;
left: 26px;
width: 19px;
height: 19px;
content: '';
}

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

.search-bar--small::after {
top: 15px;
left: 13px;
width: 11px;
height: 11px;
}

.search-bar__input {
flex: 1;
box-sizing: border-box;
border: 1px solid #e1e7ed;
border-radius: 4px;
box-shadow: 0 1px 8px 0 #3d4e611a;
padding: 0;
outline: none;
color: #3d4e61;
font-family: Avenir, sans-serif;
font-weight: 300;
font-size: 16px;
line-height: 21.86px;
padding-left: 62px;
}

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

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

.search-bar__input:focus {
background-color: var(--back-color-focus);
box-shadow: 0 4px 4px 0 var(--shadow-focus-color);
}
Loading