Skip to content

Commit c9bae69

Browse files
authored
Merge pull request #8 from IoTSharp/feature/V1.0.0
Feature/v1.0.0
2 parents cd500c4 + 3a6120d commit c9bae69

File tree

7 files changed

+81
-39
lines changed

7 files changed

+81
-39
lines changed

components/navbar/index.tsx

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
1-
import {FC, useContext, useEffect} from "react";
1+
import {FC, useContext, useState} from "react";
22
import styles from "./styles.module.scss";
33
import Image from "next/image";
44
import logoIcon from "@/public/logo-icon.svg";
55
import logoTextDark from "@/public/logo-text-dark.svg";
66
import logoText from "@/public/logo-text.svg";
77
import {ThemeContext} from "@/stores/theme";
8-
import {IconGithubLogo, IconMoon, IconSun} from '@douyinfe/semi-icons';
8+
import { Tooltip, SideSheet } from '@douyinfe/semi-ui';
9+
import {IconGithubLogo, IconMoon, IconSun, IconBox} from '@douyinfe/semi-icons';
910
import {Themes} from "@/constants/enum";
1011

1112
export interface INavBarProps {
1213
}
1314

1415
const NavBar: FC<INavBarProps> = ({}) => {
16+
const [visible, setVisible] = useState<boolean>(false);
1517
const {setTheme, theme} = useContext(ThemeContext);
1618
const icon = theme === Themes.light ? logoTextDark : logoText;
1719
const iconTheme = theme === Themes.light ? <IconMoon size="extra-large"/> : <IconSun size="extra-large"/>;
20+
const onChange = () => {
21+
setVisible(!visible);
22+
};
1823
return (
1924
<div className={styles.navBar}>
2025
<a href="https://iotsharp.io/">
@@ -32,7 +37,14 @@ const NavBar: FC<INavBarProps> = ({}) => {
3237
}
3338
}}
3439
>
35-
{iconTheme}
40+
<Tooltip position="bottom" content={Themes.light ? '切换到暗色模式' : '切换到亮色模式'}>
41+
{iconTheme}
42+
</Tooltip>
43+
</div>
44+
<div className={styles.icon} onClick={onChange}>
45+
<Tooltip position="bottom" content="查看安装包">
46+
<IconBox size="extra-large"/>
47+
</Tooltip>
3648
</div>
3749
<div className={styles.icon} onClick={(): void => {
3850
window.open(
@@ -41,9 +53,14 @@ const NavBar: FC<INavBarProps> = ({}) => {
4153
"noopener=yes,noreferrer=yes"
4254
);
4355
}}>
44-
<IconGithubLogo size="extra-large"/>
56+
<Tooltip position="bottom" content="查看Github">
57+
<IconGithubLogo size="extra-large"/>
58+
</Tooltip>
4559
</div>
4660
</div>
61+
<SideSheet title="安装包" visible={visible} onCancel={onChange} placement="right">
62+
<p>Here is more content...</p>
63+
</SideSheet>
4764
</div>
4865
);
4966
};

components/navbar/styles.module.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,21 @@
22
display: flex;
33
align-items: center;
44
justify-content: space-between;
5-
background-color: hsla(0,0%,100%,.5);
5+
background-color: var(--navbar-background-color);
66
backdrop-filter: blur(0.5rem);
7+
border-bottom: 1px solid var(--semi-color-border);
78
width: 100%;
89
height: 4rem;
910
position: sticky;
1011
top: 0;
1112
left: 0;
12-
padding: 1.25rem 8rem;
13+
padding: 1.25rem 2rem;
1314
z-index: 100;
1415
box-sizing: border-box;
1516

1617
.icon {
1718
cursor: pointer;
18-
margin-left: 1rem;
19+
margin-left: 1.8rem;
1920
}
2021

