style: run prettier

This commit is contained in:
Reinaldy Rafli 2021-07-15 16:40:34 +07:00
parent c9f9452227
commit ffef69d773
15 changed files with 107 additions and 95 deletions

View File

@ -1,3 +1,5 @@
<div class="bg-gray-900 font-code px-4 md:px-8 py-6 rounded-lg text-white overflow-ellipsis whitespace-nowrap overflow-x-scroll md:overflow-auto shadow-xl bg-gradient-to-br from-transparent to-gray-800">
<slot></slot>
<div
class="bg-gray-900 font-code px-4 md:px-8 py-6 rounded-lg text-white overflow-ellipsis whitespace-nowrap overflow-x-scroll md:overflow-auto shadow-xl bg-gradient-to-br from-transparent to-gray-800"
>
<slot />
</div>

View File

@ -1,6 +1,6 @@
<script lang="ts">
import { goto } from "$app/navigation";
import { _ } from "svelte-i18n";
import { goto } from '$app/navigation';
import { _ } from 'svelte-i18n';
// TODO: Create hamburger navigation (I know, just bit lazy on this one)
</script>

View File

@ -1,4 +1,4 @@
export default {
API_ENDPOINT: import.meta.env.VITE_API_ENDPOINT,
SENTRY_DSN: import.meta.env.VITE_SENTRY_DSN
}
SENTRY_DSN: import.meta.env.VITE_SENTRY_DSN,
};

View File

