Skip to content

Commit 6d2a0cd

Browse files
committed
Reskin header
1 parent bf95732 commit 6d2a0cd

3 files changed

Lines changed: 64 additions & 21 deletions

File tree

frontend/src/components/Header.css

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
display: flex;
33
align-items: center;
44
justify-content: space-between;
5-
background-color: coral;
5+
background-color: var(--bg-secondary-dark);
66
flex: 0 0 var(--player-height-lg);
77
padding: 0.5em 2em;
88

@@ -13,34 +13,46 @@
1313

1414
& .logo {
1515
display: inline-block;
16-
color: #fff;
16+
color: var(--text-primary);
1717
font-family: "Orbitron", sans-serif;
1818
font-size: var( --font-size-app-title);
1919
font-weight: 700;
2020
letter-spacing: 0.05em;
21-
text-shadow: 2px 2px #a13c2f;
21+
text-shadow: 0px 0px 20px var(--accent-cyan-light);
2222
text-decoration: none;
2323
}
2424

25-
& input {
26-
border-radius: 6px;
27-
}
25+
& .search-box {
26+
& input {
27+
height: 2.6rem;
28+
padding: 0.5em 1em;
29+
border: 1px solid var(--bg-secondary-light);
30+
border-radius: 6px 0 0 6px;
31+
font-size: 1em;
32+
background: var(--bg-secondary-light);
33+
transition: border-color 0.2s, box-shadow 0.2s;
34+
}
2835

29-
& input {
30-
padding: 0.5em 1em;
31-
border: 1px solid #ccc;
32-
font-size: 1em;
33-
background: #fff;
34-
transition: border-color 0.2s, box-shadow 0.2s;
35-
}
36+
& input:focus {
37+
outline: none;
38+
box-shadow: var(--shadow-outline);
39+
};
40+
41+
& .button-search {
42+
height: 2.6rem;
43+
border: 1px solid var(--bg-secondary);
44+
border-radius: 0 6px 6px 0;
45+
background: var(--bg-secondary);
46+
}
3647

37-
& input:focus {
38-
outline: 2px solid #3b82f6;
39-
outline-offset: 2px;
48+
& .button-search:focus {
49+
outline: none;
50+
box-shadow: var(--shadow-outline);
51+
}
4052
}
4153

4254
& a {
43-
color: #fff;
55+
font-weight: bold;
4456
}
4557

4658
& a + a {

frontend/src/components/Header.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,24 @@ export default function Header({onSearch}: { onSearch: (query: string) => void }
99

1010
function onInputKeyDown(e: React.KeyboardEvent<HTMLInputElement>) {
1111
if (e.key === "Enter") {
12-
onSearch(searchQuery)
12+
onSearch(searchQuery);
1313
}
1414
}
1515

1616
return (
1717
<div className="header">
1818
<a className="logo" href="/">TasteMender</a>
19-
<div>
19+
<div className="search-box">
2020
<input
21+
name="search"
2122
value={searchQuery}
2223
placeholder={inputPlaceholder}
2324
onChange={(e) => setSearchQuery(e.target.value)}
2425
onKeyDown={onInputKeyDown}
2526
/>
27+
<button type="button" className="button button-search" aria-label="Search" onClick={() => {onSearch(searchQuery)}}>
28+
<i className="fa-solid fa-magnifying-glass"></i>
29+
</button>
2630
</div>
2731
<div style={{textAlign: "right"}}>
2832
<a href={API_BASE_URL}>API</a>

frontend/src/index.css

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
/* Background colors */
33
--bg-primary: #1C1F23; /* Main app background */
44
--bg-secondary: #262A2F; /* Cards, containers */
5-
--bg-secondary-dark: #1A1D21; /* Sidebar */
5+
--bg-secondary-light: rgb(77, 81, 86); /* Inputs */
6+
--bg-secondary-dark: #12151b; /* Sidebar */
67

78
/* Accent colors */
89
--accent-cyan: #2ED3E6; /* Main highlight */
@@ -21,7 +22,8 @@
2122
--font-size-ui-label: 0.75rem; /* 12px - UI labels */
2223

2324
/* Effects */
24-
--shadow-glow: 0 0 8px rgba(46,211,230,0.5);
25+
--shadow-glow: 0 0 8px rgba(46, 211, 230, 0.5);
26+
--shadow-outline: 0 0 0 .25rem rgba(46, 211, 230, 0.8);
2527

2628
/* UI element sizes */
2729
--header-height-lg: 80px;
@@ -36,6 +38,31 @@ html, body {
3638
margin: 0;
3739
padding: 0;
3840
font-family: "Inter", sans-serif;
41+
color: var(--text-primary);
42+
}
43+
44+
input {
45+
background: var(--bg-secondary-light);
46+
border: 1px solid var(--bg-secondary-light);
47+
color: var(--text-primary);
48+
49+
&::placeholder {
50+
color: var(--text-secondary);
51+
}
52+
}
53+
54+
button {
55+
color: var(--text-primary);
56+
}
57+
58+
input:focus {
59+
outline: 2px solid var(--accent-cyan);
60+
outline-offset: 2px;
61+
}
62+
63+
a {
64+
color: var(--accent-cyan);
65+
text-decoration: none;
3966
}
4067

4168
/* Reusable styles */

0 commit comments

Comments
 (0)