This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script setup>
|
||||
import { TransitionGroup } from 'vue'
|
||||
import { Windows, ReloadRef, WindowMap } from '@/services/Windows';
|
||||
import { Windows, ReloadRef, WindowMap, getComponent } from '@/services/Windows';
|
||||
|
||||
// Gestionem ventanas
|
||||
const reload = ReloadRef();
|
||||
@@ -11,7 +11,7 @@ const windows = Windows();
|
||||
<template>
|
||||
<div class="window-container" :key="reload">
|
||||
<TransitionGroup name="window">
|
||||
<component v-for="win in windows" :is="WindowMap()[win.type]" :key="win.id" :data="win"></component>
|
||||
<component v-for="win in windows" :is="getComponent(win.type)" :key="win.id" :data="win"></component>
|
||||
</TransitionGroup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -9,7 +9,7 @@ const handle = ref(null);
|
||||
const props = defineProps(['data']);
|
||||
const data = props.data;
|
||||
|
||||
let id = data.id;
|
||||
let id = data.type;
|
||||
|
||||
const test = ref(null)
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ const handle = ref(null);
|
||||
const props = defineProps(['data']);
|
||||
const data = props.data;
|
||||
|
||||
let id = data.id;
|
||||
let id = data.type;
|
||||
|
||||
const username = ref("");
|
||||
const password = ref("");
|
||||
@@ -28,7 +28,6 @@ const password = ref("");
|
||||
onMounted(() => {
|
||||
SetupHandle(id, handle);
|
||||
SetSize(id, {width: 450, height: 480});
|
||||
SetMovable(id, false);
|
||||
SetResizable(id, false);
|
||||
ResetPosition(id, "center");
|
||||
});
|
||||
@@ -77,18 +76,18 @@ function toRegister(){
|
||||
|
||||
<form v-on:submit.prevent="login">
|
||||
<div class="form-field">
|
||||
<label for="username">Username</label>
|
||||
<input id="username-field" type="text" placeholder="Enter your username here..." name="username" v-model="username" autocomplete="off" >
|
||||
<label for="username">{{$t('login.username')}}</label>
|
||||
<input id="username-field" type="text" :placeholder="$t('login.username-placeholder')" name="username" v-model="username" autocomplete="off" >
|
||||
</div>
|
||||
<div class="form-field">
|
||||
<label for="password">Password</label>
|
||||
<input id="password-field" type="password" placeholder="Enter your password..." name="password" v-model="password" autocomplete="off" >
|
||||
<label for="password">{{$t('login.password')}}</label>
|
||||
<input id="password-field" type="password" :placeholder="$t('login.password-placeholder')" name="password" v-model="password" autocomplete="off" >
|
||||
</div>
|
||||
<div class="form-field">
|
||||
<button class="btn-primary sound-click">Log in</button>
|
||||
<button class="btn-primary sound-click">{{$t('login.log-in')}}</button>
|
||||
</div>
|
||||
<div class="form-field center">
|
||||
<p>You don't have an account? <a href="#" @click.prevent="toRegister">Register</a></p>
|
||||
<p>{{$t('login.no-account')}} <a href="#" @click.prevent="toRegister">{{$t('login.register')}}</a></p>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ const handle = ref(null);
|
||||
const props = defineProps(['data']);
|
||||
const data = props.data;
|
||||
|
||||
let id = data.id;
|
||||
let id = data.type;
|
||||
|
||||
const test = ref(null)
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import { GetWindowWithId, ClearWindow, Windows } from '@/services/Windows';
|
||||
import ArrowLeftIcon from '/icons/iconoir/regular/arrow-left.svg';
|
||||
import XMarkIcon from '/icons/iconoir/regular/xmark.svg';
|
||||
import ResizeHandleIcon from '/icons/ui/resize-handle.svg';
|
||||
import { AddSound } from '~/services/Sound';
|
||||
|
||||
const props = defineProps(['window', 'handleHeight', 'custom', 'color']);
|
||||
const id = props.window;
|
||||
@@ -25,7 +26,7 @@ let backFunction;
|
||||
|
||||
function setupHandle() {
|
||||
let win = GetWindowWithId(id);
|
||||
if(win.title) title.value = win.title;
|
||||
if(win.title) title.value = $t(win.title);
|
||||
if(win.close){
|
||||
close.value = true;
|
||||
closeAction = win.close;
|
||||
@@ -43,6 +44,8 @@ function setupHandle() {
|
||||
// Setup sounds
|
||||
let currentWindowId = "window-wrapper-" + id;
|
||||
let currentWindow = document.getElementById(currentWindowId);
|
||||
|
||||
AddSound(currentWindow);
|
||||
}
|
||||
|
||||
function CloseButton(){
|
||||
|
||||
Reference in New Issue
Block a user