From 37702831c26375006f15074e1e855a58c2b69b45 Mon Sep 17 00:00:00 2001 From: Thomas Cole Date: Fri, 23 Dec 2022 12:00:46 -0500 Subject: [PATCH] Added custom mdx components. Tweaked layouts. Quicksort project example. --- src/components/mdx/H1.astro | 3 + src/components/mdx/H2.astro | 3 + src/components/mdx/H3.astro | 3 + src/components/misc/BlogProjectCard.astro | 6 +- src/components/nav/Nav.astro | 4 +- src/layouts/InteractiveDemoLayout.astro | 2 +- src/layouts/Layout.astro | 2 +- src/pages/index.astro | 6 +- src/pages/projects/demo.mdx | 13 --- src/pages/projects/demo/quicksort.svelte | 131 +++++++++++++--------- src/pages/projects/quicksort.mdx | 24 ++++ src/pages/resume.astro | 4 +- 12 files changed, 126 insertions(+), 75 deletions(-) create mode 100644 src/components/mdx/H1.astro create mode 100644 src/components/mdx/H2.astro create mode 100644 src/components/mdx/H3.astro delete mode 100644 src/pages/projects/demo.mdx create mode 100644 src/pages/projects/quicksort.mdx diff --git a/src/components/mdx/H1.astro b/src/components/mdx/H1.astro new file mode 100644 index 0000000..f93f262 --- /dev/null +++ b/src/components/mdx/H1.astro @@ -0,0 +1,3 @@ +

+ +

\ No newline at end of file diff --git a/src/components/mdx/H2.astro b/src/components/mdx/H2.astro new file mode 100644 index 0000000..d53dcc8 --- /dev/null +++ b/src/components/mdx/H2.astro @@ -0,0 +1,3 @@ +

+ +

\ No newline at end of file diff --git a/src/components/mdx/H3.astro b/src/components/mdx/H3.astro new file mode 100644 index 0000000..100801d --- /dev/null +++ b/src/components/mdx/H3.astro @@ -0,0 +1,3 @@ +

+ +

\ No newline at end of file diff --git a/src/components/misc/BlogProjectCard.astro b/src/components/misc/BlogProjectCard.astro index c02596d..fa43717 100644 --- a/src/components/misc/BlogProjectCard.astro +++ b/src/components/misc/BlogProjectCard.astro @@ -12,10 +12,10 @@ const { title, subtitle, image, link } = Astro.props;
-
+
-
-

{title}

+
+

{title}

{subtitle}

diff --git a/src/components/nav/Nav.astro b/src/components/nav/Nav.astro index 9146dda..8c91598 100644 --- a/src/components/nav/Nav.astro +++ b/src/components/nav/Nav.astro @@ -11,7 +11,7 @@ + +
\ No newline at end of file diff --git a/src/pages/projects/quicksort.mdx b/src/pages/projects/quicksort.mdx new file mode 100644 index 0000000..e2d2caf --- /dev/null +++ b/src/pages/projects/quicksort.mdx @@ -0,0 +1,24 @@ +--- +layout: "../../layouts/InteractiveDemoLayout.astro" +title: "Quicksort Demo" +tagline: "A simple visualization of the quicksort algorithm using p5.js" +date: "December 23, 2022" +image: "https://images.unsplash.com/photo-1669399213378-2853e748f217?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1632&q=80" +--- +{/* Bring in override/custom render components. Tailwind does some default things to header tags. */} +import H1 from '../../components/mdx/H1.astro'; +export const components = {h1: H1} + +import Quicksort from './demo/quicksort.svelte'; + + + +--- + +This demo was originally written as part of a job application to work for the IT department at my university. It was the first project I wrote with the aid of the p5.js library. +I used this demo as a way to learn how to visualize the quicksort algorithm.\ +\ +I took inspiration from the YouTube video: *[15 Sorting Algorithms in 6 Minutes](https://www.youtube.com/watch?v=kPRA0W1kECg)*. The source code for those interested can be found on my *[Github](https://github.com/thomaspcole/p5QuicksortVisualization)*.\ +\ +The demo works by generating an array of 200 values then randomly shuffling the array. We then call the ```quicksort``` function to sort the array. At each iteration of the function, the code takes a 'snapshot' of the data array at that iteration. +By iterating through the 'snapshot' array we get our final animation. It also allows for stepping forward and backwards to see each step of the animation. \ No newline at end of file diff --git a/src/pages/resume.astro b/src/pages/resume.astro index 7bad196..e3dc4ea 100644 --- a/src/pages/resume.astro +++ b/src/pages/resume.astro @@ -12,7 +12,7 @@ } -
+

About Me

Lorem ipsum dolor sit amet consectetur adipisicing elit. Possimus esse inventore iusto earum asperiores necessitatibus, dolores id cumque nesciunt libero eligendi vel reprehenderit eius officia. Veritatis dolorum illum exercitationem suscipit.

@@ -63,7 +63,7 @@

Skills

-
    +
    • HTML
    • CSS
    • JavaScript