Skip to content

Commit 883e2cd

Browse files
committed
input outline
1 parent 6ec9dd9 commit 883e2cd

25 files changed

+118
-64
lines changed

tailwind.config.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ module.exports = {
2121
}
2222
},
2323
maxWidth: {
24-
side: '14rem'
24+
side: '14rem',
25+
'9/10': '90%'
2526
}
26-
},
27+
}
2728
},
2829
variants: {
2930
extend: {}

themes/example/components/ArticleLock.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const ArticleLock = props => {
2626
<div className='text-center space-y-3'>
2727
<div className='font-bold'>{locale.COMMON.ARTICLE_LOCK_TIPS}</div>
2828
<div className='flex mx-4'>
29-
<input id="password" type='password' className='w-full text-sm pl-5 rounded-l transition font-light leading-10 text-black dark:bg-gray-500 bg-gray-50'></input>
29+
<input id="password" type='password' className='outline-none w-full text-sm pl-5 rounded-l transition font-light leading-10 text-black dark:bg-gray-500 bg-gray-50'></input>
3030
<div onClick={submitPassword} className="px-3 whitespace-nowrap cursor-pointer items-center justify-center py-2 rounded-r duration-300 bg-gray-300" >
3131
<i className={'duration-200 cursor-pointer fas fa-key dark:text-black'} >&nbsp;{locale.COMMON.SUBMIT}</i>
3232
</div>

themes/example/components/SearchInput.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const SearchInput = ({ currentTag, currentSearch, cRef }) => {
6262
ref={searchInputRef}
6363
type='text'
6464
placeholder={currentTag ? `${locale.SEARCH.TAGS} #${currentTag}` : `${locale.SEARCH.ARTICLES}`}
65-
className={'w-full text-sm pl-4 transition focus:shadow-lg font-light leading-10 text-black bg-gray-100 dark:bg-gray-900 dark:text-white'}
65+
className={'outline-none w-full text-sm pl-4 transition focus:shadow-lg font-light leading-10 text-black bg-gray-100 dark:bg-gray-900 dark:text-white'}
6666
onKeyUp={handleKeyUp}
6767
onCompositionStart={lockSearchInput}
6868
onCompositionUpdate={lockSearchInput}

themes/fukasawa/components/ArticleLock.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const ArticleLock = props => {
3030
<div className="flex mx-4">
3131
<input
3232
id="password" type='password'
33-
className="w-full text-sm pl-5 rounded-l transition focus:shadow-lg dark:text-gray-300 font-light leading-10 text-black bg-gray-100 dark:bg-gray-500"
33+
className="outline-none w-full text-sm pl-5 rounded-l transition focus:shadow-lg dark:text-gray-300 font-light leading-10 text-black bg-gray-100 dark:bg-gray-500"
3434
></input>
3535
<div
3636
onClick={submitPassword}

themes/fukasawa/components/SearchInput.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const SearchInput = ({ currentTag, currentSearch, cRef }) => {
5353
<input
5454
ref={searchInputRef}
5555
type='text'
56-
className={'w-full text-sm pl-2 transition focus:shadow-lg font-light leading-10 text-black bg-gray-100 dark:bg-gray-800 dark:text-white'}
56+
className={'outline-none w-full text-sm pl-2 transition focus:shadow-lg font-light leading-10 text-black bg-gray-100 dark:bg-gray-800 dark:text-white'}
5757
onKeyUp={handleKeyUp}
5858
onCompositionStart={lockSearchInput}
5959
onCompositionUpdate={lockSearchInput}

themes/hexo/components/ArticleLock.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const ArticleLock = props => {
2525
<div className='text-center space-y-3'>
2626
<div className='font-bold'>{locale.COMMON.ARTICLE_LOCK_TIPS}</div>
2727
<div className='flex mx-4'>
28-
<input id="password" type='password' className='w-full text-sm pl-5 rounded-l transition focus:shadow-lg dark:text-gray-300 font-light leading-10 text-black bg-gray-100 dark:bg-gray-500'></input>
28+
<input id="password" type='password' className='outline-none w-full text-sm pl-5 rounded-l transition focus:shadow-lg dark:text-gray-300 font-light leading-10 text-black bg-gray-100 dark:bg-gray-500'></input>
2929
<div onClick={submitPassword} className="px-3 whitespace-nowrap cursor-pointer items-center justify-center py-2 bg-indigo-500 hover:bg-indigo-400 text-white rounded-r duration-300" >
3030
<i className={'duration-200 cursor-pointer fas fa-key'} >&nbsp;{locale.COMMON.SUBMIT}</i>
3131
</div>

themes/hexo/components/SearchInput.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const SearchInput = props => {
6969
ref={searchInputRef}
7070
type="text"
7171
className={
72-
'w-full text-sm pl-5 rounded-lg transition focus:shadow-lg dark:text-gray-300 font-light leading-10 text-black bg-gray-100 dark:bg-gray-500'
72+
'outline-none w-full text-sm pl-5 rounded-lg transition focus:shadow-lg dark:text-gray-300 font-light leading-10 text-black bg-gray-100 dark:bg-gray-500'
7373
}
7474
onKeyUp={handleKeyUp}
7575
onCompositionStart={lockSearchInput}

themes/matery/components/ArticleLock.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const ArticleLock = props => {
2525
<div className='text-center space-y-3'>
2626
<div className='font-bold'>{locale.COMMON.ARTICLE_LOCK_TIPS}</div>
2727
<div className='flex mx-4'>
28-
<input id="password" type='password' className='w-full text-sm pl-5 rounded-l transition focus:shadow-lg dark:text-gray-300 font-light leading-10 text-black bg-gray-100 dark:bg-gray-500'></input>
28+
<input id="password" type='password' className='outline-none w-full text-sm pl-5 rounded-l transition focus:shadow-lg dark:text-gray-300 font-light leading-10 text-black bg-gray-100 dark:bg-gray-500'></input>
2929
<div onClick={submitPassword} className="px-3 whitespace-nowrap cursor-pointer items-center justify-center py-2 bg-indigo-500 hover:bg-indigo-400 text-white rounded-r duration-300" >
3030
<i className={'duration-200 cursor-pointer fas fa-key'} >&nbsp;{locale.COMMON.SUBMIT}</i>
3131
</div>

themes/matery/components/SearchInput.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const SearchInput = props => {
6969
ref={searchInputRef}
7070
type="text"
7171
className={
72-
'w-full text-sm pl-5 rounded-lg transition focus:shadow-lg dark:text-gray-300 font-light leading-10 text-black bg-gray-100 dark:bg-gray-500'
72+
'outline-none w-full text-sm pl-5 rounded-lg transition focus:shadow-lg dark:text-gray-300 font-light leading-10 text-black bg-gray-100 dark:bg-gray-500'
7373
}
7474
onKeyUp={handleKeyUp}
7575
onCompositionStart={lockSearchInput}

themes/medium/components/ArticleLock.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const ArticleLock = props => {
2626
<div className='text-center space-y-3'>
2727
<div className='font-bold'>{locale.COMMON.ARTICLE_LOCK_TIPS}</div>
2828
<div className='flex mx-4'>
29-
<input id="password" type='password' className='w-full text-sm pl-5 rounded-l transition focus:shadow-lg dark:text-gray-300 font-light leading-10 text-black bg-gray-100 dark:bg-gray-500'></input>
29+
<input id="password" type='password' className='outline-none w-full text-sm pl-5 rounded-l transition focus:shadow-lg dark:text-gray-300 font-light leading-10 text-black bg-gray-100 dark:bg-gray-500'></input>
3030
<div onClick={submitPassword} className="px-3 whitespace-nowrap cursor-pointer items-center justify-center py-2 bg-green-500 hover:bg-green-400 text-white rounded-r duration-300" >
3131
<i className={'duration-200 cursor-pointer fas fa-key'} >&nbsp;{locale.COMMON.SUBMIT}</i>
3232
</div>

themes/medium/components/SearchInput.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const SearchInput = ({ currentTag, currentSearch, cRef, className }) => {
6161
<input
6262
ref={searchInputRef}
6363
type='text'
64-
className={'w-full text-sm pl-2 transition focus:shadow-lg font-light leading-10 text-black bg-gray-100 dark:bg-gray-900 dark:text-white'}
64+
className={'outline-none w-full text-sm pl-2 transition focus:shadow-lg font-light leading-10 text-black bg-gray-100 dark:bg-gray-900 dark:text-white'}
6565
onKeyUp={handleKeyUp}
6666
onCompositionStart={lockSearchInput}
6767
onCompositionUpdate={lockSearchInput}

themes/next/components/ArticleLock.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const ArticleLock = props => {
3030
<div className="flex mx-4">
3131
<input
3232
id="password" type='password'
33-
className="w-full text-sm pl-5 transition focus:shadow-lg dark:text-gray-300 font-light leading-10 text-black bg-gray-100 dark:bg-gray-500"
33+
className="outline-none w-full text-sm pl-5 transition focus:shadow-lg dark:text-gray-300 font-light leading-10 text-black bg-gray-100 dark:bg-gray-500"
3434
></input>
3535
<div
3636
onClick={submitPassword}

themes/next/components/SearchInput.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const SearchInput = ({ currentTag, currentSearch, cRef }) => {
6666
ref={searchInputRef}
6767
type='text'
6868
placeholder={currentTag ? `${locale.SEARCH.TAGS} #${currentTag}` : `${locale.SEARCH.ARTICLES}`}
69-
className={'w-full text-sm pl-4 transition focus:shadow-lg font-light leading-10 text-black bg-gray-100 dark:bg-gray-800 dark:text-white'}
69+
className={'outline-none w-full text-sm pl-4 transition focus:shadow-lg font-light leading-10 text-black bg-gray-100 dark:bg-gray-800 dark:text-white'}
7070
onKeyUp={handleKeyUp}
7171
onCompositionStart={lockSearchInput}
7272
onCompositionUpdate={lockSearchInput}

themes/nobelium/LayoutTag.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const LayoutTag = props => {
2525
placeholder={
2626
currentTag ? `Search in #${currentTag}` : 'Search Articles'
2727
}
28-
className="block w-full border px-4 py-2 border-black bg-white text-black dark:bg-night dark:border-white dark:text-white"
28+
className="outline-none block w-full border px-4 py-2 border-black bg-white text-black dark:bg-night dark:border-white dark:text-white"
2929
onChange={e => setSearchValue(e.target.value)}
3030
/>
3131
<svg

themes/nobelium/components/ArticleLock.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const ArticleLock = props => {
2626
<div className='text-center space-y-3'>
2727
<div className='font-bold'>{locale.COMMON.ARTICLE_LOCK_TIPS}</div>
2828
<div className='flex'>
29-
<input id="password" type='password' className='w-full text-sm pl-5 rounded-l transition font-light leading-10 text-black dark:bg-gray-500 bg-gray-50'></input>
29+
<input id="password" type='password' className='outline-none w-full text-sm pl-5 rounded-l transition font-light leading-10 text-black dark:bg-gray-500 bg-gray-50'></input>
3030
<div onClick={submitPassword} className="px-3 whitespace-nowrap cursor-pointer items-center justify-center py-2 rounded-r duration-300 bg-gray-300" >
3131
<i className={'duration-200 cursor-pointer fas fa-key dark:text-black'} >&nbsp;{locale.COMMON.SUBMIT}</i>
3232
</div>

themes/nobelium/components/SearchInput.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const SearchInput = ({ currentTag, currentSearch, cRef }) => {
6262
ref={searchInputRef}
6363
type='text'
6464
placeholder={currentTag ? `${locale.SEARCH.TAGS} #${currentTag}` : `${locale.SEARCH.ARTICLES}`}
65-
className={'w-full text-sm pl-4 transition focus:shadow-lg font-light leading-10 text-black bg-gray-100 dark:bg-gray-900 dark:text-white'}
65+
className={'outline-none w-full text-sm pl-4 transition focus:shadow-lg font-light leading-10 text-black bg-gray-100 dark:bg-gray-900 dark:text-white'}
6666
onKeyUp={handleKeyUp}
6767
onCompositionStart={lockSearchInput}
6868
onCompositionUpdate={lockSearchInput}

themes/simple/LayoutBase.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import CommonHead from '@/components/CommonHead'
22
import React from 'react'
33
import { Header } from './components/Header'
4-
import { Nav } from './components/Nav'
4+
import { NavBar } from './components/NavBar'
55
import { Footer } from './components/Footer'
66
// import { Title } from './components/Title'
77
import { SideBar } from './components/SideBar'
@@ -30,25 +30,25 @@ const LayoutBase = props => {
3030
{/* 顶部LOGO */}
3131
<Header {...props} />
3232

33-
{/* 菜单 */}
34-
<Nav {...props} />
33+
{/* 导航栏 */}
34+
<NavBar {...props} />
3535

3636
{/* 主体 */}
37-
<div id='container-inner' className="w-full relative z-10">
37+
<div id='container-wrap' className="w-full relative">
3838

3939
{/* <Title {...props} /> */}
4040

41-
<div className={(BLOG.LAYOUT_SIDEBAR_REVERSE ? 'flex-row-reverse' : '') + ' w-full relative container mx-auto justify-start md:flex items-start pt-12 px-2'}>
41+
<div id='container-inner' className={(BLOG.LAYOUT_SIDEBAR_REVERSE ? 'flex-row-reverse' : '') + ' max-w-9/10 w-full relative container mx-auto flex justify-center items-start pt-12'}>
4242

43-
<div className='w-full max-w-6xl'>{children}</div>
43+
<div className='w-full flex-grow'>{children}</div>
4444

4545
<SideBar {...props} />
4646

4747
</div>
4848

4949
</div>
5050

51-
<div className='fixed right-4 bottom-4 z-10'>
51+
<div className='fixed right-4 bottom-4'>
5252
<JumpToTopButton />
5353
</div>
5454

themes/simple/components/ArticleLock.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const ArticleLock = props => {
2626
<div className='text-center space-y-3'>
2727
<div className='font-bold'>{locale.COMMON.ARTICLE_LOCK_TIPS}</div>
2828
<div className='flex mx-4'>
29-
<input id="password" type='password' className='w-full text-sm pl-5 rounded-l transition font-light leading-10 text-black dark:bg-gray-500 bg-gray-50'></input>
29+
<input id="password" type='password' className='outline-none w-full text-sm pl-5 rounded-l transition font-light leading-10 text-black dark:bg-gray-500 bg-gray-50'></input>
3030
<div onClick={submitPassword} className="px-3 whitespace-nowrap cursor-pointer items-center justify-center py-2 rounded-r duration-300 bg-gray-300" >
3131
<i className={'duration-200 cursor-pointer fas fa-key dark:text-black'} >&nbsp;{locale.COMMON.SUBMIT}</i>
3232
</div>

themes/simple/components/DropMenu.js

+20-17
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,26 @@ export const DropMenu = ({ link }) => {
55
const [show, changeShow] = useState(false)
66
const hasSubMenu = link?.subMenus?.length > 0
77

8-
return <div className='pt-3' onMouseOver={() => changeShow(true)} onMouseOut={() => changeShow(false)} >
9-
<Link
10-
href={link?.to}
11-
className="font-sans menu-link pl-2 pr-4 text-gray-700 dark:text-gray-200 no-underline tracking-widest pb-1">
12-
{link?.name}
13-
{hasSubMenu && <i className='px-2 fa fa-angle-down'></i>}
14-
</Link>
8+
return <div onMouseOver={() => changeShow(true)} onMouseOut={() => changeShow(false)} >
9+
10+
{/* 大屏菜单 */}
11+
<Link
12+
href={link?.to}
13+
className="font-sans menu-link pl-2 pr-4 text-gray-700 dark:text-gray-200 no-underline tracking-widest pb-1">
14+
{link?.name}
15+
{hasSubMenu && <i className='px-2 fa fa-angle-down'></i>}
16+
</Link>
17+
18+
{/* 子菜单 */}
19+
{hasSubMenu && <ul className={`${show ? 'visible opacity-100' : 'invisible opacity-0'} border-gray-100 bg-white dark:bg-black dark:border-gray-800 transition-all duration-300 z-20 top-12 absolute block border drop-shadow-lg `}>
20+
{link.subMenus.map(sLink => {
21+
return <li key={sLink.id} className=' text-blue-400 hover:bg-gray-50 dark:hover:bg-gray-900 tracking-widest transition-all duration-200 border-b dark:border-gray-800 py-3 pr-6 pl-2'>
22+
<Link href={sLink.to}>
23+
<span className='text-xs'>{sLink.title}</span>
24+
</Link>
25+
</li>
26+
})}
27+
</ul>}
1528

16-
{/* 子菜单 */}
17-
{hasSubMenu && <ul className={`${show ? 'visible opacity-100' : 'invisible opacity-0'} border-gray-100 bg-white dark:bg-black dark:border-gray-800 transition-all duration-300 z-20 top-12 absolute block border drop-shadow-lg `}>
18-
{link.subMenus.map(sLink => {
19-
return <li key={sLink.id} className=' text-blue-400 hover:bg-gray-50 dark:hover:bg-gray-900 tracking-widest transition-all duration-200 border-b dark:border-gray-800 py-3 pr-6 pl-2'>
20-
<Link href={sLink.to}>
21-
<span className='text-xs'>{sLink.title}</span>
22-
</Link>
23-
</li>
24-
})}
25-
</ul>}
2629
</div>
2730
}

themes/simple/components/Header.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import BLOG from '@/blog.config'
22
import Link from 'next/link'
3+
import CONFIG_SIMPLE from '../config_simple'
34
// import CONFIG_SIMPLE from '../config_simple'
45

56
/**
@@ -19,12 +20,12 @@ export const Header = (props) => {
1920
<div className='flex space-x-12'>
2021
<div className='hover:rotate-45 hover:scale-125 transform duration-200 cursor-pointer'>
2122
{/* eslint-disable-next-line @next/next/no-img-element */}
22-
<img src={siteInfo?.icon} className='rounded-full' width={120} alt={BLOG.AUTHOR} />
23+
<img src={siteInfo?.icon} className='rounded-full' width={160} alt={BLOG.AUTHOR} />
2324
</div>
2425

2526
<div>
26-
<div className='text-2xl font-serif dark:text-white py-2 hover:scale-105 transform duration-200'>{BLOG.AUTHOR}</div>
27-
<div className='font-light dark:text-white py-2 hover:scale-105 transform duration-200 text-center'>{BLOG.BIO}</div>
27+
<div className='text-3xl font-serif dark:text-white py-2 hover:scale-105 transform duration-200'>{BLOG.AUTHOR}</div>
28+
<div className='font-light dark:text-white py-2 hover:scale-105 transform duration-200 text-center' dangerouslySetInnerHTML={{ __html: CONFIG_SIMPLE.LOGO_DESCRIPTION }}/>
2829
</div>
2930
</div>
3031
</Link>

themes/simple/components/Nav.js themes/simple/components/NavBar.js

+11-16
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ import { useGlobal } from '@/lib/global'
33
import { useRouter } from 'next/router'
44
import { useState } from 'react'
55
import CONFIG_SIMPLE from '../config_simple'
6-
import { DropMenu } from './DropMenu'
6+
import { NavBarMenu } from './NavBarMenu'
77

88
/**
99
* 菜单导航
1010
* @param {*} props
1111
* @returns
1212
*/
13-
export const Nav = ({ customNav, customMenu }) => {
13+
export const NavBar = (props) => {
14+
const { customNav, customMenu } = props
1415
const { locale } = useGlobal()
1516
const [showSearchInput, changeShowSearchInput] = useState(false)
1617
const router = useRouter()
@@ -47,23 +48,17 @@ export const Nav = ({ customNav, customMenu }) => {
4748
}
4849

4950
return (
50-
<nav className="w-full bg-white md:pt-0 px-6 relative z-20 shadow-md border-t border-gray-100 dark:border-hexo-black-gray dark:bg-black">
51-
<div className="container mx-auto max-w-8xl md:flex justify-between items-center text-sm md:text-md md:justify-start">
52-
<div className="w-full h-12 text-center md:text-left flex flex-wrap justify-center items-stretch md:justify-start md:items-start space-x-4">
53-
{showSearchInput && <input id="theme-simple-search" onKeyUp={onKeyUp} className='h-full px-4 w-full' aria-label="Submit search" type="search" name="s" autoComplete="off" placeholder="Type then hit enter to search..."/>}
54-
55-
{!showSearchInput && links?.map(link => {
56-
if (link?.show) {
57-
return <DropMenu key={link.id} link={link}/>
58-
} else {
59-
return null
60-
}
61-
})}
51+
<nav className="w-full bg-white md:pt-0 relative z-20 shadow border-t border-gray-100 dark:border-hexo-black-gray dark:bg-black">
52+
<div id="nav-bar-inner" className="h-12 mx-auto max-w-9/10 justify-between items-center text-sm md:text-md md:justify-start">
53+
{/* 左侧菜单 */}
54+
<div className="h-full w-full float-left text-center md:text-left flex flex-wrap items-stretch md:justify-start md:items-start space-x-4">
55+
{showSearchInput && <input id="theme-simple-search" onKeyUp={onKeyUp} className='float-left w-full outline-none h-full px-4' aria-label="Submit search" type="search" name="s" autoComplete="off" placeholder="Type then hit enter to search..." />}
56+
{!showSearchInput && (<NavBarMenu {...props}/>)}
6257
</div>
6358

64-
<div className="w-full md:w-1/3 text-center md:text-right hidden md:block">
59+
<div className="absolute right-12 h-full text-center px-2 flex items-center">
6560
{/* <!-- extra links --> */}
66-
<i className={showSearchInput ? 'fa-regular fa-circle-xmark' : 'fa-solid fa-magnifying-glass ' + ' cursor-pointer'} onClick={toggleShowSearchInput}></i>
61+
<i className={showSearchInput ? 'fa-regular fa-circle-xmark' : 'fa-solid fa-magnifying-glass' + ' align-middle cursor-pointer'} onClick={toggleShowSearchInput}></i>
6762
</div>
6863
</div>
6964
</nav>

0 commit comments

Comments
 (0)