2122
a {

pages/components/banner/index.tsx

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
import {FC, useContext, useEffect, useRef} from "react";
22
import styles from "./styles.module.scss";
33
import {Col, Row} from '@douyinfe/semi-ui';
4-
import Image from "next/image";
54
import cName from "classnames";
6-
import bannerIcon from "@/public/banner.svg";
7-
import IoTIcon from "@/public/iot.svg";
8-
import logoText from "@/public/logo-text.svg";
95
import {ThemeContext} from "@/stores/theme";
106

117
export interface IBannerProps {}
128

139
const Banner: FC<IBannerProps> = ({}) => {
1410
const mainRef = useRef<HTMLDivElement>(null);
1511
const {theme} = useContext(ThemeContext);
16-
1712
useEffect(() => {
1813
mainRef.current?.classList.remove(styles.withAnimation);
1914
window.requestAnimationFrame(() => {
@@ -23,12 +18,10 @@ const Banner: FC<IBannerProps> = ({}) => {
2318
return (
2419
<div className={cName([styles.banner, styles.withAnimation])} ref={mainRef}>
2520
<Row type="flex" align="middle">
26-
<Col xs={24} sm={24} md={24} lg={14} xl={14}>
21+
<Col xs={24} sm={24} md={24} lg={8} xl={8}>
2722
<div className={styles.container}>
28-
<div className={styles.subTitle}><Image src={IoTIcon} alt="" width={30} height={30}/>Internet of Things</div>
29-
<div className={styles.title}><Image src={logoText} alt="" width={260} height={60}/></div>
30-
<div className={styles.label}>基于.Net 6.0、C# 的开源IoT平台</div>
31-
<div className={styles.description}>设备管理与数据收集、处理、可视化的解决方案</div>
23+
<div className={styles.title}>连接物理设备与数字世界</div>
24+
<div className={styles.description}>基于.Net 6.0 使用C#开发的数据采集、数据清洗、数据可视化与设备资产管理的开源物联网(IoT)基础服务平台。</div>
3225
<div className={styles.button} onClick={(): void => {
3326
window.open(
3427
"https://docs.iotsharp.net/",
@@ -39,8 +32,11 @@ const Banner: FC<IBannerProps> = ({}) => {
3932
</div>
4033
</div>
4134
</Col>
42-
<Col xs={24} sm={24} md={24} lg={10} xl={10}>
43-
<Image src={bannerIcon} alt="" width={400} height={400} className={styles.icon}/>
35+
<Col xs={24} sm={24} md={24} lg={14} xl={14} offset={2}>
36+
<div className={styles.bannerImage}>
37+
<div className={styles.background} />
38+
<div className={styles.icon}/>
39+
</div>
4440
</Col>
4541
</Row>
4642
</div>

pages/components/banner/styles.module.scss

Lines changed: 46 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -124,49 +124,41 @@
124124

125125
.banner {
126126
width: 100%;
127-
padding: 12rem 8rem;
128-
background: url("/img.png");
129-
background-size: 100% 100%;
127+
padding: 10rem 8rem;
128+
overflow: hidden;
129+
border-bottom: 1px solid var(--semi-color-border);
130130
:global {
131131
.semi-row-flex {
132132
height: 100%;
133133
}
134134
}
135135
.icon {
136-
width: 100%;
136+
width: 920px;
137+
position: relative;
138+
border-radius: 8px;
139+
height: 32.5rem!important;
140+
border-bottom: 1px solid var(--semi-color-border);
141+
background-image: var(--banner-icon);
142+
background-size: 100% 100%;
137143
}
138144
.container {
139145
display: flex;
140146
flex-direction: column;
141-
.subTitle {
142-
font-size: 1.25rem;
143-
margin-bottom: .7rem;
144-
display: flex;
145-
align-items: center;
146-
color: #ffffff;
147-
img {
148-
margin-right: .313rem;
149-
}
150-
}
151147

152148
.title {
153149
font-weight: 700;
154-
font-size: 3rem;
150+
font-size: 2.8rem;
155151
line-height: 4rem;
156-
color: #fdfeff;
157152
}
158153

159154
.label {
160-
font-weight: 500;
161155
font-size: 1.8rem;
162156
line-height: 2rem;
163-
color: #fdfeff;
164157
}
165158

166159
.description {
167160
font-size: 1.25rem;
168161
line-height: 2rem;
169-
color: #fdfeff;
170162
margin-top: 1.6rem;
171163
}
172164

@@ -184,7 +176,41 @@
184176
cursor: pointer;
185177
border: 2px solid var(--yellow-color);
186178
background-color: var(--yellow-color);
187-
margin-top: 2rem;
179+
margin-top: 4rem;
180+
}
181+
}
182+
.bannerImage {
183+
position: relative;
184+
width: 100%;
185+
padding-top: 20px;
186+
padding-left: 50px;
187+
}
188+
.background {
189+
position: absolute;
190+
width: 640px;
191+
height: 640px;
192+
left: -50px;
193+
top: -20px;
194+
-webkit-filter: blur(120px);
195+
filter: blur(120px);
196+
opacity: .6;
197+
&:before {
198+
content: "";
199+
position: absolute;
200+
width: 474px;
201+
height: 474px;
202+
border-radius: 50%;
203+
top: 132px;
204+
background-color: rgb(var(--semi-purple-5));
205+
}
206+
&:after {
207+
content: "";
208+
position: absolute;
209+
width: 474px;
210+
height: 474px;
211+
border-radius: 50%;
212+
left: 166px;
213+
background-color: rgb(var(--semi-indigo-5));
188214
}
189215
}
190216
}

pages/global.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ html[data-theme="dark"] {
1818
--secondary-font-color-1: #9e9e9f;
1919
--popup-content-background-color: #1f1f1f;
2020
--box-shadow: rgba(255, 255, 255, 0.8);
21+
--banner-icon: url("../public/banner_dark.png");
2122
--home-background-icon: url("../public/home_bg_dark.png");
2223
--home-background-icon-webp: url("../public/home_bg_dark.webp");
2324
}
@@ -36,6 +37,7 @@ html[data-theme="light"] {
3637
--semi-page-hover-background-color: rgb(244, 245, 245);
3738
--navbar-icon: url("../public/logo-text-dark.svg");
3839
--theme-icon: url("../public/theme_light.png");
40+
--banner-icon: url("../public/banner_light.png");
3941
--popup-close-icon: url("../public/close_light.png");
4042
--popup-close-hover-background-color: #f5f5f5;
4143
--secondary-font-color-1: #333333;

public/banner_dark.png

257 KB
Loading

public/banner_light.png

259 KB
Loading

0 commit comments

Comments
 (0)