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

Open
wants to merge 4 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://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)
46 changes: 35 additions & 11 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,41 @@
href="style.css"
/>
</head>
<body>
<input
type="text"
data-qa="keypress"
placeholder="Try “Los Angeles“"
/>
<body class="page">
<div class="page__form-container">
<form
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
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>
107 changes: 106 additions & 1 deletion src/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,106 @@
/* add styles here */
/* #region PAGE */
* {

Choose a reason for hiding this comment

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

Remove all comments

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: 700;
}

html {
--border-color: #e1e7ed;
--main-color: #3d4e61;
--background-color: #fff;
--gradient-color-start: #fff;
--gradient-color-end: #f6f6f7;
--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%;
padding: 0;
display: block;
border-radius: 4px;
border: 1px solid var(--border-color);
box-shadow: 0 1px 8px 0 var(--box-shadow-color);
font-family: inherit;
outline: none;

color: var(--main-color);
line-height: normal;
}

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

.form__search-bar--big {
font-size: 16px;
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(--gradient-color-start) 0%,
var(--gradient-color-end) 100%
);
}

.form__icon {
background: center/contain url(./images/Search.svg) no-repeat;
position: absolute;
}

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

.form__icon--small {
width: 11px;
height: 11px;
top: 15px;
left: 13px;
}
Loading