forked from tangly1024/NotionNext
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3d02b0f
commit 05d79a3
Showing
22 changed files
with
387 additions
and
296 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React, { useEffect, useState } from 'react' | ||
import throttle from 'lodash.throttle' | ||
import DarkModeButton from '@/components/DarkModeButton' | ||
|
||
/** | ||
* 左上角悬浮菜单栏 | ||
* @returns {JSX.Element} | ||
* @constructor | ||
*/ | ||
const LeftFloatButton = () => { | ||
// 监听resize事件 | ||
useEffect(() => { | ||
window.addEventListener('resize', collapseSideBar) | ||
collapseSideBar() | ||
return () => { | ||
window.removeEventListener('resize', collapseSideBar) | ||
} | ||
}, []) | ||
|
||
const collapseSideBar = throttle(() => { | ||
if (window.innerWidth > 1300) { | ||
changeCollapse(false) | ||
} else { | ||
changeCollapse(true) | ||
} | ||
}, 500) | ||
const [collapse, changeCollapse] = useState(true) | ||
console.log(collapse) | ||
return <div | ||
className={(collapse ? 'left-0' : 'left-72') + ' z-30 fixed flex flex-nowrap md:flex-col top-0 pl-4 py-1 duration-500 ease-in-out'}> | ||
{/* 菜单折叠 */} | ||
<div className='p-1 border hover:shadow-xl duration-200 dark:border-gray-500 h-12 bg-white dark:bg-gray-600 dark:bg-opacity-70 bg-opacity-70 | ||
dark:hover:bg-gray-100 text-xl cursor-pointer mr-2 my-2 dark:text-gray-300 dark:hover:text-black'> | ||
<i className='fa fa-bars p-2.5 hover:scale-125 transform duration-200' | ||
onClick={() => changeCollapse(!collapse)} /> | ||
</div> | ||
{/* 夜间模式 */} | ||
<DarkModeButton /> | ||
</div> | ||
} | ||
|
||
export default LeftFloatButton |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import Link from 'next/link' | ||
import BLOG from '@/blog.config' | ||
import React from 'react' | ||
|
||
const Logo = () => { | ||
return <Link href='/'> | ||
<div | ||
className='mx-auto text-center cursor-pointer text-3xl dark:bg-gray-900 dark:text-gray-300 font-semibold dark:hover:bg-gray-600 bg-gray-700 text-white p-2 hover:scale-105 hover:shadow-2xl duration-200 transform'>{BLOG.title}</div> | ||
</Link> | ||
} | ||
export default Logo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.