Skip to content

Commit

Permalink
Contact page completed
Browse files Browse the repository at this point in the history
  • Loading branch information
Farfi55 committed Feb 3, 2024
1 parent bf377b9 commit e70e0ee
Show file tree
Hide file tree
Showing 9 changed files with 197 additions and 153 deletions.
2 changes: 1 addition & 1 deletion src/lib/components/Button.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</script>

<a
class="shadow-amber-600/10 text-center shadow-xl flex relative z-0 overflow-hidden px-5 py-2 group rounded-full text-white dark:bg-amber-700 bg-amber-600"
class="shadow-amber-600/10 text-center shadow-xl flex relative overflow-hidden px-5 py-2 group rounded-full text-white dark:bg-amber-700 bg-amber-600"
{href}
>
<div
Expand Down
5 changes: 2 additions & 3 deletions src/lib/components/Header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
{
href: '/contact',
text: 'Contact',
icon: 'fa fa-envelope',
hideInHeader: true
icon: 'fa fa-envelope'
}
];
let isDrawerOpen = false;
Expand Down Expand Up @@ -57,7 +56,7 @@
{/if}
</button>
</div>
<h1 class="font-medium h-full pe-7">
<h1 class="font-medium h-full pe-7 text-lg">
<a
href="/"
class="link-main duration-200 border-b {$page.route.id === '/'
Expand Down
1 change: 0 additions & 1 deletion src/lib/components/Main.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
</script>

<Particles />

<main class="flex flex-col flex-1 p-4">
<section id="intro-page" class="grid grid-cols-1 lg:grid-cols-3 gap-10 py-8 sm:py-14">
<div
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/Particles.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</script>

<div
class="absolute min-h-screen top-0 left-0 w-full z-[-1] duration-500 bg-gradient-to-b {loaded
class="absolute -z-10 min-h-screen top-0 left-0 w-full duration-500 bg-gradient-to-b {loaded
? 'opacity-70'
: 'opacity-0'}"
>
Expand Down
9 changes: 5 additions & 4 deletions src/lib/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { dev } from "$app/environment"

export const title = 'Alessio Farfaglia'
export const description = 'Alessio Farfaglia\'s personal website'
export const url = dev ? 'http://localhost:5173' : 'https://farfi55.github.io'
export const blogUrl = `${url}/blog`
export const title = 'Alessio Farfaglia';
export const description = 'Alessio Farfaglia\'s personal website';
export const url = dev ? 'http://localhost:5173' : 'https://farfi55.github.io';
export const blogUrl = `${url}/blog`;
export const contactFormEndpoint = "https://formspree.io/f/xkndjojj"
135 changes: 134 additions & 1 deletion src/routes/contact/+page.svelte
Original file line number Diff line number Diff line change
@@ -1 +1,134 @@
<h3>contact page WIP</h3>
<script>
import * as config from '$lib/config';
let socials = [
{
name: 'GitHub',
href: 'https://github.com/Farfi55',
icon: 'fa-brands fa-github',
color: 'bg-[#171515]'
},
{
name: 'Twitter',
href: 'https://twitter.com/farfi__',
icon: 'fa-brands fa-x-twitter',
color: 'bg-[#000000]'
},
{
name: 'Itch.io',
href: 'https://farfi55.itch.io/',
icon: 'fa-brands fa-itch-io',
color: 'bg-[#fa5c5c]'
},
{
name: 'Instagram',
href: 'https://www.instagram.com/farfi__/',
icon: 'fa-brands fa-instagram',
color: 'bg-[#125688]'
},
{
name: 'LinkedIn',
href: 'https://www.linkedin.com/in/alessio-farfaglia-8780891aa/',
icon: 'fa-brands fa-linkedin',
color: 'bg-[#007bb5]'
},
{
name: 'YouTube',
href: 'https://www.youtube.com/@farfi55',
icon: 'fa-brands fa-youtube',
color: 'bg-[#bb0000]'
}
];
</script>

<!-- modify this form HTML and place wherever you want your form -->

<section class="flex sm:justify-center p-4 pb-16">
<form
action={config.contactFormEndpoint}
method="POST"
class="flex flex-col gap-4 py-8 px-4 sm:px-8 rounded border border-y-4 border-y-amber-500 dark:border-y-amber-700 shadow bg-stone-100 dark:bg-stone-900 w-full sm:w-auto"
>
<h1 class="text-main text-3xl text-center mb-4">Get in touch</h1>

