CHORE: Starting to get to work with changing some of the old formatting over to tailwind config
This commit is contained in:
		@@ -1,17 +1,23 @@
 | 
			
		||||
<script lang="ts">
 | 
			
		||||
	import Toasts from "$lib/components/Toasts/Toasts.svelte";
 | 
			
		||||
    import ThemeSwitcher from "$lib/components/ThemeSwitcher.svelte";
 | 
			
		||||
    import "../app.css";
 | 
			
		||||
    import { ToastContainer, FlatToast } from 'svelte-toasts';
 | 
			
		||||
    import '../app.css';
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<nav>
 | 
			
		||||
    <a href = "/">//Profile</a>
 | 
			
		||||
    <a href = "/repos">//Repos</a>
 | 
			
		||||
    <a href = "/contact">//Contact</a>
 | 
			
		||||
    <ThemeSwitcher />
 | 
			
		||||
</nav>
 | 
			
		||||
<div
 | 
			
		||||
    class="min-h-screen px-8 py-4 bg-white text-slate-600 dark:bg-slate-900/90 dark:text-slate-200/60 md:text-2xl sm:text-md font-mono flex flex-col gap-5 transition duration-1000 ease-in-out"
 | 
			
		||||
>
 | 
			
		||||
    <nav
 | 
			
		||||
        class="w-full px-8 py-4 flex gap-10 text-xl justify-center items-center text-green-600 font-semibold"
 | 
			
		||||
    >
 | 
			
		||||
        <a href="/" class="hover:underline">//Profile</a>
 | 
			
		||||
        <a href="/repos" class="hover:underline">//Repos</a>
 | 
			
		||||
        <a href="/contact" class="hover:underline">//Contact</a>
 | 
			
		||||
    </nav>
 | 
			
		||||
 | 
			
		||||
<div class="container mx-auto">
 | 
			
		||||
    <Toasts />
 | 
			
		||||
    <slot />
 | 
			
		||||
    <div class="container mx-auto justify-center items-center flex flex-col">
 | 
			
		||||
        <slot />
 | 
			
		||||
        <ToastContainer let:data>
 | 
			
		||||
            <FlatToast {data} />
 | 
			
		||||
        </ToastContainer>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
 
 | 
			
		||||
@@ -2,4 +2,6 @@
 | 
			
		||||
    import Main from '../main.svelte';
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<Main></Main>
 | 
			
		||||
<div>
 | 
			
		||||
    <Main></Main>
 | 
			
		||||
</div>
 | 
			
		||||
@@ -1,149 +1,14 @@
 | 
			
		||||
