From 3114060183ed74796e1194d2ca7f4d473a576823 Mon Sep 17 00:00:00 2001 From: Jose Conde Date: Sun, 4 Aug 2024 18:39:28 +0200 Subject: [PATCH] v0,2,1 --- src-tauri/tauri.conf.json | 4 +- src/assets/base.css | 6 - src/assets/main.css | 30 +++- src/common/helpers.ts | 7 + src/components/MatchConfiguration.vue | 146 +++++++++--------- src/components/MultiplayerSetupComponent.vue | 86 +++++++++++ src/components/SessionBoxComponent.vue | 69 +++++++++ .../layouts/AuthenticatedLayout.vue | 2 +- src/detect.ts | 10 ++ src/game/Board.ts | 45 ++++-- src/game/Button.ts | 2 +- src/game/Game.ts | 27 ++-- src/game/Hand.ts | 58 ++++--- src/game/SpriteBase.ts | 54 +------ src/game/TimerText.ts | 45 +++--- src/game/utilities/Timer.ts | 1 + src/i18n/en.json | 18 ++- src/i18n/es.json | 12 +- src/router/index.ts | 12 ++ src/services/SocketIoClientService.ts | 12 +- src/views/GameView.vue | 1 - src/views/HomeView.vue | 133 +++++----------- src/views/LandingView.vue | 87 ++++++----- types/type.d.ts | 1 + 24 files changed, 515 insertions(+), 353 deletions(-) create mode 100644 src/components/MultiplayerSetupComponent.vue create mode 100644 src/components/SessionBoxComponent.vue create mode 100644 src/detect.ts diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index d59c5ab..66953ba 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -8,7 +8,7 @@ }, "package": { "productName": "domino-client", - "version": "0.2.0" + "version": "0.2.1" }, "tauri": { "allowlist": { @@ -72,7 +72,7 @@ "fullscreen": false, "height": 720, "resizable": true, - "title": "Domino v0.2.0", + "title": "Domino v0.2.1", "width": 1280, "minHeight": 720, "minWidth": 1280, diff --git a/src/assets/base.css b/src/assets/base.css index 110b7a2..40d4f57 100644 --- a/src/assets/base.css +++ b/src/assets/base.css @@ -15,9 +15,3 @@ --bulma-danger-s: 74%; --bulma-danger-l: 37%; } - -.tabs li.is-disabled { - pointer-events: none; - cursor: default; - opacity: 0.3; -} diff --git a/src/assets/main.css b/src/assets/main.css index 2ce0996..a4c0c5e 100644 --- a/src/assets/main.css +++ b/src/assets/main.css @@ -1,7 +1,35 @@ @import './base.css'; -html { +html, +body, +#app { font-size: 16px; overflow-y: auto; overflow-x: hidden; + height: 100%; +} + +#app.game { + overflow-y: hidden; +} + +.tabs li.is-disabled { + pointer-events: none; + cursor: default; + opacity: 0.3; +} + +.box.is-no-shadow { + box-shadow: none; + border: 1px solid var(--bulma-input-border-color); +} + +.landing .unauthenticated-layout { + height: 100%; +} + +.is-ellipsis { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } diff --git a/src/common/helpers.ts b/src/common/helpers.ts index 99117ba..369ff1c 100644 --- a/src/common/helpers.ts +++ b/src/common/helpers.ts @@ -143,3 +143,10 @@ export function createStringMatrix( return matrix } + +export function isMobile() { + const userAgent = navigator.userAgent || navigator.vendor || window.opera + return /android|avantgo|blackberry|bada\/|bb|meego|ip(hone|od|ad)|opera m(ob|in)i|phone|tablet|mobi|ipad|playbook|silk|windows (phone|ce)|webos|kindle|mobile|palm|fennec|gobrowser|hiptop|iemobile|iris|w3c|wap|opera mini|iemobile/i.test( + userAgent, + ) +} diff --git a/src/components/MatchConfiguration.vue b/src/components/MatchConfiguration.vue index 5c2ded9..a3b4da6 100644 --- a/src/components/MatchConfiguration.vue +++ b/src/components/MatchConfiguration.vue @@ -19,7 +19,7 @@ let options = ref({ const winTargetPointsList = [20, 50, 80, 100, 150, 200] const winTargetRoundsList = [1, 2, 3, 4, 5, 6] -const turnWaitSecondsList = [15, 20, 30, 40, 50, 60] +const turnWaitSecondsList = [5, 10, 15, 20, 30, 40, 50, 60] const backgroundOptiopnList = [ { @@ -58,86 +58,90 @@ function startSingleMatch() { diff --git a/src/views/LandingView.vue b/src/views/LandingView.vue index 6956f98..ad2e049 100644 --- a/src/views/LandingView.vue +++ b/src/views/LandingView.vue @@ -52,45 +52,56 @@ async function login() { + + diff --git a/types/type.d.ts b/types/type.d.ts index 670134a..dacb94d 100644 --- a/types/type.d.ts +++ b/types/type.d.ts @@ -6,4 +6,5 @@ declare module 'socket.io' { declare interface Window { __TAURI__: any + opera: any }