<p class="text-muted">
Feel free to reach out to me for any reason. I'll get back to you as soon as possible.
</p>

<div class="flex flex-wrap gap-1 mt-4">
<label for="name" class="w-full sm:w-28 text-stone-800 dark:text-stone-300 poppins"
>Name:
</label>
<input
type="text"
name="name"
class="bg-stone-200 dark:bg-stone-800 placeholder-stone-400 dark:placeholder-stone-500 border p-1 rounded w-full sm:w-auto flex-grow"
placeholder="First and Last name"
/>
</div>
<div class="flex flex-wrap gap-1">
<label for="email" class="w-full sm:w-28 text-stone-800 dark:text-stone-300 poppins"
>Email:
</label>
<input
type="email"
name="email"
class="bg-stone-200 dark:bg-stone-800 placeholder-stone-400 dark:placeholder-stone-500 border p-1 rounded w-full sm:w-auto flex-grow"
placeholder="[email protected]"
required
/>
</div>
<div class="flex flex-wrap gap-1">
<label for="message" class="w-full sm:w-28 text-stone-800 dark:text-stone-300 poppins">
<span>Message: </span>
</label>
<textarea
name="message"
class="bg-stone-200 dark:bg-stone-800 placeholder-stone-400 dark:placeholder-stone-500 border p-1 rounded w-full sm:w-auto flex-grow max-w-2xl"
placeholder="Your message here"
rows="5"
required
></textarea>
</div>
<div class="flex justify-end">
<!-- your other form fields go here -->
<button
type="submit"
class="shadow-amber-600/10 text-center shadow-xl flex relative overflow-hidden px-5 py-2 group rounded-full text-white dark:bg-amber-700 bg-amber-600 ms-auto"
>
<div
class="absolute top-0 right-full w-full h-full bg-amber-800 dark:opacity-100 opacity-50 group-hover:translate-x-full duration-200"
></div>
<h4 class="relative text-lg w-24">Send</h4>
</button>
</div>

<hr class="my-4" />

<div>
<h2 class="text-main text-xl text-center">My Socials</h2>

<p class="text-muted text-center">You can also follow me through the following channels:</p>

