|
| 1 | +import React, { useEffect, useState } from 'react'; |
| 2 | +import { |
| 3 | + Container, |
| 4 | + Title, |
| 5 | + Text, |
| 6 | + Button, |
| 7 | + Group, |
| 8 | + useMantineTheme, |
| 9 | + Transition, |
| 10 | +} from '@mantine/core'; |
| 11 | +import { IconArrowRight, IconChevronDown } from '@tabler/icons-react'; |
| 12 | +import v2BannerImg from '../../public/assets/sei-v2-banner.jpg'; |
| 13 | + |
| 14 | +const SeiIntro: React.FC = () => { |
| 15 | + const theme = useMantineTheme(); |
| 16 | + const [mounted, setMounted] = useState(false); |
| 17 | + |
| 18 | + useEffect(() => { |
| 19 | + setMounted(true); |
| 20 | + }, []); |
| 21 | + |
| 22 | + // Styles |
| 23 | + const heroStyles = { |
| 24 | + position: 'relative' as const, |
| 25 | + height: '80vh', |
| 26 | + backgroundImage: `url(${v2BannerImg.src})`, |
| 27 | + backgroundSize: 'cover', |
| 28 | + backgroundPosition: 'center', |
| 29 | + backgroundAttachment: 'fixed', |
| 30 | + display: 'flex', |
| 31 | + alignItems: 'center', |
| 32 | + justifyContent: 'center', |
| 33 | + color: theme.white, |
| 34 | + textShadow: '0 2px 4px rgba(0, 0, 0, 0.6)', |
| 35 | + overflow: 'hidden', |
| 36 | + }; |
| 37 | + |
| 38 | + const overlayStyles = { |
| 39 | + position: 'absolute' as const, |
| 40 | + inset: 0, |
| 41 | + backgroundColor: 'rgba(0, 0, 0, 0.5)', |
| 42 | + }; |
| 43 | + |
| 44 | + const contentStyles = { |
| 45 | + position: 'relative' as const, |
| 46 | + zIndex: 1, |
| 47 | + maxWidth: '800px', |
| 48 | + margin: '0 auto', |
| 49 | + padding: `${theme.spacing.lg}px ${theme.spacing.md}px`, |
| 50 | + textAlign: 'center' as const, |
| 51 | + fontFamily: 'Satoshi, sans-serif', |
| 52 | + }; |
| 53 | + |
| 54 | + const titleStyles = { |
| 55 | + fontSize: '3.5rem', |
| 56 | + fontWeight: 500, |
| 57 | + marginBottom: theme.spacing.md, |
| 58 | + lineHeight: 1.1, |
| 59 | + color: '#ECEDEE', |
| 60 | + }; |
| 61 | + |
| 62 | + const subtitleStyles = { |
| 63 | + fontSize: '1.25rem', |
| 64 | + marginBottom: theme.spacing.md, |
| 65 | + lineHeight: 1.5, |
| 66 | + color: '#ECEDEE', |
| 67 | + fontWeight: 500, |
| 68 | + }; |
| 69 | + |
| 70 | + const buttonsStyles = { |
| 71 | + marginTop: theme.spacing.md, |
| 72 | + justifyContent: 'center', |
| 73 | + }; |
| 74 | + |
| 75 | + const buttonStyles = { |
| 76 | + height: '2.5rem', |
| 77 | + padding: '0 1.5rem', |
| 78 | + fontSize: '0.9rem', |
| 79 | + fontFamily: 'Satoshi, sans-serif', |
| 80 | + fontWeight: 500, |
| 81 | + display: 'flex', |
| 82 | + alignItems: 'center', |
| 83 | + gap: '0.5rem', |
| 84 | + }; |
| 85 | + |
| 86 | + const scrollIndicatorContainerStyles = { |
| 87 | + position: 'absolute' as const, |
| 88 | + bottom: theme.spacing.lg, |
| 89 | + left: '50%', |
| 90 | + transform: 'translateX(-50%)', |
| 91 | + textAlign: 'center' as const, |
| 92 | + zIndex: 1, |
| 93 | + }; |
| 94 | + |
| 95 | + const scrollTextStyles = { |
| 96 | + color: '#ECEDEE', |
| 97 | + fontFamily: 'Satoshi, sans-serif', |
| 98 | + fontSize: '1rem', |
| 99 | + marginBottom: theme.spacing.xs, |
| 100 | + }; |
| 101 | + |
| 102 | + const scrollIconStyles = { |
| 103 | + animation: 'bounce 2s infinite', |
| 104 | + color: '#ECEDEE', |
| 105 | + }; |
| 106 | + |
| 107 | + const bounceAnimation = ` |
| 108 | + @keyframes bounce { |
| 109 | + 0%, 20%, 50%, 80%, 100% { |
| 110 | + transform: translateY(0); |
| 111 | + } |
| 112 | + 40% { |
| 113 | + transform: translateY(-10px); |
| 114 | + } |
| 115 | + 60% { |
| 116 | + transform: translateY(-5px); |
| 117 | + } |
| 118 | + } |
| 119 | + `; |
| 120 | + |
| 121 | + const keyframesStyle = <style>{bounceAnimation}</style>; |
| 122 | + |
| 123 | + return ( |
| 124 | + <section style={heroStyles}> |
| 125 | + {keyframesStyle} |
| 126 | + <div style={overlayStyles} /> |
| 127 | + <Transition |
| 128 | + mounted={mounted} |
| 129 | + transition="fade" |
| 130 | + duration={800} |
| 131 | + timingFunction="ease" |
| 132 | + > |
| 133 | + {(styles) => ( |
| 134 | + <div style={{ ...contentStyles, ...styles }}> |
| 135 | + <Title style={titleStyles}>Welcome to Sei Network</Title> |
| 136 | + <Text style={subtitleStyles}> |
| 137 | + The first parallelized EVM blockchain delivering unmatched |
| 138 | + scalability with a developer-focused approach. |
| 139 | + </Text> |
| 140 | + <Group style={buttonsStyles}> |
| 141 | + <Button |
| 142 | + variant="gradient" |
| 143 | + gradient={{ from: '#9E1F19', to: '#780000', deg: 135 }} |
| 144 | + size="md" |
| 145 | + style={buttonStyles} |
| 146 | + component="a" |
| 147 | + href="/users/user-quickstart" |
| 148 | + > |
| 149 | + Get Started <IconArrowRight size={18} /> |
| 150 | + </Button> |
| 151 | + <Button |
| 152 | + variant="outline" |
| 153 | + color="light" |
| 154 | + size="md" |
| 155 | + style={{ |
| 156 | + ...buttonStyles, |
| 157 | + borderColor: '#ECEDEE', |
| 158 | + color: '#ECEDEE', |
| 159 | + }} |
| 160 | + component="a" |
| 161 | + href="/learn/general-overview" |
| 162 | + > |
| 163 | + Learn More |
| 164 | + </Button> |
| 165 | + </Group> |
| 166 | + </div> |
| 167 | + )} |
| 168 | + </Transition> |
| 169 | + <div style={scrollIndicatorContainerStyles}> |
| 170 | + <Text style={scrollTextStyles}>Find your starting point</Text> |
| 171 | + <IconChevronDown |
| 172 | + size={32} |
| 173 | + style={scrollIconStyles} |
| 174 | + aria-hidden="true" |
| 175 | + /> |
| 176 | + </div> |
| 177 | + </section> |
| 178 | + ); |
| 179 | +}; |
| 180 | + |
| 181 | +export default SeiIntro; |
0 commit comments