Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Wsquare5 committed Nov 11, 2023
2 parents 13845e9 + 86a2136 commit 84a21d1
Show file tree
Hide file tree
Showing 17 changed files with 178 additions and 147 deletions.
Binary file modified Athena3-Hub-athena-frontend/public/favicon.ico
Binary file not shown.
14 changes: 12 additions & 2 deletions Athena3-Hub-athena-frontend/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@
flex-shrink: 2;
margin: 0 auto;
overflow: hidden;
background-color: 0.3s ease;
z-index: 10;
.navbar-logo {
max-width: 50px;
height: auto;
margin-left: 15px;
margin-left:15px ;
}

.navbar-menu {
Expand All @@ -65,7 +67,15 @@
vertical-align: center;
}
}

/* 固定样式 */
.navbar.fixed {
position: fixed;
top: 0;
width: 100%;
background-color: #fff;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
background-color: 0.3s ease;
}
/* body */
.mainPic {
background-image: linear-gradient(135deg, #e08417 0%, #6621d6 100%);
Expand Down
40 changes: 20 additions & 20 deletions Athena3-Hub-athena-frontend/src/App.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
// import logo from './logo.svg'
import './App.css'
import { BrowserRouter, Routes,Route } from "react-router-dom";
import AboutUs from "./components/AboutUs.js"
import Courses from "./components/Courses.js"
import NavBar from "./components/NavBar.js"
import './App.css';
import { BrowserRouter, Routes, Route } from "react-router-dom";
import AboutUs from "./components/AboutUs.js";
import Courses from "./components/Courses.js";
import NavBar from "./components/NavBar.js";
import Layout from "./Layout.js";
import Home from "./components/Home.js";
import NotFound from "./components/NotFound.js";
import Copyright from './Copyright.js';
import Copyright from './Copyright.js';

function App () {
return (
<div className="App">
<div className='container'>
<BrowserRouter>
<NavBar />
<Routes>
<Route path="/" element={<Layout />}>
{/*默认二级首页,添加index属性,去掉path来确保默认展示该页面*/}
<Route index element={<Home />}></Route>
<Route path="/courses" element={<Courses />}></Route>
<Route path="/about" element={<AboutUs />}></Route>
</Route>
<Route path="*" element={<NotFound/>}/>
</Routes>
<Copyright />
</BrowserRouter>
<BrowserRouter>
<NavBar />
<Routes>
<Route path="/" element={<Layout />}>
{/*默认二级首页,添加index属性,去掉path来确保默认展示该页面*/}
<Route index element={<Home />}></Route>
<Route path="/courses" element={<Courses />}></Route>
<Route path="/about" element={<AboutUs />}></Route>
</Route>
<Route path="*" element={<NotFound />} />
</Routes>
<Copyright />
</BrowserRouter>
</div>
</div >
)
);
}

export default App;
10 changes: 5 additions & 5 deletions Athena3-Hub-athena-frontend/src/Layout.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {Outlet} from "react-router-dom";
import { Outlet } from "react-router-dom";
function Layout () {
return (
<div>
<Outlet/>
</div>
)
<div>
<Outlet />
</div>
);
}
export default Layout;
10 changes: 5 additions & 5 deletions Athena3-Hub-athena-frontend/src/components/AboutUs.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import * as allList from "../list.js"
import { Card, Col, Row } from 'antd'
import * as allList from "../list.js";
import { Card, Col, Row } from 'antd';

function AboutUs () {
const list = allList.aboutUsList
const list = allList.aboutUsList;
return (
<div className="info">
<Row gutter={16}>
{list.map((item) => (
<Col key={item.id} span={8}>
<Card title={item.name}
// bordered={false}
// bordered={false}
hoverable
className="info-item">
<div>{item.img}</div>
Expand All @@ -24,6 +24,6 @@ function AboutUs () {
))}
</Row>
</div>
)
);
}
export default AboutUs;
10 changes: 3 additions & 7 deletions Athena3-Hub-athena-frontend/src/components/Certificates.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import React from 'react'
import * as allList from "../list.js"
import { Button, Flex } from 'antd'

function Certificates () {
const list = allList.certificatesList

return (
<div className='certificates'>
{list.map(item => (
Expand All @@ -18,9 +14,9 @@ function Certificates () {
<div className='certificates-name'>{item.name}</div>
<div className='certificates-subname'>{item.subName}</div>
</div>
</Button>
))}
</div>
))}
</div>
</>
)
}
export default Certificates;
14 changes: 7 additions & 7 deletions Athena3-Hub-athena-frontend/src/components/Courses.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as allList from "../list.js"
import { Card } from 'antd'
import * as allList from "../list.js";
import { Card } from 'antd';
import img from '../assets/pyteal.png';
const { Meta } = Card
const { Meta } = Card;



