From fb24c0597c3513dbe37d9835731142253a16b99f Mon Sep 17 00:00:00 2001 From: Maksym Seliutin Date: Tue, 6 Aug 2024 17:48:54 +0300 Subject: [PATCH 1/2] add solution --- readme.md | 20 +++++---- src/index.html | 33 ++++++++++----- src/style.css | 107 ++++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 141 insertions(+), 19 deletions(-) diff --git a/readme.md b/readme.md index b635aa290b..df6653525e 100644 --- a/readme.md +++ b/readme.md @@ -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 @@ -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 `` with your Github username and copy the links to `Pull Request` description: -- [DEMO LINK](https://.github.io/layout_search-bar-airbnb/) -- [TEST REPORT LINK](https://.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) diff --git a/src/index.html b/src/index.html index abe507e10c..4df4389882 100644 --- a/src/index.html +++ b/src/index.html @@ -17,16 +17,27 @@ /> - - - +
+ +
+
+ +
diff --git a/src/style.css b/src/style.css index a63fa10d43..38972832bd 100644 --- a/src/style.css +++ b/src/style.css @@ -1 +1,106 @@ -/* 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; +} + +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; +} + +.search-form__input::placeholder { + font-family: Avenir-Book, sans-serif; + color: var(--placeholder-color); +} + +.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; +} + +.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); + + background: + url('./images/Search.svg') no-repeat 13px 15px/11px 11px, + linear-gradient(180deg, transparent, #f6f6f7); +} + +.search-form__input--small:focus { + background: + url('./images/Search.svg') no-repeat 13px 15px/11px 11px, + linear-gradient(180deg, transparent, #f6f6f7); +} From 780347a3e6a32331e51f78c3e96fec21a500aa83 Mon Sep 17 00:00:00 2001 From: Maksym Seliutin <109984222+MakksymSly@users.noreply.github.com> Date: Tue, 6 Aug 2024 18:04:58 +0300 Subject: [PATCH 2/2] fix: fixed css input background --- src/style.css | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/style.css b/src/style.css index 38972832bd..63d437ada6 100644 --- a/src/style.css +++ b/src/style.css @@ -93,10 +93,6 @@ html { .search-form__input:focus { font-family: Avenir-Heavy, serif; box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25); - - background: - url('./images/Search.svg') no-repeat 13px 15px/11px 11px, - linear-gradient(180deg, transparent, #f6f6f7); } .search-form__input--small:focus {