mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
matery
This commit is contained in:
@@ -13,8 +13,8 @@ export function ThemeSwitch() {
|
||||
<div id="draggableBox" style={{ left: '10px', top: '90vh' }} className="fixed text-white bg-black z-50 rounded-lg shadow-card">
|
||||
<div className="p-2 flex items-center">
|
||||
<i className="fas fa-palette mr-1 cursor-move" />
|
||||
<div className='uppercase font-sans whitespace-nowrap cursor-pointer ' onClick={switchTheme}> {theme}
|
||||
<i className='fas fa-arrows cursor-move pl-2' title='click to change theme' alt='click to change theme' /></div>
|
||||
<div className='uppercase font-sans whitespace-nowrap cursor-pointer ' onClick={switchTheme}> {theme}</div>
|
||||
<i className='fas fa-arrows cursor-move pl-2' title='click to change theme' alt='click to change theme' />
|
||||
</div>
|
||||
</div>
|
||||
</Draggable>
|
||||
|
||||
@@ -3,11 +3,12 @@ import { saveDarkModeToCookies } from '@/lib/theme'
|
||||
import CONFIG_HEXO from '../config_hexo'
|
||||
|
||||
export default function FloatDarkModeButton () {
|
||||
const { isDarkMode, updateDarkMode } = useGlobal()
|
||||
|
||||
if (!CONFIG_HEXO.WIDGET_DARK_MODE) {
|
||||
return <></>
|
||||
}
|
||||
|
||||
const { isDarkMode, updateDarkMode } = useGlobal()
|
||||
// 用户手动设置主题
|
||||
const handleChangeDarkMode = () => {
|
||||
const newStatus = !isDarkMode
|
||||
|
||||
@@ -56,7 +56,7 @@ const LayoutBase = props => {
|
||||
{headerSlot}
|
||||
|
||||
<main id="wrapper" className="flex-1 w-full py-8 md:px-8 lg:px-24">
|
||||
<div id="container-inner" className="w-full max-w-4xl mx-auto lg:flex lg:space-x-4 justify-center">
|
||||
<div id="container-inner" className="w-full max-w-6xl mx-auto lg:flex lg:space-x-4 justify-center">
|
||||
{onLoading ? <LoadingCover /> : children}
|
||||
</div>
|
||||
</main>
|
||||
|
||||
@@ -46,17 +46,19 @@ export const LayoutSlug = props => {
|
||||
showTag={false}
|
||||
floatSlot={floatSlot}
|
||||
>
|
||||
<div className='inner-wrapper drop-shadow-xl'>
|
||||
<div className='inner-wrapper drop-shadow-xl max-w-4xl'>
|
||||
<div className="-mt-32 rounded-md mx-3 lg:border lg:rounded-xl lg:px-2 lg:py-4 bg-white dark:bg-hexo-black-gray dark:border-black">
|
||||
{lock && <ArticleLock validPassword={validPassword} />}
|
||||
|
||||
{!lock && <div id="container" className="overflow-x-auto flex-grow md:w-full ">
|
||||
{/* <ArticleInfo */}
|
||||
{post?.type === 'Post' && <>
|
||||
<div className='px-5'>
|
||||
<ArticleInfo post={post} />
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
</>}
|
||||
|
||||
<article itemScope itemType="https://schema.org/Movie" className="subpixel-antialiased" >
|
||||
{/* Notion文章主体 */}
|
||||
|
||||
@@ -6,7 +6,6 @@ import CONFIG_MATERY from '../config_matery'
|
||||
|
||||
const BlogPostCard = ({ post, showSummary }) => {
|
||||
const showPreview = CONFIG_MATERY.POST_LIST_PREVIEW && post.blockMap
|
||||
console.log('文章', post)
|
||||
return (
|
||||
<div
|
||||
data-aos="fade-up"
|
||||
@@ -39,24 +38,24 @@ const BlogPostCard = ({ post, showSummary }) => {
|
||||
|
||||
<div>
|
||||
{/* 描述 */}
|
||||
<div className="px-4 flex flex-col w-full">
|
||||
<div className="px-4 flex flex-col w-full text-gray-700 dark:text-gray-300">
|
||||
|
||||
{(!showPreview || showSummary) && !post.results && post.summary && (
|
||||
<p style={{ overflow: 'hidden', textOverflow: 'ellipsis', display: '-webkit-box', WebkitLineClamp: '4', WebkitBoxOrient: 'vertical' }}
|
||||
className="replace my-2 text-gray-700 dark:text-gray-300 text-sm font-light leading-7">
|
||||
className="replace my-2 text-sm font-light leading-7">
|
||||
{post.summary}
|
||||
</p>
|
||||
)}
|
||||
{/* 搜索结果 */}
|
||||
{post.results && (
|
||||
<p className="mt-4 replace text-gray-700 dark:text-gray-300 text-sm font-light leading-7">
|
||||
<p className="mt-4 replace text-sm font-light leading-7">
|
||||
{post.results.map(r => (
|
||||
<span key={r}>{r}</span>
|
||||
))}
|
||||
</p>
|
||||
)}
|
||||
|
||||
<div className='text-gray-800 justify-between flex my-2'>
|
||||
<div className='text-gray-800 justify-between flex my-2 dark:text-gray-300'>
|
||||
<Link
|
||||
href={`/archive#${post?.date?.start_date?.substr(0, 7)}`}
|
||||
passHref
|
||||
|
||||
@@ -20,13 +20,10 @@ export default function FloatDarkModeButton() {
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
onClick={handleChangeDarkMode}
|
||||
className={'justify-center items-center text-center'
|
||||
}
|
||||
>
|
||||
<i id="darkModeButton" className={`${isDarkMode ? 'fa-sun' : 'fa-moon'} fas
|
||||
text-2xl text-white bg-indigo-700 px-3 py-2.5 rounded-full dark:bg-black cursor-pointer`} />
|
||||
<div className={'justify-center items-center text-center' } onClick={handleChangeDarkMode}>
|
||||
<i id="darkModeButton"
|
||||
className={`${isDarkMode ? 'fa-sun' : 'fa-moon'} fas
|
||||
text-2xl text-white bg-indigo-700 px-3 py-2.5 rounded-full dark:bg-black cursor-pointer`} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user