-
-
+
@@ -36,6 +44,8 @@ import { useCookies } from '@vueuse/integrations/useCookies'
const gameStore = useGameStore()
const username = ref('')
const password = ref('')
+let formError = false
+let notification = ''
// automatic login because of development
onMounted(async () => {
@@ -49,7 +59,8 @@ onMounted(async () => {
async function loginFunc() {
// check if username and password are valid
if (username.value === '' || password.value === '') {
- gameStore.addNotification({ message: 'Please enter a valid username and password' })
+ notification = 'Please enter a valid username and password'
+ formError = true
return
}
@@ -57,10 +68,12 @@ async function loginFunc() {
const response = await login(username.value, password.value)
if (response.success === undefined) {
- gameStore.addNotification({ message: response.error })
+ notification = response.error
+ formError = true
return
}
+ console.log(formError)
gameStore.setToken(response.token)
gameStore.initConnection()
return true // Indicate success
@@ -69,7 +82,8 @@ async function loginFunc() {
async function registerFunc() {
// check if username and password are valid
if (username.value === '' || password.value === '') {
- gameStore.addNotification({ message: 'Please enter a valid username and password' })
+ notification = 'Please enter a valid username and password'
+ formError = true
return
}
@@ -77,13 +91,15 @@ async function registerFunc() {
const response = await register(username.value, password.value)
if (response.success === undefined) {
- gameStore.addNotification({ message: response.error })
+ notification = response.error
+ formError = true
return
}
const loginSuccess = await loginFunc()
if (!loginSuccess) {
- gameStore.addNotification({ message: 'Login after registration failed. Please try logging in manually.' })
+ notification = 'Login after registration failed. Please try logging in manually.'
+ formError = true
}
}
diff --git a/tailwind.config.js b/tailwind.config.js
index 6389f61..6db6852 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -4,9 +4,11 @@ export default {
theme: {
fontFamily: {
'titles': ['Poppins', 'serif'],
- 'default': ['Inter', 'serif']
+ 'default': ['Quicksand', 'serif']
},
backgroundSize: {
+ 'cover': 'cover',
+ 'contain': 'contain',
'30px': '30px'
},
screens: {
@@ -50,7 +52,8 @@ export default {
red: {
DEFAULT: '#d50000',
50: '#d50000',
- 100: '#b30000'
+ 100: '#b30000',
+ 200: '#F44747'
},
bordeaux: {
DEFAULT: '#800020',
@@ -68,18 +71,18 @@ export default {
DEFAULT: '#9841e6'
},
cyan: {
- DEFAULT: '#368f8b',
- 50: '#00b3b3',
- 100: '#368f8b',
+ DEFAULT: '#0D6D69',
+ 50: '#5AA39F',
+ 100: '#0D6D69',
200: '#376362'
},
gray: {
- DEFAULT: '#7f7f7f',
- 50: '#d3d3d3',
- 100: '#7f7f7f',
- 200: '#696969',
- 300: '#313638',
- 500: '#778899',
+ DEFAULT: '#282828',
+ 50: '#0C0C0C',
+ 100: '#282828',
+ 200: '#454442',
+ 300: '#888888',
+ 500: '#B4B4B4',
600: '#B1B2B5'
}
}