Skip to content

Commit

Permalink
Solution
Browse files Browse the repository at this point in the history
  • Loading branch information
KrivorotkoYurii committed Oct 1, 2024
1 parent b64f3c5 commit 4f267a7
Show file tree
Hide file tree
Showing 8 changed files with 167 additions and 14 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://KrivorotkoYurii.github.io/layout_search-bar-airbnb/)
- [TEST REPORT LINK](https://KrivorotkoYurii.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
31 changes: 31 additions & 0 deletions src/block/input.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.search-form__input {
height: 100%;
width: 100%;
padding: 0;

font-size: 16px;

border: none;
}

.search-form__input::placeholder {
color: inherit;
}

.search-form__input--small {
font-size: 14px;
}

.search-form__input:focus {
outline: none;
font-weight: 900;

background: linear-gradient(
var(--first-gradient-form-color),
var(--second-gradient-form-color)
);
}

.search-form__input--large:focus {
text-shadow: 0 4px 4px var(--box-shadow-dark-color);
}
7 changes: 7 additions & 0 deletions src/block/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.main {
margin: 0 8px;
}

.main__form {
margin-top: 20px;
}
48 changes: 48 additions & 0 deletions src/block/search-form.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
.search-form {
display: flex;
align-items: center;
height: 70px;

border: 1px solid var(--box-border-color);
border-radius: 4px;
box-shadow: 0 1px 8px var(--box-shadow-color);
}

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

.search-form__search-icon {
height: var(--icon-large-size);
min-width: var(--icon-large-size);
margin: 0 17px 0 26px;

background: center no-repeat url(../images/Search.svg);
background-size: cover;
}

.search-form__search-icon--small {
height: var(--icon-small-size);
min-width: var(--icon-small-size);
margin: 0 9px 0 13px;
}

.search-form--large:hover,
.search-form:has(.search-form__input--large:focus) {
box-shadow: 0 4px 4px var(--box-large-hover-shadow-color);
}

.search-form--small:hover {
box-shadow: 0 3px 8px var(--box-small-hover-shadow-color);
}

.search-form--small:has(.search-form__input:focus) {
box-shadow: none;
}

.search-form:has(.search-form__input:focus) {
background: linear-gradient(
var(--first-gradient-form-color),
var(--second-gradient-form-color)
);
}
55 changes: 44 additions & 11 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,64 @@
<html lang="en">
<head>
<meta charset="UTF-8" />

<meta
name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
/>

<meta
http-equiv="X-UA-Compatible"
content="ie=edge"
/>

<title>Document</title>

<link
rel="stylesheet"
href="style.css"
href="./style.css"
/>
</head>

<body>
<input
type="text"
data-qa="keypress"
placeholder="Try “Los Angeles“"
/>
<main class="main">
<div class="main__form">
<form
class="search-form search-form--large"
data-qa="big"
>
<span
href="#"
class="search-form__search-icon search-form__search-icon--large"
></span>

<input
type="text"
data-qa="hover"
placeholder="Try “Los Angeles“"
/>
<input
type="text"
data-qa="keypress"
placeholder="Try “Los Angeles“"
class="search-form__input search-form__input--large"
/>
</form>
</div>

<div class="main__form">
<form
class="search-form search-form--small"
data-qa="small"
>
<a
href="#"
class="search-form__search-icon search-form__search-icon--small"
></a>

<input
type="text"
data-qa="hover"
placeholder="Try “Los Angeles“"
class="search-form__input search-form__input--small"
/>
</form>
</div>
</main>
</body>
</html>
19 changes: 19 additions & 0 deletions src/normalized.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@font-face {
font-family: Avenir;
src: url(./fonts/Avenir.ttc);
}

body {
margin: 0;
}

* {
box-sizing: border-box;
}

html,
input {
font-family: Avenir, Arial, Helvetica, sans-serif;
color: var(--text-color);
font-weight: 300;
}
6 changes: 5 additions & 1 deletion src/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
/* add styles here */
@import './variables.css';
@import './normalized.css';
@import './block/main.css';
@import './block/search-form.css';
@import './block/input.css';
11 changes: 11 additions & 0 deletions src/variables.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
html {
--text-color: #3d4e61;
--box-border-color: #e1e7ed;
--box-shadow-color: #3d4e611a;
--box-large-hover-shadow-color: #00000040;
--box-small-hover-shadow-color: #3d4e6133;
--first-gradient-form-color: #fff;
--second-gradient-form-color: #f6f6f7;
--icon-large-size: 19px;
--icon-small-size: 11px;
}

0 comments on commit 4f267a7

Please sign in to comment.