diff --git a/packages/app/package.json b/packages/app/package.json index f9f0091cc6..cd200c5982 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -19,6 +19,7 @@ "@emotion/styled": "^11.10.4", "@mui/base": "^5.0.0-alpha.87", "@mui/material": "^5.8.6", + "@mui/icons-material": "^5.10.9", "css-spring": "^4.1.0", "lit": "^2.3.1", "next": "12.3.1", diff --git a/packages/app/public/globals.css b/packages/app/public/globals.css index 62b1feadfd..7388399c01 100644 --- a/packages/app/public/globals.css +++ b/packages/app/public/globals.css @@ -145,7 +145,7 @@ button, select, keygen, legend { - color: var(--page-text-color); + color: var(--affine-text-color); outline: 0; font-size: 18px; line-height: 1.5; @@ -156,7 +156,7 @@ body { } a, a:hover { - color: var(--page-text-color); + color: var(--affine-link-color); } input { @@ -181,3 +181,11 @@ input[type='number']::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; } + +* { + scrollbar-width: none; /* Firefox */ + -ms-overflow-style: none; /* IE 10+ */ +} +::-webkit-scrollbar { + display: none; /* Chrome Safari */ +} diff --git a/packages/app/src/components/Header/icons.tsx b/packages/app/src/components/Header/icons.tsx index 9e27fc7875..6f9d5ebee1 100644 --- a/packages/app/src/components/Header/icons.tsx +++ b/packages/app/src/components/Header/icons.tsx @@ -22,46 +22,6 @@ export const LogoIcon = ({ style = {}, ...props }: IconProps) => { ); }; -export const MoonIcon = ({ style = {}, ...props }: IconProps) => { - return ( - - - - ); -}; - -export const SunIcon = ({ style = {}, ...props }: IconProps) => { - return ( - - - - ); -}; - export const MoreIcon = ({ style = {}, ...props }: IconProps) => { return ( { - const { changeMode, mode } = useTheme(); - - return ( - <> - {mode === 'dark' ? ( - { - changeMode('light'); - }} - > - ) : ( - { - changeMode('dark'); - }} - > - )} - - ); -}; +import ThemeModeSwitch from '@/components/theme-mode-switch'; +import ContactModal from '@/components/contact-modal'; const PopoverContent = () => { const { editor, mode, setMode } = useEditor(); @@ -74,6 +51,7 @@ const PopoverContent = () => { export const Header = () => { const [title, setTitle] = useState(''); const [isHover, setIsHover] = useState(false); + const [showContactModal, setShowContactModal] = useState(false); const { editor } = useEditor(); @@ -87,38 +65,48 @@ export const Header = () => { }, [editor]); return ( - - - {}} /> - - { - setIsHover(true); - }} - onMouseLeave={() => { - setIsHover(false); - }} - > - + setShowContactModal(false)} + /> + + + { + setShowContactModal(true); + }} + /> + + { + setIsHover(true); + }} + onMouseLeave={() => { + setIsHover(false); }} - /> - {title} - - - - - } - style={{ marginLeft: '20px' }} > - - - - - - + + {title} + + + + + } + style={{ marginLeft: '20px' }} + > + + + + + + + ); }; diff --git a/packages/app/src/components/Header/styles.ts b/packages/app/src/components/Header/styles.ts index 8162ca2eaa..16ac015e7a 100644 --- a/packages/app/src/components/Header/styles.ts +++ b/packages/app/src/components/Header/styles.ts @@ -33,14 +33,10 @@ export const StyledTitleWrapper = styled('div')({ position: 'relative', }); -export const StyledLogo = styled('div')({}); - -export const StyledModeSwitch = styled('div')({ - height: '100%', - display: 'flex', - alignItems: 'center', - marginRight: '12px', -}); +export const StyledLogo = styled('div')(({ theme }) => ({ + color: theme.colors.primaryColor, + cursor: 'pointer', +})); export const StyledHeaderRightSide = styled('div')({ height: '100%', @@ -48,27 +44,25 @@ export const StyledHeaderRightSide = styled('div')({ alignItems: 'center', }); -export const StyledMoreMenuItem = styled('div')({ - height: '32px', - display: 'flex', - alignItems: 'center', - borderRadius: '5px', - fontSize: '14px', - color: '#4C6275', - padding: '0 14px', - svg: { - fill: '#4C6275', - width: '16px', - height: '16px', - marginRight: '14px', - }, - ':hover': { - color: 'var(--affine-highlight-color)', - background: '#F1F3FF', +export const StyledMoreMenuItem = styled('div')(({ theme }) => { + return { + height: '32px', + display: 'flex', + alignItems: 'center', + borderRadius: '5px', + fontSize: '14px', + color: theme.colors.popoverColor, + padding: '0 14px', svg: { - fill: 'var(--affine-highlight-color)', + width: '16px', + height: '16px', + marginRight: '14px', }, - }, + ':hover': { + color: theme.colors.primaryColor, + background: theme.colors.hoverBackground, + }, + }; }); export const IconButton = styled('div')(({ theme }) => { @@ -78,12 +72,11 @@ export const IconButton = styled('div')(({ theme }) => { display: 'flex', justifyContent: 'center', alignItems: 'center', - color: theme.colors.disabled, - background: 'transparent', + color: theme.colors.iconColor, borderRadius: '5px', ':hover': { - color: theme.colors.highlight, - background: '#F1F3FF', + color: theme.colors.primaryColor, + background: theme.colors.hoverBackground, }, }; }); diff --git a/packages/app/src/components/contact-modal/affine-text-logo.png b/packages/app/src/components/contact-modal/affine-text-logo.png new file mode 100644 index 0000000000..a136ab17fa Binary files /dev/null and b/packages/app/src/components/contact-modal/affine-text-logo.png differ diff --git a/packages/app/src/components/contact-modal/icons.tsx b/packages/app/src/components/contact-modal/icons.tsx new file mode 100644 index 0000000000..d267dbe9c3 --- /dev/null +++ b/packages/app/src/components/contact-modal/icons.tsx @@ -0,0 +1,55 @@ +// export const CloseIcon = () => { +// return ( +// +// +// +// ); +// }; + +export const LogoIcon = () => { + return ( + + + + ); +}; + +export const DiscordIcon = (props: any) => { + return ( + + + + + + + + + + + ); +}; diff --git a/packages/app/src/components/contact-modal/index.tsx b/packages/app/src/components/contact-modal/index.tsx new file mode 100644 index 0000000000..2c2d75430d --- /dev/null +++ b/packages/app/src/components/contact-modal/index.tsx @@ -0,0 +1,141 @@ +import { createPortal } from 'react-dom'; +import Fade from '@mui/material/Fade'; +import GitHubIcon from '@mui/icons-material/GitHub'; +import RedditIcon from '@mui/icons-material/Reddit'; +import TelegramIcon from '@mui/icons-material/Telegram'; +import TwitterIcon from '@mui/icons-material/Twitter'; +import CloseIcon from '@mui/icons-material/Close'; + +import { LogoIcon, DiscordIcon } from './icons'; +import logo from './affine-text-logo.png'; +import { + StyledModalContainer, + StyledModalWrapper, + StyledYellowBall, + StyledBlueBall, + StyledBigLink, + StyledSmallLink, + StyledSubTitle, + StyledLeftContainer, + StyledRightContainer, + StyledContent, + StyledBackdrop, + StyledLogo, + StyledModalHeader, + StyledModalHeaderLeft, + CloseButton, + StyledModalFooter, +} from './style'; + +const linkList = [ + { + icon: , + title: 'Github', + link: 'https://github.com/toeverything/AFFiNE', + }, + { + icon: , + title: 'Reddit', + link: 'https://www.reddit.com/r/Affine/', + }, + { + icon: , + title: 'Twitter', + link: 'https://twitter.com/AffineOfficial', + }, + { + icon: , + title: 'Telegram', + link: 'https://t.me/affineworkos', + }, + { + icon: , + title: 'Discord', + link: 'https://discord.gg/Arn7TqJBvG', + }, +]; +const rightLinkList = [ + { + icon: , + title: 'Official Website AFFiNE.pro', + link: 'https://affine.pro', + }, + { + icon: , + title: 'Check Our Docs Open Source', + link: 'https://github.com/toeverything/AFFiNE', + }, +]; + +type TransitionsModalProps = { + open: boolean; + onClose: () => void; +}; + +export const ContactModal = ({ open, onClose }: TransitionsModalProps) => { + return createPortal( + + + + + + + + + + + 2.0 + live demo + + { + onClose(); + }} + > + + + + + + + {rightLinkList.map(({ icon, title, link }) => { + return ( + + {icon} + {title} + + ); + })} + + + + Get in touch!
+ Join our community. +
+ {linkList.map(({ icon, title, link }) => { + return ( + + {icon} + {title} + + ); + })} +
+
+ + +

+ + What is the different from the affine 1.0? + +

+

Copyright © 2022 Toeverything

+
+ + + , + document.body + ); +}; + +export default ContactModal; diff --git a/packages/app/src/components/contact-modal/style.ts b/packages/app/src/components/contact-modal/style.ts new file mode 100644 index 0000000000..1527fa6faa --- /dev/null +++ b/packages/app/src/components/contact-modal/style.ts @@ -0,0 +1,216 @@ +import { styled } from '@/styles'; + +export const StyledModalContainer = styled('div')(({ theme }) => { + return { + width: '100vw', + height: '100vh', + position: 'fixed', + left: '0', + top: '0', + zIndex: theme.zIndex.modal, + }; +}); + +export const StyledModalWrapper = styled('div')(({ theme }) => { + return { + width: '1000px', + height: '626px', + background: theme.colors.popoverBackground, + padding: '0 48px', + borderRadius: '20px', + position: 'absolute', + left: 0, + right: 0, + top: 0, + bottom: 0, + margin: 'auto', + }; +}); + +export const StyledYellowBall = styled('div')` + position: absolute; + top: 189px; + left: 186px; + display: block; + width: 122px; + height: 122px; + background-color: #dda82a; + opacity: 0.45; + filter: blur(78px); +`; +export const StyledBlueBall = styled('div')` + content: ''; + position: absolute; + top: 332px; + left: 296px; + display: block; + width: 122px; + height: 122px; + background-color: #4461f2; + filter: blur(78px); +`; + +export const StyledBigLink = styled('a')(({ theme }) => { + return { + width: '335px', + height: '110px', + marginBottom: '52px', + display: 'flex', + alignItems: 'center', + fontSize: '24px', + lineHeight: '36px', + padding: '0 24px', + fontWeight: '600', + color: theme.colors.textColor, + borderRadius: '10px', + + ':visited': { + color: theme.colors.textColor, + }, + ':hover': { + color: theme.colors.primaryColor, + background: theme.colors.hoverBackground, + }, + ':last-of-type': { + marginBottom: 0, + }, + svg: { + width: '50px', + height: '50px', + marginRight: '40px', + color: theme.colors.primaryColor, + }, + p: { + width: '197px', + height: '73px', + }, + }; +}); +export const StyledSmallLink = styled('a')(({ theme }) => { + return { + width: '214px', + height: '37px', + display: 'flex', + alignItems: 'center', + fontSize: '18px', + fontWeight: '500', + paddingLeft: '24px', + borderRadius: '5px', + color: theme.colors.textColor, + ':visited': { + color: theme.colors.textColor, + }, + ':hover': { + color: theme.colors.primaryColor, + background: theme.colors.hoverBackground, + }, + svg: { + width: '22px', + marginRight: '30px', + color: theme.colors.primaryColor, + }, + }; +}); +export const StyledSubTitle = styled('div')(({ theme }) => { + return { + width: '189px', + fontSize: '18px', + fontWeight: '600', + color: theme.colors.textColor, + marginBottom: '24px', + }; +}); + +export const StyledLeftContainer = styled('div')({ + // height: '100%', + display: 'flex', + flexDirection: 'column', + justifyContent: 'space-between', +}); +export const StyledRightContainer = styled('div')({ + display: 'flex', + flexDirection: 'column', + justifyContent: 'center', + alignItems: 'flex-end', +}); + +export const StyledContent = styled('div')({ + height: '276px', + width: '100%', + padding: '0 160px', + display: 'flex', + justifyContent: 'space-between', + alignItems: 'center', + color: '#3A4C5C', + marginTop: '100px', +}); + +export const StyledBackdrop = styled('div')(({ theme }) => { + return { width: '100%', height: '100%', background: 'rgba(58, 76, 92, 0.2)' }; +}); +export const StyledLogo = styled('img')({ + height: '22px', + width: 'auto', +}); + +export const StyledModalHeader = styled('div')(({ theme }) => { + return { + height: '30px', + marginTop: '54px', + padding: '0 48px', + display: 'flex', + alignItems: 'center', + justifyContent: 'space-between', + }; +}); + +export const StyledModalHeaderLeft = styled('div')(({ theme }) => { + return { + display: 'flex', + alignItems: 'center', + color: theme.colors.primaryColor, + + 'span:first-of-type': { + fontSize: '28px', + lineHeight: 1, + fontWeight: '600', + margin: '0 12px', + }, + 'span:last-of-type': { + height: '26px', + border: `1px solid ${theme.colors.primaryColor}`, + borderRadius: '10px', + padding: '0 10px', + lineHeight: '26px', + fontSize: '16px', + }, + }; +}); + +export const CloseButton = styled('div')(({ theme }) => { + return { + width: '24px', + height: '24px', + borderRadius: '5px', + color: theme.colors.iconColor, + cursor: 'pointer', + ':hover': { + background: theme.colors.hoverBackground, + }, + }; +}); + +export const StyledModalFooter = styled('div')(({ theme }) => { + return { + fontSize: '14px', + lineHeight: '20px', + textAlign: 'center', + color: theme.colors.textColor, + + marginTop: '75px', + 'p:first-of-type': { + color: theme.colors.primaryColor, + marginBottom: '10px', + }, + }; +}); diff --git a/packages/app/src/components/editor-mode-switch/index.tsx b/packages/app/src/components/editor-mode-switch/index.tsx index 9558abc756..94bc5c5204 100644 --- a/packages/app/src/components/editor-mode-switch/index.tsx +++ b/packages/app/src/components/editor-mode-switch/index.tsx @@ -1,7 +1,6 @@ import React, { useState, useEffect, cloneElement } from 'react'; import { StyledAnimateRadioContainer, - StyledRadioMiddle, StyledMiddleLine, StyledRadioItem, StyledLabel, @@ -19,21 +18,21 @@ import { useEditor } from '@/components/editor-provider'; const PaperItem = ({ active }: { active?: boolean }) => { const { theme: { - colors: { highlight, disabled }, + colors: { iconColor, primaryColor }, }, } = useTheme(); - return ; + return ; }; const EdgelessItem = ({ active }: { active?: boolean }) => { const { theme: { - colors: { highlight, disabled }, + colors: { iconColor, primaryColor }, }, } = useTheme(); - return ; + return ; }; const AnimateRadioItem = ({ @@ -57,24 +56,11 @@ const AnimateRadioItem = ({ ); }; -const RadioMiddle = ({ - isHover, - direction, -}: { - isHover: boolean; - direction: 'left' | 'right' | 'middle'; -}) => { - return ( - - ); -}; - export const EditorModeSwitch = ({ isHover, style = {}, }: AnimateRadioProps) => { + const { mode: themeMode } = useTheme(); const { mode, setMode } = useEditor(); const modifyRadioItemStatus = (): RadioItemStatus => { return { @@ -124,7 +110,7 @@ export const EditorModeSwitch = ({ setRadioItemStatus(modifyRadioItemStatus()); }} /> -