diff options
Diffstat (limited to 'widget/src')
-rw-r--r-- | widget/src/App.vue | 21 | ||||
-rw-r--r-- | widget/src/index.scss | 32 | ||||
-rw-r--r-- | widget/src/main.ts | 58 | ||||
-rw-r--r-- | widget/src/store/index.ts | 30 | ||||
-rw-r--r-- | widget/src/vite-env.d.ts | 1 |
5 files changed, 142 insertions, 0 deletions
diff --git a/widget/src/App.vue b/widget/src/App.vue new file mode 100644 index 0000000..647c904 --- /dev/null +++ b/widget/src/App.vue @@ -0,0 +1,21 @@ +<script setup lang="ts"> +import { storeToRefs } from 'pinia'; +import { useStore, TabId } from './store'; +import { computed, defineAsyncComponent } from 'vue'; +import { isEqual } from 'lodash-es'; +import { useDark } from '@vueuse/core'; + +const store = useStore(); +const { } = storeToRefs(store); +const darkMode = useDark() + +</script> + +<template> + <head> + <title>Simple Bookmark Wiget</title> + </head> + <body> + + </body> +</template>
\ No newline at end of file diff --git a/widget/src/index.scss b/widget/src/index.scss new file mode 100644 index 0000000..0b86ea1 --- /dev/null +++ b/widget/src/index.scss @@ -0,0 +1,32 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +@import './buttons.scss'; + +.otp-input { + @apply rounded-sm gap-2; + + input { + @apply w-12 h-12 p-2 text-center text-2xl; + @apply dark:bg-gray-700 border dark:text-white; + appearance: none; + -webkit-appearance: none; + } +} + + .input { + @apply bg-transparent border border-gray-300 text-gray-900 text-sm rounded focus:ring-blue-500 focus:border-blue-500 block w-full p-2 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500; + + &.dirty:focus{ + @apply bg-green-50 border-green-500 text-green-900 dark:text-green-400 placeholder-green-700 dark:placeholder-green-500 focus:ring-green-500 focus:border-green-500 dark:bg-gray-700 dark:border-green-500; + } + + &.dirty.error{ + @apply bg-red-50 border-red-500 text-red-900 placeholder-red-700 focus:ring-red-500 dark:bg-gray-700 focus:border-red-500 dark:text-red-500 dark:placeholder-red-500 dark:border-red-500; + } +} + +.bl-link{ + @apply text-blue-500 hover:text-blue-600 dark:text-blue-400 dark:hover:text-blue-500 hover:underline duration-75 ease-linear; +}
\ No newline at end of file diff --git a/widget/src/main.ts b/widget/src/main.ts new file mode 100644 index 0000000..3e8f1a2 --- /dev/null +++ b/widget/src/main.ts @@ -0,0 +1,58 @@ +// Copyright (C) 2024 Vaughn Nugent +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see <https://www.gnu.org/licenses/>. + + +//Get the create app from boostrap dir +import { configureApi } from '@vnuge/vnlib.browser' +import { createApp } from "vue"; +import { useDark } from "@vueuse/core"; +import { createPinia } from "pinia"; +import { oauth2AppsPlugin } from './store/oauthAppsPlugin' + +import App from './App.vue' +//Import your main style file +import './index.scss' + +import { profilePlugin } from './store/userProfile' +import { mfaSettingsPlugin } from './store/mfaSettingsPlugin' +import { socialMfaPlugin } from './store/socialMfaPlugin' +import { bookmarkPlugin } from './store/bookmarks' +import { registationPlugin } from './store/registation'; +import { siteLookupPlugin } from './store/websiteLookup'; + +//Setup the vnlib api +configureApi({ + axios: { + //The base url to make api requests against + baseURL: import.meta.env.VITE_API_URL, + withCredentials: import.meta.env.VITE_CORS_ENABLED === 'true', + }, + storage: localStorage +}) + +//Import vuetify stuff + +const store = createPinia(); + +//Enable dark mode support +useDark({ + selector: 'html', + valueDark: 'dark', + valueLight: 'light', +}); + +createApp(App) + .use(store) //Add pinia to the app + .mount('#app') //Mount the app to the #app element
\ No newline at end of file diff --git a/widget/src/store/index.ts b/widget/src/store/index.ts new file mode 100644 index 0000000..9eae41b --- /dev/null +++ b/widget/src/store/index.ts @@ -0,0 +1,30 @@ +// Copyright (C) 2024 Vaughn Nugent +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see <https://www.gnu.org/licenses/>. + +import { toRefs, set, watchDebounced, useLocalStorage } from "@vueuse/core"; +import { toSafeInteger, toString, defaults } from "lodash-es"; +import { defineStore } from "pinia"; +import { computed, shallowRef, watch } from "vue"; + + +/** + * Loads the main store for the application + */ +export const useStore = defineStore('main', () => { + + return{ + + } +}) diff --git a/widget/src/vite-env.d.ts b/widget/src/vite-env.d.ts new file mode 100644 index 0000000..151aa68 --- /dev/null +++ b/widget/src/vite-env.d.ts @@ -0,0 +1 @@ +/// <reference types="vite/client" />
\ No newline at end of file |