-
-
-
-
-
-
-
-
-
-
-
- BlueMap
-
-
-
-
-
-
diff --git a/BlueMapCore/src/main/webroot/js/libs/BlueMap.js b/BlueMapCore/src/main/webroot/js/libs/BlueMap.js
deleted file mode 100644
index 3060686e..00000000
--- a/BlueMapCore/src/main/webroot/js/libs/BlueMap.js
+++ /dev/null
@@ -1,613 +0,0 @@
-/*
- * This file is part of BlueMap, licensed under the MIT License (MIT).
- *
- * Copyright (c) Blue (Lukas Rieger)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-import $ from 'jquery';
-import {
- BackSide,
- BufferGeometryLoader,
- ClampToEdgeWrapping,
- SphereGeometry,
- FileLoader,
- FrontSide,
- Mesh,
- NearestFilter,
- NearestMipMapLinearFilter,
- PerspectiveCamera,
- Scene,
- ShaderMaterial,
- Texture,
- VertexColors,
- WebGLRenderer,
- Vector3,
-} from 'three';
-
-import { CSS2DRenderer } from './hud/CSS2DRenderer';
-
-import UI from './ui/UI.js';
-
-import Controls from './Controls.js';
-import TileManager from './TileManager.js';
-
-import HIRES_VERTEX_SHADER from './shaders/HiresVertexShader.js';
-import HIRES_FRAGMENT_SHADER from './shaders/HiresFragmentShader.js';
-import LOWRES_VERTEX_SHADER from './shaders/LowresVertexShader.js';
-import LOWRES_FRAGMENT_SHADER from './shaders/LowresFragmentShader.js';
-import SKY_VERTEX_SHADER from './shaders/SkyVertexShader.js';
-import SKY_FRAGMENT_SHADER from './shaders/SkyFragmentShader.js';
-
-import { stringToImage, pathFromCoords } from './utils.js';
-import {cachePreventionNr, getCookie, setCookie} from "./utils";
-
-export default class BlueMap {
- constructor(element, dataRoot = "data/", liveApiRoot = "live/") {
- this.element = $('').appendTo(element)[0];
- this.dataRoot = dataRoot;
- this.liveApiRoot = liveApiRoot;
- this.locationHash = '';
- this.cacheSuffix = '';
-
- this.hiresViewDistance = 160;
- this.lowresViewDistance = 3200;
- this.targetSunLightStrength = 1;
- this.sunLightStrength = {
- value: this.targetSunLightStrength
- };
- this.mobSpawnOverlay = {
- value: false
- };
- this.ambientLight = {
- value: 0
- };
- this.skyColor = {
- value: new Vector3(0, 0, 0)
- };
- this.debugInfo = this.loadUserSetting("debugInfo", true);
-
- this.fileLoader = new FileLoader();
- this.blobLoader = new FileLoader();
- this.blobLoader.setResponseType('blob');
- this.bufferGeometryLoader = new BufferGeometryLoader();
-
- this.ui = new UI(this);
-
- this.loadingNoticeElement = $('
`);
- this.iconElement.find("img").click(this.onClick);
- $(window).on('mousedown touchstart', this.onUserInput);
-
- this.renderObject = new CSS2DObject(this.iconElement[0]);
- this.renderObject.position.copy(this.position);
- this.renderObject.onBeforeRender = (renderer, scene, camera) => {
- let distanceSquared = this.position.distanceToSquared(camera.position);
- if (distanceSquared > 1000000) {
- this.iconElement.addClass("distant");
- } else {
- this.iconElement.removeClass("distant");
- }
-
- this.updateRenderObject(this.renderObject, scene, camera);
- };
- }
-
- if (this.visible) {
- this.blueMap.hudScene.add(this.renderObject);
- } else {
- this.blueMap.hudScene.remove(this.renderObject);
-
- if (this.follow) {
- this.stopFollow();
- }
- }
- }
-
- updatePosition = () => {
- if (this.renderObject && (!this.renderObject.position.equals(this.position) || this.worldChanged)) {
- if (this.visible) {
- if (!this.animationRunning) {
- this.animationRunning = true;
- requestAnimationFrame(this.moveAnimation);
- }
- } else {
- this.renderObject.position.copy(this.position);
- }
-
- // try to find a map to follow player if he changes worlds
- if (this.follow && this.worldChanged){
- let found = false;
- for (let id of this.blueMap.maps) {
- let mapSettings = this.blueMap.settings.maps[id];
- if (mapSettings.world === this.world) {
- this.blueMap.changeMap(id);
- found = true;
- break;
- }
- }
- if (!found){
- this.stopFollow();
- }
- }
-
- // still following? then update position
- if (this.follow) {
- this.blueMap.controls.targetPosition.copy(this.position);
- }
- }
- };
-
- moveAnimation = (time) => {
- let delta = time - this.lastFrame;
- if (this.lastFrame === -1){
- delta = 20;
- }
- this.lastFrame = time;
-
- if (this.renderObject && !this.renderObject.position.equals(this.position)) {
- this.renderObject.position.x += (this.position.x - this.renderObject.position.x) * 0.01 * delta;
- this.renderObject.position.y += (this.position.y - this.renderObject.position.y) * 0.01 * delta;
- this.renderObject.position.z += (this.position.z - this.renderObject.position.z) * 0.01 * delta;
-
- if (this.renderObject.position.distanceToSquared(this.position) < 0.001) {
- this.renderObject.position.copy(this.position);
- }
-
- this.blueMap.updateFrame = true;
-
- requestAnimationFrame(this.moveAnimation);
- } else {
- this.animationRunning = false;
- this.lastFrame = -1;
- }
- };
-
- onClick = () => {
- this.startFollow();
- };
-
- onUserInput = e => {
- if ((e.type !== "mousedown" || e.button === 0) && this.follow) {
- this.stopFollow();
- }
- };
-
- startFollow() {
- this.follow = true;
- this.iconElement.addClass("following");
-
- this.blueMap.controls.targetPosition.copy(this.position);
- }
-
- stopFollow() {
- this.follow = false;
- this.iconElement.removeClass("following");
- this.blueMap.controls.targetPosition.y = 0;
- }
-
-}
\ No newline at end of file
diff --git a/BlueMapCore/src/main/webroot/js/libs/hud/PlayerMarkerSet.js b/BlueMapCore/src/main/webroot/js/libs/hud/PlayerMarkerSet.js
deleted file mode 100644
index 43fcedb7..00000000
--- a/BlueMapCore/src/main/webroot/js/libs/hud/PlayerMarkerSet.js
+++ /dev/null
@@ -1,93 +0,0 @@
-import POIMarker from "./POIMarker";
-import ShapeMarker from "./ShapeMarker";
-import {cachePreventionNr} from "../utils";
-import PlayerMarker from "./PlayerMarker";
-import {Vector3} from "three";
-
-export default class PlayerMarkerSet {
-
- constructor(blueMap) {
- this.blueMap = blueMap;
- this.id = "bluemap-live-players";
- this.label = "players";
- this.toggleable = true;
- this.defaultHide = false;
- this.marker = [];
- this.markerMap = {};
-
- this.visible = true;
- }
-
- update() {
- this.marker.forEach(marker => {
- marker.setVisible(this.visible);
- });
- }
-
- async updateLive(){
- await new Promise((resolve, reject) => {
- this.blueMap.fileLoader.load(this.blueMap.liveApiRoot + 'players?' + cachePreventionNr(),
- liveData => {
- try {
- liveData = JSON.parse(liveData);
- resolve(liveData);
- } catch (e){
- reject(e);
- }
- },
- xhr => {},
- error => {
- reject(error);
- }
- );
- }).then((liveData) => {
- this.updateWith(liveData)
- }).catch(() => {
- this.marker.forEach(marker => {
- marker.online = false;
- marker.setVisible(false);
- });
- });
- }
-
- updateWith(liveData){
- this.marker.forEach(marker => {
- marker.nowOnline = false;
- marker.worldChanged = false;
- });
-
- for(let i = 0; i < liveData.players.length; i++){
- let player = liveData.players[i];
- let marker = this.markerMap[player.uuid];
-
- if (!marker){
- marker = new PlayerMarker(this.blueMap, this, {
- type: "playermarker",
- map: null,
- position: player.position,
- label: player.name,
- link: null,
- newTab: false
- }, player.uuid, player.world);
-
- this.markerMap[player.uuid] = marker;
- this.marker.push(marker);
- }
-
- marker.nowOnline = true;
- marker.position = new Vector3(player.position.x, player.position.y + 1.5, player.position.z);
- if (marker.world !== player.world) {
- marker.world = player.world;
- marker.worldChanged = true;
- }
- marker.updatePosition();
- }
-
- this.marker.forEach(marker => {
- if (marker.nowOnline !== marker.online || marker.worldChanged){
- marker.online = marker.nowOnline;
- marker.setVisible(this.visible);
- }
- });
- }
-}
\ No newline at end of file
diff --git a/BlueMapCore/src/main/webroot/js/libs/hud/ShapeMarker.js b/BlueMapCore/src/main/webroot/js/libs/hud/ShapeMarker.js
deleted file mode 100644
index 4d3c6eb1..00000000
--- a/BlueMapCore/src/main/webroot/js/libs/hud/ShapeMarker.js
+++ /dev/null
@@ -1,112 +0,0 @@
-import {
- Vector2,
- Shape,
- MeshBasicMaterial,
- Mesh,
- Line,
- LineBasicMaterial,
- BufferGeometry,
- ShapeBufferGeometry,
- DoubleSide
-} from 'three';
-import Marker from "./Marker";
-import $ from "jquery";
-
-export default class ShapeMarker extends Marker {
-
- constructor(blueMap, markerSet, markerData) {
- super(blueMap, markerSet, markerData);
-
- let points = [];
- if (Array.isArray(markerData.shape)) {
- markerData.shape.forEach(point => {
- points.push(new Vector2(point.x, point.z));
- });
- }
- this.height = markerData.height ? markerData.height : 128;
-
- this.fillColor = this.prepareColor(markerData.fillColor);
- this.borderColor = this.prepareColor(markerData.borderColor);
- this.depthTest = !!markerData.depthTest;
-
- //fill
- let shape = new Shape(points);
- let fillGeo = new ShapeBufferGeometry(shape, 1);
- fillGeo.rotateX(Math.PI * 0.5);
- fillGeo.translate(0, this.height + 0.01456, 0);
- let fillMaterial = new MeshBasicMaterial({
- color: this.fillColor.rgb,
- opacity: this.fillColor.a,
- transparent: true,
- side: DoubleSide,
- depthTest: this.depthTest,
- });
- let fill = new Mesh( fillGeo, fillMaterial );
-
- //border
- points.push(points[0]);
- let lineGeo = new BufferGeometry().setFromPoints(points);
- lineGeo.rotateX(Math.PI * 0.5);
- lineGeo.translate(0, this.height + 0.01456, 0);
- let lineMaterial = new LineBasicMaterial({
- color: this.borderColor.rgb,
- opacity: this.borderColor.a,
- transparent: true,
- depthTest: false,
- });
- let line = new Line( lineGeo, lineMaterial );
-
- if (this.fillColor.a > 0 || this.borderColor.a <= 0) {
- this.renderObject = fill;
- fill.add(line);
- } else {
- this.renderObject = line;
- }
-
- this.renderObject.userData = {
- marker: this,
- };
-
- }
-
- setVisible(visible){
- super.setVisible(visible);
-
- if (this.visible) {
- this.blueMap.shapeScene.add(this.renderObject);
- $(document).on('bluemap-update-frame', this.onRender);
- } else {
- this.blueMap.shapeScene.remove(this.renderObject);
- $(document).off('bluemap-update-frame', this.onRender);
- }
- }
-
- onRender = () => {
- this.updateRenderObject(this.renderObject, this.blueMap.shapeScene, this.blueMap.camera);
- };
-
- onClick = (clickPos) => {
- if (this.label) {
- this.blueMap.ui.hudInfo.showInfoBubble(this.label, clickPos.x, clickPos.y, clickPos.z);
- }
-
- if (this.link){
- if (this.newTab){
- window.open(this.link, '_blank');
- } else {
- location.href = this.link;
- }
- }
- };
-
- prepareColor(color){
- if (color.r === undefined) color.r = 0;
- if (color.g === undefined) color.g = 0;
- if (color.b === undefined) color.b = 0;
- if (color.a === undefined) color.a = 1;
-
- color.rgb = (color.r << 16) + (color.g << 8) + (color.b);
- return color;
- }
-
-}
\ No newline at end of file
diff --git a/BlueMapCore/src/main/webroot/js/libs/shaders/HiresFragmentShader.js b/BlueMapCore/src/main/webroot/js/libs/shaders/HiresFragmentShader.js
deleted file mode 100644
index 602f48e8..00000000
--- a/BlueMapCore/src/main/webroot/js/libs/shaders/HiresFragmentShader.js
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * This file is part of BlueMap, licensed under the MIT License (MIT).
- *
- * Copyright (c) Blue (Lukas Rieger)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the 'Software'), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-import { ShaderChunk } from 'three';
-
-const HIRES_FRAGMENT_SHADER = `
-${ShaderChunk.logdepthbuf_pars_fragment}
-
-uniform sampler2D texture;
-uniform float sunlightStrength;
-uniform float ambientLight;
-uniform bool mobSpawnOverlay;
-
-varying vec3 vPosition;
-varying vec3 vWorldPosition;
-varying vec3 vNormal;
-varying vec2 vUv;
-varying vec3 vColor;
-varying float vAo;
-varying float vSunlight;
-varying float vBlocklight;
-
-vec4 lerp(vec4 v1, vec4 v2, float amount){
- return v1 * (1.0 - amount) + v2 * amount;
-}
-vec3 lerp(vec3 v1, vec3 v2, float amount){
- return v1 * (1.0 - amount) + v2 * amount;
-}
-
-bool mobSpawnColor() {
- if (vBlocklight < 7.1 && vNormal.y > 0.8){
- float cross1 = vUv.x - vUv.y;
- float cross2 = vUv.x - (1.0 - vUv.y);
- return cross1 < 0.05 && cross1 > -0.05 || cross2 < 0.05 && cross2 > -0.05;
- }
-
- return false;
-}
-
-void main() {
- vec4 color = texture2D(texture, vUv);
- if (color.a == 0.0) discard;
-
- //apply vertex-color
- color.rgb *= vColor;
-
- //mob spawn overlay
- if (mobSpawnOverlay && mobSpawnColor()){
- color.rgb = lerp(vec3(1.0, 0.0, 0.0), color.rgb, 0.25);
- }
-
- //apply ao
- color.rgb *= vAo;
-
- //apply light
- float light = max(vSunlight * sunlightStrength, vBlocklight);
- color.rgb *= max(light / 15.0, ambientLight);
-
- gl_FragColor = color;
-
- ${ShaderChunk.logdepthbuf_fragment}
-}
-`;
-
-export default HIRES_FRAGMENT_SHADER;
\ No newline at end of file
diff --git a/BlueMapCore/src/main/webroot/js/libs/shaders/HiresVertexShader.js b/BlueMapCore/src/main/webroot/js/libs/shaders/HiresVertexShader.js
deleted file mode 100644
index e0f1cfe1..00000000
--- a/BlueMapCore/src/main/webroot/js/libs/shaders/HiresVertexShader.js
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * This file is part of BlueMap, licensed under the MIT License (MIT).
- *
- * Copyright (c) Blue (Lukas Rieger)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the 'Software'), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-import { ShaderChunk } from 'three';
-
-const HIRES_VERTEX_SHADER = `
-#define EPSILON 1e-6
-${ShaderChunk.logdepthbuf_pars_vertex}
-
-attribute float ao;
-attribute float sunlight;
-attribute float blocklight;
-
-varying vec3 vPosition;
-varying vec3 vWorldPosition;
-varying vec3 vNormal;
-varying vec2 vUv;
-varying vec3 vColor;
-varying float vAo;
-varying float vSunlight;
-varying float vBlocklight;
-
-void main() {
- vPosition = position;
- vWorldPosition = (vec4(position, 1) * modelMatrix).xyz;
- vNormal = normal;
- vUv = uv;
- vColor = color;
- vAo = ao;
- vSunlight = sunlight;
- vBlocklight = blocklight;
-
- gl_Position =
- projectionMatrix *
- viewMatrix *
- modelMatrix *
- vec4(position, 1);
-
- ${ShaderChunk.logdepthbuf_vertex}
-}
-`;
-
-export default HIRES_VERTEX_SHADER;
\ No newline at end of file
diff --git a/BlueMapCore/src/main/webroot/js/libs/shaders/LowresFragmentShader.js b/BlueMapCore/src/main/webroot/js/libs/shaders/LowresFragmentShader.js
deleted file mode 100644
index d8615c13..00000000
--- a/BlueMapCore/src/main/webroot/js/libs/shaders/LowresFragmentShader.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * This file is part of BlueMap, licensed under the MIT License (MIT).
- *
- * Copyright (c) Blue (Lukas Rieger)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the 'Software'), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-import { ShaderChunk } from 'three';
-
-const LOWRES_FRAGMENT_SHADER = `
-${ShaderChunk.logdepthbuf_pars_fragment}
-
-uniform float sunlightStrength;
-uniform float ambientLight;
-
-varying vec3 vPosition;
-varying vec3 vNormal;
-varying vec2 vUv;
-varying vec3 vColor;
-
-void main() {
- vec4 color = vec4(vColor, 1.0);
-
- float diff = sqrt(max(dot(vNormal, vec3(0.3637, 0.7274, 0.5819)), 0.0)) * 0.4 + 0.6;
- color *= diff;
-
- color *= max(sunlightStrength, ambientLight);
-
- gl_FragColor = color;
-
- ${ShaderChunk.logdepthbuf_fragment}
-}
-`;
-
-export default LOWRES_FRAGMENT_SHADER;
\ No newline at end of file
diff --git a/BlueMapCore/src/main/webroot/js/libs/shaders/LowresVertexShader.js b/BlueMapCore/src/main/webroot/js/libs/shaders/LowresVertexShader.js
deleted file mode 100644
index 8cd668f5..00000000
--- a/BlueMapCore/src/main/webroot/js/libs/shaders/LowresVertexShader.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * This file is part of BlueMap, licensed under the MIT License (MIT).
- *
- * Copyright (c) Blue (Lukas Rieger)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the 'Software'), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-import { ShaderChunk } from 'three';
-
-const LOWRES_VERTEX_SHADER = `
-#define EPSILON 1e-6
-${ShaderChunk.logdepthbuf_pars_vertex}
-
-varying vec3 vPosition;
-varying vec3 vNormal;
-varying vec2 vUv;
-varying vec3 vColor;
-
-void main() {
- vPosition = position;
- vNormal = normal;
- vUv = uv;
- vColor = color;
-
- gl_Position =
- projectionMatrix *
- modelViewMatrix *
- vec4(position, 1);
-
- ${ShaderChunk.logdepthbuf_vertex}
-}
-`;
-
-export default LOWRES_VERTEX_SHADER;
\ No newline at end of file
diff --git a/BlueMapCore/src/main/webroot/js/libs/shaders/SkyFragmentShader.js b/BlueMapCore/src/main/webroot/js/libs/shaders/SkyFragmentShader.js
deleted file mode 100644
index 2ec45e5f..00000000
--- a/BlueMapCore/src/main/webroot/js/libs/shaders/SkyFragmentShader.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * This file is part of BlueMap, licensed under the MIT License (MIT).
- *
- * Copyright (c) Blue (Lukas Rieger)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the 'Software'), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-const SKY_FRAGMENT_SHADER = `
-uniform float sunlightStrength;
-uniform float ambientLight;
-uniform vec3 skyColor;
-
-varying vec3 vPosition;
-
-void main() {
- vec4 color = vec4(skyColor * max(sunlightStrength, ambientLight), 1.0);
- color.rgb *= (clamp(vPosition.y, -0.02, 0.02) + 0.02) * 25.0;
-
- gl_FragColor = color;
-}
-`;
-
-export default SKY_FRAGMENT_SHADER;
\ No newline at end of file
diff --git a/BlueMapCore/src/main/webroot/js/libs/shaders/SkyVertexShader.js b/BlueMapCore/src/main/webroot/js/libs/shaders/SkyVertexShader.js
deleted file mode 100644
index f6a279ea..00000000
--- a/BlueMapCore/src/main/webroot/js/libs/shaders/SkyVertexShader.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * This file is part of BlueMap, licensed under the MIT License (MIT).
- *
- * Copyright (c) Blue (Lukas Rieger)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the 'Software'), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-const SKY_VERTEX_SHADER = `
-varying vec3 vPosition;
-
-void main() {
- vPosition = position;
-
- gl_Position =
- projectionMatrix *
- modelViewMatrix *
- vec4(position, 1);
-}
-`;
-
-export default SKY_VERTEX_SHADER;
\ No newline at end of file
diff --git a/BlueMapCore/src/main/webroot/js/libs/ui/Button.js b/BlueMapCore/src/main/webroot/js/libs/ui/Button.js
deleted file mode 100644
index 4aa51e6a..00000000
--- a/BlueMapCore/src/main/webroot/js/libs/ui/Button.js
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * This file is part of BlueMap, licensed under the MIT License (MIT).
- *
- * Copyright (c) Blue (Lukas Rieger)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-import $ from 'jquery';
-
-import Element from './Element.js';
-
-export default class Button extends Element {
-
- constructor(label, onClick, icon){
- super();
-
- this.label = label;
- this.onClickListener = onClick;
- this.icon = icon;
- }
-
- createElement() {
- let element = super.createElement();
-
- element.addClass("button");
- element.click(this.onClickEvent);
-
- if (this.label !== undefined) {
- $(`
${this.label}
`).appendTo(element);
- }
-
- if (this.icon !== undefined){
- element.addClass("icon");
- $(``).appendTo(element);
- }
-
- return element;
- }
-
- onClickEvent = () => {
- if (this.onClickListener !== undefined && this.onClickListener !== null) {
- this.onClickListener(this);
- }
- }
-
-}
\ No newline at end of file
diff --git a/BlueMapCore/src/main/webroot/js/libs/ui/Compass.js b/BlueMapCore/src/main/webroot/js/libs/ui/Compass.js
deleted file mode 100644
index 998e0c67..00000000
--- a/BlueMapCore/src/main/webroot/js/libs/ui/Compass.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * This file is part of BlueMap, licensed under the MIT License (MIT).
- *
- * Copyright (c) Blue (Lukas Rieger)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-import $ from 'jquery';
-
-import Button from './Button.js';
-
-import COMPASS from '../../../assets/compass.svg';
-
-export default class Compass extends Button {
- constructor(blueMap) {
- super(undefined, undefined, COMPASS);
- this.blueMap = blueMap;
-
- $(document).on('bluemap-update-frame', this.onBlueMapUpdateFrame);
- }
-
- createElement(){
- let element = super.createElement();
- element.click(this.onClick);
- return element;
- }
-
- onBlueMapUpdateFrame = () => {
- this.elements.forEach(element => {
- element.find("img").css('transform', `rotate(${this.blueMap.controls.direction}rad)`);
- });
- };
-
- onClick = () => {
- this.blueMap.controls.targetDirection = 0;
- this.blueMap.controls.direction = this.blueMap.controls.direction % (Math.PI * 2);
- if (this.blueMap.controls.direction < -Math.PI) this.blueMap.controls.direction += Math.PI * 2;
- if (this.blueMap.controls.direction > Math.PI) this.blueMap.controls.direction -= Math.PI * 2;
- };
-}
diff --git a/BlueMapCore/src/main/webroot/js/libs/ui/Dropdown.js b/BlueMapCore/src/main/webroot/js/libs/ui/Dropdown.js
deleted file mode 100644
index 5e324bef..00000000
--- a/BlueMapCore/src/main/webroot/js/libs/ui/Dropdown.js
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * This file is part of BlueMap, licensed under the MIT License (MIT).
- *
- * Copyright (c) Blue (Lukas Rieger)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-import $ from 'jquery';
-
-import Element from './Element.js';
-
-export default class Dropdown extends Element {
-
- constructor(onChange, minWidth) {
- super();
- this.minWidth = minWidth;
- this.value = null;
- this.options = [];
- this.onChange = onChange;
-
- $(window).on('click', this.closeAll);
- }
-
- addOption(value, label, select) {
- this.options.push({
- value: value,
- label: label,
- select: select
- });
-
- if (this.value === null || select){
- this.select(value);
- }
- }
-
- createElement(){
- let element = super.createElement();
-
- element.addClass("dropdown");
- let headerElement = $('').appendTo(element);
- let selectElement = $('').appendTo(element);
-
- headerElement.click(this.toggleEvent(element));
-
- if (this.minWidth !== undefined){
- this.element.addClass("sized");
- this.element.css("min-width", this.minWidth);
- }
-
- this.options.forEach(option => {
- let optionElement = $(`
${option.label}
`).appendTo(selectElement);
- optionElement.on('click', this.selectButtonEvent(option.value, optionElement));
-
- if (this.value === option.value){
- optionElement.addClass('selected');
- headerElement.html('');
- headerElement.append(optionElement.clone().off());
- }
- });
-
- return element;
- }
-
- toggleEvent = element => event => {
- let select = element.find(".select");
- let open = select.css("display") !== "none";
-
- this.closeAll();
-
- if (!open) {
- select.stop(true).slideDown(200);
- element.addClass("open");
- event.stopPropagation();
- }
- };
-
- closeAll = () => {
- this.elements.forEach(element => {
- element.removeClass("open");
- element.find(".select:not(:hidden)").stop(true).slideUp(200);
- });
- };
-
- select = value => {
- this.value = value;
-
- this.elements.forEach(element => {
- let selectElement = element.find(".select");
- selectElement.find('.selected').removeClass('selected');
-
- let option = selectElement.find(`.option[data-value='${value}']`);
- option.addClass('selected');
-
- let headerElement = element.find(".header");
- headerElement.html('');
- headerElement.append(option.clone().off());
- });
- };
-
- selectButtonEvent = (value, option) => event => {
- this.select(value);
-
- //close
- this.closeAll();
-
- if (event !== undefined) event.stopPropagation();
-
- if (this.onChange !== undefined && this.onChange !== null){
- this.onChange(this.value, this);
- }
- };
-
-}
\ No newline at end of file
diff --git a/BlueMapCore/src/main/webroot/js/libs/ui/Element.js b/BlueMapCore/src/main/webroot/js/libs/ui/Element.js
deleted file mode 100644
index 3bab6f46..00000000
--- a/BlueMapCore/src/main/webroot/js/libs/ui/Element.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * This file is part of BlueMap, licensed under the MIT License (MIT).
- *
- * Copyright (c) Blue (Lukas Rieger)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-import $ from 'jquery';
-
-export default class Element {
-
- constructor() {
- this.elements = [];
- }
-
- createElement() {
- let newElement = $('');
- this.elements.push(newElement);
- return newElement;
- }
-
-}
\ No newline at end of file
diff --git a/BlueMapCore/src/main/webroot/js/libs/ui/Label.js b/BlueMapCore/src/main/webroot/js/libs/ui/Label.js
deleted file mode 100644
index 33dcd9b2..00000000
--- a/BlueMapCore/src/main/webroot/js/libs/ui/Label.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * This file is part of BlueMap, licensed under the MIT License (MIT).
- *
- * Copyright (c) Blue (Lukas Rieger)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-import Element from './Element.js';
-
-export default class Label extends Element {
-
- constructor(label){
- super();
- this.label = label;
- }
-
- createElement() {
- let element = super.createElement();
- element.addClass("label");
- element.html(this.label);
- return element;
- }
-
-}
\ No newline at end of file
diff --git a/BlueMapCore/src/main/webroot/js/libs/ui/MapSeletion.js b/BlueMapCore/src/main/webroot/js/libs/ui/MapSeletion.js
deleted file mode 100644
index 90d25bf0..00000000
--- a/BlueMapCore/src/main/webroot/js/libs/ui/MapSeletion.js
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * This file is part of BlueMap, licensed under the MIT License (MIT).
- *
- * Copyright (c) Blue (Lukas Rieger)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-import $ from 'jquery';
-
-import Dropdown from "./Dropdown";
-
-export default class MapSelection extends Dropdown {
- constructor(bluemap) {
- super(undefined);
- super.onChange = this.onChangeMap;
-
- this.bluemap = bluemap;
-
- //add maps
- const maps = this.bluemap.settings.maps;
- for (let mapId of this.bluemap.maps) {
- const map = maps[mapId];
- if (!map.enabled) continue;
-
- this.addOption(mapId, map.name);
- }
-
- $(document).on('bluemap-map-change', this.onBlueMapMapChange);
- }
-
- createElement() {
- let element = super.createElement();
- element.addClass("map-selection");
- return element;
- }
-
- onChangeMap = value => {
- this.bluemap.changeMap(value);
- };
-
- onBlueMapMapChange = () => {
- this.select(this.bluemap.map);
- };
-}
diff --git a/BlueMapCore/src/main/webroot/js/libs/ui/Menu.js b/BlueMapCore/src/main/webroot/js/libs/ui/Menu.js
deleted file mode 100644
index c587babf..00000000
--- a/BlueMapCore/src/main/webroot/js/libs/ui/Menu.js
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * This file is part of BlueMap, licensed under the MIT License (MIT).
- *
- * Copyright (c) Blue (Lukas Rieger)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-import $ from 'jquery';
-
-import Element from './Element.js';
-import Separator from "./Separator";
-
-export default class Menu {
-
- constructor(){
- this.element = $('
Menu
');
- this.content = $('').appendTo(this.element);
- this.closeButton = $('').appendTo(this.element);
-
- this.children = [];
-
- this.closeButton.click(this.close);
- }
-
- addElement(element){
- this.children.push(element);
- }
-
- update() {
- this.content.html("");
- this.children.forEach(child => {
- this.content.append(child.createElement());
- });
-
- $(``).appendTo(this.content);
-
- $(`
-
- `).appendTo(this.content);
- }
-
- isOpen = () => {
- return !this.element.hasClass('closed');
- };
-
- toggleOpen = () => {
- this.element.toggleClass('closed');
- };
-
- open = () => {
-
- this.element.removeClass('closed');
- this.element.trigger('menu-open');
- };
-
- close = () => {
- this.element.addClass('closed');
- this.element.trigger('menu-close');
- };
-
-}
\ No newline at end of file
diff --git a/BlueMapCore/src/main/webroot/js/libs/ui/MenuButton.js b/BlueMapCore/src/main/webroot/js/libs/ui/MenuButton.js
deleted file mode 100644
index 2c578554..00000000
--- a/BlueMapCore/src/main/webroot/js/libs/ui/MenuButton.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * This file is part of BlueMap, licensed under the MIT License (MIT).
- *
- * Copyright (c) Blue (Lukas Rieger)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-import $ from 'jquery';
-
-import ToggleButton from './ToggleButton.js';
-
-import BURGER from '../../../assets/burger.svg';
-
-export default class MenuButton extends ToggleButton {
- constructor(menu) {
- super(undefined, false, undefined, BURGER);
- this.menu = menu;
-
- this.menu.element.on('menu-close menu-open', this.updateMenuState);
- }
-
- createElement(){
- let element = super.createElement();
- element.click(this.onMenuClick);
- return element;
- }
-
- updateMenuState = () => {
- this.selected = this.menu.isOpen();
- this.update();
- };
-
- onMenuClick = () => {
- if (this.selected){
- this.menu.open();
- } else {
- this.menu.close();
- }
- };
-}
diff --git a/BlueMapCore/src/main/webroot/js/libs/ui/Position.js b/BlueMapCore/src/main/webroot/js/libs/ui/Position.js
deleted file mode 100644
index 43a2c353..00000000
--- a/BlueMapCore/src/main/webroot/js/libs/ui/Position.js
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * This file is part of BlueMap, licensed under the MIT License (MIT).
- *
- * Copyright (c) Blue (Lukas Rieger)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-import $ from 'jquery';
-
-import Element from "./Element";
-
-export default class Position extends Element {
- constructor(blueMap, axis) {
- super();
- this.blueMap = blueMap;
- this.axis = axis;
-
- $(document).on('bluemap-update-frame', this.update);
- }
-
- createElement(){
- let element = super.createElement();
-
- element.addClass("position");
- element.attr("data-axis", this.axis);
- let inputElement = $('').appendTo(element);
- inputElement.on('input', this.onInput);
- inputElement.on('keydown', this.onKeyDown);
-
- return element;
- }
-
- onInput = event => {
- const value = Number(event.target.value);
- if (!isNaN(value)) {
- this.blueMap.controls.targetPosition[this.axis] = value;
- this.update();
- }
- };
-
- onKeyDown = event => {
- event.stopPropagation();
- };
-
- update = () => {
- const val = Math.floor(this.blueMap.controls.targetPosition[this.axis]);
-
- this.elements.forEach(element => {
- element.find("input").val(val);
- });
- };
-}
diff --git a/BlueMapCore/src/main/webroot/js/libs/ui/Separator.js b/BlueMapCore/src/main/webroot/js/libs/ui/Separator.js
deleted file mode 100644
index 96a4ac76..00000000
--- a/BlueMapCore/src/main/webroot/js/libs/ui/Separator.js
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * This file is part of BlueMap, licensed under the MIT License (MIT).
- *
- * Copyright (c) Blue (Lukas Rieger)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-import Element from './Element.js';
-
-export default class Separator extends Element {
-
- constructor(greedy = false){
- super();
- this.greedy = greedy;
- }
-
- createElement() {
- let element = super.createElement();
-
- element.addClass("separator");
- if (this.greedy) element.addClass("greedy");
-
- return element;
- }
-
- isGreedy(){
- return this.greedy;
- }
-
- setGreedy(greedy){
- this.greedy = greedy;
- this.elements.forEach(element => {
- if (this.greedy) {
- element.addClass("greedy");
- } else {
- element.removeClass("greedy");
- }
- });
- }
-
-}
\ No newline at end of file
diff --git a/BlueMapCore/src/main/webroot/js/libs/ui/Slider.js b/BlueMapCore/src/main/webroot/js/libs/ui/Slider.js
deleted file mode 100644
index cf3b5bf1..00000000
--- a/BlueMapCore/src/main/webroot/js/libs/ui/Slider.js
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * This file is part of BlueMap, licensed under the MIT License (MIT).
- *
- * Copyright (c) Blue (Lukas Rieger)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-import $ from 'jquery';
-
-import Element from './Element.js';
-
-export default class Slider extends Element {
-
- constructor(min = 0, max = 1, step = 0.01, value, onChange, minWidth){
- super();
- this.min = min;
- this.max = max;
- this.step = step;
-
- if (value === undefined) value = min;
- this.value = value;
-
- this.onChangeListener = onChange;
- this.minWidth = minWidth;
- }
-
- createElement() {
- let element = super.createElement();
- element.addClass("slider");
-
- if (this.minWidth !== undefined){
- element.addClass("sized");
- element.css("min-width", this.minWidth);
- }
-
- let slider = $(``).appendTo(element);
- slider.on('input change', this.onChangeEvent(slider));
- $(`
-
`).appendTo(element);
-
- this.update();
-
- return element;
- }
-
- getValue() {
- return this.value;
- }
-
- update(){
- this.elements.forEach(element => {
- let label = element.find(".label");
- let slider = element.find("input");
-
- slider.val(this.value);
- label.html(Math.round(this.value * 100) / 100);
- });
- }
-
- onChangeEvent = slider => () => {
- this.value = slider.val();
-
- this.update();
-
- if (this.onChangeListener !== undefined && this.onChangeListener !== null) {
- this.onChangeListener(this);
- }
- }
-
-}
\ No newline at end of file
diff --git a/BlueMapCore/src/main/webroot/js/libs/ui/ToggleButton.js b/BlueMapCore/src/main/webroot/js/libs/ui/ToggleButton.js
deleted file mode 100644
index dca176ac..00000000
--- a/BlueMapCore/src/main/webroot/js/libs/ui/ToggleButton.js
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * This file is part of BlueMap, licensed under the MIT License (MIT).
- *
- * Copyright (c) Blue (Lukas Rieger)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-import $ from 'jquery';
-
-import Button from './Button.js';
-
-export default class ToggleButton extends Button {
-
- constructor(label, selected, onChange, icon){
- super(label, undefined, icon);
- this.selected = selected;
- this.onChangeListener = onChange;
- }
-
- createElement() {
- let element = super.createElement();
-
- element.addClass("toggle-button");
- if (this.selected) element.addClass("selected");
- $('').appendTo(element);
- element.click(this.onClick);
-
- return element;
- }
-
- isSelected(){
- return this.selected;
- }
-
- toggle(){
- this.selected = !this.selected;
- this.update();
- }
-
- update(){
- this.elements.forEach(element => {
- if (this.selected)
- element.addClass("selected");
- else
- element.removeClass("selected");
- });
- }
-
- onClick = () => {
- this.toggle();
-
- if (this.onChangeListener !== undefined && this.onChangeListener !== null){
- this.onChangeListener(this);
- }
- };
-
-}
\ No newline at end of file
diff --git a/BlueMapCore/src/main/webroot/js/libs/ui/Toolbar.js b/BlueMapCore/src/main/webroot/js/libs/ui/Toolbar.js
deleted file mode 100644
index 4ef1b4cb..00000000
--- a/BlueMapCore/src/main/webroot/js/libs/ui/Toolbar.js
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * This file is part of BlueMap, licensed under the MIT License (MIT).
- *
- * Copyright (c) Blue (Lukas Rieger)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-import $ from 'jquery';
-
-import Element from './Element.js';
-
-export default class Toolbar {
-
- constructor(){
- this.element = $('');
-
- this.children = [];
- }
-
- addElement(element, hideOnMobile = false){
- this.children.push({
- element: element,
- hideOnMobile: hideOnMobile
- });
- }
-
- update() {
- this.element.html("");
- this.children.forEach(child => {
- let element = child.element.createElement();
- element.appendTo(this.element);
- if (child.hideOnMobile){
- element.addClass("mobile-hide");
- }
- });
- }
-
-}
\ No newline at end of file
diff --git a/BlueMapCore/src/main/webroot/js/libs/ui/UI.js b/BlueMapCore/src/main/webroot/js/libs/ui/UI.js
deleted file mode 100644
index 8481d0e4..00000000
--- a/BlueMapCore/src/main/webroot/js/libs/ui/UI.js
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * This file is part of BlueMap, licensed under the MIT License (MIT).
- *
- * Copyright (c) Blue (Lukas Rieger)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-import $ from 'jquery';
-
-import Toolbar from './Toolbar.js';
-import Menu from './Menu.js';
-import Dropdown from "./Dropdown";
-import Separator from "./Separator";
-import Label from "./Label";
-import MenuButton from './MenuButton.js';
-import Compass from "./Compass";
-import Position from "./Position";
-import Button from "./Button";
-import Slider from "./Slider";
-import ToggleButton from "./ToggleButton";
-import MapSelection from "./MapSeletion";
-
-import NIGHT from '../../../assets/night.svg';
-import HudInfo from "../hud/HudInfo";
-import MarkerManager from "../hud/MarkerManager";
-
-import {cachePreventionNr} from "../utils";
-
-export default class UI {
-
- constructor(blueMap) {
- this.blueMap = blueMap;
- this.element = $('').appendTo(this.blueMap.element);
-
- this.menu = new Menu();
- this.menu.element.appendTo(this.element);
-
- this.hud = $('').appendTo(this.element);
-
- this.toolbar = new Toolbar();
- this.toolbar.element.appendTo(this.hud);
-
- //modules
- this.hudInfo = new HudInfo(this.blueMap);
- this.markers = new MarkerManager(this.blueMap, this);
- }
-
- async load() {
- //elements
- let menuButton = new MenuButton(this.menu);
- let mapSelect = new MapSelection(this.blueMap);
- let nightButton = new ToggleButton("night", blueMap.targetSunLightStrength < 1, button => {
- this.blueMap.targetSunLightStrength = button.isSelected() ? 0.1 : 1;
- }, NIGHT);
- let posX = new Position(this.blueMap, 'x');
- let posZ = new Position(this.blueMap, 'z');
- let compass = new Compass(this.blueMap);
-
- let mobSpawnOverlay = new ToggleButton("mob-spawn (experimental)", blueMap.mobSpawnOverlay.value, button => {
- this.blueMap.mobSpawnOverlay.value = button.isSelected();
- this.blueMap.updateFrame = true;
- });
-
- let quality = new Dropdown(value => {
- this.blueMap.quality = parseFloat(value);
- this.blueMap.handleContainerResize();
- });
- quality.addOption("2", "high", this.blueMap.quality === 2);
- quality.addOption("1", "normal", this.blueMap.quality === 1);
- quality.addOption("0.5", "low", this.blueMap.quality === 0.5);
- let hiresSlider = new Slider(32, 480, 1, this.blueMap.hiresViewDistance, v => {
- this.blueMap.hiresViewDistance = v.getValue();
- this.blueMap.hiresTileManager.setViewDistance(this.blueMap.hiresViewDistance);
- this.blueMap.hiresTileManager.update();
- });
- let lowresSlider = new Slider(480, 6400, 1, this.blueMap.lowresViewDistance, v => {
- this.blueMap.lowresViewDistance = v.getValue();
- this.blueMap.lowresTileManager.setViewDistance(this.blueMap.lowresViewDistance);
- this.blueMap.lowresTileManager.update();
- });
- let extendedZoom = new ToggleButton("extended zoom", this.blueMap.controls.settings.zoom.max > 2000, button => {
- this.blueMap.controls.settings.zoom.max = button.isSelected() ? 8000 : 2000;
- this.blueMap.controls.targetDistance = Math.min(this.blueMap.controls.targetDistance, this.blueMap.controls.settings.zoom.max);
- });
- let debugInfo = new ToggleButton("debug-info", this.blueMap.debugInfo, button => {
- this.blueMap.debugInfo = button.isSelected();
- });
-
- let clearCache = new Button("clear tile cache", button => {
- this.blueMap.cacheSuffix = cachePreventionNr();
- this.blueMap.reloadMap();
- });
-
- //toolbar
- this.toolbar.addElement(menuButton);
- this.toolbar.addElement(mapSelect);
- this.toolbar.addElement(new Separator(), true);
- this.toolbar.addElement(nightButton, true);
- this.toolbar.addElement(new Separator(true));
- this.toolbar.addElement(posX);
- this.toolbar.addElement(posZ);
- this.toolbar.addElement(compass);
- this.toolbar.update();
-
- //menu
- this.menu.addElement(nightButton);
- //this.menu.addElement(mobSpawnOverlay);
-
- await this.markers.readyPromise;
- this.markers.addMenuElements(this.menu);
-
- this.menu.addElement(new Separator());
- this.menu.addElement(new Label('render quality:'));
- this.menu.addElement(quality);
- this.menu.addElement(new Label('hires render-distance (blocks):'));
- this.menu.addElement(hiresSlider);
- this.menu.addElement(new Label('lowres render-distance (blocks):'));
- this.menu.addElement(lowresSlider);
- this.menu.addElement(extendedZoom);
- this.menu.addElement(new Separator());
- this.menu.addElement(clearCache);
- this.menu.addElement(debugInfo);
- this.menu.update();
- }
-
-}
\ No newline at end of file
diff --git a/BlueMapCore/src/main/webroot/js/libs/utils.js b/BlueMapCore/src/main/webroot/js/libs/utils.js
deleted file mode 100644
index 087fa9a5..00000000
--- a/BlueMapCore/src/main/webroot/js/libs/utils.js
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * This file is part of BlueMap, licensed under the MIT License (MIT).
- *
- * Copyright (c) Blue (Lukas Rieger)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the 'Software'), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-import { Vector2, Vector3 } from 'three';
-
-export const cachePreventionNr = () => {
- return Math.floor(Math.random() * 100000000);
-};
-
-export const stringToImage = string => {
- let image = document.createElementNS('http://www.w3.org/1999/xhtml', 'img');
- image.src = string;
- return image;
-};
-
-export const pathFromCoords = (x, z) => {
- let path = 'x';
- path += splitNumberToPath(x);
-
- path += 'z';
- path += splitNumberToPath(z);
-
- path = path.substring(0, path.length - 1);
-
- return path;
-};
-
-export const splitNumberToPath = num => {
- let path = '';
-
- if (num < 0) {
- num = -num;
- path += '-';
- }
-
- let s = parseInt(num).toString();
-
- for (let i = 0; i < s.length; i++) {
- path += s.charAt(i) + '/';
- }
-
- return path;
-};
-
-export const hashTile = (x, z) => `x${x}z${z}`;
-
-/**
- * Adapted from https://www.w3schools.com/js/js_cookies.asp
- */
-export const setCookie = (key, value, days = 360) => {
- value = JSON.stringify(value);
-
- let expireDate = new Date();
- expireDate.setTime(expireDate.getTime() + days * 24 * 60 * 60 * 1000);
- document.cookie = key + "=" + value + ";" + "expires=" + expireDate.toUTCString();
-};
-
-/**
- * Adapted from https://www.w3schools.com/js/js_cookies.asp
- */
-export const getCookie = key => {
- let cookieString = decodeURIComponent(document.cookie);
- let cookies = cookieString.split(';');
-
- for(let i = 0; i < cookies.length; i++) {
- let cookie = cookies[i];
-
- while (cookie.charAt(0) === ' ') {
- cookie = cookie.substring(1);
- }
-
- if (cookie.indexOf(key + "=") === 0) {
- let value = cookie.substring(key.length + 1, cookie.length);
-
- try {
- value = JSON.parse(value);
- } catch (e) {}
-
- return value;
- }
- }
-
- return undefined;
-};
-
-export const Vector2_ZERO = new Vector2(0, 0);
-export const Vector3_ZERO = new Vector3(0, 0, 0);
diff --git a/BlueMapCore/src/main/webroot/js/site.js b/BlueMapCore/src/main/webroot/js/site.js
deleted file mode 100644
index 82cb9a51..00000000
--- a/BlueMapCore/src/main/webroot/js/site.js
+++ /dev/null
@@ -1,8 +0,0 @@
-import $ from 'jquery';
-import BlueMap from './libs/BlueMap.js';
-
-import '../style/style.scss';
-
-$(document).ready(() => {
- window.blueMap = new BlueMap($('#map-container')[0], 'data/');
-});
diff --git a/BlueMapCore/src/main/webroot/style/constants.scss b/BlueMapCore/src/main/webroot/style/constants.scss
deleted file mode 100644
index 015301ce..00000000
--- a/BlueMapCore/src/main/webroot/style/constants.scss
+++ /dev/null
@@ -1,18 +0,0 @@
-// colors
-$normal_fg: #333;
-$normal_bg: #fff;
-
-$label_fg: #666;
-
-$hover_fg: $normal_fg;
-$hover_bg: #aaa;
-
-$active_fg: $normal_bg;
-$active_bg: $normal_fg;
-
-$line_color: #aaa;
-
-// breakpoints
-$super-small-max: 500px;
-$small-max: 800px;
-$middle-max: 1200px;
\ No newline at end of file
diff --git a/BlueMapCore/src/main/webroot/style/modules/hudInfo.scss b/BlueMapCore/src/main/webroot/style/modules/hudInfo.scss
deleted file mode 100644
index 2c36e06d..00000000
--- a/BlueMapCore/src/main/webroot/style/modules/hudInfo.scss
+++ /dev/null
@@ -1,134 +0,0 @@
-.bluemap-container .hud-info {
- pointer-events: none;
-}
-
-.bluemap-container .hud-info .bubble {
- transform: translate(0, calc(-50% - 0.5rem));
-
- background-color: $normal_bg;
- filter: drop-shadow(1px 1px 3px #0008);
-
- white-space: nowrap;
-
- .content {
- position: relative;
-
- > .label {
- min-height: 0;
- font-size: 0.8rem;
- padding: 0.5rem 0.5rem 0 1rem;
- line-height: 0.8rem;
- color: $label_fg;
- border-top: solid 1px $line_color;
-
- &:first-child {
- border-top: none;
- }
- }
-
- > * {
- padding: 0.5rem;
- }
-
- .coords {
- display: flex;
- justify-content: center;
-
- > .coord {
- margin: 0 0.2rem;
- padding: 0 0.2rem;
-
- border-radius: 0.2rem;
-
- //background-color: #ccc;
-
- > .label {
- color: $label_fg;
- margin-right: 0.2rem;
-
- &::after {
- content: ':';
- }
- }
- }
- }
-
- > .files {
- border-top: solid 1px $line_color;
- font-size: 0.8rem;
- line-height: 0.8rem;
- color: $label_fg;
- }
-
- &::after {
- content: '';
-
- position: absolute;
- bottom: calc(-1rem + 1px);
- left: calc(50% - 0.5rem);
-
- width: 0;
- height: 0;
-
- border: solid 0.5rem;
- border-color: $normal_bg transparent transparent transparent;
- }
- }
-}
-
-.bluemap-container .marker-poi, .bluemap-container .marker-player {
- pointer-events: none;
-
- > * {
- pointer-events: auto;
- }
-
- > img {
- filter: drop-shadow(1px 1px 3px #0008);
- }
-}
-
-.bluemap-container .marker-player {
- img {
- width: 32px;
- height: 32px;
-
- image-rendering: pixelated;
- image-rendering: crisp-edges;
-
- border: solid 2px transparent;
-
- transition: all 0.3s;
- }
-
- .nameplate {
- position: absolute;
- left: 50%;
- top: 0;
- transform: translate(-50%, -110%);
- background: rgba(50, 50, 50, 0.75);
- padding: 0.2em 0.3em;
- color: white;
-
- transition: all 0.3s;
- }
-
- &.distant {
- img {
- width: 16px;
- height: 16px;
-
- border-width: 1px;
- }
-
- .nameplate {
- opacity: 0;
- }
- }
-
- &.following {
- img {
- border-color: white;
- }
- }
-}
\ No newline at end of file
diff --git a/BlueMapCore/src/main/webroot/style/style.scss b/BlueMapCore/src/main/webroot/style/style.scss
deleted file mode 100644
index a7d2e851..00000000
--- a/BlueMapCore/src/main/webroot/style/style.scss
+++ /dev/null
@@ -1,116 +0,0 @@
-@import "constants";
-
-html, body {
- margin: 0;
- padding: 0;
-
- font-size: 16px;
- line-height: 1rem;
- font-family: Verdana,Helvetica,Arial,sans-serif;
-
- color: $normal_fg;
- background-color: $normal_bg;
-
- @media (max-width: $small-max) {
- font-size: 20px;
- }
-}
-
-#map-container {
- position: absolute;
-
- width: 100%;
- height: 100%;
-}
-
-.bluemap-container {
- position: relative;
-
- width: 100%;
- height: 100%;
-
- overflow: hidden;
-
- > .map-canvas, .map-canvas-hud {
- position: absolute;
- top: 0;
- left: 0;
-
- width: 100%;
- height: 100%;
- }
-
- > .map-canvas {
- background-color: #000;
- z-index: 0;
- }
-
- > .map-canvas-hud {
- pointer-events: none;
-
- z-index: 10;
-
- > * {
- pointer-events: auto;
- }
- }
-
- > .ui {
- display: flex;
- align-items: stretch;
-
- position: relative;
-
- width: 100%;
- height: 100%;
-
- pointer-events: none;
-
- z-index: 100;
-
- > * {
- pointer-events: auto;
- }
-
- > .menu {
- position: relative;
-
- flex-shrink: 0;
- z-index: 200;
-
- filter: drop-shadow(1px 1px 3px #0008);
-
- @media (max-width: $middle-max) {
- position: absolute;
- }
- }
-
- > .hud {
- position: relative;
-
- width: 100%;
-
- pointer-events: none;
-
- filter: drop-shadow(1px 1px 3px #0008);
-
- > * {
- pointer-events: auto;
- }
- }
- }
-}
-
-@import "ui/ui";
-@import "ui/element";
-@import "ui/toolbar";
-@import "ui/menu";
-@import "ui/button";
-@import "ui/slider";
-@import "ui/togglebutton";
-@import "ui/separator";
-@import "ui/dropdown";
-@import "ui/label";
-@import "ui/position";
-
-@import "modules/hudInfo";
diff --git a/BlueMapCore/src/main/webroot/style/ui/button.scss b/BlueMapCore/src/main/webroot/style/ui/button.scss
deleted file mode 100644
index df8b7829..00000000
--- a/BlueMapCore/src/main/webroot/style/ui/button.scss
+++ /dev/null
@@ -1,39 +0,0 @@
-.bluemap-container .ui .ui-element.button {
- cursor: pointer;
- user-select: none;
-
- > .label {
- margin: 0 0.5rem;
- }
-
- &.icon {
- flex-grow: 0;
-
- > .label {
- display: none;
- }
- }
-
- &:hover {
- background-color: $hover_bg;
- color: $hover_fg;
- }
-
- &:active {
- background-color: $active_bg;
- color: $active_fg;
-
- > img {
- filter: invert(1);
- }
- }
-
- > img {
- position: absolute;
- top: 0;
- left: 0;
-
- width: 100%;
- height: 100%;
- }
-}
\ No newline at end of file
diff --git a/BlueMapCore/src/main/webroot/style/ui/dropdown.scss b/BlueMapCore/src/main/webroot/style/ui/dropdown.scss
deleted file mode 100644
index 2951b8cb..00000000
--- a/BlueMapCore/src/main/webroot/style/ui/dropdown.scss
+++ /dev/null
@@ -1,86 +0,0 @@
-.bluemap-container .ui .ui-element.dropdown {
- padding: 0;
- cursor: pointer;
-
- overflow: visible;
-
- user-select: none;
-
- > .header {
- height: 100%;
- padding-right: 1rem;
-
- &:hover {
- background-color: $hover_bg;
- color: $hover_fg;
-
- &::after {
- border-color: $hover_fg transparent transparent transparent;
- }
- }
-
- > .ui-element {
- pointer-events: none;
- background-color: transparent;
- }
-
- &::after {
- position: absolute;
- top: calc(50% - 0.2rem);
- right: 0.5rem;
-
- content: "";
-
- width: 0;
- height: 0;
-
- border: solid;
- border-width: 0.4rem 0.25rem 0.4rem 0.25rem;
- border-color: $normal_fg transparent transparent transparent;
- }
- }
-
- &.open > .header {
- background-color: $hover_bg;
- color: $hover_fg;
-
- &::after {
- top: calc(50% - 0.6rem);
- border-color: transparent transparent $hover_fg transparent;
- }
- }
-
- > .select {
- position: absolute;
- top: 100%;
- left: 0;
-
- width: 100%;
- overflow-x: hidden;
-
- max-height: 10rem;
- overflow-y: auto;
-
- z-index: 110;
-
- > .option {
- background-color: $normal_bg;
- color: $normal_fg;
-
- &:hover {
- background-color: $hover_bg;
- color: $hover_fg;
- }
-
- &.selected {
- background-color: $active_bg;
- color: $active_fg;
- }
- }
- }
-
- .option {
- padding: 0 0.5rem;
- }
-
-}
\ No newline at end of file
diff --git a/BlueMapCore/src/main/webroot/style/ui/element.scss b/BlueMapCore/src/main/webroot/style/ui/element.scss
deleted file mode 100644
index 89a1add3..00000000
--- a/BlueMapCore/src/main/webroot/style/ui/element.scss
+++ /dev/null
@@ -1,12 +0,0 @@
-.bluemap-container .ui .ui-element {
- position: relative;
-
- min-width: 2rem;
- min-height: 2rem;
- line-height: 2rem;
- padding: 0;
-
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
diff --git a/BlueMapCore/src/main/webroot/style/ui/label.scss b/BlueMapCore/src/main/webroot/style/ui/label.scss
deleted file mode 100644
index 33fc9fc5..00000000
--- a/BlueMapCore/src/main/webroot/style/ui/label.scss
+++ /dev/null
@@ -1,5 +0,0 @@
-.bluemap-container .ui .ui-element.label {
-
- color: $label_fg;
-
-}
\ No newline at end of file
diff --git a/BlueMapCore/src/main/webroot/style/ui/menu.scss b/BlueMapCore/src/main/webroot/style/ui/menu.scss
deleted file mode 100644
index 1321bdc4..00000000
--- a/BlueMapCore/src/main/webroot/style/ui/menu.scss
+++ /dev/null
@@ -1,179 +0,0 @@
-$menu-width: 375px;
-
-.bluemap-container .ui .menu {
- height: 100%;
- width: $menu-width;
- max-width: 100%;
-
- background-color: $normal_bg;
- color: $normal_fg;
-
- overflow: hidden;
-
- transition: width 0.2s;
-
- &.closed {
- width: 0;
- }
-
- @media (max-width: $menu-width) {
- transition: opacity 0.2s;
-
- &.closed {
- opacity: 0;
- width: $menu-width;
- pointer-events: none;
- }
- }
-
- > h1 {
- position: absolute;
- right: 0;
- top: 0;
-
- width: $menu-width;
- height: 2.5rem;
- line-height: 2.5rem;
-
- margin: 0;
- padding: 0.25rem;
-
- text-align: center;
-
- font-family: inherit;
- font-size: 1.2rem;
- font-weight: bold;
-
- box-shadow: 0 0 5px #00000088;
-
- z-index: 10;
-
- @media (max-width: $menu-width) {
- width: 100%;
- }
- }
-
- > .close-button {
- z-index: 20;
- right: calc(375px - 2.5rem);
- top: 0.5rem;
-
- @media (max-width: $menu-width) {
- left: 0.5rem;
- top: 0.5rem;
- }
- }
-
- > .content {
- position: absolute;
- right: 0;
- top: 3rem;
-
- display: flex;
- flex-direction: column;
-
- width: calc(375px - 1rem);
- height: calc(100% - 4rem);
-
- padding: 0.5rem;
-
- overflow-y: auto;
-
- @media (max-width: $menu-width) {
- width: calc(100% - 1rem);
- }
-
- > * {
- flex-grow: 0;
- flex-shrink: 0;
- }
-
- > .separator {
- position: relative;
- left: -0.5rem;
-
- width: calc(100% + 1rem);
-
- border-top: solid 1px $line_color;
- margin: 0.5rem 0;
-
- &.greedy {
- flex-grow: 1;
- border-bottom: solid 1px $line_color;
- }
- }
-
- > .label {
- min-height: 0;
- font-size: 0.8rem;
- padding: 1rem 0.5rem 0.1rem 1rem;
- line-height: 0.8rem;
- }
-
- > .dropdown > .select {
- border: solid 1px $line_color;
- border-top: none;
-
- width: calc(100% - 2px);
- }
-
- // a little hacky to force not displaying any icon
- > .toggle-button.icon {
- > .label {
- display: inline;
- }
-
- > img {
- display: none;
- }
-
- > .switch {
- display: block;
- }
-
- &.selected:not(:hover) {
- background-color: $normal_bg;
- color: $normal_fg;
- }
- &:hover {
- background-color: $hover_bg;
- color: $hover_fg;
- }
- }
-
- > .footer-separator{
- flex-grow: 1;
- }
-
- > .footer {
- margin: 0.5rem -0.5rem -0.5rem -0.5rem;
- padding: 0 0.5rem 0.5rem 0.5rem;
-
- border-top: solid 1px $line_color;
-
- line-height: 1rem;
- font-size: 0.8rem;
-
- white-space: normal;
-
- h1 {
- margin: 1rem 0 0.5rem 0;
- font-size: 1rem;
- text-align: center;
- }
-
- h2 {
- margin: 1rem 0 0 0;
- font-size: inherit;
- }
-
- p {
- margin: 0 0 0.5rem 0;
-
- &:last-child {
- margin-bottom: 0;
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/BlueMapCore/src/main/webroot/style/ui/position.scss b/BlueMapCore/src/main/webroot/style/ui/position.scss
deleted file mode 100644
index 5f480600..00000000
--- a/BlueMapCore/src/main/webroot/style/ui/position.scss
+++ /dev/null
@@ -1,39 +0,0 @@
-.bluemap-container .ui .ui-element.position {
- flex-basis: 6rem;
- flex-shrink: 1;
- min-width: 4rem;
-
- display: flex;
-
- height: 1rem;
-
- > input {
- width: calc(100% - 2rem);
- height: 100%;
- padding: 0 0.5rem 0 0;
-
- font: inherit;
- color: inherit;
- background: transparent;
-
- border: none;
- outline: none;
-
- // remove number spinner firefox
- -moz-appearance:textfield;
-
- // remove number spinner webkit
- &::-webkit-inner-spin-button,
- &::-webkit-outer-spin-button {
- -webkit-appearance: none;
- margin: 0;
- }
- }
-
- &[data-axis]::before {
- padding: 0 0.2rem 0 0.5rem;
- line-height: 2rem;
- color: $label_fg;
- content: attr(data-axis)':';
- }
-}
\ No newline at end of file
diff --git a/BlueMapCore/src/main/webroot/style/ui/separator.scss b/BlueMapCore/src/main/webroot/style/ui/separator.scss
deleted file mode 100644
index bae3e2af..00000000
--- a/BlueMapCore/src/main/webroot/style/ui/separator.scss
+++ /dev/null
@@ -1,9 +0,0 @@
-.bluemap-container .ui .ui-element.separator {
- pointer-events: none;
-
- min-width: 0;
- min-height: 0;
- padding: 0;
-
- background-color: unset;
-}
\ No newline at end of file
diff --git a/BlueMapCore/src/main/webroot/style/ui/slider.scss b/BlueMapCore/src/main/webroot/style/ui/slider.scss
deleted file mode 100644
index d3392a92..00000000
--- a/BlueMapCore/src/main/webroot/style/ui/slider.scss
+++ /dev/null
@@ -1,23 +0,0 @@
-.bluemap-container .ui .ui-element.slider {
-
- display: flex;
- align-content: stretch;
-
- > input {
- box-sizing: border-box;
- width: 100%;
-
- padding: 0;
- margin: 0 0.5rem;
- }
-
- > .label {
- margin: 0 0.5rem;
-
- min-width: 4rem;
- flex-grow: 0;
-
- text-align: right;
- }
-
-}
\ No newline at end of file
diff --git a/BlueMapCore/src/main/webroot/style/ui/togglebutton.scss b/BlueMapCore/src/main/webroot/style/ui/togglebutton.scss
deleted file mode 100644
index 213fcd9d..00000000
--- a/BlueMapCore/src/main/webroot/style/ui/togglebutton.scss
+++ /dev/null
@@ -1,76 +0,0 @@
-.bluemap-container .ui .ui-element.toggle-button {
-
- &:not(.icon) {
- padding-right: 2.75rem;
- }
-
- &:active {
- background-color: $hover_bg;
- color: $hover_fg;
-
- > img {
- filter: invert(0);
- }
- }
-
- &.icon {
- &.selected {
- background-color: $active_bg;
- color: $active_fg;
-
- > img {
- filter: invert(1);
- }
- }
- }
-
- > .switch {
- position: absolute;
- right: 0.5rem;
- top: 50%;
-
- transform: translate(0, -50%);
-
- height: 1rem;
- width: 1.75rem;
-
- border-radius: 1rem;
-
- background-color: $normal_fg;
-
- transition: background-color 0.2s;
-
- &::after {
- position: absolute;
- content: '';
-
- top: 0;
- left: 0;
-
- height: 0.8rem;
- width: 0.8rem;
-
- margin: 0.1rem;
-
- border-radius: 100%;
-
- background-color: $normal_bg;
-
- transition: left 0.2s;
- }
-
- }
-
- &.selected > .switch {
- background-color: #008800;
-
- &::after {
- left: calc(100% - 1rem);
- }
- }
-
- &.icon > .switch {
- display: none;
- }
-
-}
\ No newline at end of file
diff --git a/BlueMapCore/src/main/webroot/style/ui/toolbar.scss b/BlueMapCore/src/main/webroot/style/ui/toolbar.scss
deleted file mode 100644
index 2c48c82f..00000000
--- a/BlueMapCore/src/main/webroot/style/ui/toolbar.scss
+++ /dev/null
@@ -1,96 +0,0 @@
-.bluemap-container .ui .toolbar {
- display: flex;
- align-items: stretch;
- //justify-content: center;
-
- width: calc(100% - 20px);
- margin: 10px;
-
- pointer-events: none;
-
- @media (max-width: $small-max) {
- width: 100%;
- margin: 0;
-
- background-color: $normal_bg;
-
- > .mobile-hide {
- display: none;
- }
- }
-
- @media (max-width: $super-small-max) {
- flex-wrap: wrap;
- }
-
- > * {
- pointer-events: auto;
- }
-
- > .ui-element {
- flex-shrink: 0;
-
- background-color: $normal_bg;
- color: $normal_fg;
-
- @media (max-width: $small-max) {
- border-top: solid 1px $line_color;
- margin-top: -1px;
- }
-
- @media (max-width: $super-small-max) {
- flex-grow: 1;
- }
- }
-
- > .ui-element:not(.separator) + .ui-element:not(.separator) {
- border-left: solid 1px $line_color;
- margin-left: -1px;
- }
-
- > .ui-element.separator {
- width: 10px;
- flex-shrink: 0;
-
- @media (max-width: $small-max) {
- width: 0;
- border-left: solid 1px $line_color;
- margin-left: -1px;
- }
-
- @media (max-width: $super-small-max) {
- display: none;
- }
- }
-
- > .ui-element.separator.greedy {
- flex-grow: 1;
-
- @media (max-width: $small-max) {
- border-right: solid 1px $line_color;
- margin-right: -1px;
-
- z-index: 101;
- }
-
- @media (max-width: $super-small-max) {
- display: unset;
-
- border-right: none;
- margin-right: 0;
-
- flex-grow: 0;
- }
- }
-
- > .ui-element.dropdown {
- flex-basis: 15rem;
- flex-shrink: 1;
- min-width: 10rem;
-
- @media (max-width: $super-small-max) {
- flex-basis: calc(100% - 2rem); //space for dropdown + menu button
- }
- }
-
-}
\ No newline at end of file
diff --git a/BlueMapCore/src/main/webroot/style/ui/ui.scss b/BlueMapCore/src/main/webroot/style/ui/ui.scss
deleted file mode 100644
index 091092dc..00000000
--- a/BlueMapCore/src/main/webroot/style/ui/ui.scss
+++ /dev/null
@@ -1,96 +0,0 @@
-.bluemap-container .ui {
- position: relative;
-
- h1, h2, h3, h4, h5, h6 {
- font-size: 1rem;
- font-weight: bold;
- text-decoration: none;
- text-align: left;
- margin: 0;
- padding: 0;
- }
-
- h1 {
- font-size: 1.5rem;
- }
-
- h2 {
- font-size: 1.3rem;
- }
-
- h3 {
- font-size: 1.1rem;
- }
-
- p {
- padding: 0;
- margin: 0.5rem 0 0 0;
- }
-
- .close-button {
- position: absolute;
- top: 0;
- right: 0;
-
- width: 1.5rem;
- height: 1.5rem;
-
- margin: 0.25rem;
-
- font-weight: bold;
-
- &::after, &::before {
- content: '';
-
- position: absolute;
- top: 50%;
- left: 50%;
-
- width: 0.8rem;
- height: 0.2rem;
-
- background-color: $normal_fg;
- }
-
- &::before {
- transform: translate(-50%, -50%) rotate(45deg);
- }
-
- &::after {
- transform: translate(-50%, -50%) rotate(-45deg);
- }
-
- &:hover::after, &:hover::before {
- background-color: darkred;
- }
- }
-
- .alert-box {
- position: absolute;
- top: 0;
- left: 0;
-
- width: 100%;
- height: 100%;
-
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- justify-content: center;
-
- pointer-events: none;
-
- .alert {
- position: relative;
-
- padding: 1rem;
- margin: 1rem;
-
- background-color: $normal_bg;
- color: $normal_fg;
-
- pointer-events: all;
- }
- }
-
-}
\ No newline at end of file
diff --git a/BlueMapCore/tsconfig.json b/BlueMapCore/tsconfig.json
deleted file mode 100644
index f3fce1f4..00000000
--- a/BlueMapCore/tsconfig.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "compilerOptions": {
- "sourceMap": true,
- "module": "esnext",
- "target": "es6",
- "experimentalDecorators": true,
- "emitDecoratorMetadata": true,
- "moduleResolution": "node",
- "strict": true,
- "esModuleInterop": true,
- "allowJs": true
- },
- "include": [ "src" ]
-}
diff --git a/BlueMapCore/webpack.config.js b/BlueMapCore/webpack.config.js
deleted file mode 100644
index 1e83b14c..00000000
--- a/BlueMapCore/webpack.config.js
+++ /dev/null
@@ -1,81 +0,0 @@
-const path = require('path')
-const fs = require('fs')
-const HtmlWebpackPlugin = require('html-webpack-plugin')
-const MiniCssExtractPlugin = require('mini-css-extract-plugin');
-
-const WEBROOT_PATH = path.resolve(__dirname, 'src/main/webroot')
-const BUILD_PATH = path.resolve(__dirname, 'build/generated/webroot')
-// folder with a generated world to render in the dev server
-const WORLD_DATA_PATH = path.resolve(__dirname, '../data/test-render')
-
-module.exports = {
- mode: 'production',
- devtool: 'source-map',
- entry: {
- 'bluemap': path.resolve(WEBROOT_PATH, 'js/site.js'),
- },
- output: {
- path: BUILD_PATH,
- filename: 'js/[name].js',
- },
- devServer: {
- contentBase: WORLD_DATA_PATH,
- compress: true,
- port: 8080,
- hot: true,
- host: '0.0.0.0'
- },
- plugins: [
- new MiniCssExtractPlugin({
- filename: 'style/[name].css?[hash]',
- }),
- new HtmlWebpackPlugin({
- template: path.resolve(WEBROOT_PATH, 'index.html'),
- favicon: path.resolve(WEBROOT_PATH, 'assets/favicon.png'),
- hash: true,
- }),
- ],
- resolve: {
- extensions: ['.js', '.css', '.scss'],
- },
- module: {
- rules: [
- // Transpile JavaScript source files using TypeScript engine
- {
- test: /\.(js|ts)$/,
- include: /src/,
- use: 'ts-loader',
- },
- // Just import normal css files
- {
- test: /\.css$/,
- include: /src/,
- use: [
- { loader: MiniCssExtractPlugin.loader },
- { loader: 'css-loader' },
- ],
- },
- // Converts scss files into css to use within custom elements
- {
- test: /\.scss$/,
- include: /src/,
- use: [
- { loader: MiniCssExtractPlugin.loader },
- { loader: 'css-loader' },
- { loader: 'sass-loader' },
- ],
- },
- // Load additional files
- {
- test: /\.(png|svg)(\?.*$|$)/,
- include: /src/,
- use: [
- {
- loader: 'file-loader',
- options: { name: 'assets/[name].[ext]?[hash]' },
- },
- ],
- },
- ],
- },
-}
diff --git a/gradle.properties b/gradle.properties
index 85346c1c..36a493db 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,4 +1,4 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
-coreVersion=1.3.1
+coreVersion=1.4.0-snap