Download themes/gitbook/components/FloatTocButton.js from sandy-try/blog: direct link, hf CLI and curl.
- Browser
- Download file 593 Bytes
-
https://huggingface.co/spaces/sandy-try/blog/resolve/main/themes/gitbook/components/FloatTocButton.js
- Command line
-
hf download hf://spaces/sandy-try/blog/themes/gitbook/components/FloatTocButton.js
-
curl -L -o FloatTocButton.js https://huggingface.co/spaces/sandy-try/blog/resolve/main/themes/gitbook/components/FloatTocButton.js
593 Bytes
| import { useGitBookGlobal } from '@/themes/gitbook' | |
| /** | |
| * 移动端悬浮目录按钮 | |
| */ | |
| export default function FloatTocButton () { | |
| const { tocVisible, changeTocVisible } = useGitBookGlobal() | |
| const toggleToc = () => { | |
| changeTocVisible(!tocVisible) | |
| } | |
| return ( | |
| <div | |
| onClick={toggleToc} | |
| className={ 'text-black flex justify-center items-center dark:text-gray-200 dark:bg-hexo-black-gray py-2 px-2' | |
| } | |
| > | |
| <a | |
| id="toc-button" | |
| className={'fa-list-ol cursor-pointer fas hover:scale-150 transform duration-200'} | |
| /> | |
| </div> | |
| ) | |
| } | |