@ -1,13 +1,13 @@
import { init, getLocaleFromNavigator, addMessages, getLocaleFromQueryString } from 'svelte-i18n';
import en from '../languages/en.json'
import id from '../languages/id.json'
import en from '../languages/en.json';
import id from '../languages/id.json';
addMessages('en', en)
addMessages('en-US', en)
addMessages('en-GB', en)
addMessages('id', id)
addMessages('id-ID', id)
addMessages('en', en);
addMessages('en-US', en);
addMessages('en-GB', en);
addMessages('id', id);
addMessages('id-ID', id);
init({
fallbackLocale: 'en',

View File

@ -1,9 +1,9 @@
import * as Sentry from "@sentry/browser";
import env from "./env";
import * as Sentry from '@sentry/browser';
import env from './env';
Sentry.init({
dsn: String(env.SENTRY_DSN),
tracesSampleRate: 0.5,
});
export default Sentry
export default Sentry;

View File

@ -3,13 +3,13 @@
import Sentry from '$lib/logging';
export async function load({ error }: LoadOutput): Promise<void> {
Sentry.captureException(error)
Sentry.captureException(error);
}
</script>
<script lang="ts">
import { goto } from '$app/navigation'
import { _ } from 'svelte-i18n'
import { goto } from '$app/navigation';
import { _ } from 'svelte-i18n';
</script>
<section>

View File

@ -1,16 +1,18 @@
<script lang="ts" context="module">
import '$lib/locale'
import '$lib/locale';
</script>
<script lang="ts">
//import '../locale'
import '@fontsource/fira-mono'
import '@fontsource/rubik'
import '@fontsource/fira-mono';
import '@fontsource/rubik';
import { _ } from 'svelte-i18n';
import Navbar from '../components/navbar.svelte';
</script>
<div class="bg-gradient-to-br from-transparent to-lavender-300 dark:(bg-gray-900 to-lavender-900 text-white) min-h-screen h-full w-full">
<div
class="bg-gradient-to-br from-transparent to-lavender-300 dark:(bg-gray-900 to-lavender-900 text-white) min-h-screen h-full w-full"
>
<div class="container mx-auto lg:px-40 md:20 sm:px-12 px-8">
<header>
<Navbar />
@ -21,8 +23,10 @@ import { _ } from 'svelte-i18n';
<footer class="font-body py-8">
<p class="text-sm opacity-50 hover:opacity-90 transition duration-300 ease-in-out">
{$_('footer.made')} <span class="text-red-500">&#10084;</span> {$_('footer.indonesia')}.
{$_('footer.available')} <a href="https://www.github.com/aldy505/jokes-bapak2-api" class="hover:underline">{$_('footer.github')}</a>.
{$_('footer.made')} <span class="text-red-500">&#10084;</span>
{$_('footer.indonesia')}.
{$_('footer.available')}
<a href="https://www.github.com/aldy505/jokes-bapak2-api" class="hover:underline">{$_('footer.github')}</a>.
</p>
</footer>
</div>

View File

@ -1,8 +1,8 @@
<script lang="ts">
// This page is meant to explain available API endpoints.
import { _ } from 'svelte-i18n'
import env from '$lib/env'
import Codeblock from '../components/codeblock.svelte'
import { _ } from 'svelte-i18n';
import env from '$lib/env';
import Codeblock from '../components/codeblock.svelte';
</script>
<svelte:head>

View File

@ -1,5 +1,5 @@
<script lang="ts">
import { _ } from 'svelte-i18n'
import { _ } from 'svelte-i18n';
// This page is meant to guide people on how to use the API.
</script>
@ -8,5 +8,8 @@
</svelte:head>
<section>
<p class="text-lg py-4">Sorry for the inconvinience. For now, please refer to the <a class="underline" href="/api">API</a> first. I'll work on this page later on.</p>
<p class="text-lg py-4">
Sorry for the inconvinience. For now, please refer to the <a class="underline" href="/api">API</a> first. I'll work on
this page later on.
</p>
</section>

View File

@ -1,6 +1,6 @@
<script lang="ts">
import { _ } from 'svelte-i18n'
import { goto } from '$app/navigation'
import { _ } from 'svelte-i18n';
import { goto } from '$app/navigation';
import env from '$lib/env';
import Codeblock from '../components/codeblock.svelte';
</script>
@ -17,13 +17,12 @@
</div>
<div class="flex-1 px-6">
<div class="max-w-xs mx-auto">
<img src={env.API_ENDPOINT + `/today`} alt="Sample joke" class="py-6 shadow-2xl">
<img src={env.API_ENDPOINT + `/today`} alt="Sample joke" class="py-6 shadow-2xl" />
</div>
<Codeblock class="px-4 md:px-0 mx-auto">
$ curl -XGET 'https://jokesbapak2.herokuapp.com/v1/'
</Codeblock>
<Codeblock class="px-4 md:px-0 mx-auto">$ curl -XGET 'https://jokesbapak2.herokuapp.com/v1/'</Codeblock>
<p class="text-sm text-center py-4 opacity-70 hover:opacity-100 transition duration-300 ease-in-out">
{$_('home.more.1')} <span on:click={() => goto('/guide')}>{$_('navigation.guide')}</span> {$_('home.more.2')} <span on:click={() => goto('/api')}>{$_('navigation.api')}</span>
{$_('home.more.1')} <span on:click={() => goto('/guide')}>{$_('navigation.guide')}</span>
{$_('home.more.2')} <span on:click={() => goto('/api')}>{$_('navigation.api')}</span>
</p>
</div>
</div>

View File

@ -1,5 +1,5 @@
<script lang="ts">
import { _ } from 'svelte-i18n'
import { _ } from 'svelte-i18n';
</script>
<svelte:head>
@ -12,13 +12,17 @@
<p>{$_('why.exists.body.5')} {$_('why.exists.body.6')}</p>
<h1 id="can-i-submit-my-dad-joke">{$_('why.submit.title')}</h1>
<p>
{$_('why.submit.body.1')} {$_('why.submit.body.2')}
{$_('why.submit.body.1')}
{$_('why.submit.body.2')}
<a href="mailto:aldy505@tutanota.com">{$_('why.submit.body.3')}</a>
{$_('why.submit.body.4')} {$_('why.submit.body.5')} {$_('why.submit.body.6')}
{$_('why.submit.body.4')}
{$_('why.submit.body.5')}
{$_('why.submit.body.6')}
</p>
<h1 id="can-i-contribute">{$_('why.contribute.title')}</h1>
<p>
{$_('why.contribute.body.1')} {$_('why.contribute.body.2')}
{$_('why.contribute.body.1')}
{$_('why.contribute.body.2')}
<a href="https://www.github.com/aldy505/jokes-bapak2-api">{$_('why.contribute.body.3')}</a>
{$_('why.contribute.body.4')}
</p>

View File

@ -10,7 +10,7 @@ const config = {
windi({
configPath: './windi.config.js',
}),
preprocess({ postcss: false })
preprocess({ postcss: false }),
],
kit: {
@ -22,7 +22,7 @@ const config = {
routes: './src/routes',
assets: './static',
hooks: './src',
lib: './src/lib'
lib: './src/lib',
},
adapter: adapter({
// default options are shown

View File

@ -1,4 +1,4 @@
import { defineConfig } from 'windicss/helpers'
import { defineConfig } from 'windicss/helpers';
export default defineConfig({
darkMode: 'media',
@ -50,8 +50,8 @@ export default defineConfig({
700: '#b77fb8',
800: '#926593',
900: '#785378',
}
}
}
}
})
},
},
},
},
});