diff --git a/web/public/cookie.svg b/web/public/cookie.svg new file mode 100644 index 0000000..0aab4a6 --- /dev/null +++ b/web/public/cookie.svg @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/web/src/App.vue b/web/src/App.vue index daf1b11..fa4b81f 100644 --- a/web/src/App.vue +++ b/web/src/App.vue @@ -2,9 +2,10 @@ import {defineComponent, Ref, ref, SetupContext} from 'vue'; import DebugLog from "./classes/debugger"; import Settings from "./components/Settings.vue"; +import cookiePrompt from "./components/cookiePrompt.vue"; export default defineComponent({ - components: {Settings, GameInput, AttemptList}, + components: {Settings, cookiePrompt}, setup() { var showSettings:Ref = ref(false); @@ -35,7 +36,7 @@ export default defineComponent({ const attemptList = ref | null>(null); - return { showSettings, toggleSettings, attemptList }; + return { showSettings, toggleSettings }; }, }); @@ -48,6 +49,7 @@ export default defineComponent({ + diff --git a/web/src/classes/debugger.js b/web/src/classes/debugger.js deleted file mode 100644 index bdc6d9c..0000000 --- a/web/src/classes/debugger.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Used to log values given as parameter - * Function triggers when debug is set to true in local storage - * @param debugLogs An array of type debugInput logged - */ -function DebugLog(debugLogs) { - if (localStorage.getItem("debug") === "true") { - console.log("========================== [ fetched settings values from document ] =========================="); - debugLogs.forEach((log) => { - console.log(log.logText, log.logValue); - }); - console.log("==============================================================================================="); - } -} -export default DebugLog; -//# sourceMappingURL=debugger.js.map \ No newline at end of file diff --git a/web/src/classes/language.js b/web/src/classes/language.js deleted file mode 100644 index 4c16e06..0000000 --- a/web/src/classes/language.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Handles getting the correct localized string for the requested key - * @param textKey The key for which text should be fetched - * @returns The localized text as a string - */ -async function GetLocalizedText(textKey) { - try { - // Dynamically import the JSON data and cast it to LocalizationData - const jsonData = (await import("../assets/language.json")).default; - // Return a new Promise - return new Promise((resolve, reject) => { - // Get the language from the 'data-language' attribute, default to "en" - const lang = document.documentElement.getAttribute("data-language") ?? "en"; - // Construct the key based on the language and textKey - const localizedText = jsonData[`${lang}_${textKey}`]; - // Check if the localized text exists - if (localizedText) { - resolve(localizedText); // Resolve with the localized text - } - else { - reject(`No localized text found for key: ${lang}_${textKey}`); // Reject if not found - } - }); - } - catch (error) { - // Handle any errors from importing the JSON file - return Promise.reject(`Failed to load localization with error: ${error}`); - } -} -export default GetLocalizedText; -//# sourceMappingURL=language.js.map \ No newline at end of file diff --git a/web/src/classes/settings.ts b/web/src/classes/settings.ts index 985e747..4535a32 100644 --- a/web/src/classes/settings.ts +++ b/web/src/classes/settings.ts @@ -7,9 +7,9 @@ enum SettingNodes { /** * class which handles reading and writing settings */ -class SettingsHandler { +class SettingsHandler implements ISettings{ - settings:Map + settings:Map constructor() { this.settings = new Map(); // TODO: load settings from localstorage if any present @@ -20,7 +20,7 @@ class SettingsHandler { * @param name the settings name * @param value */ - writeSetting(name:SettingNodes, value:any):boolean { + WriteSetting(name:SettingNodes, value:any):boolean { return false } @@ -28,7 +28,7 @@ class SettingsHandler { * fetches settings from the localstorage and handles errors * @param name the requested setting */ - fetchSettings(name:SettingNodes):any { + FetchSetting(name:SettingNodes):any { return "" } } \ No newline at end of file diff --git a/web/src/components/cookiePrompt.vue b/web/src/components/cookiePrompt.vue new file mode 100644 index 0000000..4563614 --- /dev/null +++ b/web/src/components/cookiePrompt.vue @@ -0,0 +1,57 @@ + + + + + \ No newline at end of file diff --git a/web/src/interfaces/ISettings.ts b/web/src/interfaces/ISettings.ts new file mode 100644 index 0000000..30a35db --- /dev/null +++ b/web/src/interfaces/ISettings.ts @@ -0,0 +1,4 @@ +interface ISettings { + WriteSetting: (name:SettingNodes, value:any) => boolean; + FetchSetting: (name:SettingNodes) => any; +} \ No newline at end of file diff --git a/web/src/main.js b/web/src/main.js deleted file mode 100644 index 1e44123..0000000 --- a/web/src/main.js +++ /dev/null @@ -1,7 +0,0 @@ -import { createApp } from 'vue'; -import './style.css'; -import App from './App.vue'; -const app = createApp(App); -// Mount the app -app.mount('#app'); -//# sourceMappingURL=main.js.map \ No newline at end of file diff --git a/web/theme-manager.config.js b/web/theme-manager.config.js deleted file mode 100644 index d63bfcd..0000000 --- a/web/theme-manager.config.js +++ /dev/null @@ -1,38 +0,0 @@ -// add the names of the themes you want to use here -// warning: you need to specify them in tailwind.config.js as well -// DO NOT REMOVE: 'default', 'light', 'dark' -export default [ - 'default', - 'light', - 'dark', - 'storm', - 'breeze', - 'cupcake', - 'bumblebee', - 'emerald', - 'corporate', - 'synthwave', - 'retro', - 'cyberpunk', - 'valentine', - 'halloween', - 'garden', - 'forest', - 'aqua', - 'lofi', - 'pastel', - 'fantasy', - 'wireframe', - 'black', - 'luxury', - 'dracula', - 'cmyk', - 'autumn', - 'business', - 'acid', - 'lemonade', - 'night', - 'coffee', - 'winter', -]; -//# sourceMappingURL=theme-manager.config.js.map \ No newline at end of file