Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reward #112

Merged
merged 4 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/public/iconfont.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
<script src="%PUBLIC_URL%/iconfont.js"></script>
</html>
Binary file added frontend/src/assets/alipay.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/src/assets/wechatpay.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 23 additions & 2 deletions frontend/src/components/AppFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import React, { memo, useEffect, useState } from "react";
import pb from "../api/compiled";
import { version as versionApi } from "../api/version";
import dayjs from "dayjs";
import { Button } from "antd";
import { Button, Popover } from "antd";
import { GithubOutlined } from "@ant-design/icons";
import Coffee from "./Coffee";

require("dayjs/locale/zh-cn");

Expand All @@ -17,7 +18,14 @@ const AppFooter: React.FC = () => {
return (
<div className="copyright">
<div style={{ fontSize: 14 }}>created by duc@2021.</div>
<div style={{ fontSize: 12 }}>
<div
style={{
fontSize: 12,
display: "flex",
justifyContent: "center",
alignItems: "center",
}}
>
version: {version?.version}, build at{" "}
{dayjs(version?.build_date).format("YYYY-MM-DD HH:mm:ss")}
<Button
Expand All @@ -26,6 +34,19 @@ const AppFooter: React.FC = () => {
href={version?.git_repo}
type="link"
></Button>
<Popover
content={<Coffee />}
overlayInnerStyle={{ padding: 0, margin: 0 }}
trigger="click"
>
<svg
style={{ width: 18, height: 18, cursor: "pointer" }}
className="icon"
aria-hidden="true"
>
<use xlinkHref="#icon-dashang"></use>
</svg>
</Popover>
</div>
</div>
);
Expand Down
57 changes: 57 additions & 0 deletions frontend/src/components/Coffee.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import React, { memo } from "react";
import Alipay from "../assets/alipay.jpg";
import WechatPay from "../assets/wechatpay.jpg";
import styled from "@emotion/styled";
import theme from "../styles/theme";

const Coffee: React.FC = () => {
return (
<Wrap>
<Front className="front">
<Image src={Alipay} alt="alipay" />
</Front>
<Back className="back">
<Image src={WechatPay} alt="wechatpay" />
</Back>
</Wrap>
);
};

export default memo(Coffee);

const Item = styled.div`
position: absolute;
backface-visibility: hidden;
transition: 0.3s;
`;

const Front = styled(Item)`
transform: rotateX(0deg);
`;

const Back = styled(Item)`
transform: rotateX(-180deg);
`;

const Wrap = styled.div`
perspective: 700px;
width: 200px;
height: 273px;
margin: 0 auto;

&:hover .front {
outline: 1px solid blue;
transform: rotateX(180deg);
}

&:hover .back {
transform: rotateX(0deg);
}
`;

const Image = styled.img`
width: 200px;
height: 273px;
border-radius: 5px;
box-shadow: 1px 1px 10px ${theme.lightMainColor};
`;
8 changes: 8 additions & 0 deletions frontend/src/styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,11 @@ body {
.ant-tabs-tabpane-active {
height: 100% !important;
}

.icon {
width: 1em;
height: 1em;
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
}