add back dist

master
howard 2021-03-26 12:18:11 -07:00
parent 69ee6e881f
commit 7a86c8029a
17 changed files with 10153 additions and 24 deletions

1
.gitignore vendored
View File

@ -1,2 +1 @@
node_modules/
dist/

0
dist/.nojekyll vendored Normal file
View File

BIN
dist/favicon.ico vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
dist/icon-192.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

BIN
dist/icon-512.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

49
dist/index.html vendored Normal file
View File

@ -0,0 +1,49 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta property="og:title" content="CAD Tool" />
<meta property="og:description" content="Three.js CAD tool" />
<meta property="og:url" content="" />
<meta property="og:image" content="" />
<link rel="apple-touch-icon" href="icon-192.png" />
<link rel="manifest" href="manifest.json" />
<title>CAD Tool</title>
<style>
html,
body {
margin: 0;
height: 100%;
}
#c {
width: 100%;
height: 100%;
display: block;
}
#react {
position: absolute;
}
</style>
</head>
<body>
<div id="react"></div>
<canvas id="c"></canvas>
<script src="bundle.js" type="module"></script>
<script src="solver.js"></script>
<div id="stats"></div>
</body>
</html>

27
dist/manifest.json vendored Normal file
View File

@ -0,0 +1,27 @@
{
"short_name": "CAD Tool",
"name": "CAD Tool using Three.js",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "icon-192.png",
"type": "image/png",
"sizes": "192x192",
"purpose": "maskable any"
},
{
"src": "icon-512.png",
"type": "image/png",
"sizes": "512x512",
"purpose": "maskable any"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}

3
dist/robots.txt vendored Normal file
View File

@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:

2460
dist/solver.js vendored Normal file

File diff suppressed because it is too large Load Diff

BIN
dist/solver.wasm vendored Executable file

Binary file not shown.

7580
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"scripts": {
"start": "webpack --watch --config webpack.dev.js",
"start": "webpack serve --config webpack.dev.js",
"build": "webpack --config webpack.prod.js",
"get-bundle-size": "webpack --profile --json > stats.json --config webpack.prod.js && webpack-bundle-analyzer stats.json dist/",
"deploy": "gh-pages -d dist -t true"
@ -22,6 +22,7 @@
"webpack": "^5.26.3",
"webpack-bundle-analyzer": "^4.4.0",
"webpack-cli": "^4.5.0",
"webpack-dev-server": "^3.11.2",
"webpack-merge": "^5.7.3"
}
}

View File

@ -2,10 +2,18 @@
import React from 'react';
import { Provider } from 'react-redux';
import './app.scss'
export const App = ({ store }) => (
export const Root = ({ store }) => (
<Provider store={store}>
<div>hellodddddd</div>
<App></App>
</Provider>
);
const App = () => {
return <>
<div>in the world where</div>
</>
}

5
src/app.scss Normal file
View File

@ -0,0 +1,5 @@
div {
color: red;
position: absolute;
right:0;
}

View File

@ -10,10 +10,9 @@ import React from 'react';
import ReactDOM from 'react-dom';
import { createStore, applyMiddleware } from 'redux'
import { App } from './app.jsx'
import { Root } from './app.jsx'
function main(store) {
var stats = new Stats();
stats.showPanel(0); // 0: fps, 1: ms, 2: mb, 3+: custom
document.getElementById('stats').appendChild(stats.dom);
@ -22,6 +21,7 @@ function main(store) {
const renderer = new THREE.WebGLRenderer({ canvas });
const scene = new THREE.Scene();
window.scene = scene;
scene.background = new THREE.Color(0xb0b0b0);
const helpersGroup = new THREE.Group();
@ -112,15 +112,15 @@ console.log(store.getState())
// main(store);
main();
main(store);
// document.addEventListener('DOMContentLoaded', () => {
document.addEventListener('DOMContentLoaded', () => {
// const root = document.getElementById('react');
// ReactDOM.render(
// React.createElement(App, { store: store }, null)
// , root
// );
const root = document.getElementById('react');
ReactDOM.render(
React.createElement(Root, { store: store }, null)
, root
);
// });
});

View File

@ -25,7 +25,8 @@ var TrackballControls = function ( object, domElement ) {
this.rotateSpeed = 3.0;
this.zoomSpeed = 1.2;
this.panSpeed = 89.5;
// this.panSpeed = 89.5;
this.panSpeed = 70;
this.noRotate = false;
this.noZoom = false;

View File

@ -1,12 +1,16 @@
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
const path = require('path');
module.exports = merge(common, {
mode: 'development',
devtool: 'inline-source-map',
});
devServer: {
contentBase: path.join(__dirname, 'dist'),
compress: true,
port: 9000,
},
})