diff --git a/app.vue b/app.vue new file mode 100644 index 0000000..3ae6471 --- /dev/null +++ b/app.vue @@ -0,0 +1,11 @@ + diff --git a/assets/css/main.css b/assets/css/main.css new file mode 100644 index 0000000..824876f --- /dev/null +++ b/assets/css/main.css @@ -0,0 +1,3 @@ +.dark img { + filter: brightness(1.1) contrast(0.9); +} diff --git a/components/ui/aspect-ratio/AspectRatio.vue b/components/ui/aspect-ratio/AspectRatio.vue new file mode 100644 index 0000000..c3295c1 --- /dev/null +++ b/components/ui/aspect-ratio/AspectRatio.vue @@ -0,0 +1,14 @@ + + + diff --git a/components/ui/aspect-ratio/index.ts b/components/ui/aspect-ratio/index.ts new file mode 100644 index 0000000..3faf121 --- /dev/null +++ b/components/ui/aspect-ratio/index.ts @@ -0,0 +1 @@ +export { default as AspectRatio } from './AspectRatio.vue' diff --git a/components/ui/navbar/Navbar.vue b/components/ui/navbar/Navbar.vue index b9c0e73..780dd5b 100644 --- a/components/ui/navbar/Navbar.vue +++ b/components/ui/navbar/Navbar.vue @@ -1,32 +1,34 @@ \ No newline at end of file + diff --git a/nuxt.config.ts b/nuxt.config.ts index 92fc551..954634e 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -8,7 +8,10 @@ export default defineNuxtConfig({ colorMode: { classSuffix: '' }, - css: ['~/assets/css/tailwind.css'], + css: [ + '~/assets/css/tailwind.css', + '~/assets/css/main.css', + ], vite: { plugins: [ tailwindcss(), diff --git a/pages/index.vue b/pages/index.vue index 1277988..bd94fe5 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -3,85 +3,78 @@ import kodikImage from "assets/img/kodik.png"; import shikimoriImage from "assets/img/shikimori.png"; import { - Select, - SelectContent, - SelectGroup, - SelectItem, - SelectLabel, - SelectTrigger, - SelectValue + Select, + SelectContent, + SelectGroup, + SelectItem, + SelectLabel, + SelectTrigger, + SelectValue } from "~/components/ui/select"; import { toast } from "vue-sonner"; -import { Toaster } from "~/components/ui/sonner"; -import { Navbar } from "~/components/ui/navbar"; import 'vue-sonner/style.css' import { Icon } from "#components"; const router = useRouter() const searchProvider = ref('kodik') const displaySearchProvider = computed(() => { - let label = ''; - let image; - if (searchProvider.value === 'kodik') { - label = 'Kodik'; - image = kodikImage; - } - if (searchProvider.value === 'shikimori') { - label = 'Shikimori'; - image = shikimoriImage; - } - return { - label, - image - } + let label = ''; + let image; + if (searchProvider.value === 'kodik') { + label = 'Kodik'; + image = kodikImage; + } + if (searchProvider.value === 'shikimori') { + label = 'Shikimori'; + image = shikimoriImage; + } + return { + label, + image + } }) const search = defineModel("") function querySearch() { - if (!search.value || search.value.trim() === "") { - toast('Please enter a value'); - return; - } - router.push({ path: '/search', query: { title: search.value, provider: searchProvider.value } }) - .catch(err => { - console.error('Navigation error:', err); - toast.error('Failed to navigate to search results'); - }); + if (!search.value || search.value.trim() === "") { + toast('Please enter a value'); + return; + } + router.push({ path: '/search', query: { title: search.value, provider: searchProvider.value } }) + .catch(err => { + console.error('Navigation error:', err); + toast.error('Failed to navigate to search results'); + }); } diff --git a/pages/search.vue b/pages/search.vue index aa4ff44..edba0d2 100644 --- a/pages/search.vue +++ b/pages/search.vue @@ -9,50 +9,53 @@ const isLoading = ref(false) const error = ref(null) watchEffect(async () => { - if (!searchQuery.value) return + if (!searchQuery.value) return - try { - isLoading.value = true - error.value = null - const response = await search({ title: searchQuery.value }) - results.value = response.data.results || [] - } catch (err) { - error.value = err - console.error('Search failed:', err) - } finally { - isLoading.value = false - } + try { + isLoading.value = true + error.value = null + const response = await search({ title: searchQuery.value }) + results.value = response.data.results || [] + } catch (err) { + error.value = err + console.error('Search failed:', err) + } finally { + isLoading.value = false + } })