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"> <div
<slot></slot> 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> </div>

View File

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

View File

@ -1,4 +1,4 @@
export default { export default {
API_ENDPOINT: import.meta.env.VITE_API_ENDPOINT, 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 { init, getLocaleFromNavigator, addMessages, getLocaleFromQueryString } from 'svelte-i18n';
import en from '../languages/en.json' import en from '../languages/en.json';
import id from '../languages/id.json' import id from '../languages/id.json';
addMessages('en', en) addMessages('en', en);
addMessages('en-US', en) addMessages('en-US', en);
addMessages('en-GB', en) addMessages('en-GB', en);
addMessages('id', id) addMessages('id', id);
addMessages('id-ID', id) addMessages('id-ID', id);
init({ init({
fallbackLocale: 'en', fallbackLocale: 'en',

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import { _ } from 'svelte-i18n' import { _ } from 'svelte-i18n';
// This page is meant to guide people on how to use the API. // This page is meant to guide people on how to use the API.
</script> </script>
@ -8,5 +8,8 @@
</svelte:head> </svelte:head>
<section> <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> </section>

View File

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import { _ } from 'svelte-i18n' import { _ } from 'svelte-i18n';
import { goto } from '$app/navigation' import { goto } from '$app/navigation';
import env from '$lib/env'; import env from '$lib/env';
import Codeblock from '../components/codeblock.svelte'; import Codeblock from '../components/codeblock.svelte';
</script> </script>
@ -17,13 +17,12 @@
</div> </div>
<div class="flex-1 px-6"> <div class="flex-1 px-6">
<div class="max-w-xs mx-auto"> <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> </div>
<Codeblock class="px-4 md:px-0 mx-auto"> <Codeblock class="px-4 md:px-0 mx-auto">$ curl -XGET 'https://jokesbapak2.herokuapp.com/v1/'</Codeblock>
$ 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"> <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> </p>
</div> </div>
</div> </div>

View File

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

View File

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

View File

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