search engine things

This commit is contained in:
Daniel Bulant 2022-12-10 18:30:40 +01:00
parent 56f1d3cca2
commit 39afafacab
7 changed files with 49 additions and 5 deletions

View file

@ -1,7 +1,10 @@
<script> <script>
import { afterNavigate } from "$app/navigation"; import { afterNavigate } from "$app/navigation";
import { logs } from "$lib/util/logs"; import { logs } from "$lib/util/logs";
import PageTransition from "./pageTransition.svelte";
export var data;
let skipFirst = true; let skipFirst = true;
let last = typeof window !== "undefined" && window.location.pathname; let last = typeof window !== "undefined" && window.location.pathname;
afterNavigate(page => { afterNavigate(page => {
@ -35,7 +38,9 @@
</script> </script>
<div class:dark={darkmode} class="main"> <div class:dark={darkmode} class="main">
<slot /> <PageTransition url={data.url}>
<slot />
</PageTransition>
</div> </div>
{#if $logs.length} {#if $logs.length}

6
src/routes/+layout.ts Normal file
View file

@ -0,0 +1,6 @@
/** @type {import('./$types').PageLoad} */
export function load({ url }) {
return { url: url.pathname };
}

View file

@ -119,7 +119,7 @@
<svelte:head> <svelte:head>
<title>Mangadex search & downloader</title> <title>Mangadex search & downloader</title>
<meta name="description" value="Read manga from Mangadex online, or download it as EPUB or CBZ file to read it on your e-reader." /> <meta name="description" content="Read manga from Mangadex online, or download it as EPUB or CBZ file to read it on your e-reader." />
</svelte:head> </svelte:head>
<Navbar bind:name {open} hostname={data.url.hostname} /> <Navbar bind:name {open} hostname={data.url.hostname} />
@ -165,6 +165,8 @@
Sign in via Anilist to view your manga list and search for manga online. You can still read manga or download it without signing in using direct mangadex URLs. Sign in via Anilist to view your manga list and search for manga online. You can still read manga or download it without signing in using direct mangadex URLs.
</p> </p>
{/if} {/if}
<a href="/about" class="about">About</a>
</main> </main>
<style lang="postcss"> <style lang="postcss">
@ -183,7 +185,7 @@
margin-bottom: 5px; margin-bottom: 5px;
} }
a:not(.button) { a:not(.button) {
color: rgb(33, 50, 87); color: rgb(86, 139, 255);
text-decoration: underline; text-decoration: underline;
} }
a:hover:not(.button) { a:hover:not(.button) {
@ -193,4 +195,14 @@
main { main {
padding-bottom: 1rem; padding-bottom: 1rem;
} }
a.about {
display: block;
text-align: right;
margin-top: 1rem;
color: white;
font-size: 1.4rem;
}
a.about:visited {
color: white;
}
</style> </style>

View file

@ -208,7 +208,7 @@
<svelte:head> <svelte:head>
<title>{title} Chapter {chapter.attributes.chapter} Page {page}</title> <title>{title} Chapter {chapter.attributes.chapter} Page {page}</title>
<meta name="description" value="Read page {page} of chapter {chapter.attributes.chapter} of {title} online. Free of charge and ads." /> <meta name="description" content="Read page {page} of chapter {chapter.attributes.chapter} of {title} online. Free of charge and ads." />
</svelte:head> </svelte:head>
<div class="top"> <div class="top">

View file

@ -1,3 +1,7 @@
<svelte:head>
<title>Mangadex search & downloader - About</title>
<meta name="description" content="About page. Read manga from Mangadex online, or download it as EPUB or CBZ file to read it on your e-reader." />
</svelte:head>
<main> <main>
<h1>Manga reader</h1> <h1>Manga reader</h1>

View file

@ -0,0 +1,14 @@
<script>
import { fade } from "svelte/transition";
export let url = "";
</script>
{#key url}
<div
in:fade={{ opacity: 1, duration: 200, delay: 150 }}
out:fade={{ opacity: 0, duration: 200 }}
class="absolute bg-inherit w-full"
>
<slot />
</div>
{/key}

View file

@ -1,4 +1,7 @@
# https://www.robotstxt.org/robotstxt.html # https://www.robotstxt.org/robotstxt.html
User-agent: * User-agent: *
Allow: / Allow: /
Disallow: /* Disallow: /*
Allow: /?search=
Allow: /random
Allow: /about