|
1 | 1 | import {FC, useContext} from "react"; |
| 2 | +import Image from "next/image"; |
2 | 3 | import {Carousel} from '@douyinfe/semi-ui'; |
3 | 4 | import TenantImage from '@/public/img_9.png'; |
4 | | -import TenantImageDark from '@/public/img_10.png'; |
5 | 5 | import RuleImage from '@/public/img_6.png'; |
6 | | -import RuleImageDark from '@/public/img_12.png'; |
7 | 6 | import ResourceImage from '@/public/img_8.png'; |
8 | | -import ResourceImageDark from '@/public/img_13.png'; |
9 | 7 | import DeviceImage from '@/public/img_5.png'; |
10 | | -import DeviceImageDark from '@/public/img_11.png'; |
11 | 8 | import ProductImage from '@/public/img_7.png'; |
12 | | -import ProductImageDark from '@/public/img_14.png'; |
13 | 9 | import styles from "./styles.module.scss"; |
14 | 10 | import {ThemeContext} from "@/stores/theme"; |
15 | | -import {Themes} from "@/constants/enum"; |
16 | 11 |
|
17 | 12 | export interface IPlatformProps { |
18 | 13 | } |
19 | 14 |
|
20 | 15 | const Platform: FC<IPlatformProps> = ({}) => { |
21 | 16 | const {theme} = useContext(ThemeContext); |
22 | 17 | const Options = [{ |
23 | | - image: theme === Themes.light ? TenantImage : TenantImageDark, |
| 18 | + image: TenantImage, |
| 19 | + background: 'rgb(230, 232, 234)', |
24 | 20 | title: '多租户', |
25 | 21 | description: '通过多租户,充分的利用系统资源为多个客户提供服务并确保数据彻底隔离。' |
26 | 22 | }, { |
27 | | - image: theme === Themes.light ? DeviceImage : DeviceImageDark, |
| 23 | + image: DeviceImage, |
| 24 | + background: 'rgb(239, 202, 240)', |
28 | 25 | title: '数字孪生', |
29 | 26 | description: '通过数字孪生使得设备的属性数据、遥测数据、数据清洗、告警更容易管理和使用' |
30 | 27 | }, { |
31 | | - image: theme === Themes.light ? RuleImage : RuleImageDark, |
| 28 | + image: RuleImage, |
| 29 | + background: 'rgb(226, 209, 244)', |
32 | 30 | title: '规则链引擎', |
33 | 31 | description: '通过规则链引擎利用多种语言脚本来扩展你对数据的分析和处理。' |
34 | 32 | }, { |
35 | | - image: theme === Themes.light ? ResourceImage : ResourceImageDark, |
| 33 | + image: ResourceImage, |
| 34 | + background: 'rgb(209, 216, 240)', |
36 | 35 | title: '资产管理', |
37 | 36 | description: '使用多个设备及其属性和遥测可抽象为资产更利于管理设备和数据分析。' |
38 | 37 | }, |
39 | 38 | { |
40 | | - image: theme === Themes.light ? ProductImage : ProductImageDark, |
| 39 | + image: ProductImage, |
41 | 40 | title: '产品管理', |
| 41 | + background: 'rgb(203, 231, 254)', |
42 | 42 | description: '为设备或者网关提供简洁有效的数据模板、字典、认证、素材组织能力。' |
43 | 43 | }] |
44 | 44 | const style = { |
45 | 45 | width: '100%', |
46 | | - height: '400px', |
| 46 | + height: '916px', |
47 | 47 | }; |
48 | 48 | return ( |
49 | 49 | <div className={styles.platformContainer}> |
50 | 50 | <p className={styles.title}>打造现代 Web 应用</p> |
51 | 51 | <p className={styles.subTitle}>与现代操作系统、浏览器更贴近的设计语言</p> |
52 | | - <Carousel style={style} speed={1000} animation='fade' theme='dark' autoPlay={false} showIndicator={false}> |
| 52 | + <Carousel showIndicator={false} style={style} speed={1000} animation='fade' theme='dark'> |
53 | 53 | { |
54 | 54 | Options.map((option, index) => { |
55 | 55 | return ( |
56 | | - <> |
57 | | - <div key={index} style={{backgroundSize: 'cover', backgroundImage: `url(${option.image})`}}/> |
58 | | - <div> |
59 | | - <div>{option.title}</div> |
60 | | - <div>{option.description}</div> |
| 56 | + <div> |
| 57 | + <div className={styles.imgWrapper} style={{backgroundColor: option.background}}> |
| 58 | + <Image src={option.image as unknown as string} unoptimized={true} |
| 59 | + priority={true} |
| 60 | + layout="fill" |
| 61 | + quality={100} |
| 62 | + alt="" /> |
61 | 63 | </div> |
62 | | - </> |
| 64 | + <div className={styles.imgInfo}> |
| 65 | + <div className={styles.logo}>{option.title}</div> |
| 66 | + <div className={styles.imgInfoText}>{option.description}</div> |
| 67 | + </div> |
| 68 | + </div> |
63 | 69 | ); |
64 | 70 | }) |
65 | 71 | } |
|
0 commit comments