forked from Ganainmtech/Athena3-Hub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/Ganainmtech/Athena3-Hub
- Loading branch information
Showing
17 changed files
with
178 additions
and
147 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
Oops, something went wrong.