Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

Hero.tsx 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. import { Button, Typography } from '@mui/material';
  2. import { Box } from '@mui/system';
  3. import { useTranslation } from 'next-i18next';
  4. import Image from 'next/image';
  5. import { useRouter } from 'next/router';
  6. import { PRODUCTS_PAGE } from '../../constants/pages';
  7. const Hero: React.FC = () => {
  8. const { t } = useTranslation('home');
  9. const router = useRouter();
  10. return (
  11. <>
  12. <Box
  13. sx={{
  14. display: 'flex',
  15. flexDirection: { xs: 'column', md: 'row' },
  16. width: '100%',
  17. height: { xs: '100vh', md: '1024px' },
  18. }}
  19. >
  20. <Box
  21. sx={{
  22. minWidth: '50%',
  23. width: { xs: '100%', md: '50%' },
  24. height: '100%',
  25. display: 'flex',
  26. flexDirection: 'column',
  27. justifyContent: { xs: 'space-around', md: 'center' },
  28. backgroundColor: 'primary.light',
  29. }}
  30. >
  31. <Box display="flex" flexDirection="column">
  32. <Typography
  33. variant="h1"
  34. sx={{
  35. fontSize: { xs: '96px', md: '64px', lg: '96px' },
  36. ml: 10,
  37. color: 'white',
  38. fontFamily: ['Indie Flower', 'cursive'].join(','),
  39. }}
  40. >
  41. {t('home:mainTitle1')}
  42. </Typography>
  43. <Typography
  44. variant="h1"
  45. sx={{
  46. fontSize: { xs: '96px', md: '64px', lg: '96px' },
  47. ml: 10,
  48. color: 'white',
  49. fontFamily: ['Indie Flower', 'cursive'].join(','),
  50. }}
  51. >
  52. {t('home:mainTitle2')}
  53. </Typography>
  54. </Box>
  55. <Typography
  56. display="flex"
  57. justifyItems="center"
  58. sx={{
  59. fontSize: { xs: '22px', md: '18px' },
  60. ml: 10,
  61. mt: { md: '50px' },
  62. color: 'white',
  63. pr: '20%',
  64. }}
  65. >
  66. {t('home:description')}
  67. </Typography>
  68. <Box
  69. sx={{
  70. mt: { md: '50px' },
  71. width: '100%',
  72. display: 'flex',
  73. flexDirection: { xs: 'column', sm: 'row' },
  74. ml: { md: 10 },
  75. justifyContent: { sm: 'space-evenly', md: 'flex-start' },
  76. alignItems: { xs: 'center' },
  77. }}
  78. >
  79. <Button
  80. disableRipple
  81. sx={{
  82. backgroundColor: '#CBA213',
  83. mr: { md: 4 },
  84. height: 50,
  85. width: 150,
  86. textTransform: 'none',
  87. color: 'white',
  88. }}
  89. onClick={() => router.push(PRODUCTS_PAGE)}
  90. >
  91. {t('home:exploreBtn')}
  92. </Button>
  93. <Button
  94. disableRipple
  95. sx={{
  96. display: { xs: 'none', sm: 'flex' },
  97. textTransform: 'none',
  98. color: 'white',
  99. }}
  100. startIcon={
  101. <Image
  102. src="/images/Play.svg"
  103. alt="profile"
  104. width={50}
  105. height={50}
  106. />
  107. }
  108. >
  109. {t('home:howTo')}
  110. </Button>
  111. </Box>
  112. </Box>
  113. <Box
  114. sx={{
  115. display: { xs: 'none', md: 'flex' },
  116. backgroundColor: 'white',
  117. }}
  118. >
  119. <Box
  120. sx={{ ml: { md: -12 } }}
  121. display="flex"
  122. justifyContent="center"
  123. alignItems="center"
  124. >
  125. <Image
  126. src="/images/Hero-Image.png"
  127. alt="profile"
  128. width={818}
  129. height={796}
  130. priority
  131. />
  132. </Box>
  133. </Box>
  134. </Box>
  135. </>
  136. );
  137. };
  138. export default Hero;