mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-06-17 01:59:08 +00:00
fix(Editor): add empty role picker help page and link
This commit is contained in:
parent
30b9ea3a59
commit
d8cdc1c62a
5 changed files with 152 additions and 25 deletions
|
@ -1,6 +1,8 @@
|
|||
import { numberToChroma, palette } from '@roleypoly/design-system/atoms/colors';
|
||||
import { Role } from '@roleypoly/types';
|
||||
import styled, { css } from 'styled-components';
|
||||
import chroma from 'chroma-js';
|
||||
import { GoCheck, GoQuestion, GoX } from 'react-icons/go';
|
||||
import styled, { css, keyframes } from 'styled-components';
|
||||
|
||||
export const DiscordBase = styled.div`
|
||||
background-color: ${palette.discord100};
|
||||
|
@ -17,9 +19,26 @@ const hover = (roleColor: string) => css`
|
|||
cursor: pointer;
|
||||
`;
|
||||
|
||||
const isBadFlash = keyframes`
|
||||
/* stylelint-disable function-name-case, function-whitespace-after */
|
||||
|
||||
0%, 100% {
|
||||
box-shadow: 0 0 8px ${chroma(palette.red400).alpha(0.5).css()}
|
||||
}
|
||||
|
||||
66% {
|
||||
box-shadow: 0 0 2px ${chroma(palette.red200).alpha(0.5).css()}
|
||||
}
|
||||
|
||||
33% {
|
||||
box-shadow: 0 0 2px ${chroma(palette.red400).alpha(0.5).css()}
|
||||
}
|
||||
`;
|
||||
|
||||
export const DiscordRole = styled.div<{
|
||||
discordRole: Role;
|
||||
isRoleypoly: boolean;
|
||||
isGood: boolean;
|
||||
}>`
|
||||
/* stylelint-disable function-name-case, function-whitespace-after */
|
||||
|
||||
|
@ -35,4 +54,29 @@ export const DiscordRole = styled.div<{
|
|||
|
||||
${(props) =>
|
||||
props.isRoleypoly && hover(numberToChroma(props.discordRole.color).alpha(0.5).css())}
|
||||
${(props) =>
|
||||
!props.isGood &&
|
||||
props.isRoleypoly &&
|
||||
css`
|
||||
animation: ${isBadFlash} 0.5s 10s ease-in-out both;
|
||||
`}
|
||||
`;
|
||||
|
||||
const bumpDown = css`
|
||||
position: relative;
|
||||
top: 0.1em;
|
||||
margin-right: 0.25em;
|
||||
`;
|
||||
|
||||
export const Dont = styled(GoX)`
|
||||
${bumpDown}
|
||||
color: ${palette.red400};
|
||||
`;
|
||||
export const Do = styled(GoCheck)`
|
||||
${bumpDown}
|
||||
color: ${palette.green400};
|
||||
`;
|
||||
export const Why = styled(GoQuestion)`
|
||||
${bumpDown}
|
||||
color: ${palette.discord400};
|
||||
`;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue