diff --git a/public/logo.png b/public/logo.png deleted file mode 100644 index 246b130..0000000 Binary files a/public/logo.png and /dev/null differ diff --git a/public/logoblack.png b/public/logoblack.png deleted file mode 100644 index 99c1abf..0000000 Binary files a/public/logoblack.png and /dev/null differ diff --git a/public/logoblack.svg b/public/logoblack.svg deleted file mode 100644 index 2115c47..0000000 --- a/public/logoblack.svg +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - diff --git a/src/App.vue b/src/App.vue index b5b6726..0f07a0a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -5,10 +5,5 @@ import { onMounted } from 'vue' import { useGlobalStore } from '@/stores/globalStore'; const globalStore = useGlobalStore(); - - onMounted(() => { - - }); console.log("Subsonics Chopin - App Vue Loaded"); - \ No newline at end of file diff --git a/src/assets/Global.scss b/src/assets/Global.scss index 11c104c..f642706 100644 --- a/src/assets/Global.scss +++ b/src/assets/Global.scss @@ -43,6 +43,7 @@ html, body { height: 100%; overflow-x: hidden; background-color: var(--primary); + transition: all 0.5s ease-in-out; } @@ -82,3 +83,6 @@ a { background: #ffffffa8; } +.full { + width: 100%; +} \ No newline at end of file diff --git a/src/assets/LogoDark.vue b/src/assets/LogoDark.vue new file mode 100644 index 0000000..672d8d6 --- /dev/null +++ b/src/assets/LogoDark.vue @@ -0,0 +1,28 @@ + \ No newline at end of file diff --git a/public/logo.svg b/src/assets/LogoLight.vue similarity index 69% rename from public/logo.svg rename to src/assets/LogoLight.vue index bce576b..0487969 100644 --- a/public/logo.svg +++ b/src/assets/LogoLight.vue @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/public/logo-white.svg b/src/assets/LogoWhite.vue similarity index 69% rename from public/logo-white.svg rename to src/assets/LogoWhite.vue index 0782db5..cb28321 100644 --- a/public/logo-white.svg +++ b/src/assets/LogoWhite.vue @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/src/components/Features/UserAction.vue b/src/components/Features/Account.vue similarity index 97% rename from src/components/Features/UserAction.vue rename to src/components/Features/Account.vue index 9aad1f6..5902630 100644 --- a/src/components/Features/UserAction.vue +++ b/src/components/Features/Account.vue @@ -39,7 +39,6 @@ function goToSettings() { justify-content: space-between; flex-direction: row; gap: 30px; - width: 100%; } .user-action { display: flex; diff --git a/src/components/Features/HeaderGuild.vue b/src/components/Features/HeaderGuild.vue new file mode 100644 index 0000000..78507e9 --- /dev/null +++ b/src/components/Features/HeaderGuild.vue @@ -0,0 +1,87 @@ + + + \ No newline at end of file diff --git a/src/components/Layout/Splash.vue b/src/components/Layout/Splash.vue index d74fd21..a392fe4 100644 --- a/src/components/Layout/Splash.vue +++ b/src/components/Layout/Splash.vue @@ -1,7 +1,7 @@ \ No newline at end of file diff --git a/src/components/UI/SubsonicsLogo.vue b/src/components/UI/SubsonicsLogo.vue new file mode 100644 index 0000000..f2416ff --- /dev/null +++ b/src/components/UI/SubsonicsLogo.vue @@ -0,0 +1,25 @@ + + + \ No newline at end of file diff --git a/src/components/Widget/ServerItem.vue b/src/components/Widget/ServerItem.vue new file mode 100644 index 0000000..92c2aad --- /dev/null +++ b/src/components/Widget/ServerItem.vue @@ -0,0 +1,54 @@ + + + \ No newline at end of file diff --git a/src/components/Widget/ServerListItem.vue b/src/components/Widget/ServerListItem.vue index c2ec99c..f8d9ab4 100644 --- a/src/components/Widget/ServerListItem.vue +++ b/src/components/Widget/ServerListItem.vue @@ -1,13 +1,7 @@ \ No newline at end of file diff --git a/src/routes.js b/src/routes.js index 109ffe3..a952efa 100644 --- a/src/routes.js +++ b/src/routes.js @@ -10,6 +10,7 @@ import { socket } from "@/socket" import { useLoginStore } from './stores/loginStore' import { useGlobalStore } from './stores/globalStore' import Interface from './views/Interface.vue' +import events from './utils/Events' const router = createRouter({ history: createWebHistory(), @@ -33,6 +34,8 @@ router.beforeEach((to, from, next) => { const loginStore = useLoginStore() const globalStore = useGlobalStore() console.log(from.matched) + events.clear() + console.log("Clearing events") if(from.matched.length == 0) { globalStore.setLastRoute(null) } else { diff --git a/src/utils/Events.js b/src/utils/Events.js new file mode 100644 index 0000000..57b0d44 --- /dev/null +++ b/src/utils/Events.js @@ -0,0 +1,23 @@ +const Events = new Map() + +export default { + on(eventName, fn) { + if(!Events.has(eventName)) { + Events.set(eventName, []) + } + + Events.get(eventName).push(fn) + }, + + off(eventName, fn) { + throw {message:'Not implemented'} + }, + emit(eventName, data) { + if(Events.has(eventName)) { + Events.get(eventName).forEach(fn => fn(data)) + } + }, + clear() { + Events.clear() + }, +} \ No newline at end of file diff --git a/src/utils/SocketEnvironment.vue b/src/utils/SocketEnvironment.vue index dfe89fc..3f9944f 100644 --- a/src/utils/SocketEnvironment.vue +++ b/src/utils/SocketEnvironment.vue @@ -11,6 +11,7 @@ import { useRouter } from 'vue-router'; import { IOListener, IORequest } from '@/utils/IORequest'; import { useUserStore } from '@/stores/userStore'; import { useGlobalStore } from '@/stores/globalStore'; +import events from '@/utils/Events.js'; const router = useRouter(); const interuptionMessage = ref(null); @@ -29,16 +30,15 @@ import { useGlobalStore } from '@/stores/globalStore'; } IOListener("/USER/READY", () => { - IORequest("/USER/INFO", (data) => { + IORequest("/USER/INFO", (data) => { interuptionMessage.value = null; userStore.setUserInfo(data); + events.emit("UPDATE") console.log("User info received:", data); globalStore.setLoading(false); }); - }); - IOListener("AUTH_ERROR", (error) => { console.error("Authentication error:", error); loginStore.setToken(null); diff --git a/src/views/Interface.vue b/src/views/Interface.vue index 07efaa1..a0326a1 100644 --- a/src/views/Interface.vue +++ b/src/views/Interface.vue @@ -1,6 +1,7 @@ @@ -16,13 +17,15 @@ import Box from '@/components/UI/Box.vue'; import Button from '@/components/UI/Button.vue'; import SocketEnvironment from '@/utils/SocketEnvironment.vue'; -import UserAction from '@/components/Features/UserAction.vue'; import { watch } from 'vue'; import { useRouter } from 'vue-router'; import { useGlobalStore } from '@/stores/globalStore'; import { useUserStore } from '@/stores/userStore'; import { IOListener, IORequest } from '@/utils/IORequest'; import { onMounted, ref } from 'vue'; +import Account from '@/components/Features/Account.vue'; +import events from '@/utils/Events.js'; +import HeaderGuild from '@/components/Features/HeaderGuild.vue'; const props = defineProps({ guildId: { @@ -54,11 +57,9 @@ onMounted(() => { } }); -watch(() => userStore.userInfo, (newValue, oldValue) => { - if(userStore.userInfo) { - checkGuildAvailability(); - } -}, { immediate: true }); +events.on("UPDATE", () => { + checkGuildAvailability(); +}); function loadInteface() { if(alreadyLoaded.value) return; @@ -99,18 +100,10 @@ function checkGuildAvailability() {