This commit is contained in:
Tben
2023-07-20 21:21:46 +01:00
parent 55424a7d78
commit 164ad29628
40 changed files with 1500 additions and 386 deletions
+28 -97
View File
@@ -1,120 +1,51 @@
"use client";
import React from "react";
// import TextShuffler from "../../components/actions/TextShuffler";
import { about, genericScroll } from "../(utils)/animate";
export default function AboutSection() {
React.useEffect(about, []);
React.useEffect(genericScroll, []);
const webDevStack = require("../(utils)/web-dev-stack.json");
const uiStack = require("../(utils)/ui-ux-stack.json");
const [targetStack, setTargetStack] = React.useState("dev");
return (
<div
className="max-w-6xl w-full flex flex-col items-center pb-40 generic-scroll"
// id="about-section"
className="max-w-6xl w-full flex flex-col items-center pb-40 generic-scroll page-section"
id="about-section"
>
{/* <span
className="text-[300px] uppercase absolute whitespace-nowrap opacity-5 -mt-64 z-[-1]"
id="about-me-label"
>
About Me
</span> */}
<div className="h-44"></div>
<div className="flex flex-col xl:flex-row w-full gap-8">
<div className="w-full xl:w-[40%]">
<h2>
About Me
{/* <TextShuffler textInput="About Me" /> */}
</h2>
<div className="w-full xl:w-[40%]"></div>
<div className="flex flex-col-reverse xl:flex-col items-start gap-4">
<div className="flex flex-col w-full gap-2">
<div
className={"p-4 cursor-pointer hover:opacity-60" + (targetStack.match(/dev/i) ? " bg-[#343680] w-full xl:w-[120%]" : " w-full border border-solid border-white/10")}
onClick={() => {
setTargetStack("dev");
}}
<div className="w-full xl:w-[60%] px-4 md:px-6 py-2">
<section className="flex flex-col items-start gap-4">
<h2 className="mb-0">About Me</h2>
<span className="text-[24px]">Quick learner, adaptable, problem solver, curious. I strive to know the system, rather than the status quo. I thrive in difficult situations and complex hurdles: problem solving is now second nature to me.</span>
<hr className="w-full my-8" />
<h3 className="m-0">_ Code Ben</h3>
<span className="text-[24px]">In the last two years I've developed from a complete designer to pro software engineer. After countless days of writing code, debugging, testing, building projects, server administration, deployment, CI/CD, etc, I've developed the most vital skill of all: adaptability. The ability to asimilate new knowledge at record pace: the tech industry moves really fast: you either keepup, or fall behind.</span>
<hr className="w-full my-8" />
<h3 className="m-0">Graphic Design</h3>
<span className="text-[24px]">
After spending about 5 years in the design industry, I've picked up a few vital concepts about UI/UX design. My design path still sips into my developer life: and I must say, it's the perfect harmony of modern tech. Some of my designs can be found on my{" "}
<a
href="https://99designs.com/profiles/tben"
target="_blank"
>
<div>Web Dev Stack</div>
</div>
<div
className={"p-4 cursor-pointer hover:opacity-60" + (targetStack.match(/design/i) ? " bg-[#343680] w-full xl:w-[120%]" : " w-full border border-solid border-white/10")}
onClick={() => {
setTargetStack("design");
}}
>
<div>UI/UX Stack</div>
</div>
</div>
<span className="hero-sub-text">
Quick learner, adaptable, problem solver, curious. I strive to know the system, rather than the status quo. My credo is: no problem too great, no knowledge too vast, no logic too complex. I thrive in difficult situations and complex hurdles: problem solving is now second nature to me: if you can think it, it can be done.
{/* <TextShuffler
textInput="Quick learner, adaptable, problem solver, curious. I strive to know the system, rather than the status quo. My credo is: no problem too great, no knowledge too vast, no logic too complex. I thrive in difficult situations and complex hurdles: problem solving is now second nature to me: if you can think it, it can be done."
delay={500}
/> */}
99designs
</a>{" "}
profile.
</span>
<hr className="w-full my-8" />
<a
href="/about"
className="button"
className="button outlined"
>
Learn More About Me
</a>
</div>
</div>
<div className="w-full xl:w-[60%] bg-[#343680] px-4 md:px-6 py-2">
<section>
<h3>
{targetStack?.match(/dev/i) ? "Web Dev Tech Stack" : "UI/UX tech stack"}
{/* <TextShuffler textInput={targetStack?.match(/dev/i) ? "Web Dev Tech Stack" : "UI/UX tech stack"} /> */}
</h3>
<hr />
<ul style={{ maxWidth: "800px" }}>
{targetStack?.match(/dev/i) ? (
<React.Fragment>
{webDevStack.map((item: { title: string; description: string }, index: number) => (
<li
key={index}
className="mb-4"
>
<h4 className="m-0">
{item.title}
{/* <TextShuffler textInput={item.title} /> */}
</h4>
<span className="opacity-80">
{item.description}
{/* <TextShuffler textInput={item.description} /> */}
</span>
</li>
))}
</React.Fragment>
) : (
<React.Fragment>
{uiStack.map((item: { title: string; description: string }, index: number) => (
<li
key={index}
className="mb-4"
>
<h4 className="m-0">
{item.title}
{/* <TextShuffler textInput={item.title} /> */}
</h4>
<span className="opacity-80">
{item.description}
{/* <TextShuffler textInput={item.description} /> */}
</span>
</li>
))}
</React.Fragment>
)}
</ul>
</section>
</div>
</div>
+65
View File
@@ -0,0 +1,65 @@
"use client";
import React from "react";
import submitContactForm from "../../functions/frontend/submitContactForm";
export default function ContactForm() {
let [success, setSuccess] = React.useState<string | null>(null);
let [loading, setLoading] = React.useState<boolean>(false);
return (
<form
autoComplete="on"
onSubmit={(e: any) => {
submitContactForm(e, setSuccess, setLoading);
}}
>
{loading && <div className="flex items-center justify-center w-full h-full absolute top-0 left-0 bg-[black]/90">Sending Mail...</div>}
<input
type="text"
placeholder="Your Name"
autoComplete="name"
required
/>
<input
type="email"
placeholder="Your Email Address"
autoComplete="email"
required
/>
<textarea
name="message"
id="contact-form-message"
cols={30}
rows={10}
placeholder="Message"
></textarea>
<button type="submit">Submit</button>
{success === "Success" && (
<div className="message-response">
Success!!!{" "}
<button
onClick={() => {
window.location.reload();
}}
>
Reload
</button>
</div>
)}
{success === "Failed" && (
<div className="message-response failed">
Failed{" "}
<button
onClick={() => {
window.location.reload();
}}
>
Reload
</button>
</div>
)}
</form>
);
}
+24
View File
@@ -0,0 +1,24 @@
"use client";
import React from "react";
import ContactForm from "./ContactForm";
export default function ContactMeSection() {
return (
<div className="max-w-6xl w-full flex items-start page-section">
<div className="flex flex-col items-start gap-6 w-full xl:w-[50%]">
<div className="h-[150px]"></div>
<h2 className="m-0">Why So Serious?</h2>
<div className="flex flex-col-reverse xl:flex-col items-start gap-4">
<span className="text-[24px]">Let's talk.</span>
</div>
<div className="flex flex-col items-start w-full">
<ContactForm />
</div>
</div>
</div>
);
}
+108 -60
View File
@@ -2,73 +2,121 @@
import React from "react";
import Image from "next/image";
// import TextShuffler from "../../components/actions/TextShuffler";
import { hero } from "../(utils)/animate";
import { gsap } from "gsap";
import { TextPlugin } from "gsap/all";
gsap.registerPlugin(TextPlugin);
export default function Hero() {
React.useEffect(hero, []);
/**
* Handle animations on page load
*/
React.useEffect(() => {
const tl = gsap.timeline();
gsap.fromTo(
"#hero-sub-text",
{
opacity: 0,
},
{
opacity: 1,
delay: 0.5,
duration: 1,
}
);
gsap.to("#hero-text", {
text: "I'm Benjamin Toby, a Software Engineer and UI/UX expert.",
delay: 1,
duration: 2,
ease: "none",
});
gsap.fromTo(
".hero-button-link",
{
opacity: 0,
},
{
opacity: 1,
delay: 3,
duration: 1,
stagger: 0.5,
}
);
}, []);
/**
* Render component
*/
return (
<div>
<div className="flex flex-col xl:flex-row items-center gap-0 justify-center -mt-[80px] xl:-mt-[160px] w-full relative pt-[500px] md:pt-0">
<div
className="rounded-full max-w-[450px] absolute md:relative top-0 flex items-center md:items-start justify-center mr-0 xl:-mr-14 bg-[#3e3f9c] overflow-hidden"
id="main-image"
>
<Image
src="/images/my-photo.png"
// fill
width={500}
height={562}
objectFit="contain"
alt="Benjamin Toby Image"
className="contrast-[140%] grayscale mt-20 flex items-center justify-center"
/>
</div>
<div
className="flex flex-col xl:flex-row items-center gap-0 justify-center -mt-[80px] xl:-mt-[160px] w-full relative pt-[500px] xl:pt-0 page-section"
id="hero-content-wrapper"
>
<div
className="rounded-full max-w-[450px] absolute md:relative flex items-center md:items-start justify-center mr-0 xl:-mr-14 bg-[#3e3f9c] overflow-hidden"
id="main-image"
style={{
transform: "scale(1.2)",
}}
>
<img
src="/images/my-photo-stroked.png"
width={500}
height={562}
alt="Benjamin Toby Image"
className="contrast-[140%] grayscale mt-20 flex items-center justify-center object-contain"
/>
</div>
<div
className="max-w-2xl relative z-10 mt-10 w-full"
id="hero-text-section"
<div
className="max-w-2xl relative z-10 mt-10 w-full"
id="hero-text-section"
>
<span
id="hero-sub-text"
className="uppercase bg-primary_light text-[black]/80 font-bold px-3 py-1 tracking-wide"
>
<h1
className="text-4xl md:text-5xl leading-snug"
id="hero-text"
Howdy Tech Enthusiasts
</span>
<div className="h-4"></div>
<h1
className="text-5xl md:text-[58px] leading-[1.1] gsap-text h-auto xl:h-[220px]"
id="hero-text"
></h1>
<div className="h-10 flex xl:hidden"></div>
<div className="gap-4 flex items-center flex-wrap">
<a
href="https://www.linkedin.com/in/benjamin-toby/"
target="_blank"
className="button grow hero-button-link"
>
I'm Benjamin Toby, a Software Engineer and UI/UX expert
{/* Fullstack developer, UI/UX designer, Software Engineer, welcome */}
{/* <TextShuffler
textInput="I'm Benjamin Toby, a Software Engineer and UI/UX expert"
delay={500}
/> */}
</h1>
<div className="gap-4 flex items-center flex-wrap">
<a
href="/documents/Resume-Benjamin-Toby-Linkedin.pdf"
download={true}
className="button grow"
>
See my resume
</a>
<a
href="https://www.linkedin.com/in/benjamin-toby/"
target="_blank"
className="button grow"
>
Linkedin
</a>
<a
href="/contact"
style={{
backgroundColor: "transparent",
color: "white",
border: "2px solid white",
}}
className="button grow"
>
Contact Me
</a>
</div>
Linkedin
</a>
<a
href="/contact"
style={{
backgroundColor: "transparent",
color: "white",
border: "2px solid white",
}}
className="button grow hero-button-link"
>
Contact Me
</a>
<a
href="/documents/Resume-Benjamin-Toby-Linkedin.pdf"
download={true}
className="button grow hero-button-link"
style={{
backgroundColor: "transparent",
color: "white",
border: "2px solid white",
}}
>
See my resume
</a>
</div>
</div>
</div>
+56
View File
@@ -0,0 +1,56 @@
"use client";
import React from "react";
import Hero from "./Hero";
import AboutSection from "./AboutSection";
import { gsap } from "gsap";
import MyWorkSection from "./MyWorkSection";
import MySkillsSection from "./MySkillsSection";
import homepageTimeline from "../(utils)/homepage-timeline";
import { SiteContext } from "../../layouts/general_layout/GeneralLayout";
import ContactMeSection from "./ContactMeSection";
export type Project = {
id: number;
title: string;
description: string;
image?: string | null;
url?: string | null;
full_description?: string;
};
type ChildProps = {
projects: Project[];
};
export default function HomepageComponent({ projects }: ChildProps) {
const layoutContext: any = React.useContext(SiteContext);
if (layoutContext) layoutContext.projects = projects;
const comp = React.useRef<HTMLDivElement>(null);
React.useLayoutEffect(() => {
let ctx = gsap.context(() => {
homepageTimeline({ componentRef: comp });
}, comp);
return () => ctx.revert();
}, []);
return (
<React.Fragment>
<div
id="homepage-content-wrapper"
ref={comp}
className="z-0 xl:z-50 mb-32"
>
<Hero />
<AboutSection />
<MySkillsSection />
<MyWorkSection />
<ContactMeSection />
</div>
</React.Fragment>
);
}
+91
View File
@@ -0,0 +1,91 @@
"use client";
import React from "react";
export default function MySkillsSection() {
const webDevStack = require("../(utils)/web-dev-stack.json");
const uiStack = require("../(utils)/ui-ux-stack.json");
const [targetStack, setTargetStack] = React.useState("dev");
return (
<div className="max-w-6xl w-full flex flex-col items-start pb-40 page-section">
<div className="h-[200px]"></div>
<div className="flex flex-col items-start gap-6 w-full xl:w-[50%]">
<h2 className="mb-0">My Skills</h2>
<span className="text-[24px]">I am well-versed in the full spectrum of design and development. While I started out as a designer, I have focused more on development in the last few years.</span>
<hr className="w-full" />
<h3 className="m-0">{targetStack?.match(/dev/i) ? "Web Dev Tech Stack" : "UI/UX tech stack"}</h3>
<div className="flex flex-col xl:flex-col items-start gap-4 w-full">
{/* <h3>My Tech Stack</h3> */}
<div className="flex flex-wrap w-full gap-2">
<div
className={"p-4 text-lg cursor-pointer grow" + (targetStack.match(/dev/i) ? " bg-[white] text-[black] font-bold" : " border border-solid border-white/10 hover:opacity-60 ")}
onClick={() => {
setTargetStack("dev");
}}
>
<div>Web Dev Stack</div>
</div>
<div
className={"p-4 text-lg cursor-pointer grow" + (targetStack.match(/design/i) ? " bg-[white] text-[black] font-bold" : " border border-solid border-white/10 hover:opacity-60 ")}
onClick={() => {
setTargetStack("design");
}}
>
<div>UI/UX Stack</div>
</div>
</div>
</div>
<ul
style={{ maxWidth: "800px" }}
className="pl-6"
>
{targetStack?.match(/dev/i) ? (
<React.Fragment>
{webDevStack.map((item: { title: string; description: string }, index: number) => (
<li
key={index}
className="mb-4"
>
<h4 className="m-0 text-[#BBE572]">
{item.title}
{/* <TextShuffler textInput={item.title} /> */}
</h4>
<span className="opacity-80">
{item.description}
{/* <TextShuffler textInput={item.description} /> */}
</span>
</li>
))}
</React.Fragment>
) : (
<React.Fragment>
{uiStack.map((item: { title: string; description: string }, index: number) => (
<li
key={index}
className="mb-4"
>
<h4 className="m-0 text-[#BBE572]">
{item.title}
{/* <TextShuffler textInput={item.title} /> */}
</h4>
<span className="opacity-80">
{item.description}
{/* <TextShuffler textInput={item.description} /> */}
</span>
</li>
))}
</React.Fragment>
)}
</ul>
</div>
</div>
);
}
+36
View File
@@ -0,0 +1,36 @@
"use client";
import React from "react";
import { Project } from "./HomepageComponent";
import Image from "next/image";
export default function MyWorkCard({ project }: { project: Project }) {
return (
<div className="bg-primary/10 w-full shadow-2xl shadow-[black] relative">
<Image
src={project.image || ""}
alt={project.title}
width={600}
height={300}
className="object-cover object-top w-full"
/>
<div className="p-10">
<h3 className="m-0">{project.title}</h3>
<p className="m-0">{project.description}</p>
</div>
<a
href={project.url || "#"}
className="absolute z-10 top-[340px] right-6 w-10 h-10 p-2 flex items-center justify-center rounded-full bg-[white]"
target="_blank"
>
<img
src="/images/external-link-dark.png"
alt="External Link Icon"
width={20}
height={20}
/>
</a>
</div>
);
}
+43
View File
@@ -0,0 +1,43 @@
"use client";
import React from "react";
import { SiteContext } from "../../layouts/general_layout/GeneralLayout";
import { Project } from "./HomepageComponent";
import MyWorkCard from "./MyWorkCard";
export default function MyWorkSection() {
const layoutContext: { projects: Project[] } = React.useContext(SiteContext);
const projects = layoutContext.projects;
return (
<div className="max-w-6xl w-full flex flex-col xl:flex-row items-start pb-40 page-section">
<div className="flex flex-col items-start gap-6 w-full xl:w-[50%]"></div>
<div className="flex flex-col items-start gap-6 w-full xl:w-[50%]">
<div className="h-[150px]"></div>
<h2 className="m-0">Some of my work</h2>
<div className="flex flex-col-reverse xl:flex-col items-start gap-4">
<span className="text-[24px]">I've been creating and building awesome designs and applications since 2016. Here are a few picks:</span>
</div>
<div className="flex flex-col items-start gap-44 mt-10">
{projects &&
projects.slice(0, 4).map((project, index) => (
<MyWorkCard
key={index}
project={project}
/>
))}
</div>
<a
href="/work"
className="button outlined mt-10"
>
See More
</a>
</div>
</div>
);
}