fix webpack strange behaviour, with filthy fixes
This commit is contained in:
parent
f5fd91008c
commit
3fe8c01c26
7 changed files with 193 additions and 189 deletions
1
frontend/www/.gitignore
vendored
1
frontend/www/.gitignore
vendored
|
@ -1,2 +1,3 @@
|
|||
node_modules
|
||||
dist
|
||||
frontend
|
||||
|
|
13
frontend/www/bootstrap.js
vendored
13
frontend/www/bootstrap.js
vendored
|
@ -2,5 +2,18 @@
|
|||
// asynchronously. This `bootstrap.js` file does the single async import, so
|
||||
// that no one else needs to worry about it again.
|
||||
// Import index.js that executes index.ts
|
||||
var h = (a, b) => {}
|
||||
|
||||
export function handle(loc, e) {
|
||||
console.log("handle");
|
||||
h(loc, e);
|
||||
}
|
||||
|
||||
import ("./index.js")
|
||||
.then(e => {
|
||||
console.log(e.handle);
|
||||
h = e.handle;
|
||||
})
|
||||
.catch(e => console.error("Error importing `index.js`:", e));
|
||||
|
||||
window.setTimeout(() => handle("static/games/spiral2.json", "spiral2"), 3000);
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
import { set_game_name, set_instance } from './index.ts'
|
||||
import { } from './games.ts' // IMPORT GAMES PLEASE, thank you webpack <3
|
||||
export { handle }
|
||||
from './games.ts' // IMPORT GAMES PLEASE, thank you webpack <3
|
||||
|
||||
const URL = window.location.origin + window.location.pathname;
|
||||
const LOCATION = URL.substring(0, URL.lastIndexOf("/") + 1);
|
||||
|
|
|
@ -361,23 +361,23 @@ function step(time: number) {
|
|||
}
|
||||
set_loading(true);
|
||||
|
||||
// requestAnimationFrame(step);
|
||||
requestAnimationFrame(step);
|
||||
|
||||
|
||||
import { voronoi, Point } from './voronoi'
|
||||
function test() {
|
||||
const points = [
|
||||
new Point(14, 6),
|
||||
new Point(13, 11),
|
||||
new Point(8, 7.5),
|
||||
new Point(7, 4),
|
||||
new Point(4, 11),
|
||||
];
|
||||
// import { voronoi, Point } from './voronoi'
|
||||
// function test() {
|
||||
// const points = [
|
||||
// new Point(14, 6),
|
||||
// new Point(13, 11),
|
||||
// new Point(8, 7.5),
|
||||
// new Point(7, 4),
|
||||
// new Point(4, 11),
|
||||
// ];
|
||||
|
||||
console.log(voronoi(points));
|
||||
}
|
||||
// console.log(voronoi(points));
|
||||
// }
|
||||
|
||||
import { test as dcelt_test } from './dcel';
|
||||
// dcelt_test();
|
||||
// import { test as dcelt_test } from './dcel';
|
||||
// // dcelt_test();
|
||||
|
||||
test();
|
||||
// test();
|
||||
|
|
|
@ -7,20 +7,15 @@ body {
|
|||
background-color: #333;
|
||||
}
|
||||
|
||||
body, html {
|
||||
height: 99%;
|
||||
}
|
||||
|
||||
p {
|
||||
padding: 3px 0;
|
||||
}
|
||||
|
||||
#wrapper {
|
||||
max-height: 100vh;
|
||||
min-height: 100vh;
|
||||
|
||||
max-height: 100%;
|
||||
min-height: 100%;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#main {
|
||||
|
@ -106,13 +101,15 @@ p {
|
|||
height: 40px;
|
||||
}
|
||||
|
||||
.button:before, .button:after {
|
||||
.button:before,
|
||||
.button:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
background-color: grey;
|
||||
}
|
||||
|
||||
.button:hover:before, .button:hover:after {
|
||||
.button:hover:before,
|
||||
.button:hover:after {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
|
@ -132,6 +129,7 @@ p {
|
|||
margin-top: -3px;
|
||||
}
|
||||
|
||||
|
||||
/* ----------------------------------------------
|
||||
* Generated by Animista on 2019-9-17 14:35:13
|
||||
* Licensed under FreeBSD License.
|
||||
|
@ -139,11 +137,13 @@ p {
|
|||
* w: http://animista.net, t: @cssanimista
|
||||
* ---------------------------------------------- */
|
||||
|
||||
|
||||
/**
|
||||
* ----------------------------------------
|
||||
* animation slide-top
|
||||
* ----------------------------------------
|
||||
*/
|
||||
|
||||
@-webkit-keyframes slide-top {
|
||||
0% {
|
||||
-webkit-transform: translate(-50%, 50%);
|
||||
|
@ -154,6 +154,7 @@ p {
|
|||
transform: translate(-50%, -150%);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes slide-top {
|
||||
0% {
|
||||
-webkit-transform: translate(-50%, 50%);
|
||||
|
@ -171,9 +172,11 @@ p {
|
|||
* Copy from https://www.w3schools.com/howto/howto_js_rangeslider.asp
|
||||
* ----------------------------------------
|
||||
*/
|
||||
|
||||
.slidecontainer {
|
||||
margin-top: 10px;
|
||||
width: 100%; /* Width of the outside container */
|
||||
width: 100%;
|
||||
/* Width of the outside container */
|
||||
}
|
||||
|
||||
.slider {
|
||||
|
@ -206,34 +209,21 @@ p {
|
|||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
||||
::-webkit-scrollbar-track
|
||||
{
|
||||
::-webkit-scrollbar-track {
|
||||
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
|
||||
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
|
||||
border-radius: 10px;
|
||||
|
||||
background-color: #444;
|
||||
border-radius: 10px;
|
||||
|
||||
}
|
||||
|
||||
::-webkit-scrollbar
|
||||
{
|
||||
::-webkit-scrollbar {
|
||||
width: 10px;
|
||||
background-color: #444;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb
|
||||
{
|
||||
::-webkit-scrollbar-thumb {
|
||||
border-radius: 10px;
|
||||
background-color: #F90;
|
||||
background-image: -webkit-linear-gradient(45deg,
|
||||
rgba(255, 255, 255, .2) 25%,
|
||||
transparent 25%,
|
||||
transparent 50%,
|
||||
rgba(255, 255, 255, .2) 50%,
|
||||
rgba(255, 255, 255, .2) 75%,
|
||||
transparent 75%,
|
||||
transparent)
|
||||
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent)
|
||||
}
|
|
@ -331,7 +331,7 @@ class Breakpoint {
|
|||
|
||||
set_edge(edge: HalfEdge) {
|
||||
this.left[1].half_edge = edge;
|
||||
this.right[1].half_edge = edge.split(edge.origin);
|
||||
// this.right[1].half_edge = edge.split(edge.origin);
|
||||
}
|
||||
|
||||
set_me(old_me: Node, new_me: Node) {
|
||||
|
|
|
@ -5,20 +5,20 @@ module.exports = {
|
|||
mode: 'development',
|
||||
entry: './bootstrap.js',
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
rules: [{
|
||||
test: /\.tsx?$/,
|
||||
use: 'ts-loader',
|
||||
exclude: /node_modules/
|
||||
}
|
||||
]
|
||||
}]
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.tsx', '.ts', '.js', '.wasm']
|
||||
},
|
||||
output: {
|
||||
path: path.join(__dirname, 'dist'),
|
||||
filename: 'bootstrap.js'
|
||||
publicPath: "/frontend/",
|
||||
path: path.join(__dirname, 'frontend'),
|
||||
filename: 'bootstrap.js',
|
||||
library: 'visualizer'
|
||||
},
|
||||
plugins: [
|
||||
new CopyWebpackPlugin(['index.html'])
|
||||
|
|
Loading…
Reference in a new issue