-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 🎸 chaingpt demo * refactor: 💡 move chainGPT to src/theme; upgrade to 0.1.1 * ci: 🎡 update chaingpt-component * feat: 🎸 chaingpt/api/chat -> /api/chaingpt * style: 💄 BackToTopButton move to center * ci: 🎡 update chaingpt-component -> 0.1.5
- Loading branch information
Showing
5 changed files
with
89 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,28 @@ | ||
import React from 'react'; | ||
import clsx from 'clsx'; | ||
import {translate} from '@docusaurus/Translate'; | ||
import {ThemeClassNames} from '@docusaurus/theme-common'; | ||
import {useBackToTopButton} from '@docusaurus/theme-common/internal'; | ||
|
||
import styles from './styles.module.css'; | ||
|
||
export default function BackToTopButton(): JSX.Element { | ||
const {shown, scrollToTop} = useBackToTopButton({threshold: 300}); | ||
return ( | ||
<button | ||
aria-label={translate({ | ||
id: 'theme.BackToTopButton.buttonAriaLabel', | ||
message: 'Scroll back to top', | ||
description: 'The ARIA label for the back to top button', | ||
})} | ||
className={clsx( | ||
'clean-btn', | ||
ThemeClassNames.common.backToTopButton, | ||
styles.backToTopButton, | ||
shown && styles.backToTopButtonShow, | ||
)} | ||
type="button" | ||
onClick={scrollToTop} | ||
/> | ||
); | ||
} |
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,39 @@ | ||
.backToTopButton { | ||
position: fixed; | ||
left: 0; | ||
right: 0; | ||
margin: auto; | ||
bottom: 1.3rem; | ||
border-radius: 50%; | ||
background-color: var(--ifm-color-emphasis-200); | ||
width: 3rem; | ||
height: 3rem; | ||
z-index: calc(var(--ifm-z-index-fixed) - 1); | ||
box-shadow: var(--ifm-global-shadow-lw); | ||
transition: all var(--ifm-transition-fast) | ||
var(--ifm-transition-timing-default); | ||
opacity: 0; | ||
transform: scale(0); | ||
visibility: hidden; | ||
} | ||
|
||
.backToTopButton::after { | ||
content: ' '; | ||
display: inline-block; | ||
mask: var(--ifm-menu-link-sublist-icon) 50% / 2rem 2rem no-repeat; | ||
background-color: var(--ifm-color-emphasis-1000); | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
@media (hover: hover) { | ||
.backToTopButton:hover { | ||
background-color: var(--ifm-color-emphasis-300); | ||
} | ||
} | ||
|
||
.backToTopButtonShow { | ||
opacity: 1; | ||
transform: scale(1); | ||
visibility: visible; | ||
} |
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 |
---|---|---|
|
@@ -5,4 +5,5 @@ | |
display: flex; | ||
flex-direction: column; | ||
align-items: end; | ||
z-index: 999; | ||
} |