From 065184bea8338e159eaffd882b6ffd528ce69ea7 Mon Sep 17 00:00:00 2001 From: H4CK3R-01 Date: Fri, 11 Jun 2021 07:55:46 +0200 Subject: [PATCH] Reformatted code --- Webservice/mobileHandler.js | 10 +++++----- public/js/Button.js | 8 ++++---- public/js/Sprite.js | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Webservice/mobileHandler.js b/Webservice/mobileHandler.js index da840d4..79a9890 100644 --- a/Webservice/mobileHandler.js +++ b/Webservice/mobileHandler.js @@ -1,11 +1,11 @@ function isMobile() { - - var mobileDeviceIndicator = 0; - if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { + let mobileDeviceIndicator = 0; + if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { mobileDeviceIndicator = 1; } /* - var hasTouchscreen = 'ontouchstart' in window; - alert(hasTouchscreen ? 'has touchscreen' : 'doesn\'t have touchscreen');*/ + let hasTouchscreen = 'ontouchstart' in window; + alert(hasTouchscreen ? 'has touchscreen' : 'doesn\'t have touchscreen'); + */ } diff --git a/public/js/Button.js b/public/js/Button.js index 163e4bd..306e6bd 100644 --- a/public/js/Button.js +++ b/public/js/Button.js @@ -20,17 +20,17 @@ function Button(default_color, hover_color, select_color, width, height, x, y, t this.graphics.beginFill(color); this.graphics.drawRect(this.x, this.y, this.width, this.height); this.graphics.endFill(); - } + }; this.selectButton = function () { this.selected = true; this.changeButtonColor(select_color); - } + }; this.unSelectButton = function () { this.selected = false; this.changeButtonColor(default_color); - } + }; this.getButton = function () { const style = new PIXI.TextStyle({ @@ -74,5 +74,5 @@ function Button(default_color, hover_color, select_color, width, height, x, y, t if (!_this.selected) _this.changeButtonColor(_this.default_color); }); return this.graphics; - } + }; } diff --git a/public/js/Sprite.js b/public/js/Sprite.js index 43b0fbb..2d588b3 100644 --- a/public/js/Sprite.js +++ b/public/js/Sprite.js @@ -6,12 +6,12 @@ function Sprite(x, y) { this.getSprite = function () { this.setSize(this.sprite, sprite_size); return this.sprite; - } + }; this.setSize = function (sprite, size) { sprite.x = this.coord_x * size - size * 0.2; sprite.y = this.coord_y * size - size * 0.2; sprite.width = size * 1.5; sprite.height = size * 1.5; - } + }; } \ No newline at end of file