Feat: Home Page

首页内容完善
This commit is contained in:
奇趣保罗 2022-04-13 00:18:48 +08:00
parent 16e067e7c9
commit 07e8976250
7 changed files with 144 additions and 49 deletions

View File

@ -0,0 +1,44 @@
import React from "react";
import Alipay from "@/images/donate/alipay.png";
import WeChat from "@/images/donate/wechat.png";
import QQ from "@/images/donate/qq.png";
export const About = () => {
return (
<>
<h3></h3>
<p> API 便 <a href="https://github.com/Dreamer-Paul/Single" target="_blank">Single</a> 使 2018 4 PHP </p>
<p> PHP CSS JS SSR </p>
<ul>
<li>CSS + Vanilla JS</li>
<li>PHP</li>
<li>MariaDB</li>
<li>Redis</li>
</ul>
</>
)
}
export const Donate = () => {
return (
<>
<h3></h3>
<p>~ API</p>
<div className="row center">
<div className="col-6 col-m-4 center-fixed">
<img src={Alipay} alt="支付宝" />
<p></p>
</div>
<div className="col-6 col-m-4 center-fixed">
<img src={WeChat} alt="微信支付" />
<p></p>
</div>
<div className="col-6 col-m-4 center-fixed">
<img src={QQ} alt="QQ 钱包" />
<p>QQ </p>
</div>
</div>
</>
)
}

View File

@ -0,0 +1,17 @@
import React from "react";
interface ArticleHeadProps {
title: string
desc: string
}
function ArticleHead({ title, desc }: ArticleHeadProps) {
return (
<section className="header">
<h1>{title}</h1>
<h2>{desc}</h2>
</section>
)
}
export default ArticleHead;

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
src/images/donate/qq.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -1,5 +1,3 @@
@charset "UTF-8";
/* ---- /* ----
# Paul API # Paul API
@ -35,6 +33,11 @@ button{
.radius-full{ border-radius: 100% } .radius-full{ border-radius: 100% }
.notice{
color: #175782;
font-style: normal;
}
/* 1 - 页眉 /* 1 - 页眉
-------------------------------- */ -------------------------------- */
.sidebar{ .sidebar{
@ -181,7 +184,7 @@ main .post{
margin-bottom: 3em; margin-bottom: 3em;
} }
main .post a{ main .post p a{
text-decoration: 1px dashed underline; text-decoration: 1px dashed underline;
text-underline-offset: 0.1em; text-underline-offset: 0.1em;
} }

View File

@ -6,63 +6,94 @@ import fetchGithubStars from '../api/star';
import { getBookByParams, getBookByQuery } from '../api/book'; import { getBookByParams, getBookByQuery } from '../api/book';
import getStat from "../api/stat"; import getStat from "../api/stat";
function Index() { import { Link } from "react-router-dom";
import ArticleHead from "@/components/Layout/ArticleHead";
import { Donate, About } from "@/components/ArticleSnippet";
const { data: date } = useRequest(() => getDate()); const apiMap: Record<string, string> = {
// const { data: repo, loading } = useRequest(() => wallpaper: "随机动漫壁纸",
// fetchGithubStars('midwayjs/midway') netease: "网易云解析",
// ); acgm: "随机动漫音乐",
const { data: book } = useRequest(() => bili: "哔哩小窗",
getBookByParams({ params: { id: '1' } }) bing: "必应每日壁纸"
); }
const { data: book2 } = useRequest(() =>
getBookByQuery({ query: { id: '2' } }) function Index() {
);
const { data: stat } = useRequest(() => getStat()); const { data: stat } = useRequest(() => getStat());
return ( return (
<main> <main>
<img src="/logo.png" className="logo" /> <ArticleHead title="保罗 API" desc="这里是保罗制作的简易 API 系列~" />
<h2>Hello Midway Hooks</h2> <article className="post">
<p style={{ textAlign: 'center' }}> <blockquote className="notice"><i className="fa fa-bell"></i> API NodeJS MidwayJS </blockquote>
Edit <code>src/api/*.ts</code> and watch it change.
<br /> <h3></h3>
You can also open Devtools to see the request details. <p> API/使 API <Link to="/notice"></Link> <Link to="/log"></Link></p>
</p>
<div> <h3></h3>
<p> <p> 2018 7 API 使</p>
<span className="lambda">λ GET</span>
<span className="lambda">getDate()</span> <div className="row text-center">
<span>Server Date: {date}</span>
</p>
<p>
<span className="lambda">λ POST</span>
<span className="lambda">fetchStars('midwayjs/midway')</span>
{/* <span>Github Stars: {loading ? 'Fetching...' : repo.stars}</span> */}
</p>
<div>
{ {
stat?.data && Object.keys(stat.data).map((item) => ( stat?.data && Object.keys(stat.data).map((item) => (
<p key={item}>{item}: {stat.data[item]}</p> <div className="col-4" key={item}>
<h2>{stat.data[item]}</h2>
<p>{apiMap[item]}</p>
</div>
)) ))
} }
</div> </div>
<p>
<span className="lambda">λ GET</span> <h3></h3>
<span className="lambda"> <div className="row full">
{`getBookByParams({ params: { id: '1' } })`} <div className="col-6 col-m-4">
</span> <Link className="box first" to="/netease">
<span>Book title: {book?.title}</span> <h3><i className="fa fa-music"></i></h3>
</p> <p> Kico Player 使</p>
<p> </Link>
<span className="lambda">λ GET</span>
<span className="lambda">
{`getBookByQuery({ query: { id: '2' } })`}
</span>
<span>Book title: {book2?.title}</span>
</p>
</div> </div>
{/* <div className="col-6 col-m-4">
<a className="box second" href="javascript:ks.notice('由于经费和资源问题,暂不考虑公开,求赞助!', {time: 2000, color: 'yellow'})">
<h3><i className="fa fa-heart"></i></h3>
<p> L2D </p>
</a>
</div> */}
<div className="col-6 col-m-4">
<Link className="box third" to="/wallpaper">
<h3><i className="fa fa-photo"></i></h3>
<p> Single </p>
</Link>
</div>
<div className="col-6 col-m-4">
<Link className="box fourth" to="/acgm">
<h3><i className="fa fa-headphones"></i></h3>
<p></p>
</Link>
</div>
{/* <div className="col-6 col-m-4">
<Link className="box fifth" to="/gravatar">
<h3><i className="fa fa-user"></i>Gravatar </h3>
<p> MD5</p>
</Link>
</div> */}
<div className="col-6 col-m-4">
<Link className="box sixth" to="/bili">
<h3><i className="fa fa-film"></i></h3>
<p> B </p>
</Link>
</div>
<div className="col-6 col-m-4">
<Link className="box seventh" to="/bing">
<h3><i className="fa fa-gift"></i></h3>
<p>使便</p>
</Link>
</div>
</div>
<Donate />
<About />
</article>
</main> </main>
) )