移动段适配,加入深夜模式按钮

This commit is contained in:
tangly1024
2021-11-05 17:21:59 +08:00
parent 5bcb50891c
commit 6cbe623e97
9 changed files with 47 additions and 34 deletions

View File

@@ -1,5 +1,4 @@
import React, { useCallback, useEffect, useState } from 'react'
import throttle from 'lodash.throttle'
import React, { useEffect, useState } from 'react'
import { useGlobal } from '@/lib/global'
/**
@@ -33,15 +32,15 @@ const JumpToTopButton = ({ targetRef, showPercent = true }) => {
}, [show])
return (
<div id='jump-to-top' className='right-0 fixed flex bottom-24 mr-2.5 py-1 duration-500 z-20 opacity-75'>
<div className='transform hover:scale-105 duration-200 '>
<div id='jump-to-top' className='right-0 fixed flex bottom-24 mr-4 duration-500 z-20'>
<div >
<div
onClick={() => window.scrollTo({ top: 0, behavior: 'smooth' })}
style={{ boxShadow: 'rgba(41, 50, 60, 0.5) 0px 2px 16px', borderRadius: '28px' }}
className={(show ? 'animate__fadeInUp' : 'animate__fadeOutUp') + ' bg-gray-700 px-2.5 py-2 cursor-pointer animate__animated animate__faster shadow-2xl'}>
className={(show ? 'animate__fadeInUp' : 'animate__fadeOutUp') + ' bg-gray-700 px-1 py-1 cursor-pointer animate__animated animate__faster shadow-2xl'}>
<div className='text-center'>
<div className='w-10 text-xl text-gray-100' title={locale.POST.TOP} ><i className='fa fa-arrow-up'/> </div>
{showPercent && (<div className='w-10 text-xs text-gray-100 dark:text-gray-200 text-center'>&nbsp;{percent}%</div>)}
<div className='w-10 text-xl text-gray-100 transform hover:scale-125 duration-200' title={locale.POST.TOP} ><i className='fa fa-arrow-up'/> </div>
{showPercent && (<div className='w-10 text-xs text-gray-100 dark:text-gray-200'>{percent} </div>)}
</div>
</div>
</div>