Skip to content

Commit a414081

Browse files
updated contact form
1 parent 238e5df commit a414081

File tree

13 files changed

+294
-193
lines changed

13 files changed

+294
-193
lines changed

.prettierrc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
{
2-
"plugins": ["prettier-plugin-svelte", "prettier-plugin-astro","prettier-plugin-tailwindcss"],
3-
"tabWidth": 4
2+
"plugins": [
3+
"prettier-plugin-svelte",
4+
"prettier-plugin-astro",
5+
"prettier-plugin-tailwindcss"
6+
],
7+
"tabWidth": 4,
8+
"useTabs": true
49
}

public/fonts/Antonio-Bold.ttf

37 KB
Binary file not shown.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
import { Image } from "astro:assets";
3+
import contactPhoto from "@/components/images/contact_photo.webp";
4+
import { AnimatedTooltip } from "@/components/ui/AnimatedToolTip";
5+
---
6+
7+
<div
8+
class="relative flex h-[400px] w-full flex-col-reverse items-start justify-center gap-10 lg:flex-row"
9+
>
10+
<div class="relative flex w-1/2 items-end justify-end">
11+
<Image
12+
src={contactPhoto}
13+
alt="Ryan"
14+
width={300}
15+
class="absolute top-0 right-0 aspect-[3/4] -translate-x-7 translate-y-3 rounded-3xl object-cover"
16+
/>
17+
<div
18+
class="absolute top-0 right-0 -z-10 aspect-[3/4] w-[300px] -translate-x-10 translate-y-5 rounded-3xl bg-[#c98703]"
19+
>
20+
</div>
21+
</div>
22+
<div
23+
class="flex h-full w-1/2 flex-col items-start justify-center text-left"
24+
>
25+
<h1
26+
class="[font-family:'Antonio',sans-serif] text-5xl leading-14 font-bold uppercase"
27+
>
28+
have an idea? <br /> let's chat!
29+
</h1>
30+
31+
<div class="mt-10 flex w-fit items-center justify-center">
32+
<AnimatedTooltip
33+
href="mailto:[email protected]"
34+
text="Email me!"
35+
client:load
36+
className="text-xl font-bold underline transition-colors duration-75 hover:text-blue-500"
37+
>[email protected]</AnimatedTooltip
38+
>
39+
</div>
40+
</div>
41+
</div>
42+
43+
<style>
44+
#title {
45+
background: linear-gradient(
46+
90deg,
47+
#85e6c5 0%,
48+
#a084e8 45%,
49+
#33bbc5 100%
50+
);
51+
52+
background-size: 300%;
53+
54+
background-clip: text;
55+
-webkit-background-clip: text;
56+
57+
-webkit-text-fill-color: transparent;
58+
}
59+
</style>

src/components/contact/ContactComponent.svelte

Lines changed: 0 additions & 45 deletions
This file was deleted.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<div class="flex w-full items-center justify-center pb-16">
2-
<div class="text-center">
3-
Copyright © 2023-{new Date().getFullYear()} RythonDev. All Rights Reserved.
4-
</div>
1+
<div class="flex w-full items-center justify-center py-16">
2+
<div class="text-center">
3+
Copyright © 2023-{new Date().getFullYear()} RythonDev. All Rights Reserved.
4+
</div>
55
</div>

src/components/global/NavBar.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
import { HoverNavigation } from "@/components/ui/HoverNavigation";
33
import { Image } from "astro:assets";
4-
import pfp from "@/components/images/pfp_new.webp";
4+
import pfp from "@/components/images/contact_photo_small.webp";
55
66
const navLinks = [
77
{
@@ -28,7 +28,7 @@ const navLinks = [
2828
---
2929

3030
<div
31-
class="bg-secondary fixed top-5 left-1/2 z-30 box-border flex -translate-x-1/2 items-center justify-center overflow-auto rounded-full border-2 border-solid border-gray-700 px-5 py-3"
31+
class="bg-secondary/90 fixed top-5 left-1/2 z-30 box-border flex -translate-x-1/2 items-center justify-center overflow-auto rounded-full border-2 border-solid border-gray-700 px-5 py-3"
3232
>
3333
<Image src={pfp} alt="Ryan" width={50} class="mr-3 rounded-full" />
3434
<HoverNavigation items={navLinks} client:load />
11.9 KB
Loading
10.5 KB
Loading
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
"use client";
2+
3+
import { useState, useRef } from "react";
4+
import {
5+
motion,
6+
useTransform,
7+
AnimatePresence,
8+
useMotionValue,
9+
useSpring,
10+
} from "motion/react";
11+
import { cn } from "@/lib/utils";
12+
13+
export const AnimatedTooltip = ({
14+
className,
15+
children,
16+
text,
17+
href,
18+
}: {
19+
className?: string;
20+
children: React.ReactNode;
21+
text: string;
22+
href?: string;
23+
}) => {
24+
const [hovered, setHovered] = useState<boolean>(false);
25+
const animationFrameRef = useRef<number | null>(null);
26+
27+
const handleMouseMove = (event: any) => {
28+
if (animationFrameRef.current) {
29+
cancelAnimationFrame(animationFrameRef.current);
30+
}
31+
};
32+
33+
return (
34+
<>
35+
<div
36+
className="group relative -mr-4"
37+
onMouseEnter={() => setHovered(true)}
38+
onMouseLeave={() => setHovered(false)}
39+
>
40+
<AnimatePresence>
41+
{hovered && (
42+
<motion.div
43+
initial={{ opacity: 0, y: 20, scale: 0.6 }}
44+
animate={{
45+
opacity: 1,
46+
y: 10,
47+
scale: 1,
48+
transition: {
49+
type: "spring",
50+
stiffness: 260,
51+
damping: 10,
52+
},
53+
}}
54+
exit={{ opacity: 0, y: 20, scale: 0.6 }}
55+
style={{
56+
whiteSpace: "nowrap",
57+
}}
58+
className="absolute -top-16 left-1/2 z-50 flex -translate-x-1/2 flex-col items-center justify-center rounded-md bg-black px-4 py-2 text-xs shadow-xl"
59+
>
60+
<div className="absolute inset-x-10 -bottom-px z-30 h-px w-[20%] bg-gradient-to-r from-transparent via-emerald-500 to-transparent" />
61+
<div className="absolute -bottom-px left-10 z-30 h-px w-[40%] bg-gradient-to-r from-transparent via-sky-500 to-transparent" />
62+
<div className="relative z-30 text-base font-bold text-white">
63+
{text}
64+
</div>
65+
</motion.div>
66+
)}
67+
</AnimatePresence>
68+
{!href && (
69+
<div
70+
onMouseMove={handleMouseMove}
71+
className={cn(
72+
"relative h-14 w-14 transition duration-500 group-hover:z-30",
73+
className,
74+
)}
75+
>
76+
{children}
77+
</div>
78+
)}
79+
{href && (
80+
<a
81+
href={href}
82+
onMouseMove={handleMouseMove}
83+
className={cn(
84+
"relative h-14 w-14 transition duration-500 group-hover:z-30",
85+
className,
86+
)}
87+
>
88+
{children}
89+
</a>
90+
)}
91+
</div>
92+
</>
93+
);
94+
};

0 commit comments

Comments
 (0)