forked from noxious/client
styling changes, added basic logics for registering accounts
This commit is contained in:
parent
095e41cfb4
commit
4d4df7cd99
@ -7,11 +7,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Game from '@/components/Game.vue'
|
import Game from '@/components/Game.vue'
|
||||||
import Login from '@/components/screens/Login.vue'
|
import Login from '@/components/screens/Login.vue'
|
||||||
import config from '@/config'
|
|
||||||
import { onMounted, type Ref, ref } from 'vue'
|
import { onMounted, type Ref, ref } from 'vue'
|
||||||
|
import SocketioService from '@/services/socketio.service';
|
||||||
|
|
||||||
const screen:Ref<string> = ref('login');
|
const screen:Ref<string> = ref('login');
|
||||||
|
|
||||||
import SocketioService from '@/services/socketio.service';
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
SocketioService.setupSocketConnection();
|
SocketioService.setupSocketConnection();
|
||||||
});
|
});
|
||||||
|
@ -37,12 +37,12 @@
|
|||||||
label {
|
label {
|
||||||
color: #000;
|
color: #000;
|
||||||
background-color: rgba(255, 255, 255, 0.5);
|
background-color: rgba(255, 255, 255, 0.5);
|
||||||
padding: 0.25rem 0.5rem;
|
padding: 0.15rem 0.5rem;
|
||||||
}
|
}
|
||||||
input {
|
input {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
border: none;
|
border: none;
|
||||||
padding: 0.5rem 0.25rem;
|
padding: 0.25rem 0.25rem;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -56,11 +56,11 @@
|
|||||||
bottom: 5rem;
|
bottom: 5rem;
|
||||||
|
|
||||||
.button {
|
.button {
|
||||||
padding: 1.2rem 0;
|
padding: 1rem 0;
|
||||||
min-width: 6rem;
|
min-width: 6rem;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
font-size: 12px;
|
font-size: 10px;
|
||||||
|
|
||||||
&.button-1 {
|
&.button-1 {
|
||||||
background-image: url('/assets/Button_1.png');
|
background-image: url('/assets/Button_1.png');
|
||||||
|
@ -7,21 +7,21 @@
|
|||||||
<div class="login-form">
|
<div class="login-form">
|
||||||
<form method="post">
|
<form method="post">
|
||||||
<div class="form-field">
|
<div class="form-field">
|
||||||
<label for="username">USERNAME</label>
|
<label for="username">Username</label>
|
||||||
<input type="text" name="username" required>
|
<input v-model="username" type="text" name="username" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-field">
|
<div class="form-field">
|
||||||
<label for="password">PASSWORD</label>
|
<label for="password">Password</label>
|
||||||
<input type="password" name="password" required>
|
<input v-model="password" type="password" name="password" required>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row-buttons">
|
<div class="row-buttons">
|
||||||
<button class="button button-1" id="submit">
|
<button class="button button-1" id="submit" @click="submit">
|
||||||
LOGIN
|
LOGIN
|
||||||
</button>
|
</button>
|
||||||
<button class="button button-2">
|
<button class="button button-2" @click="register">
|
||||||
REGISTER
|
REGISTER
|
||||||
</button>
|
</button>
|
||||||
<button class="button button-3">
|
<button class="button button-3">
|
||||||
@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted } from 'vue'
|
import { ref, onMounted } from 'vue'
|
||||||
|
import SocketioService from '@/services/socketio.service';
|
||||||
|
|
||||||
|
|
||||||
// const bgm = ref('bgm');
|
// const bgm = ref('bgm');
|
||||||
@ -46,6 +47,25 @@ import { ref, onMounted } from 'vue'
|
|||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// })
|
// })
|
||||||
|
|
||||||
|
// on login form submit
|
||||||
|
const submit = () => {
|
||||||
|
console.log('submit');
|
||||||
|
}
|
||||||
|
|
||||||
|
const username = ref('');
|
||||||
|
const password = ref('');
|
||||||
|
|
||||||
|
function register() {
|
||||||
|
// check if username and password are valid
|
||||||
|
if (username.value === '' || password.value === '') {
|
||||||
|
alert('Please enter a valid username and password');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// send register event to server
|
||||||
|
SocketioService.socket.emit('register', username.value, password.value);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user