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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Search bar for Airbnb
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://mykhailoyurkovskyi.github.io/layout_search-bar-airbnb/)
- [TEST REPORT LINK](https://mykhailoyurkovskyi.github.io/layout_search-bar-airbnb/report/html_report/)

> Follow [this instructions](https://mate-academy.github.io/layout_task-guideline/#how-to-solve-the-layout-tasks-on-github)

Expand Down
15 changes: 14 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@
<link rel="stylesheet" href="./style.css">
</head>
<body>
<h1>Search bar airbnb</h1>
<form class="search-form"
data-qa="big">
<input class="search-input big-form"
data-qa="keypress"
type="text"
placeholder="Try &quot;Los Angeles&quot;">
</form>

<form class="search-form"
data-qa="small">
<input class="search-input small-form"
type="text"
placeholder="Try &quot;Los Angeles&quot;">
</form>

Choose a reason for hiding this comment

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

image

</body>
</html>
89 changes: 89 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
:root {
--big-search-icon: url(images/Search.svg) 26px 50% no-repeat;
--small-search-icon: url(images/Search.svg) 13px 50% no-repeat;
--form-font: "Avenir", sans-serif;
--big-form-font: 16px;
--small-form-font: 14px;
--font-color: #3d4d61;
--search-box-shadow-color: 61, 78, 97;
--small-background-size: 11px;
--linear-gradient: linear-gradient(80deg, #fff 0%, #f6f6f7 100%);
}

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

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

body {
font-family: var(--form-font);
}

.search-form {
margin-top: 20px;
}

.search-input {
border-radius: 4px;
box-sizing: border-box;
font-family: inherit;
border: 1px solid #e1e7ed;
box-shadow: 0 1px 8px 0 rgba(var(--search-box-shadow-color), 0.1);
color: var(--font-color);
width: 100%;
}

.big-form {
height: 70px;
background: var(--big-search-icon);
padding-left: 62px;
font-family: inherit;
font-size: var(--big-form-font);
}

.small-form {
height: 42px;
font-family: inherit;
padding-left: 33px;
background: var(--small-search-icon);
font-size: var(--small-form-font);
background-size: var(--small-background-size);
Comment on lines +43 to +57

Choose a reason for hiding this comment

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

You could make small/big form be the default one and add a modifier only to another

}

.search-input:hover {
box-shadow: 0 3px 8px 0 rgba(var(--search-box-shadow-color), 0.2);
}

.search-input:focus {
border-radius: 3px;
outline: none;
font-weight: 800;
}

.big-form:focus {
background-color: var(--big-search-icon),
var(--linear-gradient);
}

.small-form:focus {
background-color: var(--small-search-icon),
var(--linear-gradient);
background-size: var(--small-background-size);
}

.search-input::placeholder {
font-family: inherit;
color: var(--font-color);
font-weight: 300;
}

.small-form::placeholder {
font-size: var(--font-size-small);
}