feat: 升级
@ -1,12 +0,0 @@
|
|||||||
// .dumi/theme/layout.tsx(本地主题) 或 src/layout.tsx(主题包)
|
|
||||||
import React from 'react';
|
|
||||||
import Layout from 'dumi-theme-default/es/layout';
|
|
||||||
|
|
||||||
export default ({ children, ...props }) => (
|
|
||||||
<Layout {...props}>
|
|
||||||
<>
|
|
||||||
<button>反馈</button>
|
|
||||||
{children}
|
|
||||||
</>
|
|
||||||
</Layout>
|
|
||||||
);
|
|
@ -1,32 +0,0 @@
|
|||||||
// .dumi/theme/layout.tsx(本地主题) 或 src/layout.tsx(主题包)
|
|
||||||
import React, { useEffect } from 'react';
|
|
||||||
import Layout from 'dumi-theme-default/es/layout';
|
|
||||||
|
|
||||||
export default ({ children, ...props }) => {
|
|
||||||
const { history } = props;
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const header = document.querySelector('.__dumi-default-navbar')
|
|
||||||
const cont = document.querySelector('.__dumi-default-layout-content')
|
|
||||||
const lo = document.querySelector('.__dumi-default-layout')
|
|
||||||
|
|
||||||
if (location.hash === '#/resume' && lo) {
|
|
||||||
|
|
||||||
cont.style.position = 'relative'
|
|
||||||
cont.style.top = '-64px'
|
|
||||||
header.style.display = 'none'
|
|
||||||
} else {
|
|
||||||
cont.style.position = 'relative'
|
|
||||||
cont.style.top = '0'
|
|
||||||
header.style.display = 'flex'
|
|
||||||
}
|
|
||||||
},[location.hash])
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Layout {...props}>
|
|
||||||
<>
|
|
||||||
{children}
|
|
||||||
</>
|
|
||||||
</Layout>
|
|
||||||
)
|
|
||||||
};
|
|
38
.dumirc.ts
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
import { defineConfig } from 'dumi';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
themeConfig: {
|
||||||
|
name: 'nicenote',
|
||||||
|
navs: [
|
||||||
|
null,
|
||||||
|
{
|
||||||
|
title: 'GitHub',
|
||||||
|
path: 'git@github.com:j710328466/learn-note.git',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
favicons: ['https://jzx-h5.oss-cn-hangzhou.aliyuncs.com/logo.ico'],
|
||||||
|
// logo: 'http://jzx-h5.oss-cn-hangzhou.aliyuncs.com/logo.png',
|
||||||
|
outputPath: 'docs-dist',
|
||||||
|
hash: true,
|
||||||
|
history: {
|
||||||
|
type: 'hash',
|
||||||
|
},
|
||||||
|
publicPath: '/',
|
||||||
|
resolve: {
|
||||||
|
docDirs: ['docs'],
|
||||||
|
atomDirs: [{ type: 'component', dir: 'src' }],
|
||||||
|
codeBlockMode: 'passive',
|
||||||
|
},
|
||||||
|
locales: [{ id: 'zh-CN', name: '中文' }], // 2.0 默认值
|
||||||
|
analyze: {
|
||||||
|
analyzerMode: 'server',
|
||||||
|
analyzerPort: 8888,
|
||||||
|
openAnalyzer: false,
|
||||||
|
// generate stats file while ANALYZE_DUMP exist
|
||||||
|
generateStatsFile: false,
|
||||||
|
statsFilename: 'stats.json',
|
||||||
|
logLevel: 'info',
|
||||||
|
defaultSizes: 'parsed', // stat // gzip
|
||||||
|
}
|
||||||
|
});
|
3
.editorconfig
Executable file → Normal file
@ -11,6 +11,3 @@ insert_final_newline = true
|
|||||||
|
|
||||||
[*.md]
|
[*.md]
|
||||||
trim_trailing_whitespace = false
|
trim_trailing_whitespace = false
|
||||||
|
|
||||||
[Makefile]
|
|
||||||
indent_style = tab
|
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
export default {
|
|
||||||
esm: 'rollup',
|
|
||||||
cjs: 'rollup',
|
|
||||||
};
|
|
26
.gitignore
vendored
@ -1,25 +1,5 @@
|
|||||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
node_modules
|
||||||
|
|
||||||
# dependencies
|
|
||||||
/node_modules
|
|
||||||
/npm-debug.log*
|
|
||||||
/yarn-error.log
|
|
||||||
/yarn.lock
|
|
||||||
/package-lock.json
|
|
||||||
|
|
||||||
# production
|
|
||||||
/dist
|
/dist
|
||||||
/docs-dist
|
.dumi/tmp
|
||||||
|
.dumi/tmp-production
|
||||||
# misc
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
# umi
|
|
||||||
.umi
|
|
||||||
.umi-production
|
|
||||||
.umi-test
|
|
||||||
.env.local
|
|
||||||
|
|
||||||
# ide
|
|
||||||
/.vscode
|
|
||||||
/.idea
|
|
||||||
|
4
.husky/commit-msg
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
. "$(dirname -- "$0")/_/husky.sh"
|
||||||
|
|
||||||
|
npx commitlint --edit "${1}"
|
4
.husky/pre-commit
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
. "$(dirname -- "$0")/_/husky.sh"
|
||||||
|
|
||||||
|
npx lint-staged
|
@ -1,7 +1,3 @@
|
|||||||
**/*.svg
|
.dumi/tmp
|
||||||
**/*.ejs
|
.dumi/tmp-production
|
||||||
**/*.html
|
*.yaml
|
||||||
package.json
|
|
||||||
.umi
|
|
||||||
.umi-production
|
|
||||||
.umi-test
|
|
||||||
|
11
.prettierrc
@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"singleQuote": true,
|
|
||||||
"trailingComma": "all",
|
|
||||||
"printWidth": 80,
|
|
||||||
"overrides": [
|
|
||||||
{
|
|
||||||
"files": ".prettierrc",
|
|
||||||
"options": { "parser": "json" }
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
14
.prettierrc.js
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
module.exports = {
|
||||||
|
printWidth: 80,
|
||||||
|
proseWrap: 'never',
|
||||||
|
singleQuote: true,
|
||||||
|
trailingComma: 'all',
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: '*.md',
|
||||||
|
options: {
|
||||||
|
proseWrap: 'preserve',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
53
.umi/core/devScripts.ts
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
|
||||||
|
if (window.g_initWebpackHotDevClient) {
|
||||||
|
function tryApplyUpdates(onHotUpdateSuccess?: Function) {
|
||||||
|
// @ts-ignore
|
||||||
|
if (!module.hot) {
|
||||||
|
window.location.reload();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isUpdateAvailable() {
|
||||||
|
// @ts-ignore
|
||||||
|
return window.g_getMostRecentCompilationHash() !== __webpack_hash__;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: is update available?
|
||||||
|
// @ts-ignore
|
||||||
|
if (!isUpdateAvailable() || module.hot.status() !== 'idle') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleApplyUpdates(err: Error | null, updatedModules: any) {
|
||||||
|
if (err || !updatedModules || window.g_getHadRuntimeError()) {
|
||||||
|
window.location.reload();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
onHotUpdateSuccess?.();
|
||||||
|
|
||||||
|
if (isUpdateAvailable()) {
|
||||||
|
// While we were updating, there was a new update! Do it again.
|
||||||
|
tryApplyUpdates();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
module.hot.check(true).then(
|
||||||
|
function (updatedModules: any) {
|
||||||
|
handleApplyUpdates(null, updatedModules);
|
||||||
|
},
|
||||||
|
function (err: Error) {
|
||||||
|
handleApplyUpdates(err, null);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
window.g_initWebpackHotDevClient({
|
||||||
|
tryApplyUpdates,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export const __mfsu = 1;
|
||||||
|
|
21
.umi/core/history.ts
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
import { createBrowserHistory, History } from '/Users/teddyj/Library/Mobile Documents/com~apple~CloudDocs/Documents/workspace/dev/nicenote/node_modules/_@umijs_runtime@3.5.41@@umijs/runtime';
|
||||||
|
|
||||||
|
let options = {
|
||||||
|
"basename": "/"
|
||||||
|
};
|
||||||
|
if ((<any>window).routerBase) {
|
||||||
|
options.basename = (<any>window).routerBase;
|
||||||
|
}
|
||||||
|
|
||||||
|
// remove initial history because of ssr
|
||||||
|
let history: History = process.env.__IS_SERVER ? null : createBrowserHistory(options);
|
||||||
|
export const createHistory = (hotReload = false) => {
|
||||||
|
if (!hotReload) {
|
||||||
|
history = createBrowserHistory(options);
|
||||||
|
}
|
||||||
|
|
||||||
|
return history;
|
||||||
|
};
|
||||||
|
|
||||||
|
export { history };
|
8
.umi/core/plugin.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
import { Plugin } from '/Users/teddyj/Library/Mobile Documents/com~apple~CloudDocs/Documents/workspace/dev/nicenote/node_modules/_@umijs_runtime@3.5.41@@umijs/runtime';
|
||||||
|
|
||||||
|
const plugin = new Plugin({
|
||||||
|
validKeys: ['modifyClientRenderOpts','patchRoutes','rootContainer','render','onRouteChange','__mfsu',],
|
||||||
|
});
|
||||||
|
|
||||||
|
export { plugin };
|
297
.umi/core/pluginConfig.d.ts
vendored
Normal file
@ -0,0 +1,297 @@
|
|||||||
|
// Created by Umi Plugin
|
||||||
|
|
||||||
|
export interface IConfigFromPlugins {
|
||||||
|
"404"?: boolean
|
||||||
|
routes?: {
|
||||||
|
/**
|
||||||
|
* Any valid URL path
|
||||||
|
*/
|
||||||
|
path?: string
|
||||||
|
/**
|
||||||
|
* A React component to render only when the location matches.
|
||||||
|
*/
|
||||||
|
component?: (string | (() => any))
|
||||||
|
wrappers?: string[]
|
||||||
|
/**
|
||||||
|
* navigate to a new location
|
||||||
|
*/
|
||||||
|
redirect?: string
|
||||||
|
/**
|
||||||
|
* When true, the active class/style will only be applied if the location is matched exactly.
|
||||||
|
*/
|
||||||
|
exact?: boolean
|
||||||
|
routes?: any[]
|
||||||
|
[k: string]: any
|
||||||
|
}[]
|
||||||
|
history?: {
|
||||||
|
type?: ("browser" | "hash" | "memory")
|
||||||
|
options?: {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
polyfill?: {
|
||||||
|
imports?: string[]
|
||||||
|
}
|
||||||
|
alias?: {
|
||||||
|
|
||||||
|
}
|
||||||
|
analyze?: {
|
||||||
|
analyzerMode?: ("server" | "static" | "disabled")
|
||||||
|
analyzerHost?: string
|
||||||
|
analyzerPort?: any
|
||||||
|
openAnalyzer?: boolean
|
||||||
|
generateStatsFile?: boolean
|
||||||
|
statsFilename?: string
|
||||||
|
logLevel?: ("info" | "warn" | "error" | "silent")
|
||||||
|
defaultSizes?: ("stat" | "parsed" | "gzip")
|
||||||
|
[k: string]: any
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* postcss autoprefixer, default flexbox: no-2009
|
||||||
|
*/
|
||||||
|
autoprefixer?: {
|
||||||
|
|
||||||
|
}
|
||||||
|
base?: string
|
||||||
|
chainWebpack?: (() => any)
|
||||||
|
chunks?: string[]
|
||||||
|
/**
|
||||||
|
* more css-loader options see https://webpack.js.org/loaders/css-loader/#options
|
||||||
|
*/
|
||||||
|
cssLoader?: {
|
||||||
|
url?: (boolean | (() => any))
|
||||||
|
import?: (boolean | (() => any))
|
||||||
|
modules?: (boolean | string | {
|
||||||
|
|
||||||
|
})
|
||||||
|
sourceMap?: boolean
|
||||||
|
importLoaders?: number
|
||||||
|
onlyLocals?: boolean
|
||||||
|
esModule?: boolean
|
||||||
|
localsConvention?: ("asIs" | "camelCase" | "camelCaseOnly" | "dashes" | "dashesOnly")
|
||||||
|
}
|
||||||
|
cssModulesTypescriptLoader?: {
|
||||||
|
mode?: ("emit" | "verify")
|
||||||
|
}
|
||||||
|
cssnano?: {
|
||||||
|
|
||||||
|
}
|
||||||
|
copy?: any[]
|
||||||
|
define?: {
|
||||||
|
|
||||||
|
}
|
||||||
|
devScripts?: {
|
||||||
|
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* devServer configs
|
||||||
|
*/
|
||||||
|
devServer?: {
|
||||||
|
/**
|
||||||
|
* devServer port, default 8000
|
||||||
|
*/
|
||||||
|
port?: number
|
||||||
|
host?: string
|
||||||
|
https?: ({
|
||||||
|
key?: string
|
||||||
|
cert?: string
|
||||||
|
http2?: boolean
|
||||||
|
[k: string]: any
|
||||||
|
} | boolean)
|
||||||
|
headers?: {
|
||||||
|
|
||||||
|
}
|
||||||
|
writeToDisk?: (boolean | (() => any))
|
||||||
|
[k: string]: any
|
||||||
|
}
|
||||||
|
devtool?: string
|
||||||
|
/**
|
||||||
|
* Code splitting for performance optimization
|
||||||
|
*/
|
||||||
|
dynamicImport?: {
|
||||||
|
/**
|
||||||
|
* loading the component before loaded
|
||||||
|
*/
|
||||||
|
loading?: string
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Code splitting for import statement syntax
|
||||||
|
*/
|
||||||
|
dynamicImportSyntax?: {
|
||||||
|
|
||||||
|
}
|
||||||
|
exportStatic?: {
|
||||||
|
htmlSuffix?: boolean
|
||||||
|
dynamicRoot?: boolean
|
||||||
|
supportWin?: boolean
|
||||||
|
/**
|
||||||
|
* extra render paths only enable in ssr
|
||||||
|
*/
|
||||||
|
extraRoutePaths?: (() => any)
|
||||||
|
}
|
||||||
|
externals?: ({
|
||||||
|
|
||||||
|
} | string | (() => any))
|
||||||
|
extraBabelIncludes?: any[]
|
||||||
|
extraBabelPlugins?: any[]
|
||||||
|
extraBabelPresets?: any[]
|
||||||
|
extraPostCSSPlugins?: any[]
|
||||||
|
/**
|
||||||
|
* fork-ts-checker-webpack-plugin options see https://github.com/TypeStrong/fork-ts-checker-webpack-plugin#options
|
||||||
|
*/
|
||||||
|
forkTSChecker?: {
|
||||||
|
async?: boolean
|
||||||
|
typescript?: (boolean | {
|
||||||
|
|
||||||
|
})
|
||||||
|
eslint?: {
|
||||||
|
|
||||||
|
}
|
||||||
|
issue?: {
|
||||||
|
|
||||||
|
}
|
||||||
|
formatter?: (string | {
|
||||||
|
|
||||||
|
})
|
||||||
|
logger?: {
|
||||||
|
|
||||||
|
}
|
||||||
|
[k: string]: any
|
||||||
|
}
|
||||||
|
fastRefresh?: {
|
||||||
|
|
||||||
|
}
|
||||||
|
hash?: boolean
|
||||||
|
ignoreMomentLocale?: boolean
|
||||||
|
inlineLimit?: number
|
||||||
|
lessLoader?: {
|
||||||
|
|
||||||
|
}
|
||||||
|
manifest?: {
|
||||||
|
fileName?: string
|
||||||
|
publicPath?: ""
|
||||||
|
basePath?: string
|
||||||
|
writeToFileEmit?: boolean
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* open mfsu feature
|
||||||
|
*/
|
||||||
|
mfsu?: {
|
||||||
|
development?: {
|
||||||
|
output?: string
|
||||||
|
}
|
||||||
|
production?: {
|
||||||
|
output?: string
|
||||||
|
}
|
||||||
|
mfName?: string
|
||||||
|
exportAllMembers?: {
|
||||||
|
|
||||||
|
}
|
||||||
|
chunks?: string[]
|
||||||
|
ignoreNodeBuiltInModules?: boolean
|
||||||
|
}
|
||||||
|
mountElementId?: ""
|
||||||
|
mpa?: {
|
||||||
|
|
||||||
|
}
|
||||||
|
nodeModulesTransform?: {
|
||||||
|
type?: ("all" | "none")
|
||||||
|
exclude?: string[]
|
||||||
|
}
|
||||||
|
outputPath?: ""
|
||||||
|
plugins?: string[]
|
||||||
|
postcssLoader?: {
|
||||||
|
|
||||||
|
}
|
||||||
|
presets?: string[]
|
||||||
|
proxy?: {
|
||||||
|
|
||||||
|
}
|
||||||
|
publicPath?: string
|
||||||
|
runtimePublicPath?: boolean
|
||||||
|
ssr?: {
|
||||||
|
/**
|
||||||
|
* force execing Page getInitialProps functions
|
||||||
|
*/
|
||||||
|
forceInitial?: boolean
|
||||||
|
/**
|
||||||
|
* remove window.g_initialProps in html
|
||||||
|
*/
|
||||||
|
removeWindowInitialProps?: boolean
|
||||||
|
/**
|
||||||
|
* disable serve-side render in umi dev mode.
|
||||||
|
*/
|
||||||
|
devServerRender?: boolean
|
||||||
|
mode?: ("stream" | "string")
|
||||||
|
/**
|
||||||
|
* static markup in static site
|
||||||
|
*/
|
||||||
|
staticMarkup?: boolean
|
||||||
|
}
|
||||||
|
singular?: boolean
|
||||||
|
styleLoader?: {
|
||||||
|
|
||||||
|
}
|
||||||
|
targets?: {
|
||||||
|
|
||||||
|
}
|
||||||
|
terserOptions?: {
|
||||||
|
|
||||||
|
}
|
||||||
|
theme?: {
|
||||||
|
|
||||||
|
}
|
||||||
|
runtimeHistory?: {
|
||||||
|
|
||||||
|
}
|
||||||
|
webpack5?: {
|
||||||
|
lazyCompilation?: {
|
||||||
|
entries?: boolean
|
||||||
|
imports?: boolean
|
||||||
|
test?: any
|
||||||
|
}
|
||||||
|
}
|
||||||
|
workerLoader?: {
|
||||||
|
|
||||||
|
}
|
||||||
|
favicon?: string
|
||||||
|
headScripts?: any[]
|
||||||
|
links?: any[]
|
||||||
|
metas?: any[]
|
||||||
|
scripts?: any[]
|
||||||
|
styles?: any[]
|
||||||
|
title?: string
|
||||||
|
mock?: {
|
||||||
|
exclude?: string[]
|
||||||
|
}
|
||||||
|
themeConfig?: {
|
||||||
|
|
||||||
|
}
|
||||||
|
logo?: (string | boolean)
|
||||||
|
mode?: any
|
||||||
|
description?: string
|
||||||
|
locales?: string[][]
|
||||||
|
resolve?: {
|
||||||
|
|
||||||
|
}
|
||||||
|
menus?: {
|
||||||
|
|
||||||
|
}
|
||||||
|
navs?: (any[] | {
|
||||||
|
|
||||||
|
})
|
||||||
|
algolia?: {
|
||||||
|
appId?: string
|
||||||
|
apiKey?: string
|
||||||
|
indexName?: string
|
||||||
|
debug?: boolean
|
||||||
|
}
|
||||||
|
sitemap?: {
|
||||||
|
hostname?: string
|
||||||
|
excludes?: string[]
|
||||||
|
}
|
||||||
|
apiParser?: {
|
||||||
|
|
||||||
|
}
|
||||||
|
[k: string]: any
|
||||||
|
}
|
5
.umi/core/pluginRegister.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
import { plugin } from './plugin';
|
||||||
|
|
||||||
|
|
||||||
|
export const __mfsu = 1;
|
4
.umi/core/polyfill.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
import 'core-js';
|
||||||
|
import 'regenerator-runtime/runtime';
|
||||||
|
export {};
|
129
.umi/core/routes.ts
Normal file
@ -0,0 +1,129 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
import React from 'react';
|
||||||
|
import { ApplyPluginsType } from '/Users/teddyj/Library/Mobile Documents/com~apple~CloudDocs/Documents/workspace/dev/nicenote/node_modules/_@umijs_runtime@3.5.41@@umijs/runtime';
|
||||||
|
import * as umiExports from './umiExports';
|
||||||
|
import { plugin } from './plugin';
|
||||||
|
|
||||||
|
export function getRoutes() {
|
||||||
|
const routes = [
|
||||||
|
{
|
||||||
|
"path": "/~demos/:uuid",
|
||||||
|
"layout": false,
|
||||||
|
"wrappers": [require('../dumi/layout').default],
|
||||||
|
"component": ((props) => {
|
||||||
|
const React = require('react');
|
||||||
|
const { default: getDemoRenderArgs } = require('/Users/teddyj/Library/Mobile Documents/com~apple~CloudDocs/Documents/workspace/dev/nicenote/node_modules/_@umijs_preset-dumi@1.1.53@@umijs/preset-dumi/lib/plugins/features/demo/getDemoRenderArgs');
|
||||||
|
const { default: Previewer } = require('dumi-theme-default/es/builtins/Previewer.js');
|
||||||
|
const { usePrefersColor, context } = require('dumi/theme');
|
||||||
|
|
||||||
|
|
||||||
|
const { demos } = React.useContext(context);
|
||||||
|
const [renderArgs, setRenderArgs] = React.useState([]);
|
||||||
|
|
||||||
|
// update render args when props changed
|
||||||
|
React.useLayoutEffect(() => {
|
||||||
|
setRenderArgs(getDemoRenderArgs(props, demos));
|
||||||
|
}, [props.match.params.uuid, props.location.query.wrapper, props.location.query.capture]);
|
||||||
|
|
||||||
|
// for listen prefers-color-schema media change in demo single route
|
||||||
|
usePrefersColor();
|
||||||
|
|
||||||
|
switch (renderArgs.length) {
|
||||||
|
case 1:
|
||||||
|
// render demo directly
|
||||||
|
return renderArgs[0];
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
// render demo with previewer
|
||||||
|
return React.createElement(
|
||||||
|
Previewer,
|
||||||
|
renderArgs[0],
|
||||||
|
renderArgs[1],
|
||||||
|
);
|
||||||
|
|
||||||
|
default:
|
||||||
|
return `Demo ${props.match.params.uuid} not found :(`;
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/_demos/:uuid",
|
||||||
|
"redirect": "/~demos/:uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__dumiRoot": true,
|
||||||
|
"layout": false,
|
||||||
|
"path": "/",
|
||||||
|
"wrappers": [require('../dumi/layout').default, require('/Users/teddyj/Library/Mobile Documents/com~apple~CloudDocs/Documents/workspace/dev/nicenote/node_modules/_dumi-theme-default@1.1.24@dumi-theme-default/es/layout.js').default],
|
||||||
|
"routes": [
|
||||||
|
{
|
||||||
|
"path": "/guide",
|
||||||
|
"component": require('/Users/teddyj/Library/Mobile Documents/com~apple~CloudDocs/Documents/workspace/dev/nicenote/new/docs/guide.md').default,
|
||||||
|
"exact": true,
|
||||||
|
"meta": {
|
||||||
|
"filePath": "docs/guide.md",
|
||||||
|
"updatedTime": 1698630719271,
|
||||||
|
"slugs": [],
|
||||||
|
"title": "Guide"
|
||||||
|
},
|
||||||
|
"title": "Guide - nicenote"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/",
|
||||||
|
"component": require('/Users/teddyj/Library/Mobile Documents/com~apple~CloudDocs/Documents/workspace/dev/nicenote/new/docs/index.md').default,
|
||||||
|
"exact": true,
|
||||||
|
"meta": {
|
||||||
|
"filePath": "docs/index.md",
|
||||||
|
"updatedTime": 1698630719273,
|
||||||
|
"title": "A static site based on dumi",
|
||||||
|
"hero": {
|
||||||
|
"title": "Site",
|
||||||
|
"description": "nicenote,nicecode,学习,总结",
|
||||||
|
"actions": [
|
||||||
|
{
|
||||||
|
"text": "Hello",
|
||||||
|
"link": "/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "World",
|
||||||
|
"link": "/"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"features": [
|
||||||
|
{
|
||||||
|
"title": "Hello",
|
||||||
|
"emoji": "💎",
|
||||||
|
"description": "Put hello description here"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "World",
|
||||||
|
"emoji": "🌈",
|
||||||
|
"description": "Put world description here"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "!",
|
||||||
|
"emoji": "🚀",
|
||||||
|
"description": "Put ! description here"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"slugs": []
|
||||||
|
},
|
||||||
|
"title": "A static site based on dumi - nicenote"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"title": "nicenote",
|
||||||
|
"component": (props) => props.children
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
// allow user to extend routes
|
||||||
|
plugin.applyPlugins({
|
||||||
|
key: 'patchRoutes',
|
||||||
|
type: ApplyPluginsType.event,
|
||||||
|
args: { routes },
|
||||||
|
});
|
||||||
|
|
||||||
|
return routes;
|
||||||
|
}
|
3
.umi/core/umiExports.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
export { history } from './history';
|
||||||
|
export { plugin } from './plugin';
|
1
.umi/dumi/apis.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{}
|
32
.umi/dumi/config.json
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
"menus": {
|
||||||
|
"en-US": {
|
||||||
|
"*": [
|
||||||
|
{
|
||||||
|
"path": "/",
|
||||||
|
"title": "A static site based on dumi",
|
||||||
|
"meta": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/guide",
|
||||||
|
"title": "Guide",
|
||||||
|
"meta": {}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"locales": [
|
||||||
|
{
|
||||||
|
"name": "en-US",
|
||||||
|
"label": "English"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"navs": {},
|
||||||
|
"title": "nicenote",
|
||||||
|
"mode": "doc",
|
||||||
|
"repository": {
|
||||||
|
"url": "",
|
||||||
|
"branch": "master"
|
||||||
|
},
|
||||||
|
"theme": {}
|
||||||
|
}
|
6
.umi/dumi/demos/index.ts
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
import React from 'react';
|
||||||
|
import { dynamic } from 'dumi';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
};
|
8
.umi/dumi/layout.tsx
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
import React from 'react';
|
||||||
|
import config from '@@/dumi/config';
|
||||||
|
import demos from '@@/dumi/demos';
|
||||||
|
import apis from '@@/dumi/apis';
|
||||||
|
import Layout from '/Users/teddyj/Library/Mobile Documents/com~apple~CloudDocs/Documents/workspace/dev/nicenote/node_modules/_@umijs_preset-dumi@1.1.53@@umijs/preset-dumi/lib/theme/layout';
|
||||||
|
|
||||||
|
export default (props) => <Layout {...props} config={config} demos={demos} apis={apis} />;
|
58
.umi/umi.ts
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
import './core/polyfill';
|
||||||
|
import '@@/core/devScripts';
|
||||||
|
import { plugin } from './core/plugin';
|
||||||
|
import './core/pluginRegister';
|
||||||
|
import { createHistory } from './core/history';
|
||||||
|
import { ApplyPluginsType } from '/Users/teddyj/Library/Mobile Documents/com~apple~CloudDocs/Documents/workspace/dev/nicenote/node_modules/_@umijs_runtime@3.5.41@@umijs/runtime';
|
||||||
|
import { renderClient } from '/Users/teddyj/Library/Mobile Documents/com~apple~CloudDocs/Documents/workspace/dev/nicenote/node_modules/_@umijs_renderer-react@3.5.41@@umijs/renderer-react/dist/index.js';
|
||||||
|
import { getRoutes } from './core/routes';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const getClientRender = (args: { hot?: boolean; routes?: any[] } = {}) => plugin.applyPlugins({
|
||||||
|
key: 'render',
|
||||||
|
type: ApplyPluginsType.compose,
|
||||||
|
initialValue: () => {
|
||||||
|
const opts = plugin.applyPlugins({
|
||||||
|
key: 'modifyClientRenderOpts',
|
||||||
|
type: ApplyPluginsType.modify,
|
||||||
|
initialValue: {
|
||||||
|
routes: args.routes || getRoutes(),
|
||||||
|
plugin,
|
||||||
|
history: createHistory(args.hot),
|
||||||
|
isServer: process.env.__IS_SERVER,
|
||||||
|
rootElement: 'root',
|
||||||
|
defaultTitle: ``,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
return renderClient(opts);
|
||||||
|
},
|
||||||
|
args,
|
||||||
|
});
|
||||||
|
|
||||||
|
const clientRender = getClientRender();
|
||||||
|
export default clientRender();
|
||||||
|
|
||||||
|
|
||||||
|
window.g_umi = {
|
||||||
|
version: '3.5.41',
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// hot module replacement
|
||||||
|
// @ts-ignore
|
||||||
|
if (module.hot) {
|
||||||
|
// @ts-ignore
|
||||||
|
module.hot.accept('./core/routes', () => {
|
||||||
|
const ret = require('./core/routes');
|
||||||
|
if (ret.then) {
|
||||||
|
ret.then(({ getRoutes }) => {
|
||||||
|
getClientRender({ hot: true, routes: getRoutes() })();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
getClientRender({ hot: true, routes: ret.getRoutes() })();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
39
.umirc.ts
@ -1,39 +0,0 @@
|
|||||||
import { defineConfig } from 'dumi';
|
|
||||||
|
|
||||||
export default defineConfig({
|
|
||||||
title: 'NiceNote',
|
|
||||||
favicon: 'https://jzx-h5.oss-cn-hangzhou.aliyuncs.com/logo.ico',
|
|
||||||
logo: 'http://jzx-h5.oss-cn-hangzhou.aliyuncs.com/logo.png',
|
|
||||||
outputPath: 'docs-dist',
|
|
||||||
hash: true,
|
|
||||||
dynamicImport: {},
|
|
||||||
history: {
|
|
||||||
type: 'hash',
|
|
||||||
},
|
|
||||||
mode: 'site',
|
|
||||||
publicPath: '/',
|
|
||||||
resolve: {
|
|
||||||
includes: [
|
|
||||||
'docs',
|
|
||||||
'src'
|
|
||||||
],
|
|
||||||
},
|
|
||||||
locales: [['zh-CN', '中文']],
|
|
||||||
navs: [
|
|
||||||
null,
|
|
||||||
{
|
|
||||||
title: 'GitHub',
|
|
||||||
path: 'git@github.com:j710328466/learn-note.git',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
analyze: {
|
|
||||||
analyzerMode: 'server',
|
|
||||||
analyzerPort: 8888,
|
|
||||||
openAnalyzer: false,
|
|
||||||
// generate stats file while ANALYZE_DUMP exist
|
|
||||||
generateStatsFile: false,
|
|
||||||
statsFilename: 'stats.json',
|
|
||||||
logLevel: 'info',
|
|
||||||
defaultSizes: 'parsed', // stat // gzip
|
|
||||||
}
|
|
||||||
});
|
|
2
LICENSE
@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2021 Dev
|
Copyright (c) 71032866@qq.com
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
33
README.md
@ -1,27 +1,20 @@
|
|||||||
# learn-note
|
# nicenote
|
||||||
|
|
||||||
## Getting Started
|
A static site base on [dumi](https://d.umijs.org).
|
||||||
|
|
||||||
Install dependencies,
|
## Development
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ npm i
|
# install dependencies
|
||||||
|
$ cnpm install
|
||||||
|
|
||||||
|
# start dev server
|
||||||
|
$ cnpm start
|
||||||
|
|
||||||
|
# build docs
|
||||||
|
$ cnpm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
Start the dev server,
|
## LICENSE
|
||||||
|
|
||||||
```bash
|
MIT
|
||||||
$ npm start
|
|
||||||
```
|
|
||||||
|
|
||||||
Build documentation,
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ npm run docs:build
|
|
||||||
```
|
|
||||||
|
|
||||||
Build library via `father-build`,
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ npm run build
|
|
||||||
```
|
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
extends: ["@nicecode/commit-lint"]
|
|
||||||
};
|
|
@ -4,7 +4,7 @@ nav:
|
|||||||
path: /fea
|
path: /fea
|
||||||
group:
|
group:
|
||||||
title: 💊 SVG
|
title: 💊 SVG
|
||||||
order: 3
|
order: 1
|
||||||
path: /svg
|
path: /svg
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -33,4 +33,4 @@ export default () => {
|
|||||||
|
|
||||||
## 基础动画案例
|
## 基础动画案例
|
||||||
|
|
||||||
<code src="./demos/ok.tsx" />
|
<!-- <code src="./demos/ok.tsx" ></code> -->
|
||||||
|
@ -14,9 +14,11 @@ group:
|
|||||||
|
|
||||||
### 基本对象
|
### 基本对象
|
||||||
|
|
||||||
|
一个基本的3d场景需要包括的以下几个必备要素:
|
||||||
|
|
||||||
- 场景:scence
|
- 场景:scence
|
||||||
- 相机:camera
|
- 相机:camera
|
||||||
- 相机创建实例图(THREE.PerspectiveCamera(fovy, aspect, zNear, zFar)):
|
- 相机创建实例图(THREE.PerspectiveCamera(fov, aspect, zNear, zFar)):
|
||||||
- 渲染器:renderer
|
- 渲染器:renderer
|
||||||
|
|
||||||
### 绘制方法
|
### 绘制方法
|
||||||
@ -37,13 +39,20 @@ group:
|
|||||||
- 视窗(Viewports)
|
- 视窗(Viewports)
|
||||||
- 着色器(shader)
|
- 着色器(shader)
|
||||||
|
|
||||||
### pixi
|
## pixi
|
||||||
|
|
||||||
一款基于webGL的 2d渲染引擎,用来写一些bit游戏还是挺好用的。
|
一款基于webGL的 2d渲染引擎,用来写一些bit游戏还是挺好用的。
|
||||||
|
|
||||||
|
## threeJs
|
||||||
|
|
||||||
|
目前比较热门的基于webgl的框架,缺点是每个版本之间的接口差异较大,所以使用的时候需要根据版本来找对应的接口文档
|
||||||
|
|
||||||
|
本文会更多的以threejs为基础框架来展开深入构建一个3Dweb世界
|
||||||
|
|
||||||
参考的文档有以下:
|
参考的文档有以下:
|
||||||
|
|
||||||
1. [pixi中文](http://pixijs.huashengweilai.com/guide/start/9.make-sprite-from-texture-atlas.html#%E9%80%9A%E8%BF%87%E7%BA%B9%E7%90%86%E8%B4%B4%E5%9B%BE%E9%9B%86%E5%88%9B%E5%BB%BA%E7%B2%BE%E7%81%B5)
|
1. [pixi中文](http://pixijs.huashengweilai.com/guide/start/9.make-sprite-from-texture-atlas.html#%E9%80%9A%E8%BF%87%E7%BA%B9%E7%90%86%E8%B4%B4%E5%9B%BE%E9%9B%86%E5%88%9B%E5%BB%BA%E7%B2%BE%E7%81%B5)
|
||||||
2. [PIXI API大全](https://pixijs.download/release/docs/index.html)
|
2. [PIXI API大全](https://pixijs.download/release/docs/index.html)
|
||||||
3. [bit 贴图大全](https://opengameart.org/)
|
3. [bit 贴图大全](https://opengameart.org/)
|
||||||
4. [threeJs](https://techbrood.com/threejs/examples/#webgl_shadowmap_pointlight)
|
4. [threeJs](https://techbrood.com/threejs/examples/#webgl_shadowmap_pointlight)
|
||||||
|
5. [puxiao的教程](https://github.com/puxiao/threejs-tutorial)
|
||||||
|
@ -1,20 +1,17 @@
|
|||||||
---
|
---
|
||||||
|
title: A static site based on dumi
|
||||||
hero:
|
hero:
|
||||||
title: Nice Note
|
title: NiceNote
|
||||||
desc: 💊 Dev's 笔记
|
description: dev 的学习博客
|
||||||
actions:
|
actions:
|
||||||
- text: 开始学习
|
- text: 开始学习
|
||||||
link: /fea/website
|
link: /fea/website
|
||||||
features:
|
features:
|
||||||
- icon: http://jzx-h5.oss-cn-hangzhou.aliyuncs.com/logo.png
|
- emoji: 🍍
|
||||||
title: NiceCode
|
title: nicecode
|
||||||
desc: <a href="https://nicecoders.github.io">前端工具合集</a>
|
description: <a href="https://nicecoders.github.io">前端工具合集</a>
|
||||||
|
|
||||||
footer: Open-source MIT Licensed | Copyright © 2019<br />Powered by Dev
|
|
||||||
---
|
---
|
||||||
|
|
||||||
嗨,我是 dev,这是我用来记录我的职业生涯总结的各种乱七八糟的知识点,希望能对你有帮助
|
这是我用来记录我的职业生涯总结的各种乱七八糟的知识点,希望能对你有帮助
|
||||||
|
|
||||||
## 更新日志
|
|
||||||
|
|
||||||
<embed src="../CHANGELOG.md"></embed>
|
<embed src="../CHANGELOG.md"></embed>
|
||||||
|
83
package.json
@ -1,67 +1,34 @@
|
|||||||
{
|
{
|
||||||
"private": true,
|
"name": "nicenote",
|
||||||
"name": "learn-note",
|
"version": "0.0.1",
|
||||||
"version": "1.0.0",
|
"description": "nicenote,nicecode,学习,总结",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "dumi dev",
|
"start": "npm run dev",
|
||||||
"docs:build": "dumi build",
|
"dev": "dumi dev",
|
||||||
"docs:deploy": "gh-pages -d docs-dist",
|
"build": "dumi build",
|
||||||
"build": "father-build",
|
"deploy": "npm run build && gh-pages -d docs-dist",
|
||||||
"deploy": "npm run docs:build && npm run docs:deploy",
|
"prepare": "husky install && dumi setup"
|
||||||
"release": "npm run build && npm publish",
|
|
||||||
"prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
|
|
||||||
"test": "umi-test",
|
|
||||||
"test:coverage": "umi-test --coverage",
|
|
||||||
"cz": "git add . && git cz",
|
|
||||||
"log": "conventional-changelog -n node_modules/@nicecode/changelog -i CHANGELOG.md -s -r 0"
|
|
||||||
},
|
},
|
||||||
"main": "dist/index.js",
|
"authors": [
|
||||||
"module": "dist/index.esm.js",
|
"71032866@qq.com"
|
||||||
"typings": "dist/index.d.ts",
|
],
|
||||||
"husky": {
|
"license": "MIT",
|
||||||
"hooks": {
|
"commitlint": {
|
||||||
"pre-commit": "lint-staged",
|
"extends": [
|
||||||
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
"@commitlint/config-conventional"
|
||||||
}
|
|
||||||
},
|
|
||||||
"config": {
|
|
||||||
"commitizen": {
|
|
||||||
"path": "@nicecode/commit"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"lint-staged": {
|
|
||||||
"*.{js,jsx,less,md,json}": [
|
|
||||||
"prettier --write"
|
|
||||||
],
|
|
||||||
"*.ts?(x)": [
|
|
||||||
"prettier --parser=typescript --write"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"repository": {
|
"lint-staged": {
|
||||||
"type": "git",
|
"*.{md,json}": [
|
||||||
"url": "https://github.com/j710328466/j710328466.github.io",
|
"prettier --write --no-error-on-unmatched-pattern"
|
||||||
"branch": "master",
|
]
|
||||||
"platform": "github"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@nicecode/css": "^0.0.8",
|
|
||||||
"n": "^9.0.1",
|
|
||||||
"react": "^16.12.0"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nicecode/changelog": "^0.2.0",
|
"@commitlint/cli": "^17.1.2",
|
||||||
"@nicecode/commit": "^0.0.12",
|
"@commitlint/config-conventional": "^17.1.0",
|
||||||
"@nicecode/commit-lint": "^0.1.2",
|
"dumi": "^2.2.13",
|
||||||
"@umijs/test": "^3.0.5",
|
"husky": "^8.0.1",
|
||||||
"commitizen": "^4.2.4",
|
"lint-staged": "^13.0.3",
|
||||||
"commitlint": "^13.1.0",
|
"prettier": "^2.7.1"
|
||||||
"conventional-changelog-cli": "^2.1.1",
|
|
||||||
"dumi": "^1.0.16",
|
|
||||||
"father-build": "^1.17.2",
|
|
||||||
"gh-pages": "^3.0.0",
|
|
||||||
"husky": "^7.0.4",
|
|
||||||
"lint-staged": "^10.0.7",
|
|
||||||
"prettier": "^2.2.1",
|
|
||||||
"yorkie": "^2.0.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
27137
pnpm-lock.yaml
@ -12,19 +12,19 @@ group:
|
|||||||
|
|
||||||
### 粒子背景
|
### 粒子背景
|
||||||
|
|
||||||
<code src="./demos/ParticleBG/index.jsx" />
|
<code src="./demos/ParticleBG/index.jsx" ></code>
|
||||||
|
|
||||||
### 粒子图片
|
### 粒子图片
|
||||||
|
|
||||||
<code src="./demos/ParticleIMG/index.jsx" />
|
<code src="./demos/ParticleIMG/index.jsx" ></code>
|
||||||
|
|
||||||
### 贪吃蛇
|
### 贪吃蛇
|
||||||
|
|
||||||
<code src="./demos/Snake/index.jsx" />
|
<code src="./demos/Snake/index.jsx" ></code>
|
||||||
|
|
||||||
### 液体海报
|
### 液体海报
|
||||||
|
|
||||||
<code src="./demos/LiquidPost/index.jsx" />
|
<code src="./demos/LiquidPost/index.jsx" ></code>
|
||||||
|
|
||||||
### 大转盘(doing)
|
### 大转盘(doing)
|
||||||
|
|
||||||
@ -228,7 +228,7 @@ export default () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<canvas ref={canvasRef} width="200" height="200" />
|
<canvas ref={canvasRef} width="200" height="200" ></code>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -236,7 +236,7 @@ export default () => {
|
|||||||
|
|
||||||
### 火焰
|
### 火焰
|
||||||
|
|
||||||
<code src="./demos/Fire/index.jsx" />
|
<code src="./demos/Fire/index.jsx" ></code>
|
||||||
|
|
||||||
### 星空
|
### 星空
|
||||||
|
|
||||||
@ -351,7 +351,7 @@ export default () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<canvas ref={canvasRef} width="200" height="200" />
|
<canvas ref={canvasRef} width="200" height="200" ></code>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -461,7 +461,7 @@ export default () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<canvas ref={canvasRef} width="200" height="200" />
|
<canvas ref={canvasRef} width="200" height="200" ></code>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -551,7 +551,7 @@ export default () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<canvas ref={canvasRef} width="200" height="200" />
|
<canvas ref={canvasRef} width="200" height="200" ></code>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -559,4 +559,4 @@ export default () => {
|
|||||||
|
|
||||||
### 时钟
|
### 时钟
|
||||||
|
|
||||||
<code src="./demos/Clock/index.jsx" />
|
<code src="./demos/Clock/index.jsx" ></code>
|
||||||
|
@ -14,44 +14,44 @@ group:
|
|||||||
### 心跳卡片
|
### 心跳卡片
|
||||||
|
|
||||||
<a href="https://codepen.io/gayane-gasparyan/pen/jOmaBQK">参考</a>
|
<a href="https://codepen.io/gayane-gasparyan/pen/jOmaBQK">参考</a>
|
||||||
<code src="./demos/HeartBeat/index.tsx" />
|
<code src="./demos/HeartBeat/index.tsx" ></code>
|
||||||
|
|
||||||
### 小球动画
|
### 小球动画
|
||||||
|
|
||||||
<code src="./demos/demo10/index.tsx" />
|
<code src="./demos/demo10/index.tsx" ></code>
|
||||||
|
|
||||||
### 3D 方块
|
### 3D 方块
|
||||||
|
|
||||||
<code src="./demos/demo9/index.tsx" />
|
<code src="./demos/demo9/index.tsx" ></code>
|
||||||
|
|
||||||
### 3D 导航条
|
### 3D 导航条
|
||||||
|
|
||||||
<code src="./demos/demo8/index.tsx" />
|
<code src="./demos/demo8/index.tsx" ></code>
|
||||||
|
|
||||||
### 键盘打字效果
|
### 键盘打字效果
|
||||||
|
|
||||||
<code src="./demos/demo7/index.tsx" />
|
<code src="./demos/demo7/index.tsx" ></code>
|
||||||
|
|
||||||
### 镂空文字背景
|
### 镂空文字背景
|
||||||
|
|
||||||
<code src="./demos/demo1/index.tsx" />
|
<code src="./demos/demo1/index.tsx" ></code>
|
||||||
|
|
||||||
### 按钮合集
|
### 按钮合集
|
||||||
|
|
||||||
<code src="./demos/demo2/index.tsx" />
|
<code src="./demos/demo2/index.tsx" ></code>
|
||||||
|
|
||||||
### Svg 蒙版
|
### Svg 蒙版
|
||||||
|
|
||||||
<code src="./demos/demo3/index.tsx" />
|
<code src="./demos/demo3/index.tsx" ></code>
|
||||||
|
|
||||||
### 毛玻璃蒙版
|
### 毛玻璃蒙版
|
||||||
|
|
||||||
<code src="./demos/demo4/index.tsx" />
|
<code src="./demos/demo4/index.tsx" ></code>
|
||||||
|
|
||||||
### 渐变文字
|
### 渐变文字
|
||||||
|
|
||||||
<code src="./demos/demo5/index.tsx" />
|
<code src="./demos/demo5/index.tsx" ></code>
|
||||||
|
|
||||||
### 渐变文字
|
### 渐变文字
|
||||||
|
|
||||||
<code src="./demos/demo6/index.tsx" />
|
<code src="./demos/demo6/index.tsx" ></code>
|
||||||
|
@ -4,7 +4,7 @@ nav:
|
|||||||
path: /funny
|
path: /funny
|
||||||
group:
|
group:
|
||||||
title: 说明
|
title: 说明
|
||||||
order: 3
|
order: 4
|
||||||
path: /code
|
path: /code
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -1 +0,0 @@
|
|||||||
console.log(123)
|
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 120 KiB |
Before Width: | Height: | Size: 355 KiB After Width: | Height: | Size: 355 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB |
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 66 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 260 KiB After Width: | Height: | Size: 260 KiB |
Before Width: | Height: | Size: 193 KiB After Width: | Height: | Size: 193 KiB |
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 103 KiB |
Before Width: | Height: | Size: 711 KiB After Width: | Height: | Size: 711 KiB |
Before Width: | Height: | Size: 297 KiB After Width: | Height: | Size: 297 KiB |
Before Width: | Height: | Size: 297 KiB After Width: | Height: | Size: 297 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 148 KiB After Width: | Height: | Size: 148 KiB |
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 1.2 MiB |
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 238 KiB After Width: | Height: | Size: 238 KiB |
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 85 KiB |
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 94 KiB |
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 1.2 MiB |
Before Width: | Height: | Size: 1.6 MiB After Width: | Height: | Size: 1.6 MiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 9.9 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 1021 KiB After Width: | Height: | Size: 1021 KiB |
Before Width: | Height: | Size: 223 KiB After Width: | Height: | Size: 223 KiB |