<script lang="ts">
 | 
			
		||||
    import Card from '$lib/components/Cards/Card.svelte';
 | 
			
		||||
    import { Toast, ToastType } from '$lib/toast';
 | 
			
		||||
    import { addToast } from '$lib/stores';
 | 
			
		||||
 | 
			
		||||
    import { page } from '$app/stores';
 | 
			
		||||
    const sent = $page.url.searchParams.get('sent');
 | 
			
		||||
 | 
			
		||||
    if (sent == 'true') {
 | 
			
		||||
        addToast(
 | 
			
		||||
            new Toast(
 | 
			
		||||
                'Thank you! Your E-Mail has been sent. I will reply as soon as possible!',
 | 
			
		||||
                ToastType.Success,
 | 
			
		||||
                true,
 | 
			
		||||
                5000
 | 
			
		||||
            )
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
    // Can't use else otherwise the warning will display on load
 | 
			
		||||
    if (sent == 'false') {
 | 
			
		||||
        addToast(
 | 
			
		||||
    new Toast(
 | 
			
		||||
        'Sorry, your E-Mail could not be sent... Please try again later!',
 | 
			
		||||
        ToastType.Error,
 | 
			
		||||
        true,
 | 
			
		||||
        5000
 | 
			
		||||
    )
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
    import { toasts } from 'svelte-toasts';
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<Card>
 | 
			
		||||
    <div slot="header">
 | 
			
		||||
        <h2>Contact</h2>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div slot="content">
 | 
			
		||||
        <form action="https://api.staticforms.xyz/submit" method="post" class="contact-form">
 | 
			
		||||
            <input type="hidden" name="accessKey" value="fbb5ec04-506b-448a-a445-a2e47579a966">
 | 
			
		||||
 | 
			
		||||
            <!-- Form Items-->
 | 
			
		||||
            <div class="input-group">
 | 
			
		||||
                <input type="text" id="name" name="name" required placeholder="Your Name" />
 | 
			
		||||
                <input type="email" id="email" name="email" required placeholder="Your Email" />
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="input-group">
 | 
			
		||||
                <input type="text" name="subject" placeholder="Subject" required>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="input-group">
 | 
			
		||||
                <textarea id="message" name="message" rows="4" required placeholder="Your Message"></textarea>
 | 
			
		||||
            </div>
 | 
			
		||||
            
 | 
			
		||||
            <!-- Hidden Attributes-->
 | 
			
		||||
            <input type="hidden" name="replyTo" value="@">
 | 
			
		||||
            <input type="text" name="honeypot" style="display: none;">
 | 
			
		||||
            <input type="hidden" name="redirectTo" value="https://luke-else.co.uk/contact?sent=true">
 | 
			
		||||
            
 | 
			
		||||
            <!-- reCAPTCHA integration -->
 | 
			
		||||
            <div class="input-group">
 | 
			
		||||
                <div class="g-recaptcha" data-sitekey="6LfjQAwrAAAAAIF57u8Wt4w5L5vBEWi5DfXXBuGy"></div>
 | 
			
		||||
                <script src="https://www.google.com/recaptcha/api.js" async defer></script>
 | 
			
		||||
            </div>
 | 
			
		||||
 | 
			
		||||
            <div class="input-group">
 | 
			
		||||
                <button type="submit" class="submit-button">Send Message</button>
 | 
			
		||||
            </div>
 | 
			
		||||
        </form>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div slot="footer">
 | 
			
		||||
        <a href="/Luke Else - CV.pdf" target="_blank" rel="noopener noreferrer">Curriculum Vitae</a>
 | 
			
		||||
        <a href="mailto:contact@luke-else.co.uk">E-Mail</a>
 | 
			
		||||
    </div>
 | 
			
		||||
</Card>
 | 
			
		||||
 | 
			
		||||
<style>
 | 
			
		||||
 | 
			
		||||
    /* Contact form styling */
 | 
			
		||||
    .contact-form {
 | 
			
		||||
        background: none;
 | 
			
		||||
        padding: 1rem;
 | 
			
		||||
        width: 80%;
 | 
			
		||||
        display: flex;
 | 
			
		||||
        flex-direction: column;
 | 
			
		||||
        gap: 1rem;
 | 
			
		||||
        transition: all 0.3s ease;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* Input groups */
 | 
			
		||||
    .input-group {
 | 
			
		||||
        display: flex;
 | 
			
		||||
        flex-direction: row;
 | 
			
		||||
        width: 100%;
 | 
			
		||||
        justify-content: center;
 | 
			
		||||
        gap: 1rem;
 | 
			
		||||
        flex-wrap: wrap;
 | 
			
		||||
        align-items: center;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* Input fields and textarea */
 | 
			
		||||
    .contact-form input,
 | 
			
		||||
    .contact-form textarea {
 | 
			
		||||
        padding: 0.8rem 1rem;
 | 
			
		||||
        border: 1px solid var(--fg);
 | 
			
		||||
        border-radius: 0.5rem;
 | 
			
		||||
        background: var(--input);
 | 
			
		||||
        color: var(--fg);
 | 
			
		||||
        font-size: 1rem;
 | 
			
		||||
        transition: border-color 0.3s ease, background 0.3s ease;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    .contact-form button {
 | 
			
		||||
        border: 1px solid var(--fg);
 | 
			
		||||
        width: 60%;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    .contact-form textarea {
 | 
			
		||||
        width: 100%;
 | 
			
		||||
        min-width: none;
 | 
			
		||||
        resize: vertical;
 | 
			
		||||
        min-height: fit-content;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    .contact-form input:focus,
 | 
			
		||||
    .contact-form textarea:focus {
 | 
			
		||||
        border-color: var(--glow);
 | 
			
		||||
        outline: none;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* Submit button */
 | 
			
		||||
    .submit-button {
 | 
			
		||||
        padding: 0.8rem 1rem;
 | 
			
		||||
        background: var(--accent);
 | 
			
		||||
        color: var(--fg);
 | 
			
		||||
        border: none;
 | 
			
		||||
        border-radius: 0.5rem;
 | 
			
		||||
        font-size: 1rem;
 | 
			
		||||
        cursor: pointer;
 | 
			
		||||
        transition: background 0.3s ease;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    .submit-button:hover {
 | 
			
		||||
        background: var(--link);
 | 
			
		||||
        color: var(--input);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    .g-recaptcha {
 | 
			
		||||
        width: fit-content;
 | 
			
		||||
        overflow: hidden;
 | 
			
		||||
    }
 | 
			
		||||
</style>
 | 
			
		||||
<div style="display: none;">
 | 
			
		||||
    {toasts.add({
 | 
			
		||||
        title: 'Warning',
 | 
			
		||||
        description: 'This page is under construction',
 | 
			
		||||
        duration: 0,
 | 
			
		||||
        type: 'warning',
 | 
			
		||||
        placement: 'center-center',
 | 
			
		||||
        showProgress: true
 | 
			
		||||
    })}
 | 
			
		||||
</div>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,64 +1,18 @@
 | 
			
		||||
<script lang="ts">
 | 
			
		||||
    import { onMount } from "svelte";
 | 
			
		||||
    import { Toast, ToastType } from "$lib/toast";
 | 
			
		||||
    import { repos, loadRepos, addToast } from "$lib/stores";
 | 
			
		||||
    import { timeSince, checkImage, IMAGE_URL_SUFFIX } from "$lib/api/git";
 | 
			
		||||
    import Card from "$lib/components/Cards/Card.svelte";
 | 
			
		||||
    import SlidingCard from "$lib/components/Cards/SlidingCard.svelte";
 | 
			
		||||
    import Loading from "$lib/components/Loading.svelte";
 | 
			
		||||
    import { loadRepos } from '$lib/stores';
 | 
			
		||||
    import { onMount } from 'svelte';
 | 
			
		||||
    import { toasts } from 'svelte-toasts';
 | 
			
		||||
 | 
			
		||||
    onMount(loadRepos);
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<h1>My Projects</h1>
 | 
			
		||||
<p>This here is a list of my most recently worked on projects. Note this does not show any private repositories. For more in depth information <a href="https://git.luke-else.co.uk">Click Here</a>.</p>
 | 
			
		||||
 | 
			
		||||
<div class="container">
 | 
			
		||||
    {#if $repos.length > 0}
 | 
			
		||||
        <div style="display: none;">{addToast(new Toast("See a snapshot of my latest work.", ToastType.Info, true, 8_000))}</div>
 | 
			
		||||
        <div class="cards">
 | 
			
		||||
            {#each $repos as repo}
 | 
			
		||||
                {#await checkImage(repo)}
 | 
			
		||||
                    <Loading />
 | 
			
		||||
                {:then hasImage}
 | 
			
		||||
                    {#if hasImage}
 | 
			
		||||
                        <SlidingCard>
 | 
			
		||||
                            <div slot="header">
 | 
			
		||||
                                <h2>{repo.name}</h2>
 | 
			
		||||
                                {repo.language}
 | 
			
		||||
                            </div>
 | 
			
		||||
                            <div slot="content">
 | 
			
		||||
                                <p class="not-required">{@html repo.description}</p>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            <div slot="sliding-content">
 | 
			
		||||
                                <img width="100%" src="{repo.html_url}{IMAGE_URL_SUFFIX}" alt="{repo.name}" />
 | 
			
		||||
                            </div>
 | 
			
		||||
                            <div slot="footer">
 | 
			
		||||
                                <!-- svelte-ignore a11y-invalid-attribute -->
 | 
			
		||||
                                <a href="{repo.html_url}">{repo.name}</a>
 | 
			
		||||
                                {timeSince(repo.updated_at)}
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </SlidingCard>
 | 
			
		||||
                    {:else}
 | 
			
		||||
                        <Card>
 | 
			
		||||
                            <div slot="header">
 | 
			
		||||
                                <h2>{repo.name}</h2>
 | 
			
		||||
                                {repo.language}
 | 
			
		||||
                            </div>
 | 
			
		||||
                            <div slot="content">
 | 
			
		||||
                                <p class="not-required">{@html repo.description}</p>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            <div slot="footer">
 | 
			
		||||
                                <!-- svelte-ignore a11y-invalid-attribute -->
 | 
			
		||||
                                <a href="{repo.html_url}">{repo.name}</a>
 | 
			
		||||
                                {timeSince(repo.updated_at)}
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </Card>
 | 
			
		||||
                    {/if}
 | 
			
		||||
                {/await}
 | 
			
		||||
            {/each}
 | 
			
		||||
        </div>
 | 
			
		||||
    {:else}
 | 
			
		||||
        <Loading />
 | 
			
		||||
    {/if}
 | 
			
		||||
<div style="display: none;">
 | 
			
		||||
    {toasts.add({
 | 
			
		||||
        title: 'Warning',
 | 
			
		||||
        description: 'This page is under construction',
 | 
			
		||||
        duration: 0,
 | 
			
		||||
        type: 'warning',
 | 
			
		||||
        placement: 'center-center',
 | 
			
		||||
        showProgress: true
 | 
			
		||||
    })}
 | 
			
		||||
</div>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user