Compare commits

...

3 Commits

Author SHA1 Message Date
1a5b5a336f rearch links, routes + add resume link 2026-03-07 12:17:21 -06:00
23d206de99 hide unused images 2026-03-07 11:28:43 -06:00
6fe9d8c050 lazy import about page content 2026-03-07 11:14:11 -06:00
14 changed files with 106 additions and 51 deletions

View File

@@ -1,6 +1,9 @@
import "./about.scss";
import {PropsWithChildren} from "react";
import About from "./About.mdx";
import {HTMLProps, lazy} from "react";
import {Link} from "../router/Link";
import {Path} from "../router/router";
const About = lazy(() => import("./About.mdx"));
export default function AboutPage() {
return <main className="about-page">
@@ -14,8 +17,8 @@ export default function AboutPage() {
</main>
}
function ExternalLink(props: PropsWithChildren & { href: string }) {
function ExternalLink(props: HTMLProps<HTMLAnchorElement>) {
return (
<a href={props.href} className="link external-link" target="_blank">{props.children}</a>
<Link {...props} href={props.href as Path} className="external-link" target="_blank">{props.children}</Link>
)
}

View File

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 69 KiB

View File

Before

Width:  |  Height:  |  Size: 959 KiB

After

Width:  |  Height:  |  Size: 959 KiB

View File

Before

Width:  |  Height:  |  Size: 13 MiB

After

Width:  |  Height:  |  Size: 13 MiB

View File

Before

Width:  |  Height:  |  Size: 5.6 MiB

After

Width:  |  Height:  |  Size: 5.6 MiB

View File

Before

Width:  |  Height:  |  Size: 385 KiB

After

Width:  |  Height:  |  Size: 385 KiB

View File

Before

Width:  |  Height:  |  Size: 376 KiB

After

Width:  |  Height:  |  Size: 376 KiB

BIN
src/img/resume.pdf Executable file

Binary file not shown.

40
src/index.d.ts vendored
View File

@@ -19,49 +19,71 @@ declare module '*.md' {
export default MDXComponent;
}
declare module '*.pdf' {
import {Path} from "./router/router";
const src: Path;
export default src;
}
declare module '*.avif' {
const src: string;
import {Path} from "./router/router";
const src: Path;
export default src;
}
declare module '*.bmp' {
const src: string;
import {Path} from "./router/router";
const src: Path;
export default src;
}
declare module '*.gif' {
const src: string;
import {Path} from "./router/router";
const src: Path;
export default src;
}
declare module '*.jpg' {
const src: string;
import {Path} from "./router/router";
const src: Path;
export default src;
}
declare module '*.jpeg' {
const src: string;
import {Path} from "./router/router";
const src: Path;
export default src;
}
declare module '*.png' {
const src: string;
import {Path} from "./router/router";
const src: Path;
export default src;
}
declare module '*.webp' {
const src: string;
export default src;
import {Path} from "./router/router";
const src: Path;
export default src;
}
declare module '*.svg' {
import {Path} from "./router/router";
import * as React from 'react';
export const ReactComponent: React.FunctionComponent<React.SVGProps<
SVGSVGElement
> & { title?: string }>;
const src: string;
const src: Path;
export default src;
}

View File

@@ -2,12 +2,10 @@ import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.scss';
import {RouterProvider} from "./router/RouterContext";
import {Route} from "./router/Route";
import "@fontsource/inter"; // Defaults to weight 400
import "@fontsource/neuton"; // Defaults to weight 400
import "@fontsource/neuton";
import {Routes} from "./router/Route";
const Canvas = React.lazy(() => import("./index/Canvas"));
const About = React.lazy(() => import("./about/AboutPage"));
const Nav = React.lazy(() => import("./nav/Nav"));
const root = ReactDOM.createRoot(
@@ -18,15 +16,7 @@ root.render(
<React.StrictMode>
<RouterProvider>
<Nav/>
<Route path="/">
<Canvas/>
</Route>
<Route path="/about">
<About/>
</Route>
<Route path="/articles">
<div>Test</div>
</Route>
<Routes/>
</RouterProvider>
</React.StrictMode>
);

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3"><g fill="#61DAFB"><path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/><circle cx="420.9" cy="296.5" r="45.7"/><path d="M520.5 78.1z"/></g></svg>

Before

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -1,21 +1,33 @@
import {useState} from "react";
import {Link} from "../router/Link";
import {motion} from "framer-motion";
import {ROUTES} from "../router/Route";
import ResumePdf from "../img/resume.pdf";
export function Links() {
const [links] = useState(["About", "Articles"]);
return <div className="links">
{ links.map(() => /* add spacers for flexbox */ <div/> )}
<Title/>
{ links.map(link => <Link href={`/${link}`}><h3>{link}</h3></Link>) }
</div>
}
function Title() {
return (
<Spacers length={ROUTES.length + 1} />
<Link href="/" className="name">
<motion.h1 className="name">Tymur Arsentiev</motion.h1>
</Link>
);
{
ROUTES.map(([path, name]) =>
<Link key={path} href={path}>
<h3>{name}</h3>
</Link>
)
}
<Link key={ResumePdf} href={ResumePdf} target="_blank">
<h3>Resume</h3>
</Link>
</div>
}
function Spacers(props: {length: number}) {
const spacers = [];
for (let i = 0; i < props.length; i++) {
spacers.push(<div key={i}/>);
}
return spacers;
}

View File

@@ -1,21 +1,29 @@
import "./link.scss";
import React, {PropsWithChildren} from "react";
import React, {HTMLProps, ReactNode} from "react";
import {useRouter} from "./RouterContext";
import {Path} from "./router";
export function Link(props: {className?: string, href: Path, replace?: boolean } & PropsWithChildren) {
const {children, className, href} = props;
export function Link(props: {href: Path, children : ReactNode, target?: '_blank' } & HTMLProps<HTMLAnchorElement>) {
let {children, className, href} = props;
const router = useRouter();
className = `${className} link`;
function onClick(event: React.MouseEvent) {
event.preventDefault();
if(window.location.pathname === href) {
router.replacePage(props.href);
} else {
router.pushPage(props.href);
}
// perform the default action if _blank
if(props.target === "_blank") {
return;
}
event.preventDefault();
if(window.location.pathname === href) {
router.replacePage(props.href);
} else {
router.pushPage(props.href);
}
}
return <a onClick={onClick} href={href} className={`${className} link`}>{children}</a>
return <a {...props} onClick={onClick} className={className}>
{children}
</a>
}

View File

@@ -1,10 +1,31 @@
import {PropsWithChildren} from "react";
import React, {PropsWithChildren} from "react";
import {useRouter} from "./RouterContext";
import {Path} from "./router";
export function Route(props: PropsWithChildren & {path: Path}) {
const Canvas = React.lazy(() => import("../index/Canvas"));
const About = React.lazy(() => import("../about/AboutPage"));
export const ROUTES: [Path, string][] = [
["/", "Home"],
["/about", "About"],
["/articles", "Articles"]
];
function Route(props: PropsWithChildren & {path: Path}) {
const {path, children} = props;
const router = useRouter();
return router.current.toLowerCase() === path ? <>{children}</> : <></>
return <>{router.current === path && children}</>
}
export function Routes() {
return <>
<Route path={ROUTES[0]![0]}>
<Canvas/>
</Route>
<Route path={ROUTES[1]![0]}>
<About/>
</Route>
</>
}