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

initial task solution #4563

Open
wants to merge 2 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
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://MichaelK-jpg.github.io/layout_search-bar-airbnb/)
- [TEST REPORT LINK](https://MichaelK-jpg.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
45 changes: 45 additions & 0 deletions src/blocks/big-search.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
.big-search__input {
font-size: 16px;
margin: 0 auto;
width: 100%;
text-indent: 62px;
border: none;
background-image: url(../images/Search.svg);
background-repeat: no-repeat;
background-size: 19px;
background-position: 26px 24px;
}

.main__big-search {
display: flex;
box-sizing: border-box;
border-radius: 4px;
margin: 20px 8px 0;
height: 70px;
background: #fff;
border: 1px solid #e1e7ed;
box-shadow: 0 1px 8px 0 #3d4e611a;
}

.main__big-search:hover {
background: #fff;
border: 1px solid #e1e7ed;
Comment on lines +25 to +26

Choose a reason for hiding this comment

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

The hover state for .main__big-search repeats the same background and border styles as the default state. Consider removing these redundant styles to simplify the CSS.

border-radius: 4px;
box-shadow: 0 3px 8px 0 #3d4e6133;
}

.main__big-search:focus {
background: linear-gradient(180deg, #fff 100%, #f6f6f7 100%);
}

.big-search__input:focus {
outline: none;
border-radius: 3px;
box-shadow: 1px 4px 4px #00000040;
border: 1px solid #e1e7ed;
background: linear-gradient(180deg, #fff 0%, #f6f6f7 100%);
background-image: url(../images/Search.svg);
background-repeat: no-repeat;
background-size: 19px;
background-position: 26px 24px;
Comment on lines +41 to +44

Choose a reason for hiding this comment

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

The focus state for .big-search__input repeats the background image properties that are already defined in the default state. Consider removing these redundant styles to simplify the CSS.

}
45 changes: 45 additions & 0 deletions src/blocks/small-search.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
.small-search__input {
font-weight: 400;
font-size: 14px;
margin: 0 auto;
width: 100%;
text-indent: 33px;
border: none;
background-image: url(../images/Search.svg);
background-repeat: no-repeat;
background-size: 11;

Choose a reason for hiding this comment

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

The 'background-size' property is missing a unit. It should be specified in a valid CSS unit like 'px', 'em', etc.

background-position: 13 14;

Choose a reason for hiding this comment

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

The 'background-position' property is missing units. Both values should be specified in a valid CSS unit like 'px', 'em', etc.

Comment on lines +10 to +11

Choose a reason for hiding this comment

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

The background-size and background-position properties are missing units (e.g., 'px'). Ensure that these values have the correct units to avoid potential rendering issues.

}

.main__small-search {
display: flex;
box-sizing: border-box;
margin: 20px 8px 0;
height: 42px;
background: #fff;
border: 1px solid #e1e7ed;
border-radius: 4px;
box-shadow: 0 1px 8px 0 #3d4e611a;
}

.small-search__input:hover {
background: #fff;
border: 1px solid #e1e7ed;
Comment on lines +26 to +27

Choose a reason for hiding this comment

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

The hover state for .small-search__input repeats the same background and border styles as the default state. Consider removing these redundant styles to simplify the CSS.

border-radius: 4px;
box-shadow: 0 3px 8px 0 #3d4e6133;
background-image: url(../images/Search.svg);
background-repeat: no-repeat;
background-size: 11px;
background-position: 13px 14px;
}

.small-search__input:focus {
outline: none;
background: linear-gradient(180deg, #fff 100%, #f6f6f7 100%);
border: 1px solid #e1e7ed;
border-radius: 3px;
background-image: url(../images/Search.svg);
background-repeat: no-repeat;
background-size: 11px;
background-position: 13px 14px;
Comment on lines +41 to +44

Choose a reason for hiding this comment

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

The focus state for .small-search__input repeats the background image properties that are already defined in the default state. Consider removing these redundant styles to simplify the CSS.

}
34 changes: 24 additions & 10 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,30 @@
/>
</head>
<body>
<input
type="text"
data-qa="keypress"
placeholder="Try “Los Angeles“"
/>
<main class="main">
<form
data-qa="big"
class="main__big-search"
>
Comment on lines +21 to +24

Choose a reason for hiding this comment

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

Consider adding a <label> element for the input field in the form with class main__big-search. This will improve accessibility by providing a text label for screen readers.

<input
class="big-search__input"
type="text"
data-qa="keypress"
placeholder="Try “Los Angeles“"
/>
</form>

<input
type="text"
data-qa="hover"
placeholder="Try “Los Angeles“"
/>
<form
data-qa="small"
class="main__small-search"
>
Comment on lines +33 to +36

Choose a reason for hiding this comment

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

Consider adding a <label> element for the input field in the form with class main__small-search. This will improve accessibility by providing a text label for screen readers.

<input
class="small-search__input"
type="text"
data-qa="hover"
placeholder="Try “Los Angeles“"
/>
</form>
</main>
</body>
</html>
22 changes: 22 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
/* add styles here */

@import './blocks/big-search.css';
@import './blocks/small-search.css';

* {
margin: 0;
padding: 0;
font-family: Avenir, system-ui;
font-weight: 300;
}

@font-face {
font-family: Avenir;
src: url(./fonts/Avenir-Book.ttf), url(./fonts/Avenir-Heavy.ttf),
url(./fonts/Avenir.ttc);
Comment on lines +15 to +16

Choose a reason for hiding this comment

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

The @font-face rule should specify the format for each font URL to ensure proper loading across different browsers. Consider adding format descriptors like format('truetype') or format('opentype').

}


.main {
display: flex;
flex-direction: column;
}
Loading