Skip to content

Commit

Permalink
Add footer with socials
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscunha committed Jan 16, 2025
1 parent 9b6880d commit 686508d
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 22 deletions.
33 changes: 33 additions & 0 deletions src/lib/socials.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<script lang="ts">
import EmailIcon from '$lib/icons/email_icon.svelte';
import GithubIcon from '$lib/icons/github_icon.svelte';
import ItchioIcon from '$lib/icons/itchio_icon.svelte';
import LinkedinIcon from '$lib/icons/linkedin_icon.svelte';
let socials = [
{ href: 'mailto:hello@franciscunha.com', label: 'hello@franciscunha.com', icon: EmailIcon },
{ href: 'https://github.com/franciscunha', label: 'franciscunha', icon: GithubIcon },
{
href: 'https://www.linkedin.com/in/francunha/',
label: '/in/francunha',
icon: LinkedinIcon
},
{ href: 'https://moonsheep.itch.io/', label: 'moonsheep.itch.io', icon: ItchioIcon }
];
let { horizontal }: { horizontal: boolean } = $props();
</script>

<div
class={[
'flex max-sm:flex-col max-sm:items-start max-sm:gap-2',
!horizontal && 'sm:flex-col sm:items-start sm:gap-2',
horizontal && 'sm:w-full sm:flex-row sm:justify-center sm:gap-12'
]}
>
{#each socials as social}
<a href={social.href} class="flex flex-row items-center gap-2"
><social.icon size={2} />{social.label}</a
>
{/each}
</div>
11 changes: 11 additions & 0 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<script lang="ts">
import '../app.css';
import Socials from '$lib/socials.svelte';
import LoopingStrings from './looping_strings.svelte';
import Navigation from './navigation.svelte';
import { page } from '$app/state';
let { children } = $props();
</script>

Expand All @@ -27,3 +31,10 @@
{@render children()}
</div>
</div>

<!-- Footer -->
{#if page.url.pathname !== '/'}
<div class="flex w-full justify-center py-4 text-fontcolor">
<Socials horizontal={true} />
</div>
{/if}
24 changes: 2 additions & 22 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
<script>
import EmailIcon from '$lib/icons/email_icon.svelte';
import GithubIcon from '$lib/icons/github_icon.svelte';
import ItchioIcon from '$lib/icons/itchio_icon.svelte';
import LinkedinIcon from '$lib/icons/linkedin_icon.svelte';
import ProjectCard from '$lib/project_card.svelte';
import Socials from '$lib/socials.svelte';
import AboutMe from './about_me.md';
import { get_highlighted } from '$lib/load_project';
import { fly } from 'svelte/transition';
let socials = [
{ href: 'mailto:hello@franciscunha.com', label: 'hello@franciscunha.com', icon: EmailIcon },
{ href: 'https://github.com/franciscunha', label: 'franciscunha', icon: GithubIcon },
{
href: 'https://www.linkedin.com/in/francunha/',
label: '/in/francunha',
icon: LinkedinIcon
},
{ href: 'https://moonsheep.itch.io/', label: 'moonsheep.itch.io', icon: ItchioIcon }
];
let highlighted_projects = get_highlighted();
let project_index = $state(0);
Expand All @@ -38,13 +24,7 @@
/>
<div class="max-md:-mt-32 max-md:mb-8 md:mt-8">
<h1 class="text-bold mb-2">Find me at</h1>
<div class="flex flex-col items-start gap-2">
{#each socials as social}
<a href={social.href} class="flex flex-row items-center gap-2"
><social.icon size={2} />{social.label}</a
>
{/each}
</div>
<Socials horizontal={false} />
</div>
</div>
<div class="max-w-2xl max-md:flex max-md:flex-col">
Expand Down

0 comments on commit 686508d

Please sign in to comment.