Skip to content

Commit

Permalink
Merge pull request #88 from Mercantec-GHC/SearchBarPlay
Browse files Browse the repository at this point in the history
styling search bar
  • Loading branch information
ArianYN authored May 28, 2024
2 parents a5d4b05 + 0083449 commit 8c5a9e1
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 22 deletions.
80 changes: 59 additions & 21 deletions BlazorApp/Components/Pages/Products.razor
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
<h1 class="prod-title">PRODUCTS</h1>
</div>

<div class="productSearch">
<input @bind="searchedItem" class="searchbar" placeholder="Search...">
<button @onclick="SearchItems" class="search-btn">Search</button>
</div>




Expand All @@ -35,6 +32,10 @@
<div class="sellpage-btn-container">
<button class="sellpage-btn" @onclick="NavigateToSellPage">Sell Item</button>
</div>
<div class="productSearch">
<input @bind="searchedItem" class="searchbar" placeholder="Search...">
<button @onclick="SearchItems" class="search-btn">Search</button>
</div>
</div>


Expand Down Expand Up @@ -597,32 +598,69 @@ void ApplySort()
width: 50%;
gap: 10px;
}
.searchbar
{
flex: 1;
padding: 8px;
.searchbar {
flex: 0 0 auto; /* Ensures the search bar does not stretch */
padding: 10px 20px; /* Match the button's padding for same height */
border: 1px solid #ccc;
border-radius: 10px;
font-size: 16px;
border-radius: 50px; /* Match the button's border radius */
font-size: 16px; /* Match the button's font size */
background-color: #454545;
border-color: #454545;
color: #d3d3d3;
font-weight: bold;
width: 400%; /* Four times the width of the button on small screens */
}
/* Medium screens (tablets, 768px and up) */
@@media only screen and (min-width: 768px) {
.searchbar {
width: auto; /* Auto width on medium screens */
}
}
/* Large screens (desktops, 992px and up) */
@@media only screen and (min-width: 992px) {
.searchbar {
width: auto; /* Auto width on large screens */
}
}
.search-btn {
padding: 6px;
border-radius: 10px;
border: 1px solid #ccc;
background-color: #454545;
border-color: #454545;
color: white;
font-size: 18px;
margin-top: 10px;
width: 12%;
height: 12%;
background-color: #226990;
border-color: #226990;
color: white;
border: none;
padding: 10px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
transition-duration: 0.4s;
cursor: pointer;
border-radius: 50px;
font-family: Arial, sans-serif;
width: 100%; /* Full width on small screens */
}
/* Medium screens (tablets, 768px and up) */
@@media only screen and (min-width: 768px) {
.search-btn {
width: auto; /* Auto width on medium screens */
}
}
/* Large screens (desktops, 992px and up) */
@@media only screen and (min-width: 992px) {
.search-btn {
width: auto; /* Auto width on large screens */
}
}
</style>
1 change: 0 additions & 1 deletion BlazorApp/Components/Pages/SellPage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@
</div>

}
}
</div>


Expand Down

0 comments on commit 8c5a9e1

Please sign in to comment.