├── .gitignore
├── dva-demo
├── mock
│ └── .gitkeep
├── .webpackrc
├── .eslintrc
├── .roadhogrc.mock.js
├── src
│ ├── index.css
│ ├── assets
│ │ └── yay.jpg
│ ├── services
│ │ └── example.js
│ ├── utils
│ │ ├── utils.js
│ │ └── request.js
│ ├── components
│ │ └── Example.js
│ ├── index.js
│ ├── router.js
│ ├── routes
│ │ ├── IndexPage.css
│ │ └── IndexPage.js
│ └── models
│ │ └── example.js
├── .gitignore
├── .editorconfig
├── public
│ └── index.html
└── package.json
├── umi-demo
├── mock
│ └── .gitkeep
├── src
│ ├── models
│ │ ├── .gitkeep
│ │ └── count.js
│ ├── global.css
│ ├── assets
│ │ └── yay.jpg
│ ├── app.js
│ ├── utils
│ │ └── utils.js
│ ├── layouts
│ │ ├── index.js
│ │ ├── index.css
│ │ └── __tests__
│ │ │ └── index.test.js
│ └── pages
│ │ ├── index.css
│ │ ├── __tests__
│ │ └── index.test.js
│ │ ├── index.js
│ │ └── home
│ │ ├── index.css
│ │ └── index.js
├── .env
├── .eslintrc
├── .prettierignore
├── .prettierrc
├── webpack.config.js
├── .editorconfig
├── .gitignore
├── .umirc.js
└── package.json
├── contact-demo
├── README.md
├── cors
│ ├── server1.js
│ ├── index.html
│ ├── ajax.js
│ └── server2.js
├── csrf
│ ├── server2.js
│ ├── b.html
│ ├── ajax.js
│ ├── a.html
│ └── server1.js
├── hash
│ ├── server1.js
│ ├── server2.js
│ ├── b.html
│ ├── c.html
│ └── a.html
├── name
│ ├── server1.js
│ ├── server2.js
│ ├── b.html
│ ├── c.html
│ └── a.html
├── domain
│ ├── server1.js
│ ├── server2.js
│ ├── b.html
│ └── a.html
├── postmessage
│ ├── server1.js
│ ├── server2.js
│ ├── b.html
│ └── a.html
├── websocket
│ ├── server.js
│ ├── socket.html
│ ├── serverIO.js
│ └── socketIO.html
├── package.json
├── jsonp
│ ├── index.html
│ ├── jsonp.js
│ └── server.js
└── package-lock.json
├── apple-animation-demo
├── mock
│ └── .gitkeep
├── src
│ ├── models
│ │ └── .gitkeep
│ ├── locales
│ │ └── en-US.ts
│ ├── global.css
│ ├── pages
│ │ ├── __tests__
│ │ │ ├── __mocks__
│ │ │ │ └── umi-plugin-locale.ts
│ │ │ └── index.test.tsx
│ │ ├── document.ejs
│ │ ├── demo3
│ │ │ ├── index.tsx
│ │ │ └── index.css
│ │ ├── demo2
│ │ │ ├── index.css
│ │ │ └── index.tsx
│ │ ├── index.css
│ │ ├── demo4
│ │ │ ├── index.css
│ │ │ └── index.tsx
│ │ ├── demo1
│ │ │ ├── index.css
│ │ │ └── index.tsx
│ │ ├── openMac
│ │ │ ├── index.css
│ │ │ └── index.tsx
│ │ ├── index.tsx
│ │ ├── canvasDraw
│ │ │ ├── index.css
│ │ │ └── index.tsx
│ │ └── bgAttachment
│ │ │ ├── index.css
│ │ │ └── index.tsx
│ ├── assets
│ │ ├── yay.jpg
│ │ ├── mac1.jpg
│ │ ├── mac2.jpg
│ │ ├── mac3.jpg
│ │ ├── mac4.jpg
│ │ ├── large_0000.jpg
│ │ ├── large_0001.jpg
│ │ ├── large_0002.jpg
│ │ ├── large_0003.jpg
│ │ ├── large_0004.jpg
│ │ ├── large_0005.jpg
│ │ ├── large_0006.jpg
│ │ ├── large_0007.jpg
│ │ ├── large_0008.jpg
│ │ ├── large_0009.jpg
│ │ ├── large_0010.jpg
│ │ ├── large_0011.jpg
│ │ ├── large_0012.jpg
│ │ ├── large_0013.jpg
│ │ ├── large_0014.jpg
│ │ ├── large_0015.jpg
│ │ ├── large_0016.jpg
│ │ ├── large_0017.jpg
│ │ ├── large_0018.jpg
│ │ ├── large_0019.jpg
│ │ ├── large_0020.jpg
│ │ ├── large_0021.jpg
│ │ ├── large_0022.jpg
│ │ ├── large_0023.jpg
│ │ ├── large_0024.jpg
│ │ ├── large_0025.jpg
│ │ ├── large_0026.jpg
│ │ ├── large_0027.jpg
│ │ ├── large_0028.jpg
│ │ ├── large_0029.jpg
│ │ ├── large_0030.jpg
│ │ ├── large_0031.jpg
│ │ ├── large_0032.jpg
│ │ ├── large_0033.jpg
│ │ ├── large_0034.jpg
│ │ ├── large_0035.jpg
│ │ ├── large_0036.jpg
│ │ ├── large_0037.jpg
│ │ ├── large_0038.jpg
│ │ ├── large_0039.jpg
│ │ ├── large_0040.jpg
│ │ ├── large_0041.jpg
│ │ ├── large_0042.jpg
│ │ ├── large_0043.jpg
│ │ ├── large_0044.jpg
│ │ ├── large_0045.jpg
│ │ ├── large_0046.jpg
│ │ ├── large_0047.jpg
│ │ ├── large_0048.jpg
│ │ ├── large_0049.jpg
│ │ ├── large_0050.jpg
│ │ ├── large_0051.jpg
│ │ ├── large_0052.jpg
│ │ ├── large_0053.jpg
│ │ ├── large_0054.jpg
│ │ ├── large_0055.jpg
│ │ ├── large_0056.jpg
│ │ ├── large_0057.jpg
│ │ ├── large_0058.jpg
│ │ ├── large_0059.jpg
│ │ ├── large_0060.jpg
│ │ ├── large_0061.jpg
│ │ ├── large_0062.jpg
│ │ ├── large_0063.jpg
│ │ ├── large_0064.jpg
│ │ ├── large_0065.jpg
│ │ ├── large_0066.jpg
│ │ ├── large_0067.jpg
│ │ ├── large_0068.jpg
│ │ ├── large_0069.jpg
│ │ ├── large_0070.jpg
│ │ ├── large_0071.jpg
│ │ ├── large_0072.jpg
│ │ ├── large_0073.jpg
│ │ ├── large_0074.jpg
│ │ ├── large_0075.jpg
│ │ ├── large_0076.jpg
│ │ ├── large_0077.jpg
│ │ ├── large_0078.jpg
│ │ ├── large_0079.jpg
│ │ ├── large_0080.jpg
│ │ ├── large_0081.jpg
│ │ ├── large_0082.jpg
│ │ ├── large_0083.jpg
│ │ ├── large_0084.jpg
│ │ ├── large_0085.jpg
│ │ ├── large_0086.jpg
│ │ ├── large_0087.jpg
│ │ ├── large_0088.jpg
│ │ ├── large_0089.jpg
│ │ ├── large_0090.jpg
│ │ ├── large_0091.jpg
│ │ ├── large_0092.jpg
│ │ ├── large_0093.jpg
│ │ ├── large_0094.jpg
│ │ ├── large_0095.jpg
│ │ ├── large_0096.jpg
│ │ ├── large_0097.jpg
│ │ ├── large_0098.jpg
│ │ ├── large_0099.jpg
│ │ ├── large_0100.jpg
│ │ ├── large_0101.jpg
│ │ ├── large_0102.jpg
│ │ ├── large_0103.jpg
│ │ ├── large_0104.jpg
│ │ ├── large_0105.jpg
│ │ ├── large_0106.jpg
│ │ ├── large_0107.jpg
│ │ ├── large_0108.jpg
│ │ ├── large_0109.jpg
│ │ ├── large_0110.jpg
│ │ ├── large_0111.jpg
│ │ ├── large_0112.jpg
│ │ ├── large_0113.jpg
│ │ ├── large_0114.jpg
│ │ ├── large_0115.jpg
│ │ ├── large_0116.jpg
│ │ ├── large_0117.jpg
│ │ ├── large_0118.jpg
│ │ ├── large_0119.jpg
│ │ └── large_0120.jpg
│ ├── app.ts
│ └── layouts
│ │ ├── index.css
│ │ ├── index.tsx
│ │ └── __tests__
│ │ └── index.test.tsx
├── .env
├── .eslintrc
├── typings.d.ts
├── .prettierignore
├── .prettierrc
├── .editorconfig
├── .gitignore
├── tsconfig.json
├── .umirc.ts
└── package.json
├── README.md
└── upload-demo
├── public
├── robots.txt
├── favicon.ico
├── logo192.png
├── logo512.png
├── manifest.json
└── index.html
├── src
├── setupTests.js
├── App.test.js
├── index.css
├── reportWebVitals.js
├── index.js
├── App.css
├── logo.svg
├── App2.js
└── App.js
├── .gitignore
├── package.json
├── README.md
└── server
├── app.js
├── index.js
└── controller.js
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
--------------------------------------------------------------------------------
/dva-demo/mock/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/umi-demo/mock/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/umi-demo/src/models/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/contact-demo/README.md:
--------------------------------------------------------------------------------
1 | # 跨域请求 案例代码
--------------------------------------------------------------------------------
/dva-demo/.webpackrc:
--------------------------------------------------------------------------------
1 | {
2 | }
3 |
--------------------------------------------------------------------------------
/apple-animation-demo/mock/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apple-animation-demo/src/models/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/umi-demo/.env:
--------------------------------------------------------------------------------
1 | BROWSER=none
2 | ESLINT=1
3 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # article-demo
2 | 一些文章的代码案例文件夹
3 |
--------------------------------------------------------------------------------
/dva-demo/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "umi"
3 | }
4 |
--------------------------------------------------------------------------------
/apple-animation-demo/.env:
--------------------------------------------------------------------------------
1 | BROWSER=none
2 | ESLINT=1
3 |
--------------------------------------------------------------------------------
/dva-demo/.roadhogrc.mock.js:
--------------------------------------------------------------------------------
1 |
2 | export default {
3 | };
4 |
--------------------------------------------------------------------------------
/umi-demo/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "eslint-config-umi"
3 | }
4 |
--------------------------------------------------------------------------------
/apple-animation-demo/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "eslint-config-umi"
3 | }
4 |
--------------------------------------------------------------------------------
/dva-demo/src/index.css:
--------------------------------------------------------------------------------
1 |
2 | html, body, :global(#root) {
3 | height: 100%;
4 | }
5 |
6 |
--------------------------------------------------------------------------------
/apple-animation-demo/src/locales/en-US.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | 'index.start': 'Getting Started',
3 | }
4 |
--------------------------------------------------------------------------------
/upload-demo/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/apple-animation-demo/typings.d.ts:
--------------------------------------------------------------------------------
1 | declare module '*.css';
2 | declare module "*.png";
3 | declare module "*.jpg";
--------------------------------------------------------------------------------
/umi-demo/src/global.css:
--------------------------------------------------------------------------------
1 | html, body, #root {
2 | height: 100%;
3 | }
4 |
5 | body {
6 | margin: 0;
7 | }
8 |
--------------------------------------------------------------------------------
/dva-demo/src/assets/yay.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/dva-demo/src/assets/yay.jpg
--------------------------------------------------------------------------------
/umi-demo/src/assets/yay.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/umi-demo/src/assets/yay.jpg
--------------------------------------------------------------------------------
/umi-demo/.prettierignore:
--------------------------------------------------------------------------------
1 | **/*.md
2 | **/*.svg
3 | **/*.ejs
4 | **/*.html
5 | package.json
6 | .umi
7 | .umi-production
8 |
--------------------------------------------------------------------------------
/upload-demo/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/upload-demo/public/favicon.ico
--------------------------------------------------------------------------------
/upload-demo/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/upload-demo/public/logo192.png
--------------------------------------------------------------------------------
/upload-demo/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/upload-demo/public/logo512.png
--------------------------------------------------------------------------------
/apple-animation-demo/src/global.css:
--------------------------------------------------------------------------------
1 | html, body, #root {
2 | height: 100%;
3 | }
4 |
5 | body {
6 | margin: 0;
7 | }
8 |
--------------------------------------------------------------------------------
/apple-animation-demo/src/pages/__tests__/__mocks__/umi-plugin-locale.ts:
--------------------------------------------------------------------------------
1 | export const formatMessage = (): string => 'Mock text';
2 |
--------------------------------------------------------------------------------
/apple-animation-demo/.prettierignore:
--------------------------------------------------------------------------------
1 | **/*.md
2 | **/*.svg
3 | **/*.ejs
4 | **/*.html
5 | package.json
6 | .umi
7 | .umi-production
8 |
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/yay.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/yay.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/mac1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/mac1.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/mac2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/mac2.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/mac3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/mac3.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/mac4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/mac4.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0000.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0000.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0001.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0001.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0002.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0002.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0003.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0003.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0004.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0004.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0005.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0005.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0006.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0006.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0007.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0007.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0008.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0008.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0009.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0009.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0010.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0010.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0011.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0011.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0012.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0012.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0013.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0013.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0014.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0014.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0015.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0015.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0016.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0016.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0017.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0017.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0018.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0018.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0019.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0019.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0020.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0020.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0021.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0021.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0022.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0022.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0023.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0023.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0024.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0024.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0025.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0025.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0026.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0026.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0027.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0027.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0028.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0028.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0029.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0029.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0030.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0030.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0031.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0031.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0032.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0032.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0033.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0033.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0034.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0034.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0035.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0035.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0036.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0036.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0037.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0037.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0038.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0038.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0039.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0039.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0040.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0040.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0041.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0041.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0042.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0042.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0043.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0043.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0044.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0044.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0045.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0045.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0046.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0046.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0047.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0047.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0048.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0048.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0049.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0049.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0050.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0050.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0051.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0051.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0052.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0052.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0053.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0053.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0054.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0054.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0055.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0055.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0056.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0056.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0057.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0057.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0058.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0058.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0059.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0059.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0060.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0060.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0061.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0061.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0062.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0062.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0063.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0063.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0064.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0064.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0065.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0065.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0066.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0066.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0067.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0067.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0068.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0068.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0069.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0069.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0070.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0070.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0071.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0071.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0072.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0072.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0073.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0073.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0074.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0074.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0075.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0075.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0076.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0076.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0077.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0077.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0078.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0078.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0079.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0079.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0080.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0080.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0081.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0081.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0082.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0082.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0083.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0083.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0084.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0084.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0085.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0085.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0086.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0086.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0087.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0087.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0088.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0088.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0089.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0089.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0090.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0090.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0091.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0091.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0092.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0092.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0093.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0093.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0094.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0094.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0095.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0095.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0096.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0096.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0097.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0097.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0098.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0098.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0099.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0099.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0100.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0100.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0101.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0101.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0102.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0102.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0103.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0103.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0104.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0104.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0105.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0105.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0106.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0106.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0107.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0107.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0108.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0108.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0109.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0109.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0110.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0110.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0111.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0111.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0112.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0112.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0113.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0113.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0114.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0114.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0115.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0115.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0116.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0116.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0117.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0117.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0118.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0118.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0119.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0119.jpg
--------------------------------------------------------------------------------
/apple-animation-demo/src/assets/large_0120.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/darrell0904/article-demo/HEAD/apple-animation-demo/src/assets/large_0120.jpg
--------------------------------------------------------------------------------
/dva-demo/src/services/example.js:
--------------------------------------------------------------------------------
1 | import request from '../utils/request';
2 |
3 | export function query() {
4 | return request('/api/users');
5 | }
6 |
--------------------------------------------------------------------------------
/umi-demo/src/app.js:
--------------------------------------------------------------------------------
1 | export const dva = {
2 | config: {
3 | onError(err) {
4 | err.preventDefault();
5 | console.error(err.message);
6 | },
7 | },
8 | };
9 |
--------------------------------------------------------------------------------
/dva-demo/src/utils/utils.js:
--------------------------------------------------------------------------------
1 | export function delay(timeout) {
2 | console.log('--timeout--', timeout);
3 | return new Promise((resolve) => {
4 | setTimeout(resolve, timeout);
5 | });
6 | }
--------------------------------------------------------------------------------
/umi-demo/src/utils/utils.js:
--------------------------------------------------------------------------------
1 | export function delay(timeout) {
2 | console.log('--timeout--', timeout);
3 | return new Promise((resolve) => {
4 | setTimeout(resolve, timeout);
5 | });
6 | }
--------------------------------------------------------------------------------
/apple-animation-demo/src/app.ts:
--------------------------------------------------------------------------------
1 | export const dva = {
2 | config: {
3 | onError(err: ErrorEvent) {
4 | err.preventDefault();
5 | console.error(err.message);
6 | },
7 | },
8 | };
9 |
--------------------------------------------------------------------------------
/contact-demo/cors/server1.js:
--------------------------------------------------------------------------------
1 | let express = require('express');
2 | let app = express();
3 |
4 | app.use(express.static(__dirname));
5 |
6 | app.listen(3000, () => {
7 | console.log('服务器 1 已经在3000端口启动');
8 | });
--------------------------------------------------------------------------------
/contact-demo/csrf/server2.js:
--------------------------------------------------------------------------------
1 | let express = require('express');
2 | let app = express();
3 |
4 | app.use(express.static(__dirname));
5 |
6 | app.listen(4000, () => {
7 | console.log('服务器 2 已经在4000端口启动');
8 | });
--------------------------------------------------------------------------------
/contact-demo/hash/server1.js:
--------------------------------------------------------------------------------
1 | let express = require('express');
2 | let app = express();
3 |
4 | app.use(express.static(__dirname));
5 |
6 | app.listen(3000, () => {
7 | console.log('服务器 1 已经在3000端口启动');
8 | });
--------------------------------------------------------------------------------
/contact-demo/hash/server2.js:
--------------------------------------------------------------------------------
1 | let express = require('express');
2 | let app = express();
3 |
4 | app.use(express.static(__dirname));
5 |
6 | app.listen(4000, () => {
7 | console.log('服务器 2 已经在4000端口启动');
8 | });
--------------------------------------------------------------------------------
/contact-demo/name/server1.js:
--------------------------------------------------------------------------------
1 | let express = require('express');
2 | let app = express();
3 |
4 | app.use(express.static(__dirname));
5 |
6 | app.listen(3000, () => {
7 | console.log('服务器 1 已经在3000端口启动');
8 | });
--------------------------------------------------------------------------------
/contact-demo/name/server2.js:
--------------------------------------------------------------------------------
1 | let express = require('express');
2 | let app = express();
3 |
4 | app.use(express.static(__dirname));
5 |
6 | app.listen(4000, () => {
7 | console.log('服务器 2 已经在4000端口启动');
8 | });
--------------------------------------------------------------------------------
/contact-demo/domain/server1.js:
--------------------------------------------------------------------------------
1 | let express = require('express');
2 | let app = express();
3 |
4 | app.use(express.static(__dirname));
5 |
6 | app.listen(3000, () => {
7 | console.log('服务器 1 已经在3000端口启动');
8 | });
--------------------------------------------------------------------------------
/contact-demo/domain/server2.js:
--------------------------------------------------------------------------------
1 | let express = require('express');
2 | let app = express();
3 |
4 | app.use(express.static(__dirname));
5 |
6 | app.listen(4000, () => {
7 | console.log('服务器 2 已经在4000端口启动');
8 | });
--------------------------------------------------------------------------------
/contact-demo/postmessage/server1.js:
--------------------------------------------------------------------------------
1 | let express = require('express');
2 | let app = express();
3 |
4 | app.use(express.static(__dirname));
5 |
6 | app.listen(3000, () => {
7 | console.log('服务器 1 已经在3000端口启动');
8 | });
--------------------------------------------------------------------------------
/contact-demo/postmessage/server2.js:
--------------------------------------------------------------------------------
1 | let express = require('express');
2 | let app = express();
3 |
4 | app.use(express.static(__dirname));
5 |
6 | app.listen(4000, () => {
7 | console.log('服务器 2 已经在4000端口启动');
8 | });
--------------------------------------------------------------------------------
/dva-demo/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 |
6 | # production
7 | /dist
8 |
9 | # misc
10 | .DS_Store
11 | npm-debug.log*
12 |
--------------------------------------------------------------------------------
/umi-demo/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "singleQuote": true,
3 | "trailingComma": "all",
4 | "printWidth": 100,
5 | "overrides": [
6 | {
7 | "files": ".prettierrc",
8 | "options": { "parser": "json" }
9 | }
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/apple-animation-demo/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "singleQuote": true,
3 | "trailingComma": "all",
4 | "printWidth": 100,
5 | "overrides": [
6 | {
7 | "files": ".prettierrc",
8 | "options": { "parser": "json" }
9 | }
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/dva-demo/src/components/Example.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | const Example = () => {
4 | return (
5 |
6 | Example
7 |
8 | );
9 | };
10 |
11 | Example.propTypes = {
12 | };
13 |
14 | export default Example;
15 |
--------------------------------------------------------------------------------
/upload-demo/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/contact-demo/name/b.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | window-name
7 |
8 |
9 | window-name b.html
10 |
11 |
--------------------------------------------------------------------------------
/apple-animation-demo/src/pages/document.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Your App
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/upload-demo/src/App.test.js:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import App from './App';
3 |
4 | test('renders learn react link', () => {
5 | render();
6 | const linkElement = screen.getByText(/learn react/i);
7 | expect(linkElement).toBeInTheDocument();
8 | });
9 |
--------------------------------------------------------------------------------
/apple-animation-demo/src/layouts/index.css:
--------------------------------------------------------------------------------
1 |
2 | .normal {
3 | font-family: Georgia, sans-serif;
4 | }
5 |
6 | .title {
7 | font-size: 2.5rem;
8 | font-weight: normal;
9 | letter-spacing: -1px;
10 | background: darkslateblue;
11 | padding: .6em 0;
12 | color: white;
13 | margin: 0;
14 | }
15 |
--------------------------------------------------------------------------------
/contact-demo/websocket/server.js:
--------------------------------------------------------------------------------
1 | let express = require('express');
2 | let WebSocket = require('ws');
3 | let wss = new WebSocket.Server({ port: 3000 });
4 |
5 | wss.on('connection', function(ws) {
6 | ws.on('message', function(data) {
7 | console.log(data);
8 |
9 | ws.send('服务器发的内容');
10 | })
11 | })
--------------------------------------------------------------------------------
/umi-demo/src/layouts/index.js:
--------------------------------------------------------------------------------
1 | import styles from './index.css';
2 |
3 | function BasicLayout(props) {
4 | return (
5 |
6 |
Yay! Welcome to umi!
7 | {props.children}
8 |
9 | );
10 | }
11 |
12 | export default BasicLayout;
13 |
--------------------------------------------------------------------------------
/umi-demo/src/layouts/index.css:
--------------------------------------------------------------------------------
1 |
2 | .normal {
3 | font-family: Georgia, sans-serif;
4 | text-align: center;
5 | }
6 |
7 | .title {
8 | font-size: 2.5rem;
9 | font-weight: normal;
10 | letter-spacing: -1px;
11 | background: darkslateblue;
12 | padding: .6em 0;
13 | color: white;
14 | margin: 0;
15 | }
16 |
--------------------------------------------------------------------------------
/umi-demo/webpack.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 不是真实的 webpack 配置,仅为兼容 webstorm 和 intellij idea 代码跳转
3 | * ref: https://github.com/umijs/umi/issues/1109#issuecomment-423380125
4 | */
5 |
6 | module.exports = {
7 | resolve: {
8 | alias: {
9 | '@': require('path').resolve(__dirname, 'src'),
10 | },
11 | },
12 | };
13 |
--------------------------------------------------------------------------------
/dva-demo/.editorconfig:
--------------------------------------------------------------------------------
1 | # http://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | charset = utf-8
9 | trim_trailing_whitespace = true
10 | insert_final_newline = true
11 |
12 | [*.md]
13 | trim_trailing_whitespace = false
14 |
15 | [Makefile]
16 | indent_style = tab
17 |
--------------------------------------------------------------------------------
/umi-demo/.editorconfig:
--------------------------------------------------------------------------------
1 | # http://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | charset = utf-8
9 | trim_trailing_whitespace = true
10 | insert_final_newline = true
11 |
12 | [*.md]
13 | trim_trailing_whitespace = false
14 |
15 | [Makefile]
16 | indent_style = tab
17 |
--------------------------------------------------------------------------------
/umi-demo/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /npm-debug.log*
6 | /yarn-error.log
7 | /yarn.lock
8 | /package-lock.json
9 |
10 | # production
11 | /dist
12 |
13 | # misc
14 | .DS_Store
15 |
16 | # umi
17 | .umi
18 | .umi-production
19 |
--------------------------------------------------------------------------------
/apple-animation-demo/.editorconfig:
--------------------------------------------------------------------------------
1 | # http://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | charset = utf-8
9 | trim_trailing_whitespace = true
10 | insert_final_newline = true
11 |
12 | [*.md]
13 | trim_trailing_whitespace = false
14 |
15 | [Makefile]
16 | indent_style = tab
17 |
--------------------------------------------------------------------------------
/contact-demo/csrf/b.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | csrf - demo
7 |
8 |
9 | csrf - b.html
10 |
11 |
12 |
--------------------------------------------------------------------------------
/apple-animation-demo/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /npm-debug.log*
6 | /yarn-error.log
7 | /yarn.lock
8 | /package-lock.json
9 |
10 | # production
11 | /dist
12 |
13 | # misc
14 | .DS_Store
15 |
16 | # umi
17 | .umi
18 | .umi-production
19 |
--------------------------------------------------------------------------------
/apple-animation-demo/src/layouts/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import styles from './index.css';
3 |
4 | const BasicLayout: React.FC = props => {
5 | return (
6 | <>
7 | {/* Yay! Welcome to umi!
*/}
8 | {props.children}
9 | >
10 | );
11 | };
12 |
13 | export default BasicLayout;
14 |
--------------------------------------------------------------------------------
/contact-demo/name/c.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | window-name
7 |
8 |
9 | window-name c.html
10 |
13 |
14 |
--------------------------------------------------------------------------------
/dva-demo/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Dva Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/contact-demo/domain/b.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | document-domain
7 |
8 |
9 | document-domain b.html
10 |
14 |
15 |
--------------------------------------------------------------------------------
/dva-demo/src/index.js:
--------------------------------------------------------------------------------
1 | import dva from 'dva';
2 | //使用import导入。
3 | import countModel from './models/example';
4 | import router from './router';
5 |
6 | import './index.css';
7 |
8 | // 1. Initialize
9 | const app = dva();
10 |
11 | // 2. Plugins
12 | // app.use({});
13 |
14 | // 3. Model
15 | app.model(countModel);
16 |
17 | // 4. Router
18 | app.router(router);
19 |
20 | // 5. Start
21 | app.start('#root');
--------------------------------------------------------------------------------
/dva-demo/src/router.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Router, Route, Switch } from 'dva/router';
3 | import IndexPage from './routes/IndexPage';
4 |
5 | function RouterConfig({ history }) {
6 | return (
7 |
8 |
9 |
10 |
11 |
12 | );
13 | }
14 |
15 | export default RouterConfig;
16 |
--------------------------------------------------------------------------------
/contact-demo/hash/b.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | window-hash
7 |
8 |
9 | window-hash b.html
10 |
14 |
15 |
--------------------------------------------------------------------------------
/upload-demo/.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 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/apple-animation-demo/src/pages/demo3/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import styles from './index.css';
3 |
4 | const Demo3 = (): JSX.Element => {
5 | return (
6 | <>
7 |
12 |
13 | >
14 | );
15 | }
16 |
17 | export default Demo3;
18 |
--------------------------------------------------------------------------------
/upload-demo/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/apple-animation-demo/src/pages/demo2/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding: 0px 100px;
3 | margin: 0;
4 | }
5 |
6 | nav {
7 | display: table;
8 | width: 100%;
9 | position: sticky;
10 | top: 0;
11 | }
12 |
13 | nav h3 {
14 | display: table-cell;
15 | outline: 1px solid #fff;
16 | background-color: #4caf50;
17 | color: #fff;
18 | text-align: center;
19 | padding: 10px;
20 | }
21 |
22 | p {
23 | font-size: 16px;
24 | }
25 |
26 |
--------------------------------------------------------------------------------
/upload-demo/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/contact-demo/csrf/ajax.js:
--------------------------------------------------------------------------------
1 | function ajax(
2 | methods,
3 | url
4 | ) {
5 | const xhr = new XMLHttpRequest();
6 |
7 | xhr.open(methods, url, true);
8 |
9 | xhr.withCredentials = true;
10 |
11 | xhr.onreadystatechange = function() {
12 | if (xhr.readyState === 4) {
13 | if (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) {
14 | console.log(xhr.response);
15 | }
16 | }
17 | }
18 |
19 | xhr.send();
20 | }
--------------------------------------------------------------------------------
/umi-demo/src/pages/index.css:
--------------------------------------------------------------------------------
1 |
2 | .normal {
3 | font-family: Georgia, sans-serif;
4 | margin-top: 4em;
5 | text-align: center;
6 | }
7 |
8 | .welcome {
9 | height: 512px;
10 | background: url(../assets/yay.jpg) no-repeat center 0;
11 | background-size: 512px 512px;
12 | }
13 |
14 | .list {
15 | font-size: 1.2em;
16 | margin: 1.8em 0 0;
17 | list-style: none;
18 | line-height: 1.5em;
19 | }
20 |
21 | .list code {
22 | background: #f7f7f7;
23 | }
24 |
--------------------------------------------------------------------------------
/apple-animation-demo/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "esnext",
4 | "module": "esnext",
5 | "moduleResolution": "node",
6 | "importHelpers": true,
7 | "jsx": "react",
8 | "esModuleInterop": true,
9 | "sourceMap": true,
10 | "baseUrl": ".",
11 | "strict": true,
12 | "paths": {
13 | "@/*": ["src/*"],
14 | "@tmp/*": ["src/pages/.umi/*"]
15 | },
16 | "allowSyntheticDefaultImports": true
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/umi-demo/src/pages/__tests__/index.test.js:
--------------------------------------------------------------------------------
1 | import Index from '..';
2 | import renderer from 'react-test-renderer';
3 |
4 |
5 | describe('Page: index', () => {
6 | it('Render correctly', () => {
7 | const wrapper = renderer.create();
8 | expect(wrapper.root.children.length).toBe(1);
9 | const outerLayer = wrapper.root.children[0];
10 | expect(outerLayer.type).toBe('div');
11 | expect(outerLayer.children.length).toBe(2);
12 |
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/contact-demo/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "contact-demo",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "devDependencies": {
12 | "cookie-parser": "^1.4.4",
13 | "express": "^4.17.1",
14 | "jquery": "^3.4.1",
15 | "ws": "^7.2.1"
16 | },
17 | "dependencies": {
18 | "socket.io": "^2.3.0"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/apple-animation-demo/src/pages/index.css:
--------------------------------------------------------------------------------
1 |
2 | .normal {
3 | font-family: Georgia, sans-serif;
4 | margin-top: 2em;
5 | }
6 |
7 | .welcome {
8 | height: 512px;
9 | background: url(../assets/yay.jpg) no-repeat center 0;
10 | background-size: 512px 512px;
11 | }
12 |
13 | .list {
14 | font-size: 1.2em;
15 | margin: 1.8em 0 0;
16 | list-style: none;
17 | line-height: 1.5em;
18 | }
19 |
20 | .list li {
21 | margin-top: 16px;
22 | }
23 |
24 | .list code {
25 | background: #f7f7f7;
26 | }
27 |
--------------------------------------------------------------------------------
/contact-demo/cors/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Cors
7 |
8 |
9 | Cors demo
10 |
11 |
16 |
17 |
--------------------------------------------------------------------------------
/contact-demo/csrf/a.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | csrf - demo
7 |
8 |
9 | csrf - a.html
10 |
11 |
15 |
16 |
--------------------------------------------------------------------------------
/umi-demo/src/pages/index.js:
--------------------------------------------------------------------------------
1 | import styles from './index.css';
2 |
3 | export default function() {
4 | return (
5 |
16 | );
17 | }
18 |
--------------------------------------------------------------------------------
/umi-demo/src/pages/home/index.css:
--------------------------------------------------------------------------------
1 | .normal {
2 | width: 200px;
3 | margin: 100px auto;
4 | padding: 20px;
5 | border: 1px solid #ccc;
6 | box-shadow: 0 0 20px #ccc;
7 | }
8 |
9 | .record {
10 | border-bottom: 1px solid #ccc;
11 | padding-bottom: 8px;
12 | color: #ccc;
13 | }
14 |
15 | .current {
16 | text-align: center;
17 | font-size: 40px;
18 | padding: 40px 0;
19 | }
20 |
21 | .button {
22 | text-align: center;
23 | }
24 |
25 | button {
26 | width: 100px;
27 | height: 40px;
28 | background: #aaa;
29 | color: #fff;
30 | }
--------------------------------------------------------------------------------
/apple-animation-demo/src/pages/demo3/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | overflow: visible;
3 | height: 2000px;
4 | }
5 |
6 | .wrapper {
7 |
8 | /* overflow: hidden; */
9 | }
10 |
11 | .flowBox {
12 | position: fixed;
13 | top: 20px;
14 | left: 0;
15 | right: 0;
16 | bottom: 0;
17 | background-color: #d30000;
18 | opacity: .7;
19 | mix-blend-mode: multiply;
20 | }
21 | div.nav {
22 | height: 100px;
23 | border: solid deepskyblue;
24 | margin-top: 50px;
25 | }
26 | nav {
27 | position: sticky;
28 | top: 20px;
29 | background: lightskyblue;
30 | }
--------------------------------------------------------------------------------
/contact-demo/hash/c.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | window-hash
7 |
8 |
9 | window-hash c.html
10 |
18 |
19 |
--------------------------------------------------------------------------------
/contact-demo/postmessage/b.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | postmessage
7 |
8 |
9 | postmessage B 页面
10 |
20 |
21 |
--------------------------------------------------------------------------------
/contact-demo/websocket/socket.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Socket
7 |
8 |
9 | Socket demo
10 |
22 |
23 |
--------------------------------------------------------------------------------
/dva-demo/src/routes/IndexPage.css:
--------------------------------------------------------------------------------
1 | .normal {
2 | width: 200px;
3 | margin: 100px auto;
4 | padding: 20px;
5 | border: 1px solid #ccc;
6 | box-shadow: 0 0 20px #ccc;
7 | }
8 |
9 | .record {
10 | border-bottom: 1px solid #ccc;
11 | padding-bottom: 8px;
12 | color: #ccc;
13 | }
14 |
15 | .current {
16 | text-align: center;
17 | font-size: 40px;
18 | padding: 40px 0;
19 | }
20 |
21 | .button {
22 | text-align: center;
23 |
24 | button {
25 | width: 100px;
26 | height: 40px;
27 | background: #aaa;
28 | color: #fff;
29 | }
30 | }
--------------------------------------------------------------------------------
/apple-animation-demo/src/pages/demo4/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0px;
3 | padding: 100px;
4 | height: 2000px;
5 | }
6 |
7 | h4 {
8 | margin: 2em 0 0;
9 | background-color: #333;
10 | color: #fff;
11 | padding: 10px;
12 | top: 0;
13 | z-index: 1;
14 | position: sticky;
15 | }
16 |
17 | ul {
18 | display: block;
19 | background-color: #ffffe0;
20 | position: relative;
21 | padding: 0px;
22 | }
23 |
24 | li {
25 | height: 36px;
26 | width: 36px;
27 | list-style-type: none;
28 | width: 100%;
29 | background-color: #f7f9f7;
30 | margin-top: 10px;
31 | }
--------------------------------------------------------------------------------
/contact-demo/jsonp/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | jsonp demo
7 |
8 |
9 | Jsonp 的 demo
10 |
11 |
22 |
23 |
--------------------------------------------------------------------------------
/umi-demo/src/layouts/__tests__/index.test.js:
--------------------------------------------------------------------------------
1 | import BasicLayout from '..';
2 | import renderer from 'react-test-renderer';
3 |
4 | describe('Layout: BasicLayout', () => {
5 | it('Render correctly', () => {
6 | const wrapper = renderer.create();
7 | expect(wrapper.root.children.length).toBe(1);
8 | const outerLayer = wrapper.root.children[0];
9 | expect(outerLayer.type).toBe('div');
10 | const title = outerLayer.children[0];
11 | expect(title.type).toBe('h1');
12 | expect(title.children[0]).toBe('Yay! Welcome to umi!');
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/upload-demo/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 reportWebVitals from './reportWebVitals';
6 |
7 | ReactDOM.render(
8 |
9 |
10 | ,
11 | document.getElementById('root')
12 | );
13 |
14 | // If you want to start measuring performance in your app, pass a function
15 | // to log results (for example: reportWebVitals(console.log))
16 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
17 | reportWebVitals();
18 |
--------------------------------------------------------------------------------
/contact-demo/jsonp/jsonp.js:
--------------------------------------------------------------------------------
1 | function jsonp ({
2 | url,
3 | params,
4 | cb
5 | }) {
6 | return new Promise(function(resolve, reject) {
7 | let script = document.createElement('script');
8 |
9 | window[cb] = function(data) {
10 | resolve(data);
11 | document.body.removeChild(script);
12 | }
13 |
14 | params = { ...params, cb};
15 |
16 | let arrs = [];
17 |
18 | for(let key in params) {
19 | arrs.push(`${key}=${params[key]}`);
20 | }
21 |
22 | script.src = `${url}?${arrs.join('&')}`;
23 | document.body.appendChild(script);
24 | })
25 | }
--------------------------------------------------------------------------------
/contact-demo/hash/a.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | window-hash
7 |
8 |
9 |
10 |
11 | window-hash a.html
12 |
17 |
22 |
23 |
--------------------------------------------------------------------------------
/apple-animation-demo/src/pages/demo1/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0px;
3 | }
4 |
5 | section {
6 | height: 100vh;
7 | }
8 |
9 | .normal {
10 | font-family: Georgia, sans-serif;
11 | margin-top: 2em;
12 | text-align: center;
13 | }
14 |
15 | .gImg {
16 | background-attachment: fixed;
17 | background-size: cover;
18 | background-position: center center;
19 | width: 100%;
20 | }
21 |
22 | .gImg1 {
23 | background-image: url(@/assets/mac1.jpg);
24 | }
25 |
26 | .gImg2 {
27 | background-image: url(@/assets/mac2.jpg);
28 | }
29 |
30 | .gImg3 {
31 | background-image: url(@/assets/mac4.jpg);
32 | }
--------------------------------------------------------------------------------
/contact-demo/jsonp/server.js:
--------------------------------------------------------------------------------
1 | let express = require('express');
2 | let app = express();
3 |
4 | app.use(express.static(__dirname));
5 |
6 | app.get('/jsonp', function(req, res) {
7 | const { headers } = req;
8 | console.log(headers);
9 | const data = {
10 | data: '我是 jsonp 的 data',
11 | }
12 |
13 | const { cb } = req.query;
14 |
15 | res.writeHead(200,{'Content-Type':'text/html;charset=utf-8'})
16 |
17 | if (cb) {
18 | res.end(`${cb}(${JSON.stringify(data)})`);
19 | } else {
20 | res.end('未传参数');
21 | }
22 |
23 | })
24 |
25 | app.listen(3000, () => {
26 | console.log('服务器已经在3000端口启动');
27 | });
--------------------------------------------------------------------------------
/upload-demo/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 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/apple-animation-demo/src/pages/demo1/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import styles from './index.css';
3 |
4 | const Demo = (): JSX.Element => {
5 | return (
6 |
7 | {/* */}
8 |
9 | {/* */}
10 |
11 | {/* */}
12 |
13 | {/* */}
14 |
15 | );
16 | }
17 |
18 | export default Demo;
19 |
--------------------------------------------------------------------------------
/contact-demo/websocket/serverIO.js:
--------------------------------------------------------------------------------
1 | var app = require('express')();
2 | var http = require('http').createServer(app);
3 | var io = require('socket.io')(http);
4 | var port = process.env.PORT || 3000;
5 |
6 | app.get('/', function(req, res){
7 | res.sendFile(__dirname + '/socketIO.html');
8 | });
9 |
10 | io.on('connection', function(socket){
11 | socket.on('chat message', function(msg){
12 | io.emit('chat message', msg);
13 | }); //监听socket是否连接,如果连接的话,就发送数据,chat-message
14 | socket.on('disconnect', function(){
15 | console.log('user disconnected');
16 | }); //监听socket是否断开,断开时执行相应的方法
17 | });
18 |
19 | http.listen(port, function(){
20 | console.log('listening on *:' + port);
21 | });
--------------------------------------------------------------------------------
/apple-animation-demo/src/pages/openMac/index.css:
--------------------------------------------------------------------------------
1 |
2 | .normal {
3 | font-family: Georgia, sans-serif;
4 | margin-top: 2em;
5 | text-align: center;
6 | }
7 |
8 | .stickyContainer {
9 | height: 150vh;
10 | }
11 |
12 | .stickyWrapper {
13 | height: 100vh;
14 | position: sticky;
15 | top: 100px;
16 | }
17 |
18 | .imgWrapper {
19 | width: 100vh;
20 | height: 521px;
21 | margin: 0 auto;
22 | }
23 |
24 | .imgWrapper img {
25 | width: 100%;
26 | }
27 |
28 | .list {
29 | font-size: 1.2em;
30 | margin: 1.8em 0 0;
31 | list-style: none;
32 | line-height: 1.5em;
33 | }
34 |
35 | .list code {
36 | background: #f7f7f7;
37 | }
38 |
39 | .content p {
40 | line-height: 24px
41 | }
42 |
--------------------------------------------------------------------------------
/contact-demo/cors/ajax.js:
--------------------------------------------------------------------------------
1 | function ajax(
2 | methods,
3 | url
4 | ) {
5 | const xhr = new XMLHttpRequest();
6 |
7 | xhr.open(methods, url, true);
8 |
9 | // document.cookie = "name=darrell";
10 |
11 | xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
12 | xhr.setRequestHeader('name', 'darrell');
13 | xhr.setRequestHeader('key', '123456');
14 | xhr.withCredentials = true;
15 |
16 |
17 | xhr.onreadystatechange = function() {
18 | if (xhr.readyState === 4) {
19 | if (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) {
20 | console.log(xhr.response);
21 | console.log(xhr.getResponseHeader('name'));
22 | }
23 | }
24 | }
25 |
26 | xhr.send();
27 | }
--------------------------------------------------------------------------------
/apple-animation-demo/src/layouts/__tests__/index.test.tsx:
--------------------------------------------------------------------------------
1 | import 'jest';
2 | import BasicLayout from '..';
3 | import React from 'react';
4 | import renderer, { ReactTestInstance, ReactTestRenderer } from 'react-test-renderer';
5 |
6 | describe('Layout: BasicLayout', () => {
7 | it('Render correctly', () => {
8 | const wrapper: ReactTestRenderer = renderer.create();
9 | expect(wrapper.root.children.length).toBe(1);
10 | const outerLayer = wrapper.root.children[0] as ReactTestInstance;
11 | expect(outerLayer.type).toBe('div');
12 | const title = outerLayer.children[0] as ReactTestInstance;
13 | expect(title.type).toBe('h1');
14 | expect(title.children[0]).toBe('Yay! Welcome to umi!');
15 | });
16 | });
17 |
--------------------------------------------------------------------------------
/contact-demo/domain/a.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | document-domain
7 |
8 |
9 |
10 |
11 | document-domain a.html
12 |
18 |
26 |
27 |
--------------------------------------------------------------------------------
/dva-demo/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "scripts": {
4 | "start": "roadhog server",
5 | "build": "roadhog build",
6 | "lint": "eslint --ext .js src test",
7 | "precommit": "npm run lint"
8 | },
9 | "dependencies": {
10 | "dva": "^2.4.1",
11 | "react": "^16.2.0",
12 | "react-dom": "^16.2.0"
13 | },
14 | "devDependencies": {
15 | "babel-plugin-dva-hmr": "^0.3.2",
16 | "eslint": "^4.14.0",
17 | "eslint-config-umi": "^0.1.1",
18 | "eslint-plugin-flowtype": "^2.34.1",
19 | "eslint-plugin-import": "^2.6.0",
20 | "eslint-plugin-jsx-a11y": "^5.1.1",
21 | "eslint-plugin-react": "^7.1.0",
22 | "husky": "^0.12.0",
23 | "keymaster": "^1.6.2",
24 | "redbox-react": "^1.4.3",
25 | "roadhog": "^2.5.0-beta.4"
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/contact-demo/name/a.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | window-name
7 |
8 |
9 | window-name a.html
10 |
16 |
32 |
33 |
--------------------------------------------------------------------------------
/umi-demo/.umirc.js:
--------------------------------------------------------------------------------
1 |
2 | // ref: https://umijs.org/config/
3 | export default {
4 | treeShaking: true,
5 | // routes: [
6 | // {
7 | // path: '/',
8 | // component: '../layouts/index',
9 | // routes: [
10 | // { path: '/', component: '../pages/index' }
11 | // ]
12 | // }
13 | // ],
14 | plugins: [
15 | // ref: https://umijs.org/plugin/umi-plugin-react.html
16 | ['umi-plugin-react', {
17 | antd: true,
18 | dva: true,
19 | dynamicImport: false,
20 | title: 'demo1',
21 | dll: false,
22 |
23 | routes: {
24 | exclude: [
25 | /models\//,
26 | /services\//,
27 | /model\.(t|j)sx?$/,
28 | /service\.(t|j)sx?$/,
29 | /components\//,
30 | ],
31 | },
32 | }],
33 | ],
34 | }
35 |
--------------------------------------------------------------------------------
/apple-animation-demo/src/pages/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import styles from './index.css';
3 | export default function() {
4 | return (
5 |
30 | );
31 | }
32 |
--------------------------------------------------------------------------------
/dva-demo/src/utils/request.js:
--------------------------------------------------------------------------------
1 | import fetch from 'dva/fetch';
2 |
3 | function parseJSON(response) {
4 | return response.json();
5 | }
6 |
7 | function checkStatus(response) {
8 | if (response.status >= 200 && response.status < 300) {
9 | return response;
10 | }
11 |
12 | const error = new Error(response.statusText);
13 | error.response = response;
14 | throw error;
15 | }
16 |
17 | /**
18 | * Requests a URL, returning a promise.
19 | *
20 | * @param {string} url The URL we want to request
21 | * @param {object} [options] The options we want to pass to "fetch"
22 | * @return {object} An object containing either "data" or "err"
23 | */
24 | export default function request(url, options) {
25 | return fetch(url, options)
26 | .then(checkStatus)
27 | .then(parseJSON)
28 | .then(data => ({ data }))
29 | .catch(err => ({ err }));
30 | }
31 |
--------------------------------------------------------------------------------
/apple-animation-demo/src/pages/__tests__/index.test.tsx:
--------------------------------------------------------------------------------
1 | import 'jest';
2 | import Index from '..';
3 | import React from 'react';
4 | import renderer, { ReactTestInstance, ReactTestRenderer } from 'react-test-renderer';
5 |
6 | jest.mock('umi-plugin-locale');
7 |
8 | describe('Page: index', () => {
9 | it('Render correctly', () => {
10 | const wrapper: ReactTestRenderer = renderer.create();
11 | expect(wrapper.root.children.length).toBe(1);
12 | const outerLayer = wrapper.root.children[0] as ReactTestInstance;
13 | expect(outerLayer.type).toBe('div');
14 | expect(outerLayer.children.length).toBe(2);
15 | const getStartLink = outerLayer.findAllByProps({
16 | href: 'https://umijs.org/guide/getting-started.html',
17 | }) as ReactTestInstance[];
18 | expect(getStartLink.length).toBe(1);
19 | expect(getStartLink[0].children).toMatchObject(['Mock text']);
20 | });
21 | });
22 |
--------------------------------------------------------------------------------
/apple-animation-demo/src/pages/canvasDraw/index.css:
--------------------------------------------------------------------------------
1 | html {
2 | position: relative;
3 | }
4 |
5 | body {
6 | margin: 0px;
7 | }
8 |
9 | .stickyContainer {
10 | height: 250vh;
11 | position: relative;
12 | }
13 |
14 | .componentContainer {
15 | overflow: hidden;
16 | position: sticky;
17 | width: 100%;
18 | height: 100vh;
19 | top: 0;
20 | display: flex;
21 | justify-content: center;
22 | will-change: transform;
23 | }
24 |
25 | .imgWrapper {
26 | display: flex;
27 | align-items: center;
28 | justify-content: center;
29 |
30 | width: 694px;
31 | height: 408px;
32 | background-size: 694px 408px;
33 | background-image: url(@/assets/mac3.jpg);
34 |
35 | transform-origin: top;
36 |
37 | text-align: center;
38 | position: relative;
39 |
40 | }
41 |
42 | .canvas {
43 | position: absolute;
44 | top: 18px;
45 | width: 544px;
46 | height: 341px;
47 | }
48 |
49 | .content p {
50 | line-height: 24px
51 | }
--------------------------------------------------------------------------------
/contact-demo/postmessage/a.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | postmessage
7 |
8 |
9 | postmessage A 页面
10 |
16 |
35 |
36 |
--------------------------------------------------------------------------------
/umi-demo/src/models/count.js:
--------------------------------------------------------------------------------
1 | import key from 'keymaster';
2 | import { delay } from '../utils/utils';
3 |
4 | export default {
5 |
6 | namespace: 'count',
7 |
8 | state: {
9 | record: 0,
10 | current: 0,
11 | },
12 |
13 | effects: {
14 | *add(action, { call, put }) {
15 | yield put({ type: 'add1' });
16 | yield call( delay, 1000 );
17 | yield put({ type: 'minus' });
18 | },
19 | },
20 |
21 | reducers: {
22 | add1(state) {
23 | const newCurrent = state.current + 1;
24 |
25 | return {
26 | ...state,
27 | record: newCurrent > state.record ? newCurrent : state.record,
28 | current: newCurrent,
29 | };
30 | },
31 | minus(state) {
32 | return { ...state, current: state.current - 1 };
33 | },
34 | },
35 |
36 | subscriptions: {
37 | keyboardWatcher({ dispatch }) {
38 | key('⌘+up, ctrl+up', () => { dispatch({type:'add'}) });
39 | },
40 | },
41 |
42 | };
43 |
--------------------------------------------------------------------------------
/contact-demo/csrf/server1.js:
--------------------------------------------------------------------------------
1 | let express = require('express');
2 | let app = express();
3 | const cookieParase = require('cookie-parser');
4 | //这点很重要,如果没有,下面的req.cookies 会返回undefined
5 | app.use(cookieParase());
6 |
7 | app.use(express.static(__dirname));
8 |
9 | app.get('/getMoney', function(req, res) {
10 | const { username } = req.cookies;
11 | const cookies1 = req.headers.cookie;
12 | const { name } = req.query;
13 |
14 | // console.log(req.cookies);
15 | // console.log(req.headers);
16 | // console.log('--cookies1---', cookies1);
17 |
18 | console.log(req.headers.referer);
19 |
20 | const data = {
21 | data: 'you got 1000 万',
22 | }
23 |
24 | console.log('---name---', name);
25 |
26 | res.writeHead(200,{'Content-Type':'text/html;charset=utf-8'})
27 |
28 | if (username && username == "John Smith") {
29 | res.end(JSON.stringify(data));
30 | } else {
31 | res.end('请登录');
32 | }
33 | })
34 |
35 | app.listen(3000, () => {
36 | console.log('服务器 1 已经在3000端口启动');
37 | });
--------------------------------------------------------------------------------
/apple-animation-demo/.umirc.ts:
--------------------------------------------------------------------------------
1 | import { IConfig } from 'umi-types';
2 |
3 | // ref: https://umijs.org/config/
4 | const config: IConfig = {
5 | treeShaking: true,
6 | // routes: [
7 | // {
8 | // path: '/',
9 | // component: '../layouts/index',
10 | // routes: [
11 | // { path: '/', component: '../pages/index' }
12 | // ]
13 | // }
14 | // ],
15 | plugins: [
16 | // ref: https://umijs.org/plugin/umi-plugin-react.html
17 | ['umi-plugin-react', {
18 | antd: true,
19 | dva: true,
20 | dynamicImport: { webpackChunkName: true },
21 | title: 'apple-animation-demo',
22 | dll: true,
23 | locale: {
24 | enable: true,
25 | default: 'en-US',
26 | },
27 | routes: {
28 | exclude: [
29 | /models\//,
30 | /services\//,
31 | /model\.(t|j)sx?$/,
32 | /service\.(t|j)sx?$/,
33 | /components\//,
34 | ],
35 | },
36 | }],
37 | ],
38 | }
39 |
40 | export default config;
41 |
--------------------------------------------------------------------------------
/umi-demo/src/pages/home/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { connect } from 'dva';
3 | import styles from './index.css';
4 |
5 | class IndexPage extends React.Component {
6 | render() {
7 | const { dispatch, count } = this.props;
8 |
9 | return (
10 |
11 |
12 | {/*将count的record输出*/}
13 | Highest Record: {count.record}
14 |
15 |
16 |
17 | {count.current}
18 |
19 |
20 |
21 |
30 |
31 |
32 | );
33 | }
34 | }
35 |
36 | function mapStateToProps(state) {
37 | return { count: state.count };
38 | } // 获取state
39 |
40 | export default connect(mapStateToProps)(IndexPage);
--------------------------------------------------------------------------------
/dva-demo/src/routes/IndexPage.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { connect } from 'dva';
3 | import styles from './IndexPage.css';
4 |
5 | class IndexPage extends React.Component {
6 | render() {
7 | const { dispatch, count } = this.props;
8 |
9 | return (
10 |
11 |
12 | {/*将count的record输出*/}
13 | Highest Record: {count.record}
14 |
15 |
16 |
17 | {count.current}
18 |
19 |
20 |
21 |
30 |
31 |
32 | );
33 | }
34 | }
35 |
36 | function mapStateToProps(state) {
37 | return { count: state.count };
38 | } // 获取state
39 |
40 | export default connect(mapStateToProps)(IndexPage);
--------------------------------------------------------------------------------
/dva-demo/src/models/example.js:
--------------------------------------------------------------------------------
1 | import key from 'keymaster';
2 | import { delay } from '../utils/utils';
3 |
4 | export default {
5 |
6 | namespace: 'count',
7 |
8 | state: {
9 | record: 0,
10 | current: 0,
11 | },
12 |
13 | subscriptions: {
14 | setup({ dispatch, history }) { // eslint-disable-line
15 | },
16 | },
17 |
18 |
19 | effects: {
20 | *add(action, { call, put }) {
21 | yield put({ type: 'add1' });
22 | yield call( delay, 1000 );
23 | yield put({ type: 'minus' });
24 | },
25 | },
26 |
27 | reducers: {
28 | add1(state) {
29 | const newCurrent = state.current + 1;
30 |
31 | return {
32 | ...state,
33 | record: newCurrent > state.record ? newCurrent : state.record,
34 | current: newCurrent,
35 | };
36 | },
37 | minus(state) {
38 | return { ...state, current: state.current - 1 };
39 | },
40 | },
41 |
42 | subscriptions: {
43 | keyboardWatcher({ dispatch }) {
44 | key('⌘+up, ctrl+up', () => { dispatch({type:'add'}) });
45 | },
46 | },
47 |
48 | };
49 |
--------------------------------------------------------------------------------
/umi-demo/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "scripts": {
4 | "start": "umi dev",
5 | "build": "umi build",
6 | "test": "umi test",
7 | "lint": "eslint {src,mock,tests}/**/*.{js,jsx} --fix",
8 | "precommit": "lint-staged"
9 | },
10 | "dependencies": {
11 | "dva": "^2.6.0-beta.6",
12 | "antd": "^3.19.5",
13 | "react": "^16.8.6",
14 | "react-dom": "^16.8.6"
15 | },
16 | "devDependencies": {
17 | "babel-eslint": "^9.0.0",
18 | "eslint": "^5.4.0",
19 | "eslint-config-umi": "^1.4.0",
20 | "eslint-plugin-flowtype": "^2.50.0",
21 | "eslint-plugin-import": "^2.14.0",
22 | "eslint-plugin-jsx-a11y": "^5.1.1",
23 | "eslint-plugin-react": "^7.11.1",
24 | "husky": "^0.14.3",
25 | "keymaster": "^1.6.2",
26 | "lint-staged": "^7.2.2",
27 | "react-test-renderer": "^16.7.0",
28 | "umi": "^2.7.7",
29 | "umi-plugin-react": "^1.8.4"
30 | },
31 | "lint-staged": {
32 | "*.{js,jsx}": [
33 | "eslint --fix",
34 | "git add"
35 | ]
36 | },
37 | "engines": {
38 | "node": ">=8.0.0"
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/apple-animation-demo/src/pages/demo4/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import styles from './index.css';
3 |
4 | const Demo4 = (): JSX.Element => {
5 | return (
6 |
7 |
时间固定demo
8 |
9 |
10 | 5月20日
11 |
12 | - 1
13 | - 2
14 | - 3
15 | - 4
16 |
17 |
18 |
19 | 5月19日
20 |
21 | - 1
22 | - 2
23 | - 3
24 |
25 |
26 |
27 | 5月11日
28 |
29 | - 1
30 | - 2
31 | - 3
32 | - 4
33 | - 5
34 | - 6
35 | - 7
36 |
37 |
38 |
39 |
40 |
41 | );
42 | }
43 |
44 | export default Demo4;
45 |
--------------------------------------------------------------------------------
/upload-demo/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "upload-demo",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.11.4",
7 | "@testing-library/react": "^11.1.0",
8 | "@testing-library/user-event": "^12.1.10",
9 | "react": "^17.0.2",
10 | "react-dom": "^17.0.2",
11 | "react-scripts": "4.0.3",
12 | "web-vitals": "^1.0.1"
13 | },
14 | "scripts": {
15 | "start": "PORT=8080 react-scripts start",
16 | "build": "react-scripts build",
17 | "test": "react-scripts test",
18 | "eject": "react-scripts eject",
19 | "server": "nodemon ./server/index.js"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | },
39 | "devDependencies": {
40 | "fs-extra": "^8.1.0",
41 | "multiparty": "^4.2.1",
42 | "nodemon": "^2.0.1"
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/upload-demo/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | /* text-align: center; */
3 | margin: 100px;
4 | }
5 |
6 | .App-logo {
7 | height: 40vmin;
8 | pointer-events: none;
9 | }
10 |
11 | @media (prefers-reduced-motion: no-preference) {
12 | .App-logo {
13 | animation: App-logo-spin infinite 20s linear;
14 | }
15 | }
16 |
17 | .App-header {
18 | background-color: #282c34;
19 | min-height: 100vh;
20 | display: flex;
21 | flex-direction: column;
22 | align-items: center;
23 | justify-content: center;
24 | font-size: calc(10px + 2vmin);
25 | color: white;
26 | }
27 |
28 | .App-link {
29 | color: #61dafb;
30 | }
31 |
32 | .progressText {
33 | margin-top: 4px;
34 | width: 1000px;
35 | }
36 |
37 | .totalBar {
38 | height: 30px;
39 | border: 1px solid;
40 | border-radius: 3px;
41 | width: 50%;
42 | margin: 10px 0 60px;
43 | }
44 |
45 | .totalBarColor {
46 | width: 0%;
47 | border: 0;
48 | background: #FFFE33;
49 | color: #FFF;
50 | height: 28px;
51 | }
52 |
53 | .action button + button {
54 | margin-left: 8px;
55 | }
56 |
57 | @keyframes App-logo-spin {
58 | from {
59 | transform: rotate(0deg);
60 | }
61 | to {
62 | transform: rotate(360deg);
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/apple-animation-demo/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "scripts": {
4 | "start": "umi dev",
5 | "build": "umi build",
6 | "test": "umi test",
7 | "lint": "eslint {src,mock,tests}/**/*.{ts,tsx} --fix",
8 | "precommit": "lint-staged"
9 | },
10 | "dependencies": {
11 | "dva": "^2.6.0-beta.6",
12 | "antd": "^3.19.5",
13 | "react": "^16.8.6",
14 | "react-dom": "^16.8.6"
15 | },
16 | "devDependencies": {
17 | "@types/jest": "^23.3.12",
18 | "@types/react": "^16.7.18",
19 | "@types/react-dom": "^16.0.11",
20 | "@types/react-test-renderer": "^16.0.3",
21 | "babel-eslint": "^9.0.0",
22 | "eslint": "^5.4.0",
23 | "eslint-config-umi": "^1.4.0",
24 | "eslint-plugin-flowtype": "^2.50.0",
25 | "eslint-plugin-import": "^2.14.0",
26 | "eslint-plugin-jsx-a11y": "^5.1.1",
27 | "eslint-plugin-react": "^7.11.1",
28 | "husky": "^0.14.3",
29 | "lint-staged": "^7.2.2",
30 | "react-test-renderer": "^16.7.0",
31 | "umi": "^2.9.0",
32 | "umi-plugin-react": "^1.8.0",
33 | "umi-types": "^0.3.0"
34 | },
35 | "lint-staged": {
36 | "*.{ts,tsx}": ["eslint --fix", "git add"],
37 | "*.{js,jsx}": ["eslint --fix", "git add"]
38 | },
39 | "engines": {
40 | "node": ">=8.0.0"
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/apple-animation-demo/src/pages/demo2/index.tsx:
--------------------------------------------------------------------------------
1 | import React, { useEffect } from 'react';
2 | import styles from './index.css';
3 |
4 | const Demo2 = (): JSX.Element => {
5 | return (
6 |
7 |
我是 sticky 的第一个 demo
8 |
13 |
14 | position:sticky早有耳闻也有所了解,后来,Chrome放弃了对其支持,我也就不关心这个声明了,
今天偶然发现,卧槽,Chrome什么时候杀了个回马枪,居然又支持了。眼瞅着,各个浏览器纷纷立了山头,要必要关心关心position:sticky了,不要被人留下厚此薄彼的口舌。
15 | 单词sticky的中文意思是“粘性的”,position:sticky表现也符合这个粘性的表现。基本上,
可以看出是position:relative和position:fixed的结合体——当元素在屏幕内,表现为relative,就要滚出显示器屏幕的时候,表现为fixed。例如,可以滚动下面这个框框感受下交互表现:
16 | 很多人以为position:sticky就上面这点效果,就好像以为就是个平常的史莱姆一样,实际上,
position:sticky可以实现性价比极高,甚至还有点小酷的交互布局效果。嘿嘿,这可是皇帝的夜壶——不是人人都能看到的哟。
17 | position:sticky有个非常重要的特性,那就是sticky元素效果完全受制于父级元素们。
这和position:fixed定位有着根本性的不同,fixed元素直抵页面根元素,其他父元素对其left/top定位无法限制。
18 | 父级元素不能有任何overflow:visible以外的overflow设置,否则没有粘滞效果。
因为改变了滚动容器(即使没有出现滚动条)。因此,如果你的position:sticky无效,看看是不是某一个祖先元素设置了overflow:hidden,移除之即可。
19 | 父级元素设置和粘性定位元素等高的固定的height高度值,或者高度计算值和粘性定位元素高度一样,
也没有粘滞效果。我专门写了篇文章深入讲解了粘性效果无效的原因,可以点击这里查看。
20 | 同一个父容器中的sticky元素,如果定位值相等,则会重叠;如果属于不同父元素,
且这些父元素正好紧密相连,则会鸠占鹊巢,挤开原来的元素,形成依次占位的效果。至于原因需要理解粘性定位的计算规则,同样点击这里查看。
21 | sticky定位,不仅可以设置top,基于滚动容器上边缘定位;还可以设置bottom,
也就是相对底部粘滞。如果是水平滚动,也可以设置left和right值。
22 |
23 |
24 | );
25 | }
26 |
27 | export default Demo2;
28 |
--------------------------------------------------------------------------------
/contact-demo/websocket/socketIO.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Socket.IO chat
7 |
17 |
18 |
19 |
20 |
23 |
24 |
25 |
26 |
27 |
28 |
44 |
45 |
--------------------------------------------------------------------------------
/upload-demo/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
17 |
18 |
27 | React App
28 |
29 |
30 |
31 |
32 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/contact-demo/cors/server2.js:
--------------------------------------------------------------------------------
1 | let express = require('express');
2 | let app = express();
3 |
4 | const cookieParase = require('cookie-parser');
5 | //这点很重要,如果没有,下面的req.cookies 会返回undefined
6 | app.use(cookieParase());
7 |
8 | let whiteList = ['http://localhost:3000']
9 |
10 | app.all('*', function (req, res, next) {
11 | let origin = req.headers.origin;
12 |
13 | if (whiteList.includes(origin)) {
14 | // 设置哪个源访问
15 | res.setHeader('Access-Control-Allow-Origin', origin);
16 | // 允许前端携带哪个头访问我
17 | res.setHeader('Access-Control-Allow-Headers', 'name,key');
18 | // 允许哪个方法访问
19 | res.header("Access-Control-Allow-Methods","PUT");
20 | // 允许携带 cookie
21 | res.header("Access-Control-Allow-Credentials", true);
22 | // 允许前端获取哪个头
23 | res.header("Access-Control-Expose-Headers", 'name');
24 | // 用来指定本次预检请求的有效期,单位为秒
25 | res.header("Access-Control-Max-Age","6");
26 | } else {
27 | res.end('你不在白名单中');
28 | }
29 |
30 | next();
31 | });
32 |
33 | app.get('/getData', function(req, res) {
34 | // console.log(req.cookies);
35 |
36 | // res.cookie('user', 'maolei');
37 | res.setHeader('name', 'maolei');
38 |
39 | const data = {
40 | data: '我是 cors 的 data',
41 | }
42 |
43 | res.end(JSON.stringify(data));
44 | })
45 |
46 | // 修改文件
47 | // 发送与预请求
48 | // options 请求
49 | // http://www.ruanyifeng.com/blog/2016/04/cors.html
50 | // chorme 无法显示 options
51 | // https://blog.csdn.net/willingtolove/article/details/104461912
52 |
53 | app.put('/getData', function(req, res) {
54 | console.log(req.headers);
55 |
56 | res.writeHead(200,{'Content-Type':'text/html;charset=utf-8'})
57 |
58 | const data = {
59 | data: '我是 cors 的 data',
60 | }
61 |
62 | res.end(JSON.stringify(data));
63 | })
64 |
65 | app.post('/getData', function(req, res) {
66 | console.log(req.headers);
67 |
68 | const data = {
69 | data: '我是 cors 的 data',
70 | }
71 |
72 | res.end(JSON.stringify(data));
73 | })
74 |
75 | app.listen(4000, () => {
76 | console.log('服务器 2 已经在 4000 端口启动');
77 | });
--------------------------------------------------------------------------------
/apple-animation-demo/src/pages/bgAttachment/index.css:
--------------------------------------------------------------------------------
1 | html {
2 | position: relative;
3 | }
4 |
5 | body {
6 | margin: 0px;
7 | /*padding: 48px;
8 | display: flex;
9 | flex-direction: column;
10 | justify-content: center;
11 | align-items: center;*/
12 | }
13 |
14 | .normal {
15 | font-family: Georgia, sans-serif;
16 | margin-top: 2em;
17 | text-align: center;
18 | }
19 |
20 | .box {
21 | width: 100px;
22 | height: 100px;
23 | background: #00C487;
24 | /*transform: translate(10px, 20px) rotate(30deg) scale(1.5, 2);*/
25 | /*transform: matrix(0.75, 0.8, -0.8, 1.2, 10, 20);*/
26 | /*transform: matrix(1, 0, 0, 1, 0, 136);*/
27 | }
28 |
29 | img {
30 | /*opacity: 0;*/
31 | }
32 |
33 | .stickyContainer {
34 | height: 150vh;
35 | position: relative;
36 | /*margin-top: 100px;*/
37 | }
38 |
39 | .componentContainer {
40 | overflow: hidden;
41 | position: sticky;
42 | width: 100%;
43 | height: 100vh;
44 | top: 0;
45 | display: flex;
46 | justify-content: center;
47 | will-change: transform;
48 | }
49 |
50 | .imgWrapper {
51 | /*margin-top: 100px;*/
52 |
53 | width: 694px;
54 | height: 408px;
55 | /*background-size: 694px 408px;*/
56 | background-image: url(@/assets/mac3.jpg);
57 | background-position: center center;
58 | transform-origin: top;
59 | text-align: center;
60 | position: relative;
61 | background-repeat: no-repeat;
62 | /*transform: matrix(1, 0, 0, 1, 0, 136);*/
63 | }
64 |
65 | .content p {
66 | line-height: 24px
67 | }
68 |
69 | section {
70 | height: 100vh;
71 | }
72 |
73 | .gImg {
74 | background-size: cover;
75 | background-position: center center;
76 | width: 100%;
77 | }
78 |
79 | .fixed {
80 | background-attachment: fixed;
81 | }
82 |
83 | .gImg1 {
84 | background-image: url(@/assets/mac1.jpg);
85 | }
86 |
87 | .gImg2 {
88 | background-image: url(@/assets/mac2.jpg);
89 | /*background-size: 544px 341px;*/
90 | background-repeat: no-repeat;
91 | width: 544px;
92 | height: 341px;
93 | /*position: absolute;*/
94 | /*top: 18px;*/
95 | margin: 0 auto;
96 | }
--------------------------------------------------------------------------------
/upload-demo/src/logo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/upload-demo/README.md:
--------------------------------------------------------------------------------
1 | # Getting Started with Create React App
2 |
3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
4 |
5 | ## Available Scripts
6 |
7 | In the project directory, you can run:
8 |
9 | ### `yarn start`
10 |
11 | Runs the app in the development mode.\
12 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
13 |
14 | The page will reload if you make edits.\
15 | You will also see any lint errors in the console.
16 |
17 | ### `yarn test`
18 |
19 | Launches the test runner in the interactive watch mode.\
20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21 |
22 | ### `yarn build`
23 |
24 | Builds the app for production to the `build` folder.\
25 | It correctly bundles React in production mode and optimizes the build for the best performance.
26 |
27 | The build is minified and the filenames include the hashes.\
28 | Your app is ready to be deployed!
29 |
30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31 |
32 | ### `yarn eject`
33 |
34 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
35 |
36 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37 |
38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
39 |
40 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
41 |
42 | ## Learn More
43 |
44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45 |
46 | To learn React, check out the [React documentation](https://reactjs.org/).
47 |
48 | ### Code Splitting
49 |
50 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
51 |
52 | ### Analyzing the Bundle Size
53 |
54 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
55 |
56 | ### Making a Progressive Web App
57 |
58 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
59 |
60 | ### Advanced Configuration
61 |
62 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
63 |
64 | ### Deployment
65 |
66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
67 |
68 | ### `yarn build` fails to minify
69 |
70 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
71 |
--------------------------------------------------------------------------------
/upload-demo/server/app.js:
--------------------------------------------------------------------------------
1 | var http = require('http');
2 | var koaStatic = require('koa-static');
3 | var path = require('path');
4 | var koaBody = require('koa-body');
5 | var fs = require('fs');
6 | var Koa = require('koa2');
7 | const bodyParser = require('koa-bodyparser')
8 |
9 |
10 | var app = new Koa();
11 | var port = process.env.PORT || '3000';
12 |
13 | var uploadHost= `http://localhost:${port}/uploads/`;
14 |
15 | app.use(koaBody({
16 | formidable: {
17 | //设置文件的默认保存目录,不设置则保存在系统临时目录下
18 | uploadDir: path.resolve(__dirname, '../static/uploads')
19 | },
20 | multipart: true // 支持文件上传
21 | }));
22 |
23 | app.use(bodyParser());
24 |
25 | app.use(koaStatic(
26 | path.resolve(__dirname, '../static')
27 | ));
28 |
29 | //允许跨域
30 | app.use(async (ctx, next) => {
31 | console.log('----ctx.headers.origin----', ctx.headers.origin);
32 | ctx.set('Access-Control-Allow-Origin', ctx.headers.origin);
33 | ctx.set("Access-Control-Max-Age", 864000);
34 | // 设置所允许的HTTP请求方法
35 | ctx.set("Access-Control-Allow-Methods", "OPTIONS, GET, POST");
36 | // 字段是必需的。它也是一个逗号分隔的字符串,表明服务器支持的所有头信息字段.
37 | ctx.set("Access-Control-Allow-Headers", "x-requested-with, accept, origin, content-type");
38 |
39 | await next();
40 | })
41 |
42 | //二次处理文件,修改名称
43 | app.use((ctx) => {
44 | console.log(ctx.request.files);
45 | var body = ctx.request.body;
46 | var files = ctx.request.files ? ctx.request.files.f1:[];//得到上传文件的数组
47 | var result=[];
48 | var fileToken = ctx.request.body.token;// 文件标识
49 | var fileIndex=ctx.request.body.index;//文件顺序
50 |
51 | console.log('files');
52 | console.log(files);
53 | console.log('=-====', ctx.request.body);
54 | console.log(fileToken);
55 | console.log(fileIndex);
56 |
57 |
58 | if(files && !Array.isArray(files)){//单文件上传容错
59 | files=[files];
60 | }
61 |
62 | files && files.forEach(item=>{
63 | var path = item.path.replace(/\\/g, '/');
64 | var fname = item.name;//原文件名称
65 | var nextPath = path.slice(0, path.lastIndexOf('/') + 1) + fileIndex + '-' + fileToken;
66 | if (item.size > 0 && path) {
67 | //得到扩展名
68 | var extArr = fname.split('.');
69 | var ext = extArr[extArr.length - 1];
70 | //var nextPath = path + '.' + ext;
71 | //重命名文件
72 | fs.renameSync(path, nextPath);
73 |
74 | result.push(uploadHost+ nextPath.slice(nextPath.lastIndexOf('/') + 1));
75 | }
76 | });
77 |
78 | ctx.body = `{
79 | "fileUrl":${JSON.stringify(result)}
80 | }`;
81 |
82 | if(body.type==='merge'){
83 | //合并文件
84 | var filename = body.filename,
85 | chunkCount = body.chunkCount,
86 | folder = path.resolve(__dirname, '../static/uploads')+'/';
87 |
88 | var writeStream = fs.createWriteStream(`${folder}${filename}`);
89 |
90 | var cindex=0;
91 | //合并文件
92 | function fnMergeFile(){
93 | var fname = `${folder}${cindex}-${fileToken}`;
94 | var readStream = fs.createReadStream(fname);
95 |
96 | readStream.pipe(writeStream, { end: false });
97 | readStream.on("end", function () {
98 | fs.unlink(fname, function (err) {
99 | if (err) {
100 | throw err;
101 | }
102 | });
103 | if (cindex+1 < chunkCount){
104 | cindex += 1;
105 | fnMergeFile();
106 | }
107 | });
108 | }
109 |
110 | try {
111 | fnMergeFile();
112 | } catch (error) {
113 |
114 | }
115 |
116 |
117 | ctx.body='merge ok 200';
118 | }
119 | });
120 |
121 | /**
122 | * Create HTTP server.
123 | */
124 | var server = http.createServer(app.callback());
125 | server.listen(port);
126 | console.log('demo13 server start ...... ');
127 |
--------------------------------------------------------------------------------
/upload-demo/server/index.js:
--------------------------------------------------------------------------------
1 | const multiparty = require('multiparty');
2 | const http = require('http');
3 | const path = require('path');
4 | const fse = require('fs-extra');
5 | const server = http.createServer();
6 |
7 | const extractExt = (filename) => {
8 | return filename.slice(filename.lastIndexOf('.'), filename.length); // 提取后缀名
9 | }
10 |
11 | const rendAjax = (res, obj) => {
12 | res.end(JSON.stringify(obj));
13 | };
14 |
15 | const UPLOAD_DIR = path.resolve(__dirname, '..', 'target'); // 大文件存储目录
16 |
17 | const pipeStream = (path, writeStream) =>
18 | new Promise((resolve) => {
19 | const readStream = fse.createReadStream(path);
20 | readStream.on('end', () => {
21 | fse.unlinkSync(path);
22 | resolve();
23 | });
24 | readStream.pipe(writeStream);
25 | });
26 |
27 | // 合并切片
28 | /**
29 | *
30 | * @param {*} filePath 文件目录
31 | * @param {*} fileHash md5值
32 | * @param {*} size 切片的个数
33 | */
34 | const mergeFileChunk = async (filePath, fileHash, size) => {
35 | const chunkDir = path.resolve(UPLOAD_DIR, fileHash);
36 | const chunkPaths = await fse.readdir(chunkDir);
37 | // 根据切片下标进行排序
38 | // 否则直接读取目录的获得的顺序可能会错乱
39 | chunkPaths.sort((a, b) => a.split('-')[1] - b.split('-')[1]);
40 | await Promise.all(
41 | chunkPaths.map((chunkPath, index) =>
42 | pipeStream(
43 | path.resolve(chunkDir, chunkPath),
44 | // 指定位置创建可写流
45 | fse.createWriteStream(filePath, {
46 | start: index * size,
47 | end: (index + 1) * size
48 | })
49 | )
50 | )
51 | );
52 | fse.rmdirSync(chunkDir); // 合并后删除保存切片的目录
53 | };
54 |
55 | server.on('request', async (req, res) => {
56 | res.setHeader('Access-Control-Allow-Origin', '*');
57 | res.setHeader('Access-Control-Allow-Headers', '*');
58 | res.writeHead(200, {'Content-Type': 'text/html; charset=utf-8'});
59 |
60 | if (req.method === 'OPTIONS') {
61 | res.status = 200;
62 | res.end();
63 | return;
64 | }
65 |
66 | if (req.url.indexOf('/fileChunk/presence') !== -1) {
67 | await controller.handleVerifyUpload(req, res);
68 | return;
69 | }
70 |
71 | if (req.url === '/fileChunk/merge') {
72 | const multipart = new multiparty.Form();
73 |
74 | multipart.parse(req, async (err, fields, files) => {
75 | if (err) {
76 | console.error(err);
77 | res.status = 500;
78 | res.end('process file chunk failed');
79 | return;
80 | }
81 |
82 | const [md5] = fields.token;
83 | const [fileName] = fields.filename;
84 |
85 | const ext = extractExt(fileName);
86 |
87 | const filePath = path.resolve(UPLOAD_DIR, `${md5}${ext}`);
88 |
89 | await mergeFileChunk(filePath, md5, 2 * 1024 * 1024);
90 |
91 | return rendAjax(res, {
92 | code: 2000,
93 | message: '合并成功'
94 | });
95 | })
96 |
97 | return;
98 | }
99 |
100 | if (req.url === '/fileChunk') {
101 | const multipart = new multiparty.Form();
102 |
103 | multipart.parse(req, async (err, fields, files) => {
104 | if (err) {
105 | console.error(err);
106 | res.status = 500;
107 | res.end('process file chunk failed');
108 | return;
109 | }
110 |
111 | const [chunk] = files.f1;
112 | const [hash] = fields.token;
113 | const [filename] = fields.index;
114 |
115 | const ext = extractExt(fields.index);
116 |
117 | const filePath = path.resolve(UPLOAD_DIR, `${hash}`);
118 | const chunkDir = path.resolve(UPLOAD_DIR, hash);
119 |
120 | // 文件存在直接返回
121 | if (fse.existsSync(`${filePath}${ext}`)) {
122 | return rendAjax(res, {
123 | code: 2001,
124 | message: '文件已存在'
125 | });
126 | }
127 |
128 | // 切片目录不存在,创建切片目录
129 | if (!fse.existsSync(chunkDir)) {
130 | await fse.mkdirs(chunkDir);
131 | }
132 |
133 | try {
134 | await fse.move(chunk.path, path.resolve(chunkDir, filename));
135 | } catch (error) {
136 | console.log('handleFileChunk -> error', error);
137 | }
138 | rendAjax(res, {
139 | code: 200,
140 | message: '切片上传成功'
141 | });
142 | return;
143 | });
144 | }
145 |
146 | if (req.url === '/') {
147 | res.end('Welcome');
148 | }
149 | });
150 |
151 | server.listen(3000, () => console.log('正在监听 3000 端口'));
152 |
--------------------------------------------------------------------------------
/upload-demo/src/App2.js:
--------------------------------------------------------------------------------
1 | import { useState } from 'react';
2 | import './App.css';
3 |
4 | const CHUNK_SIZE = 2 * 1024 * 1024; //2m
5 | const THREADS = 3; //最大并发数
6 |
7 | // 单个文件的状态
8 | const fileStatus = {
9 | wait: 'wait',
10 | uploading: 'uploading',
11 | success: 'success',
12 | error: 'error',
13 | secondPass: 'secondPass',
14 | pause: 'pause',
15 | resume: 'resume'
16 | };
17 |
18 | // 创建文件切片
19 | const createFileChunk = (file, size = CHUNK_SIZE) => {
20 | const fileChunkList = [];
21 | var count = 0;
22 | while (count < file.size) {
23 | fileChunkList.push({
24 | file: file.slice(count, count + size)
25 | });
26 | count += size;
27 | }
28 | return fileChunkList;
29 | };
30 |
31 | const xhrSend = (formData, {
32 | onProgress,
33 | onComplete,
34 | callback
35 | }) => {
36 | const xhr = new XMLHttpRequest(); //创建对象
37 | xhr.open('POST', 'http://localhost:3000/', true);
38 |
39 | xhr.onreadystatechange = function () {
40 | console.log('state change', xhr.readyState);
41 | if (xhr.readyState == 4 && xhr.responseText.length>10) {
42 | console.log('xhr.responseText');
43 | console.log(xhr.responseText);
44 | callback && callback();
45 | }
46 | }
47 |
48 | xhr.upload.addEventListener('progress', (event) => {
49 | if (event.lengthComputable) {
50 | var completedPercent = (event.loaded / event.total * 100).toFixed(2);
51 | // progressSpan.style.width = completedPercent + '%';
52 | // progressSpan.innerHTML = completedPercent + '%';
53 | // if (completedPercent > 90) {//进度条变色
54 | // progressSpan.classList.add('green');
55 | // }
56 | }
57 | });
58 |
59 | xhr.send(formData);
60 | };
61 |
62 | function App() {
63 | const [uploadFile, setUploadFile] = useState(null);
64 |
65 | const handleFileChange = (e) => {
66 | const files = e.target.files;
67 |
68 | if (!files) return;
69 |
70 | const file = files[0];
71 |
72 |
73 | file.status = fileStatus.wait;
74 | file.fileHash = 1570615258206;
75 | file.chunkList = [];
76 | file.uploadProgress = 0;
77 |
78 | setUploadFile(file);
79 | };
80 |
81 | const sendRequest = (chunks) => {
82 | const fileHash = 1570615258206; //模拟 hash
83 | const chunkCount = chunks.length;
84 | let sendChunkCount = 0;
85 |
86 | return new Promise((resolve, reject) => {
87 | const handler = () => {
88 | // if (chunks.length > 0) {
89 | // var fd = new FormData(); //构造FormData对象
90 | // fd.append('hash', fileHash);
91 | // fd.append('file', chunks[i]);
92 | // fd.append('fileName', i);
93 | // }
94 | };
95 |
96 | for (let i = 0; i < THREADS; i++) {
97 | handler();
98 | }
99 | });
100 | };
101 |
102 | // 点击上传
103 | const upload = (e) => {
104 | console.log('---e----', uploadFile);
105 |
106 | const chunks = createFileChunk(uploadFile);
107 |
108 | uploadFile.chunkList = chunks.map(({file}, index) => ({
109 | fileHash: uploadFile.fileHash,
110 | fileName: uploadFile.name,
111 | index,
112 | hash: uploadFile.fileHash + '-' + index,
113 | chunk: file,
114 | size: file.size,
115 | }));
116 |
117 | const requestDataList = chunks
118 | .map(({ fileHash, chunk, fileName, index }) => {
119 | const formData = new FormData();
120 | formData.append('hash', fileHash);
121 | formData.append('file', chunk);
122 | formData.append('fileName', index); // 文件名使用切片的下标
123 |
124 | return { formData, index, fileName };
125 | });
126 |
127 | console.log('---chunks---', chunks);
128 |
129 |
130 | };
131 |
132 | const pause = (e) => {
133 | console.log('---暂停了');
134 | };
135 |
136 | return (
137 |
138 |
139 |
140 |
141 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 | );
153 | }
154 |
155 | export default App;
156 |
--------------------------------------------------------------------------------
/upload-demo/server/controller.js:
--------------------------------------------------------------------------------
1 | const multiparty = require('multiparty');
2 | const path = require('path');
3 | const fse = require('fs-extra');
4 | const url = require('url');
5 |
6 | const extractExt = (filename) =>
7 | filename.slice(filename.lastIndexOf('.'), filename.length); // 提取后缀名
8 |
9 | const UPLOAD_DIR = path.resolve(__dirname, '..', 'target'); // 大文件存储目录
10 |
11 | const pipeStream = (path, writeStream) =>
12 | new Promise((resolve) => {
13 | const readStream = fse.createReadStream(path);
14 | readStream.on('end', () => {
15 | fse.unlinkSync(path);
16 | resolve();
17 | });
18 | readStream.pipe(writeStream);
19 | });
20 |
21 | // 合并切片
22 | /**
23 | *
24 | * @param {*} filePath 文件目录
25 | * @param {*} fileHash md5值
26 | * @param {*} size 切片的个数
27 | */
28 | const mergeFileChunk = async (filePath, fileHash, size) => {
29 | const chunkDir = path.resolve(UPLOAD_DIR, fileHash);
30 | const chunkPaths = await fse.readdir(chunkDir);
31 | // 根据切片下标进行排序
32 | // 否则直接读取目录的获得的顺序可能会错乱
33 | chunkPaths.sort((a, b) => a.split('-')[1] - b.split('-')[1]);
34 | await Promise.all(
35 | chunkPaths.map((chunkPath, index) =>
36 | pipeStream(
37 | path.resolve(chunkDir, chunkPath),
38 | // 指定位置创建可写流
39 | fse.createWriteStream(filePath, {
40 | start: index * (50 * 1024 * 1024),
41 | end: (index + 1) * (50 * 1024 * 1024)
42 | })
43 | )
44 | )
45 | );
46 | fse.rmdirSync(chunkDir); // 合并后删除保存切片的目录
47 | };
48 |
49 | const resolvePost = (req) => {
50 | return new Promise((resolve) => {
51 | let chunk = '';
52 | req.on('data', (data) => {
53 | chunk += data;
54 | console.log('chunk', chunk);
55 | });
56 | req.on('end', () => {
57 | resolve(JSON.parse(chunk));
58 | });
59 | });
60 | }
61 |
62 | module.exports = class {
63 | // 合并切片
64 | async handleMerge(req, res) {
65 | const data = await resolvePost(req);
66 | const { md5, fileName, fileChunkNum } = data;
67 | const ext = extractExt(fileName);
68 | const filePath = path.resolve(UPLOAD_DIR, `${md5}${ext}`);
69 | await mergeFileChunk(filePath, md5, fileChunkNum);
70 | return rendAjax(res, {
71 | code: 2000,
72 | message: '合并成功'
73 | });
74 | }
75 | // 处理切片
76 | async handleFileChunk(req, res) {
77 | const multipart = new multiparty.Form();
78 |
79 | multipart.parse(req, async (err, fields, files) => {
80 | if (err) {
81 | console.error(err);
82 | res.status = 500;
83 | res.end('process file chunk failed');
84 | return;
85 | }
86 | const [chunk] = files.file;
87 | const [hash] = fields.md5;
88 | const [filename] = fields.fileName;
89 | const ext = extractExt(fields.fileName);
90 | console.log('handleFileChunk -> filename', filename);
91 | const filePath = path.resolve(UPLOAD_DIR, `${hash}`);
92 | const chunkDir = path.resolve(UPLOAD_DIR, hash);
93 |
94 | console.log('---chunk.path---', chunk.path);
95 |
96 | // 文件存在直接返回
97 | if (fse.existsSync(`${filePath}${ext}`)) {
98 | return rendAjax(res, {
99 | code: 2001,
100 | message: '文件已存在'
101 | });
102 | }
103 |
104 | // 切片目录不存在,创建切片目录
105 | if (!fse.existsSync(chunkDir)) {
106 | await fse.mkdirs(chunkDir);
107 | }
108 |
109 | try {
110 | await fse.move(chunk.path, path.resolve(chunkDir, filename));
111 | } catch (error) {
112 | console.log('handleFileChunk -> error', error);
113 | }
114 | rendAjax(res, {
115 | code: 200,
116 | message: '切片上传成功'
117 | });
118 | return;
119 | });
120 | }
121 | // 验证是否已上传/已上传切片下标
122 | async handleVerifyUpload(req, res) {
123 | var data = url.parse(req.url, true);
124 | const { md5, fileName } = data.query;
125 | const ext = extractExt(fileName);
126 | const filePath = path.resolve(UPLOAD_DIR, `${md5}${ext}`);
127 | if (fse.existsSync(filePath)) {
128 | return rendAjax(res, {
129 | code: 2000,
130 | message: '操作成功',
131 | data: {
132 | md5: md5,
133 | presence: true
134 | }
135 | });
136 | } else {
137 | return rendAjax(res, {
138 | code: 2000,
139 | message: '操作成功',
140 | data: {
141 | md5: md5,
142 | presence: false
143 | }
144 | });
145 | }
146 | }
147 | };
148 |
149 | const rendAjax = (res, obj) => {
150 | res.end(JSON.stringify(obj));
151 | };
152 |
--------------------------------------------------------------------------------
/upload-demo/src/App.js:
--------------------------------------------------------------------------------
1 | import { useState } from 'react';
2 | import './App.css';
3 |
4 | const CHUNK_SIZE = 2 * 1024 * 1024; //2m
5 | const THREADS = 3; //最大并发数
6 |
7 |
8 | const SAVE_CHUNK_KEY = "chunkuploadedObj";
9 |
10 | // 创建文件切片
11 | const createFileChunk = (file, size = CHUNK_SIZE) => {
12 | const fileChunkList = [];
13 | var count = 0;
14 | while (count < file.size) {
15 | fileChunkList.push({
16 | file: file.slice(count, count + size)
17 | });
18 | count += size;
19 | }
20 | return fileChunkList;
21 | };
22 |
23 | //获得本地缓存的数据
24 | const getUploadedFromStorage = () => {
25 | return JSON.parse( localStorage.getItem(SAVE_CHUNK_KEY) || "{}");
26 | };
27 |
28 | // 写入缓存
29 | const setUploadedToStorage = (index) => {
30 | var obj = getUploadedFromStorage();
31 | obj[index]=true;
32 | localStorage.setItem(SAVE_CHUNK_KEY, JSON.stringify(obj) );
33 | }
34 |
35 | const clearLocalStorage = () => {
36 | localStorage.removeItem(SAVE_CHUNK_KEY);
37 | };
38 |
39 | function App() {
40 | const [uploadFile, setUploadFile] = useState(null);
41 | const [uploadPersent, setUploadPersent] = useState(0);
42 |
43 | const handleFileChange = (e) => {
44 | const files = e.target.files;
45 |
46 | if (!files) return;
47 |
48 | const file = files[0];
49 |
50 | file.token = 1570615258206;
51 |
52 | console.log('---file---', file);
53 |
54 | setUploadFile(file);
55 | };
56 |
57 | const xhrSend = (url, formData, callback) => {
58 | const xhr = new XMLHttpRequest(); //创建对象
59 |
60 | xhr.open('POST', url, true);
61 |
62 | xhr.onreadystatechange = function () {
63 | console.log('state change', xhr.readyState);
64 | if (xhr.readyState == 4 && xhr.responseText.length > 10) {
65 | console.log(xhr.responseText);
66 | callback && callback();
67 | }
68 | }
69 |
70 | xhr.upload.addEventListener('progress', (event) => {
71 | if (event.lengthComputable) {
72 | var completedPercent = (event.loaded / event.total * 100).toFixed(2);
73 |
74 | // setUploadPersent(completedPercent);
75 | }
76 | });
77 |
78 | xhr.send(formData);
79 | };
80 |
81 | // 发送分片
82 | const sendRequest = (chunks) => {
83 | let finished = 0;
84 | const total = chunks.length;
85 |
86 | const uploadedInfo = getUploadedFromStorage();
87 |
88 | return new Promise((resolve, reject) => {
89 | const handler = () => {
90 | if (chunks.length > 0) {
91 | // 出栈
92 | const formInfo = chunks.shift();
93 |
94 | if (uploadedInfo[formInfo.index]) {
95 | finished++;
96 | handler();
97 | return;
98 | }
99 |
100 | console.log('---formInfo---', formInfo);
101 |
102 | const formData = new FormData();
103 | formData.append('token', formInfo.token);
104 | formData.append('f1', formInfo.file);
105 | formData.append('index', formInfo.index); // 文件名使用切片的下标
106 |
107 | xhrSend('http://localhost:3000/fileChunk', formData, () => {
108 | finished++;
109 | setUploadPersent(finished / total * 100);
110 | setUploadedToStorage(formInfo.index);
111 | handler();
112 | });
113 | }
114 |
115 | if (finished >= total) {
116 | resolve('done');
117 | }
118 | };
119 |
120 | // 控制并发
121 | for (let i = 0; i < THREADS; i++) {
122 | handler();
123 | }
124 | });
125 | }
126 |
127 | const sendMergeQuest = (chunkLength) => {
128 | const formD = new FormData();
129 |
130 | console.log('-----chunks----', chunkLength);
131 |
132 | formD.append('type', 'merge');
133 | formD.append('token', uploadFile.token);
134 | formD.append('chunkCount', chunkLength);
135 | formD.append('filename', uploadFile.name);
136 |
137 | clearLocalStorage();
138 |
139 | xhrSend('http://localhost:3000/fileChunk/merge', formD);
140 | };
141 |
142 | // 点击上传
143 | const upload = async () => {
144 | let chunks = createFileChunk(uploadFile);
145 |
146 | chunks = chunks.map((item, index) => {
147 | return {
148 | file: item.file,
149 | index,
150 | token: uploadFile.token
151 | }
152 | });
153 |
154 | const chunkLength = chunks.length;
155 |
156 | const ret = await sendRequest(chunks);
157 |
158 | console.log('---ret----', ret);
159 |
160 | // 合并请求
161 | if (ret === 'done') {
162 | sendMergeQuest(chunkLength);
163 | }
164 | };
165 |
166 | return (
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 | 上传中:{uploadPersent}%
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 | );
185 | }
186 |
187 | export default App;
188 |
--------------------------------------------------------------------------------
/apple-animation-demo/src/pages/openMac/index.tsx:
--------------------------------------------------------------------------------
1 | import React, { useEffect, useRef, useState } from 'react';
2 | import styles from './index.css';
3 |
4 | declare global {
5 | interface Window {
6 | $: any
7 | }
8 | }
9 |
10 | const { $ } = window;
11 |
12 | const OpenMac = (): JSX.Element => {
13 |
14 | let startOpen = 0;
15 |
16 | const [asset, setAsset] = useState(`large_0001`);
17 |
18 | let url = 'large_0001';
19 |
20 | const scrollEvent = () => {
21 | const scrollTop = $('html').scrollTop();
22 |
23 | if (scrollTop > startOpen && scrollTop < startOpen + 400) {
24 | let offset = Math.floor((scrollTop - startOpen) / 400 * 120);
25 | let newAsset = ''
26 |
27 | if (offset < 1) {
28 | offset = 1;
29 | } else if (offset > 120) {
30 | offset = 120;
31 | }
32 |
33 | console.log('---offset---', offset);
34 |
35 | if (offset < 10) {
36 | newAsset = `large_000${offset}`;
37 | } else if (offset < 100) {
38 | newAsset = `large_00${offset}`;
39 | } else {
40 | newAsset = `large_0${offset}`;
41 | }
42 |
43 | console.log('----newAsset---', newAsset);
44 |
45 | setAsset(newAsset);
46 | }
47 |
48 | if (scrollTop < startOpen) {
49 | setAsset('large_0001');
50 | }
51 |
52 | if (scrollTop > startOpen + 400) {
53 | setAsset('large_0120');
54 | }
55 | };
56 |
57 | useEffect(() => {
58 | window.addEventListener('scroll', scrollEvent, false);
59 |
60 | startOpen = $('#imgWrapper').offset().top - (window.innerHeight / 2 - $('#imgWrapper').height() / 2);
61 |
62 |
63 | scrollEvent();
64 |
65 | return ()=>{
66 | window.removeEventListener('scroll', scrollEvent, false);
67 | }
68 | }, []);
69 |
70 | return (
71 |
72 |
73 |
1
74 |
1
75 |
1
76 |
1
77 |
1
78 |
1
79 |
1
80 |
1
81 |
1
82 |
1
83 |
1
84 |
1
85 |
1
86 |
1
87 |
1
88 |
1
89 |
1
90 |
1
91 |
1
92 |
1
93 |
1
94 |
1
95 |
1
96 |
1
97 |
1
98 |
1
99 |
1
100 |
1
101 |
1
102 |
1
103 |
1
104 |
1
105 |
1
106 |
1
107 |
1
108 |
1
109 |
1
110 |
1
111 |
1
112 |
1
113 |
1
114 |
1
115 |
1
116 |
1
117 |
1
118 |
1
119 |
1
120 |
1
121 |
1
122 |
1
123 |
1
124 |
1
125 |
1
126 |
1
127 |
1
128 |
1
129 |
1
130 |
1
131 |
1
132 |
1
133 |
1
134 |
1
135 |
1
136 |
1
137 |
1
138 |
1
139 |
1
140 |
1
141 |
1
142 |
1
143 |
1
144 |
145 |
146 |
147 |
148 |
149 |
})
153 |
154 |
155 |
156 |
157 |
158 |
1
159 |
1
160 |
1
161 |
1
162 |
1
163 |
1
164 |
1
165 |
1
166 |
1
167 |
1
168 |
1
169 |
1
170 |
1
171 |
1
172 |
1
173 |
1
174 |
1
175 |
1
176 |
1
177 |
1
178 |
1
179 |
1
180 |
1
181 |
1
182 |
1
183 |
1
184 |
1
185 |
1
186 |
1
187 |
1
188 |
1
189 |
1
190 |
1
191 |
1
192 |
1
193 |
1
194 |
1
195 |
1
196 |
1
197 |
1
198 |
1
199 |
1
200 |
1
201 |
1
202 |
1
203 |
1
204 |
1
205 |
1
206 |
1
207 |
1
208 |
1
209 |
1
210 |
1
211 |
1
212 |
1
213 |
1
214 |
1
215 |
1
216 |
1
217 |
1
218 |
1
219 |
1
220 |
1
221 |
1
222 |
1
223 |
1
224 |
1
225 |
1
226 |
1
227 |
1
228 |
1
229 |
230 |
231 | );
232 | }
233 |
234 | export default OpenMac;
235 |
--------------------------------------------------------------------------------
/apple-animation-demo/src/pages/bgAttachment/index.tsx:
--------------------------------------------------------------------------------
1 | import React, { useEffect, useRef, useState, useCallback } from 'react';
2 | import styles from './index.css';
3 |
4 | declare global {
5 | interface Window {
6 | $: any
7 | }
8 | }
9 |
10 | const { $ } = window;
11 |
12 | const CANVAS_WIDTH = 544;
13 | const CANVAS_HEIGHT = 341;
14 |
15 | const WRAPPER_WIDTH = 694;
16 | const WRAPPER_HEIGHT = 408;
17 |
18 | const ZOOM_SCROLL_RANGE = 400;
19 |
20 | const BgAttachment = (): JSX.Element => {
21 |
22 | const [fixImg, setFixImg] = useState(false);
23 |
24 | let imgFixFixed = 0;
25 | let StartScale = 0;
26 |
27 | // scalaRadio
28 | const scaleRadio = window.innerHeight / CANVAS_HEIGHT;
29 |
30 | const scrollEvent = () => {
31 | const scrollTop = $('html').scrollTop();
32 | let curScale = scaleRadio;
33 | let translate = -scaleRadio * 18;
34 |
35 | if (!imgFixFixed || !StartScale) {
36 | return;
37 | }
38 |
39 |
40 | if (scrollTop > imgFixFixed - 10 && scrollTop < imgFixFixed + window.innerHeight) {
41 | setFixImg(true);
42 | } else {
43 | setFixImg(false);
44 | }
45 |
46 | curScale = scaleRadio - ((scaleRadio - 1) / ZOOM_SCROLL_RANGE) * (scrollTop - imgFixFixed - window.innerHeight);
47 |
48 |
49 | if (curScale > scaleRadio) {
50 | curScale = scaleRadio;
51 | } else if (curScale < 1) {
52 | curScale = 1;
53 | }
54 |
55 | // StartScale = window.innerHeight / 2 - $('#img-wrapper').height() / curScale / 2 ;
56 |
57 | console.log('---StartScale-1111--', StartScale);
58 |
59 | // 从 scaleRadio * 18 开始
60 | // all = scaleRadio * 18 + StartScale
61 | // 滑动过程中不断相加
62 | translate = -scaleRadio * 18 + ((scrollTop - imgFixFixed - window.innerHeight) / ZOOM_SCROLL_RANGE * (scaleRadio * 18 + StartScale));
63 |
64 |
65 | if (translate > StartScale) {
66 | translate = StartScale;
67 | } else if (translate < -scaleRadio * 18) {
68 | translate = - scaleRadio * 18;
69 | }
70 |
71 | $('#g-img2').css({
72 | width: curScale * CANVAS_WIDTH,
73 | height: curScale * CANVAS_HEIGHT,
74 | "margin-top": `${translate + 18 * curScale}px`,
75 | });
76 |
77 | // console.log('---123---');
78 |
79 | $('#img-wrapper').css({
80 | "width": scaleRadio * WRAPPER_WIDTH,
81 | "height": scaleRadio * WRAPPER_HEIGHT,
82 | "background-size": `${curScale * WRAPPER_WIDTH}px ${curScale * WRAPPER_HEIGHT}px`,
83 | "background-position": `center ${translate}px`,
84 | });
85 | };
86 |
87 | useEffect(() => {
88 | window.addEventListener('scroll', scrollEvent, false);
89 |
90 | imgFixFixed = $('#g-img').offset().top;
91 | StartScale = window.innerHeight / 2 - $('#img-wrapper').height() / 2;
92 |
93 | console.log('---StartScale---', StartScale);
94 |
95 | scrollEvent();
96 |
97 | return ()=>{
98 | window.removeEventListener('scroll', scrollEvent, false);
99 | }
100 | }, []);
101 |
102 |
103 | return (
104 | <>
105 |
106 |
1
107 |
1
108 |
1
109 |
1
110 |
1
111 |
1
112 |
1
113 |
1
114 |
1
115 |
1
116 |
1
117 |
1
118 |
1
119 |
1
120 |
1
121 |
1
122 |
1
123 |
1
124 |
1
125 |
1
126 |
1
127 |
1
128 |
1
129 |
1
130 |
1
131 |
1
132 |
1
133 |
1
134 |
1
135 |
1
136 |
1
137 |
1
138 |
1
139 |
1
140 |
1
141 |
1
142 |
1
143 |
1
144 |
1
145 |
1
146 |
1
147 |
1
148 |
1
149 |
1
150 |
1
151 |
1
152 |
1
153 |
1
154 |
1
155 |
1
156 |
1
157 |
1
158 |
1
159 |
1
160 |
1
161 |
1
162 |
1
163 |
1
164 |
1
165 |
1
166 |
1
167 |
1
168 |
1
169 |
1
170 |
1
171 |
1
172 |
1
173 |
1
174 |
1
175 |
1
176 |
1
177 |
178 |
179 |
180 |
181 |
188 |
189 |
190 |
1
191 |
1
192 |
1
193 |
1
194 |
1
195 |
1
196 |
1
197 |
1
198 |
1
199 |
1
200 |
1
201 |
1
202 |
1
203 |
1
204 |
1
205 |
1
206 |
1
207 |
1
208 |
1
209 |
1
210 |
1
211 |
1
212 |
1
213 |
1
214 |
1
215 |
1
216 |
1
217 |
1
218 |
1
219 |
1
220 |
1
221 |
1
222 |
1
223 |
1
224 |
1
225 |
1
226 |
1
227 |
1
228 |
1
229 |
1
230 |
1
231 |
1
232 |
1
233 |
1
234 |
1
235 |
1
236 |
1
237 |
1
238 |
1
239 |
1
240 |
1
241 |
1
242 |
1
243 |
1
244 |
1
245 |
1
246 |
1
247 |
1
248 |
1
249 |
1
250 |
1
251 |
1
252 |
1
253 |
1
254 |
1
255 |
256 | >
257 | );
258 | }
259 |
260 | export default BgAttachment;
261 |
--------------------------------------------------------------------------------
/apple-animation-demo/src/pages/canvasDraw/index.tsx:
--------------------------------------------------------------------------------
1 | import React, { useEffect, useRef, useState } from 'react';
2 | import styles from './index.css';
3 | import asset1 from '@/assets/mac1.jpg';
4 | import asset2 from '@/assets/mac2.jpg';
5 |
6 | declare global {
7 | interface Window {
8 | $: any
9 | }
10 | }
11 |
12 | const { $ } = window;
13 |
14 | const CANVAS_WIDTH = 544;
15 | const CANVAS_HEIGHT = 341;
16 | const ZOOM_SCROLL_RANGE = 400;
17 |
18 | const IMG_NATURAL_WIDTH = 2048;
19 | const IMG_NATURAL_HEIGHT = 1024;
20 |
21 |
22 | interface drawImageProps {
23 | img1: any;
24 | img2: any;
25 | secTop: number;
26 | }
27 |
28 | const CanvasDraw = (): JSX.Element => {
29 |
30 | let canvasRef: any = useRef();
31 |
32 | let NewStartScale = 0;
33 | let StartScale = 0;
34 |
35 | let image1: any = null;
36 | let image2: any = null;
37 |
38 | // scalaRadio
39 | const scaleRadio = window.innerHeight / CANVAS_HEIGHT;
40 |
41 |
42 | const scrollEvent = () => {
43 | const scrollTop = $('html').scrollTop();
44 | let curScale = scaleRadio;
45 | let translate = -scaleRadio * 18;
46 |
47 | console.log('---NewStartScale---', NewStartScale);
48 | console.log('---scrollTop---', scrollTop);
49 |
50 |
51 | if (!NewStartScale || !StartScale) return;
52 |
53 |
54 | curScale = scaleRadio - ((scaleRadio - 1) / ZOOM_SCROLL_RANGE) * (scrollTop + scaleRadio * 18 - NewStartScale);
55 |
56 |
57 | if (curScale > scaleRadio) {
58 | curScale = scaleRadio;
59 | } else if (curScale < 1) {
60 | curScale = 1;
61 | }
62 |
63 | // 从 scaleRadio * 18 开始
64 | // all = scaleRadio * 18 + StartScale
65 | // 滑动过程中不断相加
66 | translate = -scaleRadio * 18 + ((scrollTop + scaleRadio * 18 - NewStartScale) / ZOOM_SCROLL_RANGE * (scaleRadio * 18 + StartScale));
67 |
68 |
69 | if (translate > StartScale) {
70 | translate = StartScale;
71 | } else if (translate < -scaleRadio * 18) {
72 | translate = - scaleRadio * 18;
73 | }
74 |
75 | if (image1 && image2) {
76 | if (curScale === scaleRadio) {
77 | drawImage({
78 | img1: image1,
79 | img2: image2,
80 | secTop: CANVAS_HEIGHT * (scrollTop + 18 * scaleRadio - NewStartScale) / window.innerHeight,
81 | });
82 | } else {
83 | drawImage({
84 | img1: image1,
85 | img2: image2,
86 | secTop: 0,
87 | });
88 | }
89 | }
90 |
91 | $('#img-wrapper').css({
92 | transform: `matrix(${curScale}, 0, 0, ${curScale}, 0, ${translate})`,
93 | });
94 | };
95 |
96 | const loadImageAsync = (url: string) => {
97 | return new Promise(function(resolve, reject) {
98 | const image = new Image();
99 |
100 | image.onload = function() {
101 | resolve(image);
102 | };
103 |
104 | image.onerror = function() {
105 | reject(new Error('Could not load image at ' + url));
106 | };
107 |
108 | image.src = url;
109 | });
110 | }
111 |
112 | const loadAllImg = () => {
113 | Promise.all([loadImageAsync(asset1), loadImageAsync(asset2)])
114 | .then(res => {
115 | const img1: any = res[0];
116 | const img2: any = res[1];
117 |
118 | image1 = img1;
119 | image2 = img2;
120 |
121 | drawImage({
122 | img1: img1,
123 | img2: img2,
124 | secTop: CANVAS_HEIGHT,
125 | });
126 |
127 | }).catch(err => {
128 | console.log('--err---', err);
129 | })
130 | }
131 |
132 | function drawImage(item: drawImageProps) {
133 | const context = canvasRef.current.getContext('2d');
134 | context.drawImage(item.img1, 0, 0, IMG_NATURAL_WIDTH, IMG_NATURAL_HEIGHT, 0, 0, CANVAS_WIDTH, CANVAS_HEIGHT);
135 | context.drawImage(item.img2, 0, -item.secTop * IMG_NATURAL_HEIGHT / CANVAS_HEIGHT, IMG_NATURAL_WIDTH, IMG_NATURAL_HEIGHT, 0, -item.secTop, CANVAS_WIDTH, CANVAS_HEIGHT);
136 | }
137 |
138 | useEffect(() => {
139 | window.addEventListener('scroll', scrollEvent, false);
140 |
141 | NewStartScale = $('#section-sticky-hero').offset().top + window.innerHeight;
142 | StartScale = window.innerHeight / 2 - $('#img-wrapper').height() / 2;
143 |
144 | scrollEvent();
145 |
146 | return ()=>{
147 | window.removeEventListener('scroll', scrollEvent, false);
148 | }
149 | }, []);
150 |
151 | useEffect(() => {
152 | const canvasNode = canvasRef.current;
153 |
154 | if (canvasNode) {
155 | canvasNode.width = CANVAS_WIDTH;
156 | canvasNode.height = CANVAS_HEIGHT;
157 | loadAllImg();
158 | }
159 |
160 | }, [canvasRef, NewStartScale, StartScale, loadAllImg]);
161 |
162 | return (
163 | <>
164 |
165 |
1
166 |
1
167 |
1
168 |
1
169 |
1
170 |
1
171 |
1
172 |
1
173 |
1
174 |
1
175 |
1
176 |
1
177 |
1
178 |
1
179 |
1
180 |
1
181 |
1
182 |
1
183 |
1
184 |
1
185 |
1
186 |
1
187 |
1
188 |
1
189 |
1
190 |
1
191 |
1
192 |
1
193 |
1
194 |
1
195 |
1
196 |
1
197 |
1
198 |
1
199 |
1
200 |
1
201 |
1
202 |
1
203 |
1
204 |
1
205 |
1
206 |
1
207 |
1
208 |
1
209 |
1
210 |
1
211 |
1
212 |
1
213 |
1
214 |
1
215 |
1
216 |
1
217 |
1
218 |
1
219 |
1
220 |
1
221 |
1
222 |
1
223 |
1
224 |
1
225 |
1
226 |
1
227 |
1
228 |
1
229 |
1
230 |
1
231 |
1
232 |
1
233 |
1
234 |
1
235 |
1
236 |
237 |
238 |
245 |
246 |
247 |
1
248 |
1
249 |
1
250 |
1
251 |
1
252 |
1
253 |
1
254 |
1
255 |
1
256 |
1
257 |
1
258 |
1
259 |
1
260 |
1
261 |
1
262 |
1
263 |
1
264 |
1
265 |
1
266 |
1
267 |
1
268 |
1
269 |
1
270 |
1
271 |
1
272 |
1
273 |
1
274 |
1
275 |
1
276 |
1
277 |
1
278 |
1
279 |
1
280 |
1
281 |
1
282 |
1
283 |
1
284 |
1
285 |
1
286 |
1
287 |
1
288 |
1
289 |
1
290 |
1
291 |
1
292 |
1
293 |
1
294 |
1
295 |
1
296 |
1
297 |
1
298 |
1
299 |
1
300 |
1
301 |
1
302 |
1
303 |
1
304 |
1
305 |
1
306 |
1
307 |
1
308 |
1
309 |
1
310 |
1
311 |
1
312 |
313 | >
314 | );
315 | }
316 |
317 | export default CanvasDraw;
318 |
--------------------------------------------------------------------------------
/contact-demo/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "contact-demo",
3 | "version": "1.0.0",
4 | "lockfileVersion": 1,
5 | "requires": true,
6 | "dependencies": {
7 | "accepts": {
8 | "version": "1.3.7",
9 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
10 | "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==",
11 | "requires": {
12 | "mime-types": "~2.1.24",
13 | "negotiator": "0.6.2"
14 | }
15 | },
16 | "after": {
17 | "version": "0.8.2",
18 | "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz",
19 | "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8="
20 | },
21 | "array-flatten": {
22 | "version": "1.1.1",
23 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
24 | "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=",
25 | "dev": true
26 | },
27 | "arraybuffer.slice": {
28 | "version": "0.0.7",
29 | "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz",
30 | "integrity": "sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog=="
31 | },
32 | "async-limiter": {
33 | "version": "1.0.1",
34 | "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz",
35 | "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ=="
36 | },
37 | "backo2": {
38 | "version": "1.0.2",
39 | "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz",
40 | "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc="
41 | },
42 | "base64-arraybuffer": {
43 | "version": "0.1.5",
44 | "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz",
45 | "integrity": "sha1-c5JncZI7Whl0etZmqlzUv5xunOg="
46 | },
47 | "base64id": {
48 | "version": "2.0.0",
49 | "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz",
50 | "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog=="
51 | },
52 | "better-assert": {
53 | "version": "1.0.2",
54 | "resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz",
55 | "integrity": "sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI=",
56 | "requires": {
57 | "callsite": "1.0.0"
58 | }
59 | },
60 | "blob": {
61 | "version": "0.0.5",
62 | "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.5.tgz",
63 | "integrity": "sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig=="
64 | },
65 | "body-parser": {
66 | "version": "1.19.0",
67 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
68 | "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==",
69 | "dev": true,
70 | "requires": {
71 | "bytes": "3.1.0",
72 | "content-type": "~1.0.4",
73 | "debug": "2.6.9",
74 | "depd": "~1.1.2",
75 | "http-errors": "1.7.2",
76 | "iconv-lite": "0.4.24",
77 | "on-finished": "~2.3.0",
78 | "qs": "6.7.0",
79 | "raw-body": "2.4.0",
80 | "type-is": "~1.6.17"
81 | }
82 | },
83 | "bytes": {
84 | "version": "3.1.0",
85 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
86 | "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==",
87 | "dev": true
88 | },
89 | "callsite": {
90 | "version": "1.0.0",
91 | "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz",
92 | "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA="
93 | },
94 | "component-bind": {
95 | "version": "1.0.0",
96 | "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz",
97 | "integrity": "sha1-AMYIq33Nk4l8AAllGx06jh5zu9E="
98 | },
99 | "component-emitter": {
100 | "version": "1.2.1",
101 | "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz",
102 | "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY="
103 | },
104 | "component-inherit": {
105 | "version": "0.0.3",
106 | "resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz",
107 | "integrity": "sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM="
108 | },
109 | "content-disposition": {
110 | "version": "0.5.3",
111 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz",
112 | "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==",
113 | "dev": true,
114 | "requires": {
115 | "safe-buffer": "5.1.2"
116 | }
117 | },
118 | "content-type": {
119 | "version": "1.0.4",
120 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
121 | "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==",
122 | "dev": true
123 | },
124 | "cookie": {
125 | "version": "0.4.0",
126 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz",
127 | "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==",
128 | "dev": true
129 | },
130 | "cookie-parser": {
131 | "version": "1.4.4",
132 | "resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.4.4.tgz",
133 | "integrity": "sha512-lo13tqF3JEtFO7FyA49CqbhaFkskRJ0u/UAiINgrIXeRCY41c88/zxtrECl8AKH3B0hj9q10+h3Kt8I7KlW4tw==",
134 | "dev": true,
135 | "requires": {
136 | "cookie": "0.3.1",
137 | "cookie-signature": "1.0.6"
138 | },
139 | "dependencies": {
140 | "cookie": {
141 | "version": "0.3.1",
142 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz",
143 | "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=",
144 | "dev": true
145 | }
146 | }
147 | },
148 | "cookie-signature": {
149 | "version": "1.0.6",
150 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
151 | "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=",
152 | "dev": true
153 | },
154 | "debug": {
155 | "version": "2.6.9",
156 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
157 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
158 | "dev": true,
159 | "requires": {
160 | "ms": "2.0.0"
161 | }
162 | },
163 | "depd": {
164 | "version": "1.1.2",
165 | "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
166 | "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=",
167 | "dev": true
168 | },
169 | "destroy": {
170 | "version": "1.0.4",
171 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
172 | "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=",
173 | "dev": true
174 | },
175 | "ee-first": {
176 | "version": "1.1.1",
177 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
178 | "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=",
179 | "dev": true
180 | },
181 | "encodeurl": {
182 | "version": "1.0.2",
183 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
184 | "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=",
185 | "dev": true
186 | },
187 | "engine.io": {
188 | "version": "3.4.0",
189 | "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.4.0.tgz",
190 | "integrity": "sha512-XCyYVWzcHnK5cMz7G4VTu2W7zJS7SM1QkcelghyIk/FmobWBtXE7fwhBusEKvCSqc3bMh8fNFMlUkCKTFRxH2w==",
191 | "requires": {
192 | "accepts": "~1.3.4",
193 | "base64id": "2.0.0",
194 | "cookie": "0.3.1",
195 | "debug": "~4.1.0",
196 | "engine.io-parser": "~2.2.0",
197 | "ws": "^7.1.2"
198 | },
199 | "dependencies": {
200 | "cookie": {
201 | "version": "0.3.1",
202 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz",
203 | "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s="
204 | },
205 | "debug": {
206 | "version": "4.1.1",
207 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
208 | "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
209 | "requires": {
210 | "ms": "^2.1.1"
211 | }
212 | },
213 | "ms": {
214 | "version": "2.1.2",
215 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
216 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
217 | }
218 | }
219 | },
220 | "engine.io-client": {
221 | "version": "3.4.0",
222 | "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.4.0.tgz",
223 | "integrity": "sha512-a4J5QO2k99CM2a0b12IznnyQndoEvtA4UAldhGzKqnHf42I3Qs2W5SPnDvatZRcMaNZs4IevVicBPayxYt6FwA==",
224 | "requires": {
225 | "component-emitter": "1.2.1",
226 | "component-inherit": "0.0.3",
227 | "debug": "~4.1.0",
228 | "engine.io-parser": "~2.2.0",
229 | "has-cors": "1.1.0",
230 | "indexof": "0.0.1",
231 | "parseqs": "0.0.5",
232 | "parseuri": "0.0.5",
233 | "ws": "~6.1.0",
234 | "xmlhttprequest-ssl": "~1.5.4",
235 | "yeast": "0.1.2"
236 | },
237 | "dependencies": {
238 | "debug": {
239 | "version": "4.1.1",
240 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
241 | "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
242 | "requires": {
243 | "ms": "^2.1.1"
244 | }
245 | },
246 | "ms": {
247 | "version": "2.1.2",
248 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
249 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
250 | },
251 | "ws": {
252 | "version": "6.1.4",
253 | "resolved": "https://registry.npmjs.org/ws/-/ws-6.1.4.tgz",
254 | "integrity": "sha512-eqZfL+NE/YQc1/ZynhojeV8q+H050oR8AZ2uIev7RU10svA9ZnJUddHcOUZTJLinZ9yEfdA2kSATS2qZK5fhJA==",
255 | "requires": {
256 | "async-limiter": "~1.0.0"
257 | }
258 | }
259 | }
260 | },
261 | "engine.io-parser": {
262 | "version": "2.2.0",
263 | "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.2.0.tgz",
264 | "integrity": "sha512-6I3qD9iUxotsC5HEMuuGsKA0cXerGz+4uGcXQEkfBidgKf0amsjrrtwcbwK/nzpZBxclXlV7gGl9dgWvu4LF6w==",
265 | "requires": {
266 | "after": "0.8.2",
267 | "arraybuffer.slice": "~0.0.7",
268 | "base64-arraybuffer": "0.1.5",
269 | "blob": "0.0.5",
270 | "has-binary2": "~1.0.2"
271 | }
272 | },
273 | "escape-html": {
274 | "version": "1.0.3",
275 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
276 | "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=",
277 | "dev": true
278 | },
279 | "etag": {
280 | "version": "1.8.1",
281 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
282 | "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=",
283 | "dev": true
284 | },
285 | "express": {
286 | "version": "4.17.1",
287 | "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz",
288 | "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==",
289 | "dev": true,
290 | "requires": {
291 | "accepts": "~1.3.7",
292 | "array-flatten": "1.1.1",
293 | "body-parser": "1.19.0",
294 | "content-disposition": "0.5.3",
295 | "content-type": "~1.0.4",
296 | "cookie": "0.4.0",
297 | "cookie-signature": "1.0.6",
298 | "debug": "2.6.9",
299 | "depd": "~1.1.2",
300 | "encodeurl": "~1.0.2",
301 | "escape-html": "~1.0.3",
302 | "etag": "~1.8.1",
303 | "finalhandler": "~1.1.2",
304 | "fresh": "0.5.2",
305 | "merge-descriptors": "1.0.1",
306 | "methods": "~1.1.2",
307 | "on-finished": "~2.3.0",
308 | "parseurl": "~1.3.3",
309 | "path-to-regexp": "0.1.7",
310 | "proxy-addr": "~2.0.5",
311 | "qs": "6.7.0",
312 | "range-parser": "~1.2.1",
313 | "safe-buffer": "5.1.2",
314 | "send": "0.17.1",
315 | "serve-static": "1.14.1",
316 | "setprototypeof": "1.1.1",
317 | "statuses": "~1.5.0",
318 | "type-is": "~1.6.18",
319 | "utils-merge": "1.0.1",
320 | "vary": "~1.1.2"
321 | }
322 | },
323 | "finalhandler": {
324 | "version": "1.1.2",
325 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz",
326 | "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==",
327 | "dev": true,
328 | "requires": {
329 | "debug": "2.6.9",
330 | "encodeurl": "~1.0.2",
331 | "escape-html": "~1.0.3",
332 | "on-finished": "~2.3.0",
333 | "parseurl": "~1.3.3",
334 | "statuses": "~1.5.0",
335 | "unpipe": "~1.0.0"
336 | }
337 | },
338 | "forwarded": {
339 | "version": "0.1.2",
340 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz",
341 | "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=",
342 | "dev": true
343 | },
344 | "fresh": {
345 | "version": "0.5.2",
346 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
347 | "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=",
348 | "dev": true
349 | },
350 | "has-binary2": {
351 | "version": "1.0.3",
352 | "resolved": "https://registry.npmjs.org/has-binary2/-/has-binary2-1.0.3.tgz",
353 | "integrity": "sha512-G1LWKhDSvhGeAQ8mPVQlqNcOB2sJdwATtZKl2pDKKHfpf/rYj24lkinxf69blJbnsvtqqNU+L3SL50vzZhXOnw==",
354 | "requires": {
355 | "isarray": "2.0.1"
356 | }
357 | },
358 | "has-cors": {
359 | "version": "1.1.0",
360 | "resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz",
361 | "integrity": "sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk="
362 | },
363 | "http-errors": {
364 | "version": "1.7.2",
365 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz",
366 | "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==",
367 | "dev": true,
368 | "requires": {
369 | "depd": "~1.1.2",
370 | "inherits": "2.0.3",
371 | "setprototypeof": "1.1.1",
372 | "statuses": ">= 1.5.0 < 2",
373 | "toidentifier": "1.0.0"
374 | }
375 | },
376 | "iconv-lite": {
377 | "version": "0.4.24",
378 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
379 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
380 | "dev": true,
381 | "requires": {
382 | "safer-buffer": ">= 2.1.2 < 3"
383 | }
384 | },
385 | "indexof": {
386 | "version": "0.0.1",
387 | "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz",
388 | "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10="
389 | },
390 | "inherits": {
391 | "version": "2.0.3",
392 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
393 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
394 | "dev": true
395 | },
396 | "ipaddr.js": {
397 | "version": "1.9.1",
398 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
399 | "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
400 | "dev": true
401 | },
402 | "isarray": {
403 | "version": "2.0.1",
404 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz",
405 | "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4="
406 | },
407 | "jquery": {
408 | "version": "3.4.1",
409 | "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.4.1.tgz",
410 | "integrity": "sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw==",
411 | "dev": true
412 | },
413 | "media-typer": {
414 | "version": "0.3.0",
415 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
416 | "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=",
417 | "dev": true
418 | },
419 | "merge-descriptors": {
420 | "version": "1.0.1",
421 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
422 | "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=",
423 | "dev": true
424 | },
425 | "methods": {
426 | "version": "1.1.2",
427 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
428 | "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=",
429 | "dev": true
430 | },
431 | "mime": {
432 | "version": "1.6.0",
433 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
434 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
435 | "dev": true
436 | },
437 | "mime-db": {
438 | "version": "1.43.0",
439 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz",
440 | "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ=="
441 | },
442 | "mime-types": {
443 | "version": "2.1.26",
444 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz",
445 | "integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==",
446 | "requires": {
447 | "mime-db": "1.43.0"
448 | }
449 | },
450 | "ms": {
451 | "version": "2.0.0",
452 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
453 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
454 | "dev": true
455 | },
456 | "negotiator": {
457 | "version": "0.6.2",
458 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz",
459 | "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw=="
460 | },
461 | "object-component": {
462 | "version": "0.0.3",
463 | "resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz",
464 | "integrity": "sha1-8MaapQ78lbhmwYb0AKM3acsvEpE="
465 | },
466 | "on-finished": {
467 | "version": "2.3.0",
468 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
469 | "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=",
470 | "dev": true,
471 | "requires": {
472 | "ee-first": "1.1.1"
473 | }
474 | },
475 | "parseqs": {
476 | "version": "0.0.5",
477 | "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz",
478 | "integrity": "sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=",
479 | "requires": {
480 | "better-assert": "~1.0.0"
481 | }
482 | },
483 | "parseuri": {
484 | "version": "0.0.5",
485 | "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz",
486 | "integrity": "sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=",
487 | "requires": {
488 | "better-assert": "~1.0.0"
489 | }
490 | },
491 | "parseurl": {
492 | "version": "1.3.3",
493 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
494 | "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
495 | "dev": true
496 | },
497 | "path-to-regexp": {
498 | "version": "0.1.7",
499 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
500 | "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=",
501 | "dev": true
502 | },
503 | "proxy-addr": {
504 | "version": "2.0.6",
505 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz",
506 | "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==",
507 | "dev": true,
508 | "requires": {
509 | "forwarded": "~0.1.2",
510 | "ipaddr.js": "1.9.1"
511 | }
512 | },
513 | "qs": {
514 | "version": "6.7.0",
515 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz",
516 | "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==",
517 | "dev": true
518 | },
519 | "range-parser": {
520 | "version": "1.2.1",
521 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
522 | "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
523 | "dev": true
524 | },
525 | "raw-body": {
526 | "version": "2.4.0",
527 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz",
528 | "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==",
529 | "dev": true,
530 | "requires": {
531 | "bytes": "3.1.0",
532 | "http-errors": "1.7.2",
533 | "iconv-lite": "0.4.24",
534 | "unpipe": "1.0.0"
535 | }
536 | },
537 | "safe-buffer": {
538 | "version": "5.1.2",
539 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
540 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
541 | "dev": true
542 | },
543 | "safer-buffer": {
544 | "version": "2.1.2",
545 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
546 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
547 | "dev": true
548 | },
549 | "send": {
550 | "version": "0.17.1",
551 | "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz",
552 | "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==",
553 | "dev": true,
554 | "requires": {
555 | "debug": "2.6.9",
556 | "depd": "~1.1.2",
557 | "destroy": "~1.0.4",
558 | "encodeurl": "~1.0.2",
559 | "escape-html": "~1.0.3",
560 | "etag": "~1.8.1",
561 | "fresh": "0.5.2",
562 | "http-errors": "~1.7.2",
563 | "mime": "1.6.0",
564 | "ms": "2.1.1",
565 | "on-finished": "~2.3.0",
566 | "range-parser": "~1.2.1",
567 | "statuses": "~1.5.0"
568 | },
569 | "dependencies": {
570 | "ms": {
571 | "version": "2.1.1",
572 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
573 | "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==",
574 | "dev": true
575 | }
576 | }
577 | },
578 | "serve-static": {
579 | "version": "1.14.1",
580 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz",
581 | "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==",
582 | "dev": true,
583 | "requires": {
584 | "encodeurl": "~1.0.2",
585 | "escape-html": "~1.0.3",
586 | "parseurl": "~1.3.3",
587 | "send": "0.17.1"
588 | }
589 | },
590 | "setprototypeof": {
591 | "version": "1.1.1",
592 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz",
593 | "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==",
594 | "dev": true
595 | },
596 | "socket.io": {
597 | "version": "2.3.0",
598 | "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.3.0.tgz",
599 | "integrity": "sha512-2A892lrj0GcgR/9Qk81EaY2gYhCBxurV0PfmmESO6p27QPrUK1J3zdns+5QPqvUYK2q657nSj0guoIil9+7eFg==",
600 | "requires": {
601 | "debug": "~4.1.0",
602 | "engine.io": "~3.4.0",
603 | "has-binary2": "~1.0.2",
604 | "socket.io-adapter": "~1.1.0",
605 | "socket.io-client": "2.3.0",
606 | "socket.io-parser": "~3.4.0"
607 | },
608 | "dependencies": {
609 | "debug": {
610 | "version": "4.1.1",
611 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
612 | "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
613 | "requires": {
614 | "ms": "^2.1.1"
615 | }
616 | },
617 | "ms": {
618 | "version": "2.1.2",
619 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
620 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
621 | }
622 | }
623 | },
624 | "socket.io-adapter": {
625 | "version": "1.1.2",
626 | "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-1.1.2.tgz",
627 | "integrity": "sha512-WzZRUj1kUjrTIrUKpZLEzFZ1OLj5FwLlAFQs9kuZJzJi5DKdU7FsWc36SNmA8iDOtwBQyT8FkrriRM8vXLYz8g=="
628 | },
629 | "socket.io-client": {
630 | "version": "2.3.0",
631 | "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.3.0.tgz",
632 | "integrity": "sha512-cEQQf24gET3rfhxZ2jJ5xzAOo/xhZwK+mOqtGRg5IowZsMgwvHwnf/mCRapAAkadhM26y+iydgwsXGObBB5ZdA==",
633 | "requires": {
634 | "backo2": "1.0.2",
635 | "base64-arraybuffer": "0.1.5",
636 | "component-bind": "1.0.0",
637 | "component-emitter": "1.2.1",
638 | "debug": "~4.1.0",
639 | "engine.io-client": "~3.4.0",
640 | "has-binary2": "~1.0.2",
641 | "has-cors": "1.1.0",
642 | "indexof": "0.0.1",
643 | "object-component": "0.0.3",
644 | "parseqs": "0.0.5",
645 | "parseuri": "0.0.5",
646 | "socket.io-parser": "~3.3.0",
647 | "to-array": "0.1.4"
648 | },
649 | "dependencies": {
650 | "debug": {
651 | "version": "4.1.1",
652 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
653 | "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
654 | "requires": {
655 | "ms": "^2.1.1"
656 | }
657 | },
658 | "ms": {
659 | "version": "2.1.2",
660 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
661 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
662 | },
663 | "socket.io-parser": {
664 | "version": "3.3.0",
665 | "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.3.0.tgz",
666 | "integrity": "sha512-hczmV6bDgdaEbVqhAeVMM/jfUfzuEZHsQg6eOmLgJht6G3mPKMxYm75w2+qhAQZ+4X+1+ATZ+QFKeOZD5riHng==",
667 | "requires": {
668 | "component-emitter": "1.2.1",
669 | "debug": "~3.1.0",
670 | "isarray": "2.0.1"
671 | },
672 | "dependencies": {
673 | "debug": {
674 | "version": "3.1.0",
675 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
676 | "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
677 | "requires": {
678 | "ms": "2.0.0"
679 | }
680 | },
681 | "ms": {
682 | "version": "2.0.0",
683 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
684 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
685 | }
686 | }
687 | }
688 | }
689 | },
690 | "socket.io-parser": {
691 | "version": "3.4.0",
692 | "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.4.0.tgz",
693 | "integrity": "sha512-/G/VOI+3DBp0+DJKW4KesGnQkQPFmUCbA/oO2QGT6CWxU7hLGWqU3tyuzeSK/dqcyeHsQg1vTe9jiZI8GU9SCQ==",
694 | "requires": {
695 | "component-emitter": "1.2.1",
696 | "debug": "~4.1.0",
697 | "isarray": "2.0.1"
698 | },
699 | "dependencies": {
700 | "debug": {
701 | "version": "4.1.1",
702 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
703 | "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
704 | "requires": {
705 | "ms": "^2.1.1"
706 | }
707 | },
708 | "ms": {
709 | "version": "2.1.2",
710 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
711 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
712 | }
713 | }
714 | },
715 | "statuses": {
716 | "version": "1.5.0",
717 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
718 | "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=",
719 | "dev": true
720 | },
721 | "to-array": {
722 | "version": "0.1.4",
723 | "resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz",
724 | "integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA="
725 | },
726 | "toidentifier": {
727 | "version": "1.0.0",
728 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz",
729 | "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==",
730 | "dev": true
731 | },
732 | "type-is": {
733 | "version": "1.6.18",
734 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
735 | "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
736 | "dev": true,
737 | "requires": {
738 | "media-typer": "0.3.0",
739 | "mime-types": "~2.1.24"
740 | }
741 | },
742 | "unpipe": {
743 | "version": "1.0.0",
744 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
745 | "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=",
746 | "dev": true
747 | },
748 | "utils-merge": {
749 | "version": "1.0.1",
750 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
751 | "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=",
752 | "dev": true
753 | },
754 | "vary": {
755 | "version": "1.1.2",
756 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
757 | "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=",
758 | "dev": true
759 | },
760 | "ws": {
761 | "version": "7.2.1",
762 | "resolved": "https://registry.npmjs.org/ws/-/ws-7.2.1.tgz",
763 | "integrity": "sha512-sucePNSafamSKoOqoNfBd8V0StlkzJKL2ZAhGQinCfNQ+oacw+Pk7lcdAElecBF2VkLNZRiIb5Oi1Q5lVUVt2A=="
764 | },
765 | "xmlhttprequest-ssl": {
766 | "version": "1.5.5",
767 | "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz",
768 | "integrity": "sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4="
769 | },
770 | "yeast": {
771 | "version": "0.1.2",
772 | "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz",
773 | "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk="
774 | }
775 | }
776 | }
777 |
--------------------------------------------------------------------------------