function Courses () {
const list = allList.coursesList
const list = allList.coursesList;


return (
Expand All @@ -21,7 +21,7 @@ function Courses () {
hoverable
className="courses-item"

cover={<img alt={item.title} src={img} />}
cover={<img alt={item.title} src={img} />}
>
<Meta title={item.title} description={item.digest} />
</Card>
Expand All @@ -30,7 +30,7 @@ function Courses () {
</div>
</div>
</>
)
);
}

export default Courses
export default Courses;
22 changes: 11 additions & 11 deletions Athena3-Hub-athena-frontend/src/components/Home.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import WelcomeWord from "./WelcomeWord.js"
import WelcomeWord from "./WelcomeWord.js";
import Certificates from "./Certificates.js";
import Queries from "./Queries.js";
import MainPic from "./MainPic.js";
import Subscribe from "./Subscribe.js";
function Home () {
return (
<div>
<MainPic />
<WelcomeWord />
<Certificates />
<foot>
<Queries />
<Subscribe />
</foot>
</div>
)
<div>
<MainPic />
<WelcomeWord />
<Certificates />
<foot>
<Queries />
<Subscribe />
</foot>
</div>
);
}
export default Home;
10 changes: 5 additions & 5 deletions Athena3-Hub-athena-frontend/src/components/MainPic.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logo from "../assets/nameWhite.png"
import logo from "../assets/nameWhite.png";
import React from 'react';
import { Button, Flex } from 'antd';
import { Button, Flex } from 'antd';
function MainPic () {
return (
<>
Expand All @@ -9,14 +9,14 @@ function MainPic () {
<div className="mainPic-subtitle">
<h1 className="subtitle1">Unlocking your potential</h1>
<div>Learn from women, grow with women, build for women</div>
</div>
<Flex gap="large" wrap="wrap">
</div>
<Flex gap="large" wrap="wrap">
<Button>Mint Now</Button>
<Button>Learn Now</Button>
</Flex>
</div>
</>
)
);
}

export default MainPic;
43 changes: 34 additions & 9 deletions Athena3-Hub-athena-frontend/src/components/NavBar.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,46 @@
import * as allList from "../list.js"
import { Menu } from 'antd'
import { Link } from 'react-router-dom'
import Wallet from './Wallet.js'
import LogoImage from '../assets/TransperantLogo.png'
import * as allList from "../list.js";
import { Menu } from 'antd';
import { Link } from 'react-router-dom';
import Wallet from './Wallet.js';
import LogoImage from '../assets/TransperantLogo.png';
import { useNavigate } from 'react-router-dom';
import React, { useState, useEffect } from 'react';

function NavBar (params) {
const navList = allList.navList
const navList = allList.navList;
const navigate = useNavigate();
const [isFixed, setIsFixed] = useState(false);

useEffect(() => {
const handleScroll = () => {
const scrollPosition = window.scrollY;
const offsetToFix = 100; // 根据需要调整固定导航栏的滚动偏移

if (scrollPosition > offsetToFix && !isFixed) {
setIsFixed(true);
} else if (scrollPosition <= offsetToFix && isFixed) {
setIsFixed(false);
}
};

window.addEventListener('scroll', handleScroll);

// 清除监听器,防止内存泄漏
return () => {
window.removeEventListener('scroll', handleScroll);
};
}, [isFixed]);

return (
<div className='navbar'>
<div>
<div className={`navbar ${isFixed ? 'fixed' : ''}`}>
<div onClick={() => navigate('/')}>
<img className='navbar-logo' src={LogoImage} alt="Logo" />
</div>
<Menu className="navbar-menu" mode="horizontal">
{navList.map(item => (<Menu.Item key={item.id}><Link to={item.path}>{item.name}</Link></Menu.Item>))}
</Menu>
<div className='navbar-wallet'><Wallet /></div>
</div >
)
);
}
export default NavBar;
20 changes: 10 additions & 10 deletions Athena3-Hub-athena-frontend/src/components/NotFound.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ function NotFound () {
const navigate = useNavigate();
return (
<Result
className='notFound'
status="warning"
title="Sorry, this website is under construction."
extra={
<Button type="primary" key="console" onClick={ ()=> navigate('/') }>
Go Home
</Button>
}
/>
)
className='notFound'
status="warning"
title="Sorry, this website is under construction."
extra={
<Button type="primary" key="console" onClick={() => navigate('/')}>
Go Home
</Button>
}
/>
);
}
export default NotFound;
44 changes: 22 additions & 22 deletions Athena3-Hub-athena-frontend/src/components/Queries.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
import * as allList from "../list.js"
import * as allList from "../list.js";
import { Card, ConfigProvider } from 'antd';

function Queries (params) {
const questionList = allList.questionList
const questionList = allList.questionList;
return (
<div className='queries'>
<div className="mainTitle">
Popular Queries Unraveled
</div>
<ConfigProvider
theme={{
token: {
colorBgContainer: "#F3EDFC",
colorBorderSecondary:"null",
borderRadiusLG: 20,
boxShadowTertiary: "0 1px 2px 0 rgba(#3334db, #bacff5, #87dfdc, 0.03)"
},
}}
>
<Card bordered={false} >
<div className="queries-items">{questionList.map(item => (
<Card.Grid bordered={false} className='queries-item'>
<div className="queries-item-title subtitle">{item.question}</div>
<div className="queries-item-answer">{item.answer}</div>
</Card.Grid>
)
)}</div>
</Card>
</ConfigProvider>
theme={{
token: {
colorBgContainer: "#F3EDFC",
colorBorderSecondary: "null",
borderRadiusLG: 20,
boxShadowTertiary: "0 1px 2px 0 rgba(#3334db, #bacff5, #87dfdc, 0.03)"
},
}}
>
<Card bordered={false} >
<div className="queries-items">{questionList.map(item => (
<Card.Grid bordered={false} className='queries-item'>
<div className="queries-item-title subtitle">{item.question}</div>
<div className="queries-item-answer">{item.answer}</div>
</Card.Grid>
)
)}</div>
</Card>
</ConfigProvider>
</div>
)
);
}

export default Queries;
Loading

0 comments on commit 84a21d1

Please sign in to comment.