diff --git a/package.json b/package.json index 7737a6e..e25f0bf 100644 --- a/package.json +++ b/package.json @@ -90,4 +90,4 @@ "tsconfig-paths-webpack-plugin": "^3.3.0", "typescript": "^4.0.3" } -} \ No newline at end of file +} diff --git a/src/design-system/Intro.stories.mdx b/src/design-system/Intro.stories.mdx index 6c3c409..84e04a2 100644 --- a/src/design-system/Intro.stories.mdx +++ b/src/design-system/Intro.stories.mdx @@ -5,7 +5,7 @@ import { palette } from 'roleypoly/src/design-system/atoms/colors'; - + # Rapid UI diff --git a/src/design-system/atoms/branding/Branding.tsx b/src/design-system/atoms/branding/Branding.tsx index 5f32f08..5a392e5 100644 --- a/src/design-system/atoms/branding/Branding.tsx +++ b/src/design-system/atoms/branding/Branding.tsx @@ -10,6 +10,8 @@ export type LogoProps = { typeFill: string; style: object; className: string; + 'data-for'?: string; + 'data-tip'?: string; }; export const Logotype = ({ @@ -23,11 +25,13 @@ export const Logotype = ({ className={props.className} width={props.width} height={props.height} - viewBox="0 0 487 143" + data-for={props['data-for']} + data-tip={props['data-tip']} + viewBox="45 25 400 88" fill="none" xmlns="http://www.w3.org/2000/svg" > - + @@ -101,15 +105,17 @@ export const Logomark = ({ ...props }: Partial) => ( - + diff --git a/src/design-system/atoms/branding/DynamicBranding.stories.tsx b/src/design-system/atoms/branding/DynamicBranding.stories.tsx index b76aa60..5c1ff02 100644 --- a/src/design-system/atoms/branding/DynamicBranding.stories.tsx +++ b/src/design-system/atoms/branding/DynamicBranding.stories.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; +import ReactTooltip from 'react-tooltip'; import styled from 'styled-components'; import { AllVariants, DynamicLogomark, DynamicLogotype } from './DynamicBranding'; @@ -7,11 +8,18 @@ export default { component: DynamicLogotype, }; -const Wrapper = styled.div` +const WrapperDiv = styled.div` background-color: black; padding: 2em; `; +const Wrapper = (props: { children: React.ReactNode }) => ( + <> + {props.children} + + +); + export const DynamicLogotype_ = (args) => { return ( @@ -32,7 +40,9 @@ export const AllCustomizedLogotypes = () => { return ( {AllVariants.map((variant, idx) => ( - +
+ +
))} ); diff --git a/src/design-system/atoms/branding/DynamicBranding.tsx b/src/design-system/atoms/branding/DynamicBranding.tsx index 7d838df..d58854a 100644 --- a/src/design-system/atoms/branding/DynamicBranding.tsx +++ b/src/design-system/atoms/branding/DynamicBranding.tsx @@ -1,4 +1,7 @@ import * as React from 'react'; +import ReactTooltip from 'react-tooltip'; +import { palette } from '../colors'; +import { SparkleOverlay } from '../sparkle'; import { Logomark, LogoProps, Logotype } from './Branding'; type DynamicLogoProps = Partial & { @@ -14,7 +17,20 @@ export const DynamicLogomark = (props: DynamicLogoProps) => { return ; } - return ; + let tooltipProps = {}; + if (variant.tooltip) { + tooltipProps = { + 'data-tip': variant.tooltip, + // 'data-for': 'dynamic-logomark', + }; + } + + return ( + <> + + + + ); }; export const DynamicLogotype = (props: DynamicLogoProps) => { @@ -26,7 +42,20 @@ export const DynamicLogotype = (props: DynamicLogoProps) => { return ; } - return ; + let tooltipProps = {}; + if (variant.tooltip) { + tooltipProps = { + 'data-tip': variant.tooltip, + // 'data-for': 'dynamic-logomark', + }; + } + + return ( + <> + + + + ); }; const getRelevantVariant = (currentDate?: Date) => { @@ -69,6 +98,8 @@ const matchDay = ( type Variant = { activeIf: (currentDate?: Date) => boolean; + sharedProps?: Partial; + tooltip?: string; Logomark: React.FunctionComponent; Logotype: React.FunctionComponent; }; @@ -77,89 +108,210 @@ export const Trans: Variant = { // March 31, Nov 13-20+1 activeIf: (currentDate?: Date) => matchDay(new Date('2021-Mar-31'), new Date('2021-Apr-1'), currentDate) || - matchDay(new Date('2021-Nov-13'), new Date('2021-Nov-21'), currentDate), - Logomark: (props: DynamicLogoProps) => <>, - Logotype: (props: DynamicLogoProps) => <>, -}; - -export const Pride: Variant = { - // June - activeIf: (currentDate?: Date) => - matchDay(new Date('2021-Jun-1'), new Date('2021-Jul-1'), currentDate), - Logomark: (props: DynamicLogoProps) => <>, - Logotype: (props: DynamicLogoProps) => <>, + matchDay(new Date('2021-Nov-13'), new Date('2021-Nov-22'), currentDate), + sharedProps: { + circleFill: '#F7A8B8', + circleOuterFill: '#55CDFC', + typeFill: palette.grey600, + }, + tooltip: 'Roleypoly says trans rights!', + Logomark: (props: DynamicLogoProps) => , + Logotype: (props: DynamicLogoProps) => , }; export const Bi: Variant = { // Sept 16-23 activeIf: (currentDate?: Date) => matchDay(new Date('2021-Sep-16'), new Date('2021-Sep-24'), currentDate), - Logomark: (props: DynamicLogoProps) => <>, - Logotype: (props: DynamicLogoProps) => <>, + sharedProps: { + circleFill: '#D60270', + circleOuterFill: '#9B4F96', + typeFill: '#0038A8', + }, + tooltip: 'Being bi is a lot like a riding a bicycle since they can go both ways.', + Logomark: (props: DynamicLogoProps) => , + Logotype: (props: DynamicLogoProps) => , }; export const Lesbian: Variant = { // Apr 26 activeIf: (currentDate?: Date) => matchDay(new Date('2021-Apr-25'), new Date('2021-Apt-27'), currentDate), - Logomark: (props: DynamicLogoProps) => <>, - Logotype: (props: DynamicLogoProps) => <>, + sharedProps: { + circleFill: '#D362A4', + circleOuterFill: '#A30262', + typeFill: '#FF9A56', + }, + tooltip: "I'm a lesbiab... lesbiam... Less Bien... Girls.", + Logomark: (props: DynamicLogoProps) => ( + + ), + Logotype: (props: DynamicLogoProps) => ( + + ), }; export const Ace: Variant = { // Oct 24-30 activeIf: (currentDate?: Date) => matchDay(new Date('2021-Oct-24'), new Date('2021-Oct-31'), currentDate), - Logomark: (props: DynamicLogoProps) => <>, - Logotype: (props: DynamicLogoProps) => <>, + sharedProps: { + circleFill: '#333', + circleOuterFill: '#84067C', + typeFill: '#CCC', + }, + tooltip: "Sexualn't", + Logomark: (props: DynamicLogoProps) => , + Logotype: (props: DynamicLogoProps) => , }; export const Birthday: Variant = { // Jan 15 activeIf: (currentDate?: Date) => matchDay(new Date('2021-Jan-15'), new Date('2021-Jan-16'), currentDate), - Logomark: (props: DynamicLogoProps) => <>, - Logotype: (props: DynamicLogoProps) => <>, + sharedProps: { + circleFill: 'none', + circleOuterFill: palette.taupe300, + typeFill: palette.taupe500, + }, + tooltip: '๐ŸŽ‰ HAPPY BIRTHDAY ROLEYPOLY ๐ŸŽ‰', + Logomark: (props: DynamicLogoProps) => ( + + + + + + + + + + + + + + + + + + ), + Logotype: (props: DynamicLogoProps) => ( +
+ + + +
+ ), }; export const DevilsLettuce: Variant = { // Apr 20 activeIf: (currentDate?: Date) => matchDay(new Date('2021-Apr-20'), new Date('2021-Apr-21'), currentDate), + sharedProps: { + circleFill: palette.green400, + circleOuterFill: palette.green200, + typeFill: palette.green400, + }, + tooltip: 'Legalize it.', Logomark: (props: DynamicLogoProps) => ( - <> - - + ), Logotype: (props: DynamicLogoProps) => ( - <> - - + ), }; export const BicycleDay: Variant = { // Apr 19 + // TODO: hexagon is bestagon activeIf: (currentDate?: Date) => matchDay(new Date('2021-Apr-19'), new Date('2021-Apr-20'), currentDate), - Logomark: (props: DynamicLogoProps) => <>, - Logotype: (props: DynamicLogoProps) => <>, + sharedProps: { + circleFill: palette.gold400, + circleOuterFill: palette.red200, + typeFill: palette.discord400, + }, + tooltip: 'It increases brain complexity.', + Logomark: (props: DynamicLogoProps) => ( + + ), + Logotype: (props: DynamicLogoProps) => ( + + ), }; export const Christmas: Variant = { // Dec 20-27 activeIf: (currentDate?: Date) => matchDay(new Date('2021-Dec-20'), new Date('2021-Dec-28'), currentDate), - Logomark: (props: DynamicLogoProps) => <>, - Logotype: (props: DynamicLogoProps) => <>, + sharedProps: { + circleFill: palette.green200, + circleOuterFill: palette.red200, + typeFill: palette.green400, + }, + tooltip: 'Have yourself a merry little Christmas~', + Logomark: (props: DynamicLogoProps) => ( + + ), + Logotype: (props: DynamicLogoProps) => ( + + ), }; export const NewYear: Variant = { // Dec 30 - Jan 2 + // TODO: sparkle activeIf: (currentDate?: Date) => matchDay(new Date('2021-Dec-30'), new Date('2021-Jan-3'), currentDate), - Logomark: (props: DynamicLogoProps) => <>, - Logotype: (props: DynamicLogoProps) => <>, + sharedProps: { + circleFill: '#222', + circleOuterFill: palette.red400, + typeFill: '#aaa', + }, + tooltip: 'Fuck 2020. ๐ŸŽ†๐ŸŽ‡๐ŸŽ†๐ŸŽ‡', + Logomark: (props: DynamicLogoProps) => ( + + ), + Logotype: (props: DynamicLogoProps) => ( +
+ + + +
+ ), }; export const LunarNewYear: Variant = { @@ -168,8 +320,323 @@ export const LunarNewYear: Variant = { activeIf: (currentDate?: Date) => matchDay(new Date('2021-Feb-10'), new Date('2021-Feb-13'), currentDate, true) || matchDay(new Date('2022-Jan-30'), new Date('2022-Feb-3'), currentDate, true), - Logomark: (props: DynamicLogoProps) => <>, - Logotype: (props: DynamicLogoProps) => <>, + sharedProps: { + circleFill: palette.red200, + circleOuterFill: palette.gold400, + typeFill: palette.taupe300, + }, + tooltip: 'ๆญๅ–œๅ‘่ดข! ๐ŸŽŠ๐ŸŽ†๐ŸŽ‡', + Logomark: (props: DynamicLogoProps) => ( + + ), + Logotype: (props: DynamicLogoProps) => ( +
+ + + +
+ ), +}; + +export const Pride: Variant = { + // June + activeIf: (currentDate?: Date) => + matchDay(new Date('2021-Jun-1'), new Date('2021-Jul-1'), currentDate), + sharedProps: { + circleOuterFill: palette.taupe200, + typeFill: palette.grey500, + }, + tooltip: 'LOVE WINS. ๐Ÿ’–๐ŸŒˆ๐ŸŒŸ', + Logomark: (props: DynamicLogoProps) => ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + ), + Logotype: (props: DynamicLogoProps) => ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ), }; export const AllVariants: Variant[] = [ diff --git a/src/design-system/atoms/sparkle/Shapes.tsx b/src/design-system/atoms/sparkle/Shapes.tsx index 5cebe02..10bb19a 100644 --- a/src/design-system/atoms/sparkle/Shapes.tsx +++ b/src/design-system/atoms/sparkle/Shapes.tsx @@ -49,7 +49,7 @@ const Animation = (props: SparkleProps) => ( const SparkleCircle = (props: SparkleProps) => ( - + @@ -62,7 +62,7 @@ const SparkleStar = (props: SparkleProps) => ( ( diff --git a/src/design-system/atoms/sparkle/Sparkle.tsx b/src/design-system/atoms/sparkle/Sparkle.tsx index 0e76715..f4309b6 100644 --- a/src/design-system/atoms/sparkle/Sparkle.tsx +++ b/src/design-system/atoms/sparkle/Sparkle.tsx @@ -9,6 +9,7 @@ type Props = { size?: number; opacity?: number; repeatCount?: number; + strokeColor?: string; }; const SparkleContainer = styled.div` @@ -33,18 +34,18 @@ const SparkleEffect = styled.div` pointer-events: none; `; -export const SparkleOverlay = (props: Props) => ( +export const SparkleOverlay = ({ strokeColor = palette.gold400, ...props }: Props) => ( {props.children} diff --git a/src/design-system/organisms/masthead/Authed.tsx b/src/design-system/organisms/masthead/Authed.tsx index 04aa761..8d5611e 100644 --- a/src/design-system/organisms/masthead/Authed.tsx +++ b/src/design-system/organisms/masthead/Authed.tsx @@ -1,16 +1,16 @@ import Link from 'next/link'; import * as React from 'react'; import { GoOrganization } from 'react-icons/go'; -import { - RoleypolyUser, - GuildEnumeration, -} from 'roleypoly/src/design-system/shared-types'; -import { Logomark } from 'roleypoly/src/design-system/atoms/branding'; +import { DynamicLogomark } from 'roleypoly/src/design-system/atoms/branding'; import { Popover } from 'roleypoly/src/design-system/atoms/popover'; import { GuildNav } from 'roleypoly/src/design-system/molecules/guild-nav'; import { NavSlug } from 'roleypoly/src/design-system/molecules/nav-slug'; import { UserAvatarGroup } from 'roleypoly/src/design-system/molecules/user-avatar-group'; import { UserPopover } from 'roleypoly/src/design-system/molecules/user-popover'; +import { + GuildEnumeration, + RoleypolyUser, +} from 'roleypoly/src/design-system/shared-types'; import { guildEnum } from 'roleypoly/src/design-system/shared-types/storyData'; import { GuildPopoverHead, @@ -38,7 +38,7 @@ export const Authed = (props: Props) => { - + ( @@ -17,7 +17,7 @@ export const Guest = () => ( - + diff --git a/src/design-system/organisms/masthead/Masthead.styled.tsx b/src/design-system/organisms/masthead/Masthead.styled.tsx index d79e5bb..b011cf7 100644 --- a/src/design-system/organisms/masthead/Masthead.styled.tsx +++ b/src/design-system/organisms/masthead/Masthead.styled.tsx @@ -70,6 +70,7 @@ export const InteractionBase = styled.div` export const MastheadA = styled.a` display: flex; align-items: center; + justify-content: center; color: unset; text-decoration: unset; `;