├── public ├── robots.txt └── locales │ ├── zh │ ├── project.json │ ├── common.json │ ├── not_found.json │ ├── desc.json │ ├── home.json │ ├── about.json │ └── drawer.json │ └── en │ ├── project.json │ ├── common.json │ ├── not_found.json │ ├── desc.json │ ├── home.json │ ├── about.json │ └── drawer.json ├── .eslintrc.json ├── .idea ├── .gitignore ├── vcs.xml ├── inspectionProfiles │ └── Project_Default.xml ├── modules.xml └── home_page.iml ├── README.md ├── next-i18next.config.js ├── next-env.d.ts ├── styles └── main.css ├── .gitignore ├── next.config.js ├── tsconfig.json ├── package.json ├── pages ├── _document.tsx ├── 404.tsx ├── _app.tsx ├── about.tsx ├── project.tsx └── index.tsx ├── components ├── project.tsx └── github.tsx ├── LICENSE ├── layout └── homeLayout.tsx └── yarn.lock /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-Agent: * 2 | Allow: * 3 | -------------------------------------------------------------------------------- /public/locales/zh/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "项目" 3 | } -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals" 3 | } 4 | -------------------------------------------------------------------------------- /public/locales/en/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Project" 3 | } -------------------------------------------------------------------------------- /public/locales/zh/common.json: -------------------------------------------------------------------------------- 1 | { 2 | "request_err": "请求失败" 3 | } -------------------------------------------------------------------------------- /public/locales/zh/not_found.json: -------------------------------------------------------------------------------- 1 | { 2 | "desc": "404 您访问的页面不存在" 3 | } -------------------------------------------------------------------------------- /public/locales/en/common.json: -------------------------------------------------------------------------------- 1 | { 2 | "request_err": "request failed" 3 | } -------------------------------------------------------------------------------- /public/locales/en/not_found.json: -------------------------------------------------------------------------------- 1 | { 2 | "desc": "404 Page Does't Exists" 3 | } -------------------------------------------------------------------------------- /public/locales/zh/desc.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "XCSOFT", 3 | "subtitle": "我已很久不再成为我自己" 4 | } -------------------------------------------------------------------------------- /public/locales/en/desc.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "XCSOFT", 3 | "subtitle": "Not myself for a while" 4 | } -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # 默认忽略的文件 2 | /shelf/ 3 | /workspace.xml 4 | # 基于编辑器的 HTTP 客户端请求 5 | /httpRequests/ 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # home_page_nextjs 2 | 3 | this is the source code of xsot.cn 4 | 5 | # help 6 | 7 | visit it on https://xsot.cn 8 | -------------------------------------------------------------------------------- /next-i18next.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | i18n: { 3 | defaultLocale: 'zh', 4 | locales: ['en', 'zh'] 5 | }, 6 | }; -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /public/locales/zh/home.json: -------------------------------------------------------------------------------- 1 | { 2 | "my_proj": "我的项目", 3 | "timeletters": "拾光:给未来写封信", 4 | "urlshorter": "星辰短域:简洁的网址缩短工具", 5 | "xopenid": "OpenID:一个第三方登录平台", 6 | "busuanzi": "不蒜子:简易网站统计" 7 | } -------------------------------------------------------------------------------- /next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | // NOTE: This file should not be edited 5 | // see https://nextjs.org/docs/basic-features/typescript for more information. 6 | -------------------------------------------------------------------------------- /public/locales/en/home.json: -------------------------------------------------------------------------------- 1 | { 2 | "my_proj": "Projects", 3 | "timeletters": "Timeletters:Write a letter to the future", 4 | "urlshorter": "Urlshorter:Concise url shortening tool", 5 | "xopenid": "XopenID:A third-party login platform", 6 | "busuanzi": "Busuanzi:A simple web analytics" 7 | } -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /public/locales/zh/about.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "关于", 3 | "content": "Hi there, 我是一个来自中国的学生,
有过后端, React, Flutter 跨端软件及 Uni-app 相关开发经验,
平常喜欢听听歌, 拍拍照, 写写BUG,
喜欢折腾, 研究一些莫名其妙的东西.
", 4 | "sponsor": "支持我", 5 | "alipay": "支付宝", 6 | "wechat": "微信支付", 7 | "paypal": "PayPal" 8 | } -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /styles/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #fafafa; 3 | -moz-user-select: none; 4 | -webkit-user-select: none; 5 | -ms-user-select: none; 6 | user-select: none; 7 | } 8 | 9 | @media (prefers-color-scheme: dark) { 10 | body { 11 | background-color: #303030; 12 | } 13 | 14 | .mainAppBar { 15 | background-color: rgb(65, 65, 65) !important; 16 | } 17 | } -------------------------------------------------------------------------------- /public/locales/zh/drawer.json: -------------------------------------------------------------------------------- 1 | { 2 | "subtitle_index": "首页", 3 | "subtitle_mysite": "我的网站", 4 | "subtitle_findme": "找到我", 5 | "subtitle_suggest": "推荐链接", 6 | "home": "首页", 7 | "mail": "邮件", 8 | "project": "项目", 9 | "about": "关于", 10 | "timeletters": "拾光", 11 | "openid": "OpenID", 12 | "whois": "Whois", 13 | "gallery": "画廊", 14 | "blog": "星辰日记", 15 | "github": "Github" 16 | } -------------------------------------------------------------------------------- /public/locales/en/about.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "About", 3 | "content": "Hi there, I am a student from china,
I have experience in Bakcend developent, React, Flutter cross-end software and Uni-app,
Usually I like to listen to songs, take pictures, write bugs,
I love tossing around and researching something inexplicable.
", 4 | "sponsor": "Sponsor", 5 | "alipay": "Alipay", 6 | "wechat": "Wechat Pay", 7 | "paypal": "PayPal" 8 | } -------------------------------------------------------------------------------- /public/locales/en/drawer.json: -------------------------------------------------------------------------------- 1 | { 2 | "subtitle_index": "Index", 3 | "subtitle_mysite": "My Sites", 4 | "subtitle_findme": "Find Me", 5 | "subtitle_suggest": "Referral link", 6 | "home": "Home", 7 | "mail": "Mail", 8 | "project": "Project", 9 | "about": "About", 10 | "timeletters": "Timeletters", 11 | "openid": "OpenID", 12 | "whois": "Whois", 13 | "gallery": "Gallery", 14 | "blog": "My Blog", 15 | "github": "Github" 16 | } -------------------------------------------------------------------------------- /.idea/home_page.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # next.js 12 | /.next/ 13 | /out/ 14 | 15 | # production 16 | /build 17 | 18 | # misc 19 | .DS_Store 20 | *.pem 21 | 22 | # debug 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | .pnpm-debug.log* 27 | 28 | # local env files 29 | .env*.local 30 | 31 | # vercel 32 | .vercel 33 | 34 | # typescript 35 | *.tsbuildinfo 36 | -------------------------------------------------------------------------------- /next.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | 3 | const { 4 | i18n 5 | } = require('./next-i18next.config'); 6 | const nextConfig = { 7 | reactStrictMode: false, 8 | poweredByHeader: false, 9 | generateEtags: false, 10 | i18n, 11 | webpack5: true, 12 | webpack: (config) => { 13 | config.resolve = { 14 | ...config.resolve, 15 | fallback: { 16 | ...config.resolve.fallback, 17 | fs: false, 18 | }, 19 | }; 20 | config.module = { 21 | ...config.module, 22 | exprContextCritical: false, 23 | }; 24 | return config; 25 | }, 26 | }; 27 | 28 | module.exports = nextConfig; -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": ["dom", "dom.iterable", "esnext"], 5 | "allowJs": true, 6 | "skipLibCheck": true, 7 | "strict": true, 8 | "forceConsistentCasingInFileNames": true, 9 | "noEmit": true, 10 | "esModuleInterop": true, 11 | "module": "esnext", 12 | "moduleResolution": "node", 13 | "resolveJsonModule": true, 14 | "isolatedModules": true, 15 | "jsx": "preserve", 16 | "incremental": true, 17 | "baseUrl": ".", 18 | "paths": { 19 | "@/*": [ 20 | "*" 21 | ], 22 | }, 23 | }, 24 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], 25 | "exclude": ["node_modules"] 26 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "home_page", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "start": "next start", 9 | "lint": "next lint" 10 | }, 11 | "dependencies": { 12 | "@emotion/react": "^11.9.0", 13 | "@emotion/styled": "^11.8.1", 14 | "@mui/icons-material": "^5.6.1", 15 | "@mui/material": "^5.6.1", 16 | "axios": "^0.26.1", 17 | "next": "12.1.5", 18 | "next-i18next": "^11.0.0", 19 | "qrcode.react": "^3.0.1", 20 | "react": "18.0.0", 21 | "react-dom": "18.0.0" 22 | }, 23 | "devDependencies": { 24 | "@types/node": "17.0.23", 25 | "@types/react": "18.0.4", 26 | "@types/react-dom": "18.0.0", 27 | "eslint": "8.13.0", 28 | "eslint-config-next": "12.1.5", 29 | "typescript": "4.6.3" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /pages/_document.tsx: -------------------------------------------------------------------------------- 1 | import Document, { Html, Head, Main, NextScript } from "next/document"; 2 | 3 | export default class MyDocument extends Document { 4 | render() { 5 | return ( 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | ); 20 | } 21 | } -------------------------------------------------------------------------------- /pages/404.tsx: -------------------------------------------------------------------------------- 1 | import Head from "next/head"; 2 | import { useTranslation } from "next-i18next" 3 | import { serverSideTranslations } from 'next-i18next/serverSideTranslations' 4 | 5 | import { 6 | Container, 7 | Typography, 8 | } from '@mui/material'; 9 | 10 | const NotFound = () => { 11 | const { t } = useTranslation('desc'); 12 | 13 | return <> 14 | 15 | 404 NotFound - {t('title')} 16 | 17 | 18 |
19 | 20 | 21 | {': ('} 22 | 23 |
24 | 25 | {t('desc', { ns: 'not_found' })} 26 | 27 |
28 | 29 | } 30 | 31 | export const getStaticProps = async ({ locale }: { locale: string }) => ({ 32 | props: { 33 | ...(await serverSideTranslations(locale, ['not_found', 'desc'])), 34 | }, 35 | }); 36 | 37 | export default NotFound; -------------------------------------------------------------------------------- /components/project.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | Card, 3 | CardActionArea, 4 | Grid, 5 | Typography 6 | } from "@mui/material"; 7 | import type { ReactElement } from "react"; 8 | 9 | type ProjectProps = { 10 | title: string, 11 | desc: string, 12 | url: string, 13 | icon: ReactElement, 14 | }; 15 | 16 | const Proj = (props: ProjectProps): ReactElement => { 17 | return ( 18 | 26 | window.open(props.url)} 28 | sx={{ 29 | paddingTop: '5px', 30 | paddingBottom: '5px', 31 | paddingLeft: '8px', 32 | paddingRight: '8px', 33 | }} 34 | > 35 | 41 | 49 | {props.icon} 50 | 51 | 58 | 62 | 67 | {props.title} 68 | 69 | 70 | 73 | 78 | {props.desc} 79 | 80 | 81 | 82 | 83 | 84 | 85 | ); 86 | } 87 | 88 | export default Proj; -------------------------------------------------------------------------------- /pages/_app.tsx: -------------------------------------------------------------------------------- 1 | import type { AppProps } from 'next/app' 2 | import type { Theme } from '@mui/material' 3 | 4 | import { useState } from 'react' 5 | import Head from 'next/head' 6 | import { appWithTranslation } from 'next-i18next' 7 | import { useTranslation } from "next-i18next"; 8 | import { useRouter } from 'next/router' 9 | import Link from 'next/link' 10 | 11 | import GTranslateIcon from '@mui/icons-material/GTranslate'; 12 | 13 | import { 14 | useEffect, 15 | useMemo 16 | } from 'react' 17 | 18 | import { 19 | useMediaQuery, 20 | createTheme, 21 | ThemeProvider, 22 | Fab, 23 | Menu, 24 | MenuItem, 25 | } from '@mui/material' 26 | import "@/styles/main.css" 27 | import Script from 'next/script' 28 | const App = ({ Component, pageProps }: AppProps) => { 29 | 30 | const [t] = useTranslation('desc'); 31 | const path = useRouter().pathname; 32 | const [anchorEl, setAnchorEl] = useState(null); 33 | const LangMenuOpen = Boolean(anchorEl); 34 | 35 | // 处理暗黑模式 36 | const prefersDarkMode: boolean = useMediaQuery('(prefers-color-scheme: dark)'); 37 | 38 | useEffect(() => { 39 | window.document.body.style.backgroundColor = prefersDarkMode ? '#303030' : '#fafafa'; 40 | }, [prefersDarkMode]); 41 | 42 | const theme: Theme = useMemo( 43 | () => 44 | createTheme({ 45 | palette: { 46 | mode: prefersDarkMode ? 'dark' : 'light', 47 | background: { 48 | default: prefersDarkMode ? '#303030' : '#fafafa', 49 | paper: prefersDarkMode ? '#424242' : '#fff', 50 | }, 51 | text: { 52 | primary: !prefersDarkMode ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.85)', 53 | secondary: !prefersDarkMode ? 'rgba(0, 0, 0, 0.55)' : 'rgba(255, 255, 255, 0.7)', 54 | disabled: !prefersDarkMode ? 'rgba(0, 0, 0, 0.38)' : 'rgba(255, 255, 255, 0.5)', 55 | }, 56 | }, 57 | typography: { 58 | fontFamily: [ 59 | 'LXGW WenKai Screen', 60 | '-apple-system', 61 | 'BlinkMacSystemFont', 62 | '"Segoe UI"', 63 | 'Roboto', 64 | '"Helvetica Neue"', 65 | 'Arial', 66 | 'sans-serif', 67 | '"Apple Color Emoji"', 68 | '"Segoe UI Emoji"', 69 | '"Segoe UI Symbol"', 70 | ].join(','), 71 | }, 72 | }), 73 | [prefersDarkMode], 74 | ); 75 | 76 | return ( 77 | <> 78 | 79 | {`${t('title')} - ${t('subtitle')}`} 80 | 81 | 82 |