<div
class="flex flex-wrap justify-center gap-2 sm:gap-4 mt-4 text-white text-2xl text-center"
>
{#each socials as social}
<a
class="{social.color} w-10 h-10 sm:w-12 sm:h-12 rounded sm:rounded-md flex justify-center hover:opacity-75 border-2 border-transparent hover:border-stone-900 hover:dark:border-stone-100 duration-200 transition-colors"
target="_blank"
href={social.href}
aria-label={social.name}
title={social.name}
>
<i class="{social.icon} self-center justify-self-center"> </i>
</a>
{/each}
</div>
</div>
</form>
</section>

<style>
</style>
96 changes: 48 additions & 48 deletions src/routes/projects/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,64 +6,64 @@
export let data;
</script>

<section class="p-4 py-16">
<div class="flex flex-col gap-16 items-center">
{#each data.projects as project, index}
{@const year = new Date(project.date).getFullYear()}
{@const prevYear = index === 0 ? null : new Date(data.projects[index - 1].date).getFullYear()}
<!-- when the project year is different from the previous project year, create a h3 header with the year in question -->
{#if index === 0 || year !== prevYear}
<div
class="w-full text-center relative py-6 mt-6 scroll-mt-24
<section class="p-4 pb-16 flex flex-col gap-16 items-center">
{#each data.projects as project, index}
{@const year = new Date(project.date).getFullYear()}
{@const prevYear = index === 0 ? null : new Date(data.projects[index - 1].date).getFullYear()}
<!-- when the project year is different from the previous project year, create a h3 header with the year in question -->
{#if index === 0 || year !== prevYear}
<div
class="w-full text-center relative py-6 mt-6 scroll-mt-24
before:absolute before:top-0 before:left-0 before:w-2/3 before:h-1.5 before:bg-amber-600 dark:before:bg-amber-700 before:rounded
after:absolute after:bottom-0 after:right-0 after:w-2/3 after:h-1.5 after:bg-amber-600 dark:after:bg-amber-700 after:rounded"
id={year.toString()}
>
id={year.toString()}
>
<a href="/projects#{year}">
<h3 class="text-4xl font-bold">
year <span class="text-main poppins">{year}</span>
</h3>
</div>
{/if}

<div class="w-full max-w-6xl {index % 2 ? 'sm:ps-4 md:ps-20' : 'sm:pe-4 md:pe-20'}">
<div
class="bg-stone-200 dark:bg-stone-900 rounded-lg shadow-md flex flex-col sm:flex-row sm:gap-2 overflow-hidden w-full snap-center scroll-mt-24"
id={project.slug}
>
{#if project.coverImage}
<div class="sm:max-w-[40%] h-full self-center p-2">
<img src={project.coverImage} alt={project.title} class="rounded" />
</div>
{/if}
<div class="p-2 w-full">
<span class="flex text-center sm:text-start flex-wrap">
<a href="/projects#{project.slug}" class="self-center">
<h3 class="text-3xl py-3 text-main">
{project.title}
</h3>
</a>
<p class="text-muted ms-auto">{formatDate(project.date)}</p>
</span>
<p class="pb-3 self-center">{project.description}</p>
<div class="flex flex-wrap gap-2 content-around">
{#each project.tags as tag}
<div class="inline">
<Tech name={tag}></Tech>
</div>
{/each}
</a>
</div>
{/if}

<div class="flex h-fit ms-auto">
<Button href={project.repo}>
<i class="fab fa-github"></i>
View on GitHub
</Button>
<div class="w-full max-w-6xl {index % 2 ? 'md:ps-20' : 'md:pe-20'}">
<div
class="bg-stone-200 dark:bg-stone-900 rounded-lg shadow-md flex flex-col sm:flex-row sm:gap-2 overflow-hidden w-full snap-center scroll-mt-24"
id={project.slug}
>
{#if project.coverImage}
<div class="sm:max-w-[40%] h-full self-center p-2">
<img src={project.coverImage} alt={project.title} class="rounded" />
</div>
{/if}
<div class="p-2 w-full">
<span class="flex text-center sm:text-start flex-wrap">
<a href="/projects#{project.slug}" class="self-center">
<h3 class="text-3xl py-3 text-main">
{project.title}
</h3>
</a>
<p class="text-muted ms-auto">{formatDate(project.date)}</p>
</span>
<p class="pb-3 self-center">{project.description}</p>
<div class="flex flex-wrap gap-2 content-around">
{#each project.tags as tag}
<div class="inline">
<Tech name={tag}></Tech>
</div>
{/each}

<div class="flex h-fit ms-auto">
<Button href={project.repo}>
<i class="fab fa-github"></i>
View on GitHub
</Button>
</div>
</div>
</div>
</div>
{/each}
</div>
{/each}

<h3 class="text-muted py-8 text-3xl">And many other unfinished projects...</h3>
</div>
<h3 class="text-muted py-8 text-3xl">And many other unfinished projects...</h3>
</section>
50 changes: 3 additions & 47 deletions static/assets/particles-light.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,16 @@
}
},
"color": {
"value": "#000033"
"value": "#1c1917"
},
"shape": {
"type": "circle",
"stroke": {
"width": 0,
"color": "#000033"
"color": "#1c1917"
},
"polygon": {
"nb_sides": 5
},
"image": {
"src": "img/github.svg",
"width": 100,
"height": 100
}
},
"opacity": {
Expand All @@ -48,7 +43,7 @@
"line_linked": {
"enable": true,
"distance": 150,
"color": "#000033",
"color": "#1c1917",
"opacity": 0.4,
"width": 1
},
Expand All @@ -67,44 +62,5 @@
}
}
},
"interactivity": {
"detect_on": "canvas",
"events": {
"onhover": {
"enable": true,
"mode": "repulse"
},
"onclick": {
"enable": true,
"mode": "push"
},
"resize": true
},
"modes": {
"grab": {
"distance": 400,
"line_linked": {
"opacity": 1
}
},
"bubble": {
"distance": 400,
"size": 40,
"duration": 2,
"opacity": 8,
"speed": 3
},
"repulse": {
"distance": 200,
"duration": 0.4
},
"push": {
"particles_nb": 4
},
"remove": {
"particles_nb": 2
}
}
},
"retina_detect": true
}
Loading

0 comments on commit e70e0ee

Please sign in to comment.