From f262ca2ba509a58aabf7b07d7a5bda2a27f48cdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20P=C4=99dzich?= Date: Mon, 29 Apr 2024 11:38:14 +0200 Subject: [PATCH] Add an about page --- src/pages/about.astro | 35 +++++++++++++++++++++++++++++++++++ src/pages/index.astro | 14 ++++++-------- 2 files changed, 41 insertions(+), 8 deletions(-) create mode 100644 src/pages/about.astro diff --git a/src/pages/about.astro b/src/pages/about.astro new file mode 100644 index 0000000..23b023a --- /dev/null +++ b/src/pages/about.astro @@ -0,0 +1,35 @@ +--- +import BaseLayout from '@/layouts/BaseLayout.astro'; +--- + + +

About

+

+ Inspired by Six Degrees of Wikipedia, Six Degress of Formula 1 stores data of over 800 drivers, who are + connected together by about 5000 links. If two drivers competed for the same + team in at least one race, there's a link between them. +

+

+ Simply enter the names of two F1 drivers, and you'll be shown how to get + from one to the other using as few connections as possible. +

+

+ The aforementioned data was sourced from Ergast. The website was built with Astro, PicoCSS, Neo4j, and vis.js. +

+
+ + diff --git a/src/pages/index.astro b/src/pages/index.astro index 625766e..9012642 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -6,14 +6,16 @@ import PathVisualiser from '@/components/PathVisualiser.astro'; const source = (Astro.url.searchParams.get('source')! || '').trim(); const dest = (Astro.url.searchParams.get('dest')! || '').trim(); +const noEmptyParams = source !== '' && dest !== ''; + // Cache the page for 2 weeks Astro.response.headers.set('Cache-Control', 'public, max-age=1209600'); ---
-

Six Degrees of F1

-

Find out which driver is the sport's Kevin Bacon

+

Six Degrees of Formula 1

+

Find out who's the sport's Kevin Bacon

Get all the shortest paths from/to:

@@ -40,13 +42,9 @@ Astro.response.headers.set('Cache-Control', 'public, max-age=1209600'); /> - + - { - source !== '' && dest !== '' && ( - - ) - } + {noEmptyParams && }