forked from Magickbase/websites
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Magickbase#35 from WhiteMinds/fix/339_NeuronProblems
fix issues of neuron website
- Loading branch information
Showing
34 changed files
with
662 additions
and
167 deletions.
There are no files selected for viewing
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
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,76 @@ | ||
@use 'sass:color'; | ||
|
||
.button { | ||
all: unset; | ||
display: flex; | ||
gap: 10px; | ||
align-items: center; | ||
justify-content: center; | ||
padding: 16px 24px; | ||
border-radius: 7px; | ||
cursor: pointer; | ||
} | ||
|
||
.contained { | ||
color: var(--btnForeground); | ||
background: var(--btnBackground); | ||
|
||
&:disabled { | ||
color: var(--btnForegroundDisabled); | ||
background: var(--btnBackgroundDisabled); | ||
} | ||
|
||
&:not(:disabled):hover { | ||
background: var(--btnBackgroundHover); | ||
} | ||
|
||
&:not(:disabled):active { | ||
background: var(--btnBackgroundActive); | ||
} | ||
} | ||
|
||
.outlined { | ||
color: var(--btnBackground); | ||
border: 2px solid var(--btnBackground); | ||
|
||
&:disabled { | ||
color: var(--btnBackgroundDisabled); | ||
border-color: var(--btnBackgroundDisabled); | ||
} | ||
|
||
&:not(:disabled):hover { | ||
color: var(--btnBackgroundHover); | ||
border-color: var(--btnBackgroundHover); | ||
} | ||
|
||
&:not(:disabled):active { | ||
color: var(--btnBackgroundActive); | ||
border-color: var(--btnBackgroundActive); | ||
} | ||
} | ||
|
||
.text { | ||
padding: 6px 24px; | ||
color: var(--btnBackground); | ||
|
||
&:disabled { | ||
color: var(--btnBackgroundDisabled); | ||
} | ||
|
||
&:not(:disabled):hover { | ||
color: var(--btnBackgroundHover); | ||
} | ||
|
||
&:not(:disabled):active { | ||
color: var(--btnBackgroundActive); | ||
} | ||
} | ||
|
||
.themeBlackWhite { | ||
--btnForeground: #000; | ||
--btnForegroundDisabled: #{rgba(#000, 0.5)}; | ||
--btnBackground: #f5f5f5; | ||
--btnBackgroundDisabled: #{color.mix(#fff, #f5f5f5, $weight: 50%)}; | ||
--btnBackgroundHover: #{color.mix(#000, #f5f5f5, $weight: 20%)}; | ||
--btnBackgroundActive: #{color.mix(#000, #f5f5f5, $weight: 40%)}; | ||
} |
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,38 @@ | ||
/** | ||
* Currently, there are no complex button scenarios, so a simple implementation is sufficient. | ||
* If the requirements cannot be met in the future, consider using a third-party component library. | ||
*/ | ||
import { ComponentProps, FC } from 'react' | ||
import clsx from 'clsx' | ||
import styles from './index.module.scss' | ||
import presets from '../../styles/presets.module.scss' | ||
|
||
export type ButtonVariant = 'contained' | 'outlined' | 'text' | ||
|
||
export interface ButtonProps extends ComponentProps<'button'> { | ||
variant?: ButtonVariant | ||
theme?: 'light' | 'dark' | 'blackwhite' | ||
} | ||
|
||
export const Button: FC<ButtonProps> = ({ children, variant = 'contained', theme, ...elProps }) => { | ||
return ( | ||
<button | ||
{...elProps} | ||
className={clsx( | ||
styles.button, | ||
{ | ||
[styles.contained ?? '']: variant === 'contained', | ||
[styles.outlined ?? '']: variant === 'outlined', | ||
[styles.text ?? '']: variant === 'text', | ||
|
||
[presets.themeLight ?? '']: theme === 'light', | ||
[presets.themeDark ?? '']: theme === 'dark', | ||
[styles.themeBlackWhite ?? '']: theme === 'blackwhite', | ||
}, | ||
elProps.className, | ||
)} | ||
> | ||
{children} | ||
</button> | ||
) | ||
} |
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 was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
Oops, something went wrong.