├── public ├── favicon.ico ├── img │ ├── hbewm.png │ ├── header.png │ ├── read.png │ └── donatezfb.png ├── manifest.json ├── index.html └── bookSource.html ├── src ├── App.test.js ├── component │ ├── scrollToTop.js │ ├── theme.js │ ├── main.js │ ├── sourceRule.js │ ├── toolbar.js │ ├── home.js │ └── edit.js ├── index.css ├── App.js ├── svg │ ├── hint.js │ └── github.js ├── App.css ├── index.js ├── utils │ └── HttpUtil.js ├── logo.svg └── serviceWorker.js ├── package.json ├── README.md └── .gitignore /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsakvo/yuedu-website/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /public/img/hbewm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsakvo/yuedu-website/HEAD/public/img/hbewm.png -------------------------------------------------------------------------------- /public/img/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsakvo/yuedu-website/HEAD/public/img/header.png -------------------------------------------------------------------------------- /public/img/read.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsakvo/yuedu-website/HEAD/public/img/read.png -------------------------------------------------------------------------------- /public/img/donatezfb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsakvo/yuedu-website/HEAD/public/img/donatezfb.png -------------------------------------------------------------------------------- /src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | it('renders without crashing', () => { 6 | const div = document.createElement('div'); 7 | ReactDOM.render(, div); 8 | ReactDOM.unmountComponentAtNode(div); 9 | }); 10 | -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": ".", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /src/component/scrollToTop.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { withRouter } from "react-router-dom"; 3 | 4 | class ScrollToTop extends React.Component { 5 | componentDidUpdate(prevProps) { 6 | if (this.props.location !== prevProps.location) { 7 | window.scrollTo(0, 0); 8 | } 9 | } 10 | render() { 11 | return this.props.children; 12 | } 13 | } 14 | export default withRouter(ScrollToTop); 15 | -------------------------------------------------------------------------------- /src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", 5 | "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", 6 | sans-serif; 7 | -webkit-font-smoothing: antialiased; 8 | -moz-osx-font-smoothing: grayscale; 9 | } 10 | 11 | code { 12 | font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", 13 | monospace; 14 | } 15 | -------------------------------------------------------------------------------- /src/component/theme.js: -------------------------------------------------------------------------------- 1 | import { createMuiTheme } from "@material-ui/core/styles"; 2 | 3 | const AppTheme = createMuiTheme({ 4 | palette: { 5 | primary: { 6 | main: "#2196f3", 7 | light: "#4dabf5", 8 | dark: "#1769aa" 9 | }, 10 | secondary: { 11 | main: "#f50057", 12 | light: "#f73378", 13 | dark: "#ab003c" 14 | } 15 | }, 16 | typography: { 17 | useNextVariants: true 18 | } 19 | }); 20 | 21 | export default AppTheme; 22 | -------------------------------------------------------------------------------- /src/App.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import { MuiThemeProvider } from "@material-ui/core/styles"; 3 | import AppTheme from "./component/theme"; 4 | import Toolbar from "./component/toolbar"; 5 | import Main from "./component/main"; 6 | 7 | class App extends Component { 8 | render() { 9 | return ( 10 |
11 | 12 | 13 |
14 | 15 |
16 | ); 17 | } 18 | } 19 | 20 | export default App; 21 | -------------------------------------------------------------------------------- /src/svg/hint.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import SvgIcon from "@material-ui/core/SvgIcon"; 3 | 4 | class Icon extends React.Component { 5 | render() { 6 | return ( 7 | 8 | {" "} 9 | 10 | ); 11 | } 12 | } 13 | 14 | export default Icon; 15 | -------------------------------------------------------------------------------- /src/component/main.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Switch, Route } from "react-router-dom"; 3 | import Editor from "./edit"; 4 | import Home from "./home"; 5 | import SourceRule from "./sourceRule"; 6 | 7 | import ScrollToTop from "./scrollToTop"; 8 | 9 | const Main = () => ( 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | ); 20 | 21 | export default Main; 22 | -------------------------------------------------------------------------------- /src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | animation: App-logo-spin infinite 20s linear; 7 | height: 40vmin; 8 | } 9 | 10 | .App-header { 11 | background-color: #282c34; 12 | min-height: 100vh; 13 | display: flex; 14 | flex-direction: column; 15 | align-items: center; 16 | justify-content: center; 17 | font-size: calc(10px + 2vmin); 18 | color: white; 19 | } 20 | 21 | .App-link { 22 | color: #61dafb; 23 | } 24 | 25 | @keyframes App-logo-spin { 26 | from { 27 | transform: rotate(0deg); 28 | } 29 | to { 30 | transform: rotate(360deg); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 10 | 11 | 12 | 13 | 阅读 14 | 15 | 16 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | // import React from 'react'; 2 | // import ReactDOM from 'react-dom'; 3 | // import './index.css'; 4 | // import App from './App'; 5 | // import * as serviceWorker from './serviceWorker'; 6 | 7 | // ReactDOM.render(, document.getElementById('root')); 8 | 9 | // serviceWorker.unregister(); 10 | 11 | import React from "react"; 12 | import { render } from "react-dom"; 13 | import { BrowserRouter } from "react-router-dom"; 14 | import App from "./App"; 15 | 16 | import "./index.css"; 17 | 18 | render( 19 | 20 | 21 | , 22 | document.getElementById("root") 23 | ); 24 | -------------------------------------------------------------------------------- /src/svg/github.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import SvgIcon from "@material-ui/core/SvgIcon"; 3 | 4 | class Icon extends React.Component { 5 | render() { 6 | return ( 7 | 8 | 9 | 10 | ); 11 | } 12 | } 13 | 14 | export default Icon; 15 | -------------------------------------------------------------------------------- /src/utils/HttpUtil.js: -------------------------------------------------------------------------------- 1 | var HTTPUtil = {}; 2 | 3 | // const APIBaseURL = "http://qr.daguduiyuan.xyz/"; 4 | 5 | HTTPUtil.get = function(param) { 6 | // var url = APIBaseURL + param; 7 | return fetch(param, { 8 | method: "GET", 9 | mode: "cors" 10 | }).then(function(response) { 11 | return response.json(); 12 | }); 13 | }; 14 | 15 | HTTPUtil.post = function(param, formData) { 16 | return fetch(param, { 17 | method: "POST", 18 | mode: "cors", 19 | credentials: "include", 20 | headers: { 21 | Accept: "application/json", 22 | "Content-Type": "application/x-www-form-urlencoded" 23 | }, 24 | body: formData 25 | }).then(response => { 26 | return response.json(); 27 | }); 28 | }; 29 | 30 | export default HTTPUtil; 31 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "yuedu-website", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@material-ui/core": "^3.6.2", 7 | "@material-ui/icons": "^3.0.1", 8 | "copy-to-clipboard": "^3.0.8", 9 | "qrcode.react": "^0.8.0", 10 | "react": "^16.6.3", 11 | "react-dom": "^16.6.3", 12 | "react-router": "^4.3.1", 13 | "react-router-dom": "^4.3.1", 14 | "react-scripts": "2.1.1" 15 | }, 16 | "scripts": { 17 | "start": "react-scripts start", 18 | "build": "react-scripts build", 19 | "test": "react-scripts test", 20 | "eject": "react-scripts eject" 21 | }, 22 | "eslintConfig": { 23 | "extends": "react-app" 24 | }, 25 | "browserslist": [ 26 | ">0.2%", 27 | "not dead", 28 | "not ie <= 11", 29 | "not op_mini all" 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /src/component/sourceRule.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import PropTypes from "prop-types"; 3 | import { withStyles } from "@material-ui/core/styles"; 4 | 5 | const styles = () => ({ 6 | ruleRoot: { 7 | paddingTop: 56, 8 | paddingLeft: 40, 9 | paddingRight: 40, 10 | height: "100%" 11 | }, 12 | ruleFrame: { 13 | paddingTop: 24 14 | } 15 | }); 16 | 17 | class sourceRule extends React.Component { 18 | state = {}; 19 | 20 | render() { 21 | const { classes } = this.props; 22 | return ( 23 |
24 |
25 |