Skip to content
This repository has been archived by the owner on Aug 27, 2020. It is now read-only.

Commit

Permalink
initial migration to smaller assets and removed older models
Browse files Browse the repository at this point in the history
  • Loading branch information
amilajack committed Mar 31, 2019
1 parent 5151826 commit 7ab46dd
Show file tree
Hide file tree
Showing 87 changed files with 8,097 additions and 313,930 deletions.
15 changes: 2 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ coverage
# node-waf configuration
.lock-wscript

build

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
.eslintcache
Expand All @@ -37,20 +39,7 @@ flow-typed/npm/*

# App packaged
release
app/main.prod.js
app/main.prod.js.map
app/renderer.prod.js
app/renderer.prod.js.map
app/style.css
app/style.css.map
dist
dll
main.js
main.js.map

.idea
npm-debug.log.*
.cache
src/*.map
src/*.js
src/*.ogg
26 changes: 21 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,22 @@
"main": "index.js",
"repository": "git@github.com:amilajack/xwing-rewrite.git",
"author": "Amila Welihinda <amilajack@gmail.com>",
"homepage": "https://amilajack.github.io/xwing-rewrite",
"license": "MIT",
"scripts": {
"build": "parcel build src/index.html --out-dir dist --public-url /xwing-rewrite && cp -r src/models dist",
"deploy": "rm -rf build && yarn build && gh-pages -d dist",
"start": "parcel src/index.html --out-dir src --open"
"build": "react-scripts build",
"deploy": "rm -rf build && yarn build && gh-pages -d build",
"eject": "react-scripts eject",
"start": "react-scripts start",
"test": "react-scripts test"
},
"dependencies": {
"@tweenjs/tween.js": "^17.3.0",
"pubsub-js": "^1.7.0",
"raf-loop": "^1.1.3",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-scripts": "2.1.8",
"three": "^0.103.0",
"three-dragcontrols": "^0.88.2",
"three-fly-controls": "^1.1.0",
Expand All @@ -27,15 +33,25 @@
"@types/react-dom": "^16.8.3",
"@types/stats.js": "^0.17.0",
"@types/three": "^0.93.30",
"eslint": "^5.16.0",
"eslint-config-bliss": "^3.3.0",
"gh-pages": "^2.0.1",
"parcel": "^1.12.3",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"stats.js": "^0.17.0",
"typescript": "^3.4.1"
},
"eslintConfig": {
"globals": {
"DocumentTouch": true
},
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"renovate": {
"extends": [
"bliss"
Expand Down
Binary file added public/favicon.ico
Binary file not shown.
41 changes: 41 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<meta name="theme-color" content="#000000" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>xwing</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
15 changes: 15 additions & 0 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
28 changes: 28 additions & 0 deletions public/models/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import * as THREE from 'three/build/three.module.js';
import PubSub from 'pubsub-js';

// Instantiate a loader
const loader = new THREE.GLTFLoader();

// Load a glTF resource
loader.load(
// resource URL
'/models/xwing/scene.gltf',
// called when the resource is loaded
function (gltf) {
PubSub.publish('models.xwing.loaded', {
gltf
});
},
// called while loading is progressing
function ( xhr ) {
console.log( ( xhr.loaded / xhr.total * 100 ) + '% loaded' );
PubSub.publish('models.xwing.loading', {
xhr
});
},
// called when loading has errors
function ( error ) {
console.log( 'An error happened' );
}
);
60 changes: 60 additions & 0 deletions public/models/trench.js

Large diffs are not rendered by default.

Binary file added public/models/xwing/scene.bin
Binary file not shown.
Loading

0 comments on commit 7ab46dd

Please sign in to comment.