Skip to content

Commit

Permalink
Refactored code
Browse files Browse the repository at this point in the history
  • Loading branch information
VampireAotD committed Nov 2, 2024
1 parent c235e0a commit c841c3d
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Vite;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
Expand All @@ -32,6 +33,7 @@ public function boot(): void
{
$this->enforceMorphAliases();
Model::shouldBeStrict(!$this->app->isProduction());
Vite::prefetch(concurrency: 3);
}

private function setUpElasticsearchClient(): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ defineProps<Props>();

<template>
<div class="flex items-center py-4 space-x-4">
<img :src="anime.image.path" :alt="anime.title" class="w-12 h-16 rounded" />
<img
class="w-12 h-16 rounded"
loading="lazy"
:src="anime.image.path"
:alt="anime.title"
/>

<div class="flex flex-col">
<div class="flex items-center">
Expand Down
11 changes: 9 additions & 2 deletions src/resources/js/pages/Anime/Show.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ const voiceActingList = computed(() =>
</script>

<template>
<Head :title="anime.title" />
<Head>
<title>{{ anime.title }}</title>
<meta property="og:title" :content="anime.title" />
<meta property="og:description" :content="anime.title" />
<meta property="og:image" :content="anime.image.path" />
<meta property="og:url" :content="route('anime.show', anime.id)" />
<meta property="og:type" content="anime" />
</Head>

<AuthenticatedLayout>
<div class="bg-white dark:bg-gray-800 overflow-hidden shadow-sm">
Expand All @@ -33,8 +40,8 @@ const voiceActingList = computed(() =>
<div class="grid grid-cols-1 mb-5">
<div class="px-1 mb-5 lg:mb-0 overflow-hidden">
<img
:src="anime.image.path"
class="w-full sm:w-64 sm:h-80"
:src="anime.image.path"
:alt="anime.title"
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ defineProps<Props>();
<Link :href="route('anime.show', anime.id)">
<img
class="w-full h-72 rounded-lg object-fit"
loading="lazy"
:src="anime.image.path"
:alt="anime.title"
/>
Expand Down
4 changes: 4 additions & 0 deletions src/resources/views/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Anilibrary - service for scraping anime">
<meta name="keywords" content="anilibrary, anime, scraping">

<title inertia>{{ config('app.name', 'anilibrary') }}</title>

<link rel="canonical" href="{{ url()->current() }}">

<!-- Scripts -->
@routes
@vite(['resources/js/app.ts', "resources/js/pages/{$page['component']}.vue"])
Expand Down

0 comments on commit c841c3d

Please sign in to comment.