diff --git a/README.md b/README.md index 2f32774..1ccd0d8 100644 --- a/README.md +++ b/README.md @@ -43,3 +43,10 @@ pnpm run preview Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information. View Primevue out the [documentation](https://primevue.org/nuxt) for more information. + + +## ikon és splash képernyő +Az assets/ mappát megtarthatod - ha később módosítani akarod az icon-t vagy splash-t, csak cseréld le az assets/icon.png vagy assets/splash.png fájlt, és futtasd újra: + +pnpm capacitor-assets generate --iconBackgroundColor '#262626' --splashBackgroundColor '#262626' +pnpm cap sync diff --git a/assets/icon.png b/assets/icon.png new file mode 100644 index 0000000..d4e9007 Binary files /dev/null and b/assets/icon.png differ diff --git a/assets/splash-dark.png b/assets/splash-dark.png new file mode 100644 index 0000000..d4e9007 Binary files /dev/null and b/assets/splash-dark.png differ diff --git a/assets/splash.png b/assets/splash.png new file mode 100644 index 0000000..d4e9007 Binary files /dev/null and b/assets/splash.png differ diff --git a/composables/useAuthToken.ts b/composables/useAuthToken.ts index 8c5211f..d070a84 100644 --- a/composables/useAuthToken.ts +++ b/composables/useAuthToken.ts @@ -1,37 +1,14 @@ const AUTH_KEY = '_auth' -// Platform ellenőrzés - csak kliens oldalon -const isNative = (): boolean => { - if (typeof window === 'undefined') return false - try { - const { Capacitor } = require('@capacitor/core') - return Capacitor.isNativePlatform() - } catch { - return false - } -} - export const useAuthToken = () => { const token = ref(null) const isLoaded = ref(false) - // Token betöltése + // Token betöltése - LocalStorage (működik web + native) const loadToken = async (): Promise => { - // SSR esetén ne csináljunk semmit - if (typeof window === 'undefined') { - return null - } + if (typeof window === 'undefined') return null - if (isNative()) { - // Natív app: Preferences használata - const { Preferences } = await import('@capacitor/preferences') - const { value } = await Preferences.get({ key: AUTH_KEY }) - token.value = value - } else { - // Web: Cookie használata - const cookie = useCookie(AUTH_KEY) - token.value = cookie.value || null - } + token.value = localStorage.getItem(AUTH_KEY) isLoaded.value = true return token.value } @@ -41,13 +18,7 @@ export const useAuthToken = () => { if (typeof window === 'undefined') return token.value = newToken - if (isNative()) { - const { Preferences } = await import('@capacitor/preferences') - await Preferences.set({ key: AUTH_KEY, value: newToken }) - } else { - const cookie = useCookie(AUTH_KEY, { maxAge: 60 * 60 * 24 * 365 }) // 1 év - cookie.value = newToken - } + localStorage.setItem(AUTH_KEY, newToken) } // Token törlése (kijelentkezés) @@ -55,13 +26,7 @@ export const useAuthToken = () => { if (typeof window === 'undefined') return token.value = null - if (isNative()) { - const { Preferences } = await import('@capacitor/preferences') - await Preferences.remove({ key: AUTH_KEY }) - } else { - const cookie = useCookie(AUTH_KEY) - cookie.value = null - } + localStorage.removeItem(AUTH_KEY) } // Getter a token értékhez diff --git a/icons/icon-128.webp b/icons/icon-128.webp new file mode 100644 index 0000000..5ca2a2b Binary files /dev/null and b/icons/icon-128.webp differ diff --git a/icons/icon-192.webp b/icons/icon-192.webp new file mode 100644 index 0000000..f1c44ff Binary files /dev/null and b/icons/icon-192.webp differ diff --git a/icons/icon-256.webp b/icons/icon-256.webp new file mode 100644 index 0000000..3a6f045 Binary files /dev/null and b/icons/icon-256.webp differ diff --git a/icons/icon-48.webp b/icons/icon-48.webp new file mode 100644 index 0000000..1697c45 Binary files /dev/null and b/icons/icon-48.webp differ diff --git a/icons/icon-512.webp b/icons/icon-512.webp new file mode 100644 index 0000000..f2bdda4 Binary files /dev/null and b/icons/icon-512.webp differ diff --git a/icons/icon-72.webp b/icons/icon-72.webp new file mode 100644 index 0000000..b1b819b Binary files /dev/null and b/icons/icon-72.webp differ diff --git a/icons/icon-96.webp b/icons/icon-96.webp new file mode 100644 index 0000000..2e5ab94 Binary files /dev/null and b/icons/icon-96.webp differ diff --git a/package.json b/package.json index a35ca86..93ebb4c 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "@capacitor/android": "^8.0.0", "@capacitor/app": "^8.0.0", "@capacitor/core": "^8.0.0", + "@capacitor/device": "^8.0.0", "@capacitor/haptics": "^8.0.0", "@capacitor/ios": "^8.0.0", "@capacitor/preferences": "^8.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9cd6e7c..59b8220 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,6 +17,9 @@ importers: '@capacitor/core': specifier: ^8.0.0 version: 8.0.0 + '@capacitor/device': + specifier: ^8.0.0 + version: 8.0.0(@capacitor/core@8.0.0) '@capacitor/haptics': specifier: ^8.0.0 version: 8.0.0(@capacitor/core@8.0.0) @@ -674,6 +677,11 @@ packages: '@capacitor/core@8.0.0': resolution: {integrity: sha512-250HTVd/W/KdMygoqaedisvNbHbpbQTN2Hy/8ZYGm1nAqE0Fx7sGss4l0nDg33STxEdDhtVRoL2fIaaiukKseA==} + '@capacitor/device@8.0.0': + resolution: {integrity: sha512-qFmlTDnAvUwIg93YUF3u3ovqpDFqUl2RFkf2dVIF8Py7vTA+GjQIHQWITcBKfeUENoVXPNn04t5nxg5mAkjNEA==} + peerDependencies: + '@capacitor/core': '>=8.0.0' + '@capacitor/haptics@8.0.0': resolution: {integrity: sha512-DY1IUOjke1T4ITl7mFHQIKCaJJyHYAYRYHG9bVApU7PDOZiMVGMp48Yjzdqjya+wv/AHS5mDabSTUmhJ5uDvBA==} peerDependencies: @@ -6640,6 +6648,10 @@ snapshots: dependencies: tslib: 2.8.1 + '@capacitor/device@8.0.0(@capacitor/core@8.0.0)': + dependencies: + '@capacitor/core': 8.0.0 + '@capacitor/haptics@8.0.0(@capacitor/core@8.0.0)': dependencies: '@capacitor/core': 8.0.0 diff --git a/public/manifest.webmanifest b/public/manifest.webmanifest new file mode 100644 index 0000000..dff93d6 --- /dev/null +++ b/public/manifest.webmanifest @@ -0,0 +1,47 @@ +{ + "background_color": "#262626", + "icons": [ + { + "src": "../icons/icon-48.webp", + "type": "image/png", + "sizes": "48x48", + "purpose": "any maskable" + }, + { + "src": "../icons/icon-72.webp", + "type": "image/png", + "sizes": "72x72", + "purpose": "any maskable" + }, + { + "src": "../icons/icon-96.webp", + "type": "image/png", + "sizes": "96x96", + "purpose": "any maskable" + }, + { + "src": "../icons/icon-128.webp", + "type": "image/png", + "sizes": "128x128", + "purpose": "any maskable" + }, + { + "src": "../icons/icon-192.webp", + "type": "image/png", + "sizes": "192x192", + "purpose": "any maskable" + }, + { + "src": "../icons/icon-256.webp", + "type": "image/png", + "sizes": "256x256", + "purpose": "any maskable" + }, + { + "src": "../icons/icon-512.webp", + "type": "image/png", + "sizes": "512x512", + "purpose": "any maskable" + } + ] +} diff --git a/resources/euro_cars_rent_a_car_logo.svg b/resources/euro_cars_rent_a_car_logo.svg new file mode 100644 index 0000000..990b344 --- /dev/null +++ b/resources/euro_cars_rent_a_car_logo.svg @@ -0,0 +1 @@ +euro_cars_rent_a_car_logo \ No newline at end of file