add back dist
parent
69ee6e881f
commit
7a86c8029a
|
@ -1,2 +1 @@
|
|||
node_modules/
|
||||
dist/
|
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
Binary file not shown.
After Width: | Height: | Size: 9.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
|
@ -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>
|
|
@ -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"
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
# https://www.robotstxt.org/robotstxt.html
|
||||
User-agent: *
|
||||
Disallow:
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
14
src/app.jsx
14
src/app.jsx
|
@ -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>
|
||||
</>
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
div {
|
||||
color: red;
|
||||
position: absolute;
|
||||
right:0;
|
||||
}
|
20
src/index.js
20
src/index.js
|
@ -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
|
||||
);
|
||||
|
||||
// });
|
||||
});
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
})
|
Loading…
Reference in New Issue