Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jun 13, 2024
2 parents bb08b72 + e3ce491 commit ec67822
Show file tree
Hide file tree
Showing 17 changed files with 254 additions and 203 deletions.
3 changes: 2 additions & 1 deletion lib/lang/en-US.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ export default {
START_READING: 'Start Reading',
MINUTE: 'min',
WORD_COUNT: 'Words',
READ_TIME: 'Read Time'
READ_TIME: 'Read Time',
NEXT_POST: '下一篇'
},
PAGINATION: {
PREV: 'Prev',
Expand Down
3 changes: 2 additions & 1 deletion lib/lang/zh-CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ export default {
START_READING: '开始阅读',
MINUTE: '分钟',
WORD_COUNT: '字数',
READ_TIME: '阅读时长'
READ_TIME: '阅读时长',
NEXT_POST:'下一篇'
},
PAGINATION: {
PREV: '上页',
Expand Down
1 change: 1 addition & 0 deletions themes/example/components/BlogListPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const BlogListPage = props => {
.split('?')[0]
.replace(/\/page\/[1-9]\d*/, '')
.replace(/\/$/, '')
.replace('.html', '')

const showPageCover = siteConfig('EXAMPLE_POST_LIST_COVER', null, CONFIG)

Expand Down
1 change: 1 addition & 0 deletions themes/game/components/PaginationSimple.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const PaginationSimple = ({ page, showNext }) => {
.split('?')[0]
.replace(/\/page\/[1-9]\d*/, '')
.replace(/\/$/, '')
.replace('.html', '')

return (
<div className='my-10 flex justify-between font-medium text-black dark:text-gray-100 space-x-2'>
Expand Down
14 changes: 9 additions & 5 deletions themes/heo/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ const Header = props => {
{/* 顶部导航菜单栏 */}
<nav
id='nav'
className={`z-20 h-16 top-0 w-full duration-500 transition-all
className={`z-20 h-16 top-0 w-full duration-300 transition-all
${fixedNav ? 'fixed' : 'relative bg-transparent'}
${textWhite ? 'text-white ' : 'text-black dark:text-white'}
${navBgWhite ? 'bg-white dark:bg-[#18171d] shadow' : 'bg-transparent'}`}>
Expand All @@ -153,14 +153,18 @@ const Header = props => {
{/* 中间菜单 */}
<div
id='nav-bar-swipe'
className={`hidden lg:flex flex-grow flex-col items-center justify-center h-full relative w-full ${activeIndex === 0 ? 'fade-in-down' : 'fade-in-up'}`}>
{activeIndex === 0 && <MenuListTop {...props} />}
{activeIndex === 1 && (
className={`hidden lg:flex flex-grow flex-col items-center justify-center h-full relative w-full`}>
<div
className={`absolute transition-all duration-700 ${activeIndex === 0 ? 'opacity-100 mt-0' : '-mt-20 opacity-0 invisible'}`}>
<MenuListTop {...props} />
</div>
<div
className={`absolute transition-all duration-700 ${activeIndex === 1 ? 'opacity-100 mb-0' : '-mb-20 opacity-0 invisible'}`}>
<h1 className='font-bold text-center text-light-400 dark:text-gray-400'>
{siteConfig('AUTHOR') || siteConfig('TITLE')}{' '}
{siteConfig('BIO') && <>|</>} {siteConfig('BIO')}
</h1>
)}
</div>
</div>

{/* 右侧固定 */}
Expand Down
4 changes: 2 additions & 2 deletions themes/heo/components/MenuItemDrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ export const MenuItemDrop = ({ link }) => {
{hasSubMenu && (
<ul
style={{ backdropFilter: 'blur(3px)' }}
className={`${show ? 'visible opacity-100 top-14' : 'invisible opacity-0 top-20'} drop-shadow-md overflow-hidden rounded-xl bg-white dark:bg-[#1e1e1e] border dark:border-gray-700 transition-all duration-300 z-20 absolute`}>
className={`${show ? 'visible opacity-100 top-14' : 'invisible opacity-0 top-20'} drop-shadow-md overflow-hidden rounded-xl bg-white dark:bg-[#1e1e1e] transition-all duration-300 z-20 absolute`}>
{link.subMenus.map((sLink, index) => {
return (
<li
key={index}
className='cursor-pointer hover:bg-blue-600 dark:hover:bg-yellow-600 hover:text-white text-gray-900 dark:text-gray-100 tracking-widest transition-all duration-200 dark:border-gray-700 py-1 pr-6 pl-3'>
className='cursor-pointer hover:bg-blue-600 dark:hover:bg-yellow-600 hover:text-white text-gray-900 dark:text-gray-100 tracking-widest transition-all duration-200 py-1 pr-6 pl-3'>
<Link href={sLink.href} target={link?.target}>
<span className='text-sm text-nowrap font-extralight'>
{link?.icon && <i className={sLink?.icon}> &nbsp; </i>}
Expand Down
1 change: 1 addition & 0 deletions themes/heo/components/PaginationNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const PaginationNumber = ({ page, totalPage }) => {
.split('?')[0]
.replace(/\/page\/[1-9]\d*/, '')
.replace(/\/$/, '')
.replace('.html', '')
const pages = generatePages(pagePrefix, page, currentPage, totalPage)

const [value, setValue] = useState('')
Expand Down
12 changes: 7 additions & 5 deletions themes/heo/components/PostAdjacent.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { siteConfig } from '@/lib/config'
import { useGlobal } from '@/lib/global'
import Link from 'next/link'
import { useRouter } from 'next/router'
import { useEffect, useState } from 'react'
Expand All @@ -12,6 +13,7 @@ import CONFIG from '../config'
export default function PostAdjacent({ prev, next }) {
const [isShow, setIsShow] = useState(false)
const router = useRouter()
const { locale } = useGlobal()

useEffect(() => {
setIsShow(false)
Expand Down Expand Up @@ -85,13 +87,13 @@ export default function PostAdjacent({ prev, next }) {

<div
id='pc-next-post'
className={`hidden md:block fixed z-40 right-24 bottom-4 duration-200 transition-all ${isShow ? 'mb-0 opacity-100' : '-mb-24 opacity-0'}`}>
className={`${isShow ? 'mb-5 opacity-100' : '-mb-24 opacity-0'} hidden md:block fixed z-40 right-10 bottom-4 duration-200 transition-all`}>
<Link
href={`/${next.slug}`}
className='cursor-pointer drop-shadow-xl duration transition-all h-24 dark:bg-[#1e1e1e] border dark:border-gray-600 p-3 bg-white dark:text-gray-300 dark:hover:text-yellow-600 hover:font-bold hover:text-blue-600 rounded-lg flex flex-col justify-between'>
<div className='text-xs'>下一篇</div>
<hr />
<div>{next?.title}</div>
className='text-sm block p-4 w-72 h-28 cursor-pointer drop-shadow-xl duration transition-all dark:bg-[#1e1e1e] border dark:border-gray-600 bg-white dark:text-gray-300 dark:hover:text-yellow-600 hover:font-bold hover:text-blue-600 rounded-lg'>
<div className='font-semibold'>{locale.COMMON.NEXT_POST}</div>
<hr className='mt-2 mb-3' />
<div className='line-clamp-2'>{next?.title}</div>
</Link>
</div>
</div>
Expand Down
16 changes: 7 additions & 9 deletions themes/heo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,18 +291,19 @@ const LayoutSlug = props => {
{!lock && (
<div id='article-wrapper' className='mx-auto md:w-full md:px-5'>
{/* 文章主体 */}
<article
itemScope
itemType='https://schema.org/Movie'
data-wow-delay='.2s'
className='wow fadeInUp'>
<article itemScope itemType='https://schema.org/Movie'>
{/* Notion文章主体 */}
<section className='px-5 py-5 justify-center mx-auto'>
<section
className='wow fadeInUp p-5 justify-center mx-auto'
data-wow-delay='.2s'>
<WWAds orientation='horizontal' className='w-full' />
{post && <NotionPage post={post} />}
<WWAds orientation='horizontal' className='w-full' />
</section>

{/* 上一篇\下一篇文章 */}
<PostAdjacent {...props} />

{/* 分享 */}
<ShareBar post={post} />
{post?.type === 'Post' && (
Expand All @@ -315,9 +316,6 @@ const LayoutSlug = props => {
)}
</article>

{/* 上一篇\下一篇文章 */}
<PostAdjacent {...props} />

{/* 评论区 */}
{fullWidth ? null : (
<div className={`${commentEnable && post ? '' : 'hidden'}`}>
Expand Down
1 change: 1 addition & 0 deletions themes/hexo/components/PaginationNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const PaginationNumber = ({ page, totalPage }) => {
.split('?')[0]
.replace(/\/page\/[1-9]\d*/, '')
.replace(/\/$/, '')
.replace('.html', '')
const pages = generatePages(pagePrefix, page, currentPage, totalPage)

return (
Expand Down
56 changes: 25 additions & 31 deletions themes/movie/components/PaginationNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const PaginationNumber = ({ page, totalPage }) => {
.split('?')[0]
.replace(/\/page\/[1-9]\d*/, '')
.replace(/\/$/, '')
.replace('.html', '')
const pages = generatePages(pagePrefix, page, currentPage, totalPage)
if (pages?.length <= 1) {
return <></>
Expand All @@ -46,7 +47,7 @@ const PaginationNumber = ({ page, totalPage }) => {
return (
<>
{/* pc端分页按钮 */}
<div className="hidden lg:flex justify-between items-end mt-10 mb-5 font-medium text-black duration-500 dark:text-gray-300 py-3 space-x-2 overflow-x-auto">
<div className='hidden lg:flex justify-between items-end mt-10 mb-5 font-medium text-black duration-500 dark:text-gray-300 py-3 space-x-2 overflow-x-auto'>
{/* 上一页 */}
<Link
href={{
Expand All @@ -56,32 +57,29 @@ const PaginationNumber = ({ page, totalPage }) => {
: `${pagePrefix}/page/${currentPage - 1}`,
query: router.query.s ? { s: router.query.s } : {}
}}
rel="prev"
className={`${currentPage === 1 ? 'invisible' : 'block'}`}
>
<div className="relative w-24 h-10 flex items-center transition-all duration-200 justify-center py-2 px-2 bg-white dark:bg-[#1e1e1e] border rounded-lg cursor-pointer group">
<i className="fas fa-angle-left mr-2 transition-all duration-200 transform group-hover:-translate-x-4" />
<div className="absolute translate-x-4 ml-2 opacity-0 transition-all duration-200 group-hover:opacity-100 group-hover:translate-x-0">
rel='prev'
className={`${currentPage === 1 ? 'invisible' : 'block'}`}>
<div className='relative w-24 h-10 flex items-center transition-all duration-200 justify-center py-2 px-2 bg-white dark:bg-[#1e1e1e] border rounded-lg cursor-pointer group'>
<i className='fas fa-angle-left mr-2 transition-all duration-200 transform group-hover:-translate-x-4' />
<div className='absolute translate-x-4 ml-2 opacity-0 transition-all duration-200 group-hover:opacity-100 group-hover:translate-x-0'>
{locale.PAGINATION.PREV}
</div>
</div>
</Link>

{/* 分页 */}
<div className="flex items-center space-x-2">
<div className='flex items-center space-x-2'>
{pages}

{/* 跳转页码 */}
<div className="bg-white hover:bg-gray-100 dark:hover:bg-yellow-600 dark:bg-[#1e1e1e] h-10 border flex justify-center items-center rounded-lg group hover:border-indigo-600 transition-all duration-200">
<div className='bg-white hover:bg-gray-100 dark:hover:bg-yellow-600 dark:bg-[#1e1e1e] h-10 border flex justify-center items-center rounded-lg group hover:border-indigo-600 transition-all duration-200'>
<input
value={value}
className="w-0 group-hover:w-20 group-hover:px-3 transition-all duration-200 bg-gray-100 border-none outline-none h-full rounded-lg"
onInput={handleInputChange}
></input>
className='w-0 group-hover:w-20 group-hover:px-3 transition-all duration-200 bg-gray-100 border-none outline-none h-full rounded-lg'
onInput={handleInputChange}></input>
<div
onClick={jumpToPage}
className="cursor-pointer hover:bg-indigo-600 dark:bg-[#1e1e1e] dark:hover:bg-yellow-600 hover:text-white px-4 py-2 group-hover:px-2 group-hover:mx-1 group-hover:rounded bg-white"
>
className='cursor-pointer hover:bg-indigo-600 dark:bg-[#1e1e1e] dark:hover:bg-yellow-600 hover:text-white px-4 py-2 group-hover:px-2 group-hover:mx-1 group-hover:rounded bg-white'>
<ChevronDoubleRight className={'w-4 h-4'} />
</div>
</div>
Expand All @@ -93,12 +91,11 @@ const PaginationNumber = ({ page, totalPage }) => {
pathname: `${pagePrefix}/page/${currentPage + 1}`,
query: router.query.s ? { s: router.query.s } : {}
}}
rel="next"
className={`${+showNext ? 'block' : 'invisible'} `}
>
<div className="relative w-24 h-10 flex items-center transition-all duration-200 justify-center py-2 px-2 bg-white dark:bg-[#1e1e1e] border rounded-lg cursor-pointer group">
<i className="fas fa-angle-right mr-2 transition-all duration-200 transform group-hover:translate-x-6" />
<div className="absolute -translate-x-10 ml-2 opacity-0 transition-all duration-200 group-hover:opacity-100 group-hover:-translate-x-2">
rel='next'
className={`${+showNext ? 'block' : 'invisible'} `}>
<div className='relative w-24 h-10 flex items-center transition-all duration-200 justify-center py-2 px-2 bg-white dark:bg-[#1e1e1e] border rounded-lg cursor-pointer group'>
<i className='fas fa-angle-right mr-2 transition-all duration-200 transform group-hover:translate-x-6' />
<div className='absolute -translate-x-10 ml-2 opacity-0 transition-all duration-200 group-hover:opacity-100 group-hover:-translate-x-2'>
{locale.PAGINATION.NEXT}
</div>
</div>
Expand All @@ -107,7 +104,7 @@ const PaginationNumber = ({ page, totalPage }) => {

{/* 移动端分页 */}

<div className="lg:hidden w-full flex flex-row">
<div className='lg:hidden w-full flex flex-row'>
{/* 上一页 */}
<Link
href={{
Expand All @@ -117,23 +114,21 @@ const PaginationNumber = ({ page, totalPage }) => {
: `${pagePrefix}/page/${currentPage - 1}`,
query: router.query.s ? { s: router.query.s } : {}
}}
rel="prev"
className={`${showPrev ? 'block' : 'hidden'} dark:text-white relative w-full flex-1 h-14 flex items-center transition-all duration-200 justify-center py-2 px-2 bg-white dark:bg-[#1e1e1e] border rounded-xl cursor-pointer`}
>
rel='prev'
className={`${showPrev ? 'block' : 'hidden'} dark:text-white relative w-full flex-1 h-14 flex items-center transition-all duration-200 justify-center py-2 px-2 bg-white dark:bg-[#1e1e1e] border rounded-xl cursor-pointer`}>
{locale.PAGINATION.PREV}
</Link>

{showPrev && showNext && <div className="w-12"></div>}
{showPrev && showNext && <div className='w-12'></div>}

{/* 下一页 */}
<Link
href={{
pathname: `${pagePrefix}/page/${currentPage + 1}`,
query: router.query.s ? { s: router.query.s } : {}
}}
rel="next"
className={`${+showNext ? 'block' : 'hidden'} dark:text-white relative w-full flex-1 h-14 flex items-center transition-all duration-200 justify-center py-2 px-2 bg-white dark:bg-[#1e1e1e] border rounded-xl cursor-pointer`}
>
rel='next'
className={`${+showNext ? 'block' : 'hidden'} dark:text-white relative w-full flex-1 h-14 flex items-center transition-all duration-200 justify-center py-2 px-2 bg-white dark:bg-[#1e1e1e] border rounded-xl cursor-pointer`}>
{locale.PAGINATION.NEXT}
</Link>
</div>
Expand Down Expand Up @@ -163,8 +158,7 @@ function getPageElement(page, currentPage, pagePrefix) {
? 'bg-indigo-600 dark:bg-yellow-600 text-white '
: 'dark:bg-[#1e1e1e] bg-white') +
' hover:border-indigo-600 dark:hover:bg-yellow-600 dark:border-gray-600 px-4 border py-2 rounded-lg drop-shadow-sm duration-200 transition-colors'
}
>
}>
{page}
</Link>
)
Expand Down Expand Up @@ -197,7 +191,7 @@ function generatePages(pagePrefix, page, currentPage, totalPage) {
}
if (startPage > 2) {
pages.push(
<div key={-1} className="-mt-2 mx-1">
<div key={-1} className='-mt-2 mx-1'>
...{' '}
</div>
)
Expand Down
Loading

0 comments on commit ec67822

Please sign in to comment.