diff options
| author | Jacky Zhao <[email protected]> | 2021-03-06 17:57:24 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-03-06 17:57:24 -0800 |
| commit | 5dd02b5c2acd7a4c408ce9ffa1d95e208d20bbc8 (patch) | |
| tree | 5a09bea364331dd0f41510153924065b815b702e /frontend/src/components/Common | |
| parent | fix(typo): public api docs endpoint (diff) | |
| parent | fix password modal (diff) | |
| download | ctrl-v-5dd02b5c2acd7a4c408ce9ffa1d95e208d20bbc8.tar.xz ctrl-v-5dd02b5c2acd7a4c408ce9ffa1d95e208d20bbc8.zip | |
Merge pull request #70 from jackyzha0/visual-overhaul
Diffstat (limited to 'frontend/src/components/Common')
| -rw-r--r-- | frontend/src/components/Common/Button.js | 32 | ||||
| -rw-r--r-- | frontend/src/components/Common/Input.js | 9 | ||||
| -rw-r--r-- | frontend/src/components/Common/mixins.js | 52 |
3 files changed, 93 insertions, 0 deletions
diff --git a/frontend/src/components/Common/Button.js b/frontend/src/components/Common/Button.js new file mode 100644 index 0000000..59e148b --- /dev/null +++ b/frontend/src/components/Common/Button.js @@ -0,0 +1,32 @@ +import styled, {css} from 'styled-components' +import {Border, ButtonLike, DropShadow, Rounded} from "./mixins"; + +const Base = css` + ${DropShadow} + ${Rounded} + ${ButtonLike} + margin-right: 2em; + height: calc(16px + 1.6em); + cursor: pointer; +` + +const Primary = css` + ${Base}; + border: none; + color: ${p => p.theme.colors.background}; + background-color: ${p => p.theme.colors.text}; +` +const Secondary = css` + ${Base}; + ${Border}; + color: ${p => p.theme.colors.text}; + background-color: ${p => p.theme.colors.background}; +` + +export const Button = styled.button` + ${p => p.secondary ? css`${Secondary}` : css`${Primary}` } +` + +export const SubmitButton = styled.input` + ${Primary} +`
\ No newline at end of file diff --git a/frontend/src/components/Common/Input.js b/frontend/src/components/Common/Input.js new file mode 100644 index 0000000..e000cfb --- /dev/null +++ b/frontend/src/components/Common/Input.js @@ -0,0 +1,9 @@ +import styled from 'styled-components' +import {Border, DropShadow, InputLike, Rounded} from "./mixins"; + +export const Input = styled.input` + ${Border} + ${Rounded} + ${DropShadow} + ${InputLike} +`
\ No newline at end of file diff --git a/frontend/src/components/Common/mixins.js b/frontend/src/components/Common/mixins.js new file mode 100644 index 0000000..ff2759f --- /dev/null +++ b/frontend/src/components/Common/mixins.js @@ -0,0 +1,52 @@ +import {css} from 'styled-components'; + +export const DropShadow = css` + box-shadow: 0 14px 28px rgba(27, 33, 48,0.06), 0 10px 10px rgba(27, 33, 48,0.02); +` + +export const Hover = css` + opacity: 0.5; + transition: all 0.5s cubic-bezier(.25,.8,.25,1); + + & ~ pre { + transition: all 0.5s cubic-bezier(.25,.8,.25,1); + opacity: 0.5; + } + + &:focus, &:hover, &:focus span, &:focus ~ pre { + opacity: 1; + } +` + +export const Rounded = css` + border-radius: 3px; +` + +export const Border = css` + border: 1px solid ${p => p.theme.colors.border}; +` + +export const InputLike = css` + ${Hover} + font-family: 'JetBrains Mono', monospace; + width: 100%; + font-size: 0.8em; + padding: 0.6em; + outline: none; + margin: 1.7em 0; +` + +export const CodeLike = css` + font-family: JetBrains Mono !important; + font-size: 13px !important; + line-height: 1.6em !important; + white-space: pre-wrap; +` + +export const ButtonLike = css` + font-family: 'JetBrains Mono', serif; + font-weight: 700; + padding: 0.6em 1.5em; + margin: 2em 0; + outline: 0; +`
\ No newline at end of file |