Skip to content

Commit 39ce10b

Browse files
committed
Update search style.
1 parent 3a01f25 commit 39ce10b

File tree

2 files changed

+186
-184
lines changed

2 files changed

+186
-184
lines changed
Lines changed: 83 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
import ButtonLink from "../button-link/button-link.astro";
32
import Button from "@ui/Button.astro";
43
import HeaderButton from "./header-button.astro";
54
import Search from "../search/Search.astro";
@@ -12,16 +11,32 @@ export interface Props {
1211
const { mobile = false }: Props = Astro.props;
1312
1413
const IS_LIVE = false;
14+
15+
16+
//<Button id="searchButton" icon="search" iconSize="fa-xl" clear title="Search (Crtl+K)"></Button>
1517
---
1618

17-
<div class="flex items-start justify-end gap-2 h-[85px]">
19+
<div class="flex items-center justify-end gap-2 h-[85px] w-1/3">
1820
<Search />
19-
<div class="ml-auto flex items-start">
21+
<div class="ml-auto justify-end flex items-center w-full">
2022
{
2123
!mobile ?
2224
<>
23-
<Button id="searchButton" icon="search" iconSize="fa-xl" clear title="Search (Crtl+K)"></Button>
24-
<Button url="/tickets" icon="ticket" class="max-xl:hidden">Register Now!</Button>
25+
26+
<button
27+
id="searchButton"
28+
class="mx-6 md:mx-2"
29+
data-open-modal
30+
aria-label="Search"
31+
aria-keyshortcuts="Control+K"
32+
>
33+
<Icon name="search" />
34+
<span class="hidden md:block" aria-hidden="true">Search</span>
35+
<kbd class="hidden md:flex" >
36+
<kbd>Ctrl</kbd><kbd>K</kbd>
37+
</kbd>
38+
</button>
39+
<Button url="/tickets" icon="ticket" class="w-full max-w-48 max-xl:hidden">Register Now!</Button>
2540
{IS_LIVE && <Button url="/live">Live</Button>}
2641
</>
2742
: null
@@ -34,13 +49,66 @@ const IS_LIVE = false;
3449
</span>
3550
</label>
3651
</div>
37-
<script>
38-
const searchButton = document.getElementById("searchButton");
39-
const searchWrapper = document.querySelector(".search-wrapper") as HTMLElement;
40-
41-
if (searchButton && searchWrapper) {
42-
searchButton.addEventListener("click", function () {
43-
searchWrapper.style.display = searchWrapper.style.display === "block" ? "none" : "block";
44-
});
45-
}
46-
</script>
52+
53+
<style>
54+
button[data-open-modal] {
55+
display: flex;
56+
align-items: center;
57+
gap: 0.5rem;
58+
border: 0;
59+
background-color: transparent;
60+
color: grey;
61+
cursor: pointer;
62+
height: 2.5rem;
63+
font-size: 28px;
64+
}
65+
66+
@media (min-width: 45rem) {
67+
button[data-open-modal] {
68+
border: 1px solid #ccc;
69+
border-radius: 0.5rem;
70+
padding-inline-start: 0.75rem;
71+
padding-inline-end: 0.5rem;
72+
background-color: #fff;
73+
font-size: 16px;
74+
width:100%;
75+
min-width: 10rem;
76+
max-width: 22rem;
77+
color: #5f3d1b;
78+
}
79+
button[data-open-modal]:hover {
80+
border-color: #5f3d1b;
81+
color: #000;
82+
}
83+
84+
button[data-open-modal] > :last-child {
85+
margin-inline-start: auto;
86+
}
87+
}
88+
89+
button > kbd {
90+
border-radius: 0.25rem;
91+
font-size: 16px;
92+
gap: 0.25em;
93+
padding-inline: 0.375rem;
94+
background-color: #F1E1D4;
95+
color: #5f3d1b;
96+
}
97+
98+
kbd {
99+
font-family: var(--__sl-font);
100+
}
101+
102+
button[data-close-modal] {
103+
position: absolute;
104+
z-index: 1;
105+
align-items: center;
106+
align-self: flex-end;
107+
height: calc(64px * var(--pagefind-ui-scale));
108+
padding: 0.25rem;
109+
border: 0;
110+
background: transparent;
111+
cursor: pointer;
112+
color: #333;
113+
}
114+
</style>

0 commit comments

Comments
 (0)