Skip to content

Commit 793c279

Browse files
committed
update
1 parent 4f4e939 commit 793c279

2 files changed

Lines changed: 20 additions & 9 deletions

File tree

src/App.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ footer {
142142
position: fixed;
143143
height: 2px;
144144
width: 100%;
145-
top: 3.8rem;
145+
top: 4.355rem;
146146
transform-origin: 0 50%;
147147
z-index: 20;
148148
animation: scaleProgress auto linear;
@@ -155,7 +155,7 @@ footer {
155155
position: fixed;
156156
height: 5px;
157157
width: 100%;
158-
top: 3.745rem;
158+
top: 4.25rem;
159159
transform-origin: 0 50%;
160160
z-index: 15;
161161
animation: scaleProgress auto linear;

src/assets/NavBar.tsx

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
1+
import { useState } from "react";
2+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
23
import {
34
faBars,
45
faBook, faBoxesStacked, faClock,
56
faCode, faFolder,
67
faMagnifyingGlass,
78
faPalette
89
} from "@fortawesome/free-solid-svg-icons";
9-
import {faGithub} from "@fortawesome/free-brands-svg-icons";
10+
import { faGithub } from "@fortawesome/free-brands-svg-icons";
1011

1112
export interface Props {
1213
searchCallback: (search: string) => void
1314
}
1415

1516
export default function NavBar(props: Props) {
17+
const [searchFocused, setSearchFocused] = useState(false);
18+
1619
const onThemeChange = () => {
1720
const theme = (document.querySelector('input[name="theme-dropdown"]:checked')! as HTMLInputElement).value;
1821
localStorage.setItem('theme', JSON.stringify(theme));
@@ -43,11 +46,10 @@ export default function NavBar(props: Props) {
4346
}
4447
}
4548

46-
4749
return (
4850
<>
4951
<div>
50-
<div className="navbar bg-base-100 fixed z-10 border-b-2 border-b-base-300 h-14" id="navbar_anchor">
52+
<div className="navbar bg-base-100 fixed z-10 border-b-2 border-b-base-300 h-[4.5rem]" id="navbar_anchor">
5153
<div className="navbar-start">
5254
<div className="dropdown">
5355
<div tabIndex={0} role="button" className="btn btn-ghost btn-circle">
@@ -118,10 +120,19 @@ export default function NavBar(props: Props) {
118120
</div>
119121
</div>
120122
<div className="navbar-center">
121-
<label className="cursor-text input input-bordered hidden items-center gap-2 lg:w-96 lg:flex">
123+
<label
124+
className={`cursor-text input input-bordered hidden items-center gap-2 lg:w-96 lg:flex${searchFocused ? " input-primary" : ""}`}
125+
>
122126
<FontAwesomeIcon icon={faMagnifyingGlass}/>
123-
<input type="text" className="grow" id="search_bar" placeholder="Search"
124-
onKeyUp={() => props.searchCallback((document.getElementById("search_bar")! as HTMLInputElement).value)}/>
127+
<input
128+
type="text"
129+
className="grow"
130+
id="search_bar"
131+
placeholder="Search"
132+
onKeyUp={() => props.searchCallback((document.getElementById("search_bar")! as HTMLInputElement).value)}
133+
onFocus={() => setSearchFocused(true)}
134+
onBlur={() => setSearchFocused(false)}
135+
/>
125136
<kbd className="kbd kbd-sm select-none cursor-text">ctrl</kbd>
126137
<kbd className="kbd kbd-sm select-none cursor-text">k</kbd>
127138
</label>

0 commit comments

Comments
 (0)