Skip to content

Commit

Permalink
add task solution
Browse files Browse the repository at this point in the history
  • Loading branch information
iyehorova committed Jun 14, 2024
1 parent afacaf6 commit 628806a
Show file tree
Hide file tree
Showing 8 changed files with 131 additions and 17 deletions.
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ ___

❗️ 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://iyehorova.github.io/layout_search-bar-airbnb/)
- [TEST REPORT LINK](https://iyehorova.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
46 changes: 32 additions & 14 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!doctype html>
<html lang="en">
<head>
<head class="page">
<meta charset="UTF-8" />
<meta
name="viewport"
Expand All @@ -10,23 +10,41 @@
http-equiv="X-UA-Compatible"
content="ie=edge"
/>
<title>Document</title>
<title>Search bar</title>
<link
rel="stylesheet"
href="style.css"
href="styles/main.css"
/>
</head>
<body>
<input
type="text"
data-qa="keypress"
placeholder="Try “Los Angeles“"
/>
<body class="page__body">
<form
action="/src/index.html"
method="get"
class="page__form search-bar search-bar--big"
data-qa="big"
>
<input
type="text"
data-qa="keypress"
placeholder="Try “Los Angeles“"
class="search-bar__input"
name="big-search"
/>
</form>

<input
type="text"
data-qa="hover"
placeholder="Try “Los Angeles“"
/>
<form
action="/src/index.html"
method="get"
class="page__form search-bar search-bar--small"
data-qa="small"
>
<input
type="text"
data-qa="hover"
placeholder="Try “Los Angeles“"
class="search-bar__input"
name="small-search"
/>
</form>
</body>
</html>
1 change: 0 additions & 1 deletion src/style.css

This file was deleted.

9 changes: 9 additions & 0 deletions src/styles/blocks/fonts.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@font-face {
font-family: 'Avenir Book';
src: url(../../fonts/Avenir-Book.ttf);
}

@font-face {
font-family: 'Avenir Heavy';
src: url(../../fonts/Avenir-Heavy.ttf);
}
10 changes: 10 additions & 0 deletions src/styles/blocks/page.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.page {
font-family: 'Avenir Book', sans-serif;
font-weight: 300;
color: #3d4e61;
font-size: 16px;
}

.page__form {
margin-top: 20px;
}
68 changes: 68 additions & 0 deletions src/styles/blocks/search-bar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
.search-bar {
box-sizing: border-box;
background-image: url(../../images/search.svg);
background-repeat: no-repeat;
border: 1px solid #e1e7ed;
box-shadow: 0 1px 8px rgba(61, 78, 97, 0.1);
border-radius: 4px;

display: flex;
align-items: center;
}

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

background-position: 26px center;
background-size: 19px 19px;
}

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

background-position: 13px center;
background-size: 11px 11px;
}

.search-bar__input {
font-family: var(--default-font);
font-weight: var(--default-weight);
color: var(--text-color);
font-size: inherit;

border: none;
outline: none;
padding: 0;
flex-grow: 1;
}

.search-bar--small .search-bar__input {
font-weight: 400;
}

.search-bar__input::placeholder {
font-family: var(--default-font);
font-weight: var(--default-weight);
color: var(--text-color);

font-size: inherit;

/* line-height: 22px; */
}

.search-bar:hover {
box-shadow: 0 3px 8px rgba(61, 78, 97, 0.2);
}

.search-bar:focus {
background: linear-gradient(180deg, #fff 0%, #f6f6f7 100%);
filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.25));
border-radius: 3px;
}

.search-bar__input:focus {
font-family: var(--accent-font);
}
6 changes: 6 additions & 0 deletions src/styles/blocks/variables.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
:root {
--text-color: #3d4e61;
--default-weight: 300;
--default-font: 'Avenir Book', sans-serif;
--accent-font: 'Avenir Heavy', sans-serif;
}
4 changes: 4 additions & 0 deletions src/styles/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@import 'blocks/fonts.css';
@import 'blocks/variables.css';
@import 'blocks/page.css';
@import 'blocks/search-bar.css';

0 comments on commit 628806a

Please sign in to comment.