mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
搜索框样式,顶部Sticky样式
This commit is contained in:
@@ -37,12 +37,12 @@ const SearchInput = ({ currentTag, currentSearch }) => {
|
||||
setSearchKey(val)
|
||||
}
|
||||
|
||||
return <div className='flex border dark:border-gray-600 w-full'>
|
||||
return <div className='flex border dark:border-gray-600 w-full bg-gray-100 dark:bg-gray-900'>
|
||||
<input
|
||||
ref={searchInputRef}
|
||||
type='text'
|
||||
placeholder={currentTag ? `${locale.SEARCH.TAGS} #${currentTag}` : `${locale.SEARCH.ARTICLES}`}
|
||||
className={'pl-2 transition leading-10 border-gray-300 bg-white text-black bg-gray-100 dark:bg-gray-900 dark:text-white'}
|
||||
className={'w-full pl-2 transition leading-10 border-gray-300 bg-white text-black bg-gray-100 dark:bg-gray-900 dark:text-white'}
|
||||
onKeyUp={handleKeyUp}
|
||||
onChange={e => updateSearchKey(e.target.value)}
|
||||
defaultValue={currentSearch}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
const StickyBar = ({ children }) => {
|
||||
if (!children) return <></>
|
||||
return (
|
||||
<div id='sticky-bar' className='fixed lg:top-0 top-16 duration-500 z-10 w-full border-b dark:border-gray-600'>
|
||||
<div id='sticky-bar' className='fixed lg:top-0 top-14 duration-500 z-10 w-full border-b dark:border-gray-600 shadow-xl'>
|
||||
<div className='bg-white dark:bg-gray-800 flex overflow-x-auto'>
|
||||
<div className='z-30 sticky left-0 flex'>
|
||||
<div className='pr-2 bg-white dark:bg-gray-800'/>
|
||||
|
||||
@@ -102,7 +102,7 @@ const handleScrollDown = () => {
|
||||
nav && nav.classList.replace('top-0', '-top-16')
|
||||
|
||||
const stickyBar = document.querySelector('#sticky-bar')
|
||||
stickyBar && stickyBar.classList.replace('top-16', 'top-0')
|
||||
stickyBar && stickyBar.classList.replace('top-14', 'top-0')
|
||||
|
||||
const tocDrawerButton = document.querySelector('#toc-drawer-button')
|
||||
tocDrawerButton && tocDrawerButton.classList.replace('hidden', 'block')
|
||||
@@ -124,7 +124,7 @@ const handleScrollUp = () => {
|
||||
nav && nav.classList.replace('-top-16', 'top-0')
|
||||
|
||||
const stickyBar = document.querySelector('#sticky-bar')
|
||||
stickyBar && stickyBar.classList.replace('top-0', 'top-16')
|
||||
stickyBar && stickyBar.classList.replace('top-0', 'top-14')
|
||||
|
||||
// const tocDrawerButton = document.querySelector('#toc-drawer-button')
|
||||
// tocDrawerButton && tocDrawerButton.classList.replace('block', 'hidden')
|
||||
|
||||
Reference in New Issue
Block a user