Skip to content

Commit

Permalink
初始
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaxiangfeng committed Oct 21, 2022
1 parent 1384f61 commit 3469bc9
Show file tree
Hide file tree
Showing 47 changed files with 5,658 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
4 changes: 4 additions & 0 deletions .fatherrc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
// more father 4 config: https://github.com/umijs/father-next/blob/master/docs/config.md
esm: {},
};
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/npm-debug.log*
/yarn-error.log
/yarn.lock
/package-lock.json

# production
/es
/docs-dist

# misc
.DS_Store
/coverage

# umi
.umi
.umi-production
.umi-test
.env.local

# ide
/.vscode
/.idea
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
**/*.svg
**/*.ejs
**/*.html
package.json
.umi
.umi-production
.umi-test
1 change: 1 addition & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@umijs/fabric').prettier;
76 changes: 76 additions & 0 deletions .umirc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import { defineConfig } from 'dumi';

export default defineConfig({
resolve: { includes: ['docs', 'src'] },
menus: {
'/guide': [
{
title: '指南',
children: [
{
title: '安装',
path: '/guide/installation',
},
],
},
{
title: '示例',
children: [
{
title: '自定义背景色',
path: '/guide/background',
},
{
title: '获取截图',
path: '/guide/snapshot',
},
{
title: '旋转模型',
path: '/guide/rotation',
},
{
title: 'GLTF格式',
path: '/guide/gltf',
},
{
title: 'Collada格式',
path: '/guide/collada',
},
{
title: 'FBX格式',
path: '/guide/fbx',
},
{
title: 'OBJ格式',
path: '/guide/obj',
},
{
title: 'PLY格式',
path: '/guide/ply',
},
{
title: 'STL格式',
path: '/guide/stl',
},
],
},
],
},
navs: [
{
title: '指南',
path: '/guide',
},
{
title: 'GitHub',
path: 'https://github.com/umijs/dumi',
},
],
publicPath: './',
history: { type: 'hash' },
title: 'react-3d-model',
favicon: './3d.png',
logo: './3d.png',
outputPath: 'docs-dist',
mode: 'site',
});
20 changes: 20 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
hero:
title: react-3d-model
desc: react-3d-model site example
actions:
- text: Getting Started
link: /guide
footer: Open-source MIT Licensed | Copyright © 2022<br />
---

```tsx
import React from 'react';
import Model from 'react-3d-model';

export default () => (
<div style={{ maxWidth: 800, width: '100%', height: 400, margin: 'auto' }}>
<Model.FBX src="./Samba%20Dancing.fbx" />
</div>
);
```
51 changes: 51 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"private": true,
"name": "react-3d-model",
"version": "1.0.0",
"scripts": {
"start": "dumi dev",
"docs:build": "dumi build",
"docs:deploy": "gh-pages -d docs-dist",
"build": "father build",
"deploy": "npm run docs:build && npm run docs:deploy",
"prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
"test": "umi-test",
"test:coverage": "umi-test --coverage",
"prepublishOnly": "npm run build"
},
"files": [
"dist"
],
"module": "dist/esm/index.js",
"typings": "dist/esm/index.d.ts",
"gitHooks": {
"pre-commit": "lint-staged"
},
"lint-staged": {
"*.{js,jsx,less,md,json}": [
"prettier --write"
],
"*.ts?(x)": [
"prettier --parser=typescript --write"
]
},
"dependencies": {
"react": "^16.8.6",
"react-dom": "^16.8.6",
"three": "^0.135.0"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.15.1",
"@testing-library/react": "^13.0.0",
"@types/jest": "^27.0.3",
"@types/three": "^0.144.0",
"@umijs/fabric": "^2.8.1",
"@umijs/test": "^3.0.5",
"dumi": "^1.1.0",
"father": "^4.0.0-rc.2",
"gh-pages": "^3.0.0",
"lint-staged": "^10.0.7",
"prettier": "^2.2.1",
"yorkie": "^2.0.0"
}
}
Binary file added public/3d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/Body_tex_003.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 3469bc9

Please sign in to comment.