removed old stuff
This commit is contained in:
@@ -54,11 +54,9 @@
|
||||
"jose": "^6.1.3",
|
||||
"mermaid": "^11.12.2",
|
||||
"motion": "^12.23.26",
|
||||
"pdfjs-dist": "^5.4.449",
|
||||
"solid-js": "^1.9.5",
|
||||
"solid-tiptap": "^0.8.0",
|
||||
"uuid": "^13.0.0",
|
||||
"valibot": "^0.29.0",
|
||||
"vinxi": "^0.5.7",
|
||||
"zod": "^4.2.1"
|
||||
},
|
||||
|
||||
@@ -1,61 +1,6 @@
|
||||
import { Title, Meta } from "@solidjs/meta";
|
||||
import { createSignal, onMount, Show, For } from "solid-js";
|
||||
import { isServer } from "solid-js/web";
|
||||
import { TerminalSplash } from "~/components/TerminalSplash";
|
||||
import { PDF_CONFIG } from "~/config";
|
||||
|
||||
export default function Resume() {
|
||||
const [pages, setPages] = createSignal<HTMLCanvasElement[]>([]);
|
||||
const [loading, setLoading] = createSignal(true);
|
||||
const [error, setError] = createSignal(false);
|
||||
let containerRef: HTMLDivElement | undefined;
|
||||
|
||||
onMount(async () => {
|
||||
try {
|
||||
// Dynamically import PDF.js only on client
|
||||
const pdfjsLib = await import("pdfjs-dist");
|
||||
|
||||
// Set worker source to local file
|
||||
pdfjsLib.GlobalWorkerOptions.workerSrc = "/pdf.worker.min.mjs";
|
||||
|
||||
// Load the PDF
|
||||
const loadingTask = pdfjsLib.getDocument("/resume.pdf");
|
||||
const pdf = await loadingTask.promise;
|
||||
|
||||
const canvases: HTMLCanvasElement[] = [];
|
||||
|
||||
// Render each page
|
||||
for (let pageNum = 1; pageNum <= pdf.numPages; pageNum++) {
|
||||
const page = await pdf.getPage(pageNum);
|
||||
const viewport = page.getViewport({ scale: PDF_CONFIG.RENDER_SCALE });
|
||||
|
||||
// Create canvas
|
||||
const canvas = document.createElement("canvas");
|
||||
const context = canvas.getContext("2d");
|
||||
if (!context) continue;
|
||||
|
||||
canvas.height = viewport.height;
|
||||
canvas.width = viewport.width;
|
||||
canvas.className = "shadow-lg mb-4 mx-auto max-w-full";
|
||||
|
||||
// Render page
|
||||
await page.render({
|
||||
canvasContext: context,
|
||||
viewport: viewport
|
||||
}).promise;
|
||||
|
||||
canvases.push(canvas);
|
||||
}
|
||||
|
||||
setPages(canvases);
|
||||
setLoading(false);
|
||||
} catch (err) {
|
||||
console.error("Error loading PDF:", err);
|
||||
setError(true);
|
||||
setLoading(false);
|
||||
}
|
||||
});
|
||||
|
||||
return (
|
||||
<>
|
||||
<Title>Resume | Michael Freno</Title>
|
||||
@@ -64,18 +9,7 @@ export default function Resume() {
|
||||
content="View Michael Freno's resume - Software Engineer."
|
||||
/>
|
||||
|
||||
<main class="flex min-h-screen w-full flex-col">
|
||||
<Show
|
||||
when={!loading() && !error()}
|
||||
fallback={
|
||||
<Show when={error()} fallback={<TerminalSplash />}>
|
||||
<div class="flex h-screen w-full flex-col items-center justify-center gap-6 p-8">
|
||||
<div class="flex flex-col items-center gap-4 text-center">
|
||||
<h2 class="text-2xl font-bold">View Resume</h2>
|
||||
<p class="text-gray-600 dark:text-gray-400">
|
||||
Unable to load PDF viewer.
|
||||
</p>
|
||||
</div>
|
||||
<main class="w-full flex-1 flex-col items-center p-4">
|
||||
<div class="mb-4 flex gap-3">
|
||||
<a
|
||||
href="/resume.pdf"
|
||||
@@ -93,44 +27,12 @@ export default function Resume() {
|
||||
Download PDF
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</Show>
|
||||
}
|
||||
>
|
||||
<div
|
||||
ref={containerRef}
|
||||
class="flex w-full flex-col items-center gap-4 overflow-y-auto p-4"
|
||||
>
|
||||
<div class="mb-4 flex gap-3">
|
||||
<a
|
||||
href="/resume.pdf"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="bg-blue rounded px-4 py-2 text-base text-sm hover:brightness-125"
|
||||
>
|
||||
Open in New Tab
|
||||
</a>
|
||||
<a
|
||||
href="/resume.pdf"
|
||||
download="Michael_Freno_Resume.pdf"
|
||||
class="border-blue text-blue rounded border px-4 py-2 text-sm hover:brightness-125"
|
||||
>
|
||||
Download PDF
|
||||
</a>
|
||||
</div>
|
||||
<For each={pages()}>
|
||||
{(canvas) => {
|
||||
let divRef: HTMLDivElement | undefined;
|
||||
onMount(() => {
|
||||
if (divRef) {
|
||||
divRef.appendChild(canvas);
|
||||
}
|
||||
});
|
||||
return <div ref={divRef} />;
|
||||
}}
|
||||
</For>
|
||||
</div>
|
||||
</Show>
|
||||
|
||||
<embed
|
||||
src="/resume.pdf"
|
||||
type="application/pdf"
|
||||
class="h-full w-full max-w-5xl shadow-lg"
|
||||
/>
|
||||
</main>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
import { wrap } from "@typeschema/valibot";
|
||||
import { string } from "valibot";
|
||||
import {
|
||||
createTRPCRouter,
|
||||
publicProcedure,
|
||||
protectedProcedure,
|
||||
adminProcedure
|
||||
} from "../utils";
|
||||
|
||||
export const exampleRouter = createTRPCRouter({
|
||||
hello: publicProcedure
|
||||
.input(wrap(string()))
|
||||
.query(({ input }) => {
|
||||
return `Hello ${input}!`;
|
||||
}),
|
||||
|
||||
// Example of a protected procedure (requires authentication)
|
||||
getProfile: protectedProcedure.query(({ ctx }) => {
|
||||
return {
|
||||
userId: ctx.userId,
|
||||
privilegeLevel: ctx.privilegeLevel,
|
||||
message: "You are authenticated!",
|
||||
};
|
||||
}),
|
||||
|
||||
// Example of an admin-only procedure
|
||||
adminDashboard: adminProcedure.query(({ ctx }) => {
|
||||
return {
|
||||
userId: ctx.userId,
|
||||
message: "Welcome to the admin dashboard!",
|
||||
isAdmin: true,
|
||||
};
|
||||
}),
|
||||
});
|
||||
Reference in New Issue
Block a user