import * as React from 'react'; import { Button, Flex, Typography } from 'antd'; import { createStyles, css, useTheme } from 'antd-style'; import classNames from 'classnames'; import { Link, useLocation } from 'dumi'; import useLocale from '../../../hooks/useLocale'; import SiteContext from '../../../theme/slots/SiteContext'; import * as utils from '../../../theme/utils'; import GroupMaskLayer from './GroupMaskLayer'; const locales = { cn: { slogan: '助力设计开发者「更灵活」地搭建出「更美」的产品,让用户「快乐工作」~', start: '开始使用', designLanguage: '设计语言', }, en: { slogan: 'Help designers/developers building beautiful products more flexible and working with happiness', start: 'Getting Started', designLanguage: 'Design Language', }, }; const useStyle = () => { const { isMobile } = React.useContext(SiteContext); return createStyles(({ token }) => ({ titleBase: css` h1& { font-family: AliPuHui, ${token.fontFamily}; } `, title: isMobile ? css` h1& { margin-bottom: ${token.margin}px; font-weight: normal; font-size: ${token.fontSizeHeading1 + 2}px; line-height: ${token.lineHeightHeading2}; } ` : css` h1& { margin-bottom: ${token.marginMD}px; font-weight: 900; font-size: 68px; } `, btnWrap: css` margin-bottom: ${token.marginXL}px; `, layer: css` text-align: center; padding-top: ${token.marginFar - 16}px; padding-bottom: ${token.marginFarSM}px; `, mobileBg: css` width: 100%; `, videoWrap: css` height: 320px; background-color: #77c6ff; display: flex; flex-wrap: nowrap; justify-content: center; `, video: css` height: 100%; object-fit: contain; `, bg: css` flex: auto; background-repeat: repeat-x; background-size: auto 100%; `, bg1: css` background-image: url(https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*6d50SboraPIAAAAAAAAAAAAAARQnAQ); background-position: 100% 0; `, bg2: css` background-image: url(https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*8ILtRrQlVDMAAAAAAAAAAAAAARQnAQ); background-position: 0 0; margin-inline-start: -1px; `, }))(); }; const Banner: React.FC = ({ children }) => { const [locale] = useLocale(locales); const { pathname, search } = useLocation(); const token = useTheme(); const { styles } = useStyle(); const { isMobile } = React.useContext(SiteContext); const isZhCN = utils.isZhCN(pathname); return ( <> {/* Banner Placeholder Motion */} {isMobile ? ( ) : (
)} {/* Logo */}
{/* Image Bottom Right */} Ant Design {/* Image Left Top */} bg {/* Image Right Top */} bg Ant Design 5.0
{locale.slogan}
{children}
); }; export default Banner;