Skip to content

Commit 3a6120d

Browse files
committed
feat: banner调整
1 parent 8dd9633 commit 3a6120d

File tree

6 files changed

+57
-33
lines changed

6 files changed

+57
-33
lines changed

components/navbar/styles.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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);
77
border-bottom: 1px solid var(--semi-color-border);
88
width: 100%;

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)