mirror of
https://github.com/pawelmalak/flame.git
synced 2025-04-23 13:27:21 -04:00
update search bar stayx
This commit is contained in:
parent
3c347c854c
commit
0de8bdbf71
2 changed files with 53 additions and 21 deletions
|
@ -1,18 +1,44 @@
|
|||
.SearchBar {
|
||||
.SearchContainer {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
padding: 10px 0;
|
||||
color: var(--color-primary);
|
||||
/* font-size: 20px; */
|
||||
margin-bottom: 20px;
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
border-bottom: 2px solid var(--color-accent);
|
||||
opacity: 0.5;
|
||||
transition: all 0.2s;
|
||||
border-radius: 0px;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.SearchBar:focus {
|
||||
opacity: 1;
|
||||
.SearchWrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: var(--color-bg-secondary);
|
||||
border: 2px solid var(--color-accent);
|
||||
border-radius: 30px; /* 药丸形状 */
|
||||
padding: 10px 15px;
|
||||
width: 70%;
|
||||
/* max-width: 600px; */
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
transition: box-shadow 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.SearchWrapper:focus-within {
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.SearchIcon {
|
||||
color: var(--color-primary);
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.SearchBar {
|
||||
flex: 1;
|
||||
border: none;
|
||||
background-color: transparent;
|
||||
outline: none;
|
||||
}
|
||||
font-size: 16px;
|
||||
color: var(--color-primary);
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.SearchBar::placeholder {
|
||||
color: var(--color-placeholder);
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
|
|
@ -15,6 +15,9 @@ import { State } from '../../store/reducers';
|
|||
import { bindActionCreators } from 'redux';
|
||||
import { actionCreators } from '../../store';
|
||||
|
||||
import Icon from '@mdi/react';
|
||||
import { mdiSearchWeb } from '@mdi/js';
|
||||
|
||||
interface Props {
|
||||
setLocalSearch: (query: string) => void;
|
||||
appSearchResult: App[] | null;
|
||||
|
@ -120,13 +123,16 @@ export const SearchBar = (props: Props): JSX.Element => {
|
|||
|
||||
return (
|
||||
<div className={classes.SearchContainer}>
|
||||
<input
|
||||
ref={inputRef}
|
||||
type="text"
|
||||
className={classes.SearchBar}
|
||||
onKeyUp={(e) => searchHandler(e)}
|
||||
onDoubleClick={clearSearch}
|
||||
/>
|
||||
<div className={classes.SearchWrapper}>
|
||||
<Icon path={mdiSearchWeb} size={1} className={classes.SearchIcon} />
|
||||
<input
|
||||
ref={inputRef}
|
||||
type="text"
|
||||
className={classes.SearchBar}
|
||||
onKeyUp={(e) => searchHandler(e)}
|
||||
onDoubleClick={clearSearch}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue