fix home page

This commit is contained in:
Aifeilong 2023-11-01 13:13:53 +08:00
parent 2258496fd7
commit 69f94827ac
9 changed files with 87 additions and 34 deletions

BIN
src/assets/三极联动.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 480 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 516 KiB

BIN
src/assets/数据共享.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 MiB

BIN
src/assets/方法库.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 KiB

BIN
src/assets/方法库2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 KiB

View File

@ -1,6 +1,12 @@
import { Fragment } from "react"; import { Fragment } from "react";
import { Dropdown } from "antd"; import { Dropdown } from "antd";
import NavBarButton from "./NavBarButton"; import NavBarButton from "./NavBarButton";
import funcLibrary from "@/assets/方法库.png";
// import funcLibrary from "@/assets/2.png";
import threePoles from "@/assets/三极联动.png";
import dataShare from "@/assets/数据共享.jpg";
import onlineDecisionSupport from "@/assets/在线决策支持.png";
// import onlineDecisionSupport from "@/assets/线2.png";
import styles from "./index.module.less"; import styles from "./index.module.less";
const itemsTwo = [ const itemsTwo = [
@ -109,31 +115,35 @@ function NavBar() {
<Fragment> <Fragment>
<div className="nav-bar-first"> <div className="nav-bar-first">
<NavBarButton <NavBarButton
text={"数据集成和共享"} text={"三极地数据集成与开放共享"}
onClick={() => onClick={() =>
navigateHandler("http://casearthpoles.tpdc.ac.cn/zh-hans/") navigateHandler("http://casearthpoles.tpdc.ac.cn/zh-hans/")
} }
imgSrc={dataShare}
/> />
<Dropdown <Dropdown
menu={{ items: itemsTwo }} menu={{ items: itemsTwo }}
trigger={["click"]} trigger={["click"]}
overlayClassName={styles.navDropdown} overlayClassName={styles.navDropdown}
> >
<NavBarButton text={"方法库集成与在线计算"} /> <NavBarButton text={"方法库集成与在线计算"} imgSrc={funcLibrary} />
</Dropdown> </Dropdown>
<Dropdown <Dropdown
menu={{ items: itemsThree }} menu={{ items: itemsThree }}
trigger={["click"]} trigger={["click"]}
overlayClassName={styles.navDropdown} overlayClassName={styles.navDropdown}
> >
<NavBarButton text={"在线决策支持服务"} /> <NavBarButton
text={"三极信息服务与决策支持"}
imgSrc={onlineDecisionSupport}
/>
</Dropdown> </Dropdown>
<Dropdown <Dropdown
menu={{ items: itemsFour }} menu={{ items: itemsFour }}
trigger={["click"]} trigger={["click"]}
overlayClassName={styles.navDropdown} overlayClassName={styles.navDropdown}
> >
<NavBarButton text={"三极联动"} /> <NavBarButton text={"三极联动科学发现"} imgSrc={threePoles} />
</Dropdown> </Dropdown>
</div> </div>
</Fragment> </Fragment>

View File

@ -1,15 +1,16 @@
function NavBarButton({ text, onClick }) { function NavBarButton({ text, onClick, imgSrc }) {
return ( return (
<div className="nav-bar-button" onClick={onClick}> <div className="xx">
<div className="btn-table left-top" /> <div className="nav-bar-button" onClick={onClick}>
<div className="btn-table right-top" /> <div className="btn-table left-top" />
<div className="btn-table left-bottom" /> <div className="btn-table right-top" />
<div className="btn-table right-bottom" /> <div className="btn-table left-bottom" />
<div className="nav-bar-content"> <div className="btn-table right-bottom" />
<div className="nav-bar-content-text"> <div className="nav-bar-content">
{text} <div className="nav-bar-content-img">
{/* <div>{text.split("-")[0]}</div> <img src={imgSrc} alt="img" />
<div>{text.split("-")[1]}</div> */} </div>
<div className="nav-bar-content-text">{text}</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -20,47 +20,51 @@
.nav-bar-first { .nav-bar-first {
width: 100%; width: 100%;
max-width: 1200px; max-width: 1200px;
margin: 250px auto 0; margin: 50px auto 0;
color: #fff; color: #fff;
display: flex; display: grid;
justify-content: space-between; grid-template-columns: 1fr 1fr;
justify-items: center;
grid-gap: 20px;
.nav-bar-button { .nav-bar-button {
width: 450px;
position: relative; position: relative;
cursor: pointer; @btn-table-color: #04fdfdbd;
@btn-table-color: #04fbfd;
transition: all 0.3s ease; transition: all 0.3s ease;
text-align: center; text-align: center;
user-select: none;
cursor: pointer;
.btn-table { .btn-table {
width: 20px; width: 20%;
height: 10px; height: 20%;
position: absolute; position: absolute;
background-color: transparent; background-color: transparent;
&.left-top { &.left-top {
left: 0; left: 0;
top: 0; top: 0;
border-left: 1px solid @btn-table-color; border-left: 2px solid @btn-table-color;
border-top: 1px solid @btn-table-color; border-top: 2px solid @btn-table-color;
} }
&.left-bottom { &.left-bottom {
left: 0; left: 0;
bottom: 0; bottom: 0;
border-left: 1px solid @btn-table-color; border-left: 2px solid @btn-table-color;
border-bottom: 1px solid @btn-table-color; border-bottom: 2px solid @btn-table-color;
} }
&.right-top { &.right-top {
right: 0; right: 0;
top: 0; top: 0;
border-right: 1px solid @btn-table-color; border-right: 2px solid @btn-table-color;
border-top: 1px solid @btn-table-color; border-top: 2px solid @btn-table-color;
} }
&.right-bottom { &.right-bottom {
right: 0; right: 0;
bottom: 0; bottom: 0;
border-right: 1px solid @btn-table-color; border-right: 2px solid @btn-table-color;
border-bottom: 1px solid @btn-table-color; border-bottom: 2px solid @btn-table-color;
} }
} }
@ -68,16 +72,25 @@
padding: 32px 20px; padding: 32px 20px;
font-size: 32px; font-size: 32px;
font-weight: 600; font-weight: 600;
color: @btn-table-color; color: #04fdfd;
background-color: #081633; background-color: #081633;
height: 100%; height: 100%;
display: flex; display: flex;
justify-content: space-evenly; flex-direction: column;
align-items: center; align-items: center;
gap: 8px; gap: 8px;
.anticon { .nav-bar-content-img {
font-size: 40px; // border-radius: 999px;
overflow: hidden;
width: 100%;
height: 200px;
img {
width: 100%;
height: 100%;
// object-fit: cover;
}
} }
.nav-bar-content-text { .nav-bar-content-text {
@ -91,8 +104,37 @@
&:hover { &:hover {
// transform: translate(0, -4px); // transform: translate(0, -4px);
.btn-table {
border-color: #04fdfd;
&.left-top {
height: 10%;
width: 30%;
}
&.left-bottom {
height: 30%;
width: 10%;
}
&.right-top {
height: 30%;
width: 10%;
}
&.right-bottom {
height: 10%;
width: 30%;
}
}
.nav-bar-content { .nav-bar-content {
background-color: #112f6a; background-color: #112f6a;
.nav-bar-content-img {
img {
transform: scale(1.1);
}
}
} }
} }
} }