diff --git a/astro.config.mjs b/astro.config.mjs index 82be796..6a47186 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -11,6 +11,9 @@ export default defineConfig({ integrations: [ starlight({ title: 'mcwaddams', + components: { + Footer: './src/components/Footer.astro', + }, tagline: 'I was told there would be document extraction.', logo: { src: './src/assets/stapler.svg', diff --git a/public/flair/basement.svg b/public/flair/basement.svg new file mode 100644 index 0000000..60f32ab --- /dev/null +++ b/public/flair/basement.svg @@ -0,0 +1,12 @@ + diff --git a/public/flair/bobs.svg b/public/flair/bobs.svg new file mode 100644 index 0000000..2cb6940 --- /dev/null +++ b/public/flair/bobs.svg @@ -0,0 +1,17 @@ + diff --git a/public/flair/coffee.svg b/public/flair/coffee.svg new file mode 100644 index 0000000..187cfc3 --- /dev/null +++ b/public/flair/coffee.svg @@ -0,0 +1,14 @@ + diff --git a/public/flair/conclusions.svg b/public/flair/conclusions.svg new file mode 100644 index 0000000..cc4d5bc --- /dev/null +++ b/public/flair/conclusions.svg @@ -0,0 +1,17 @@ + diff --git a/public/flair/extraction.svg b/public/flair/extraction.svg new file mode 100644 index 0000000..d4aed1e --- /dev/null +++ b/public/flair/extraction.svg @@ -0,0 +1,11 @@ + diff --git a/public/flair/flair-badge.svg b/public/flair/flair-badge.svg new file mode 100644 index 0000000..3e199e0 --- /dev/null +++ b/public/flair/flair-badge.svg @@ -0,0 +1,16 @@ + diff --git a/public/flair/memo.svg b/public/flair/memo.svg new file mode 100644 index 0000000..6365b55 --- /dev/null +++ b/public/flair/memo.svg @@ -0,0 +1,18 @@ + diff --git a/public/flair/oface.svg b/public/flair/oface.svg new file mode 100644 index 0000000..594a411 --- /dev/null +++ b/public/flair/oface.svg @@ -0,0 +1,20 @@ + diff --git a/public/flair/printer.svg b/public/flair/printer.svg new file mode 100644 index 0000000..ccc9103 --- /dev/null +++ b/public/flair/printer.svg @@ -0,0 +1,15 @@ + diff --git a/public/flair/spreadsheet.svg b/public/flair/spreadsheet.svg new file mode 100644 index 0000000..27839ea --- /dev/null +++ b/public/flair/spreadsheet.svg @@ -0,0 +1,23 @@ + diff --git a/public/flair/stapler.svg b/public/flair/stapler.svg new file mode 100644 index 0000000..34be001 --- /dev/null +++ b/public/flair/stapler.svg @@ -0,0 +1,17 @@ + diff --git a/public/flair/tps.svg b/public/flair/tps.svg new file mode 100644 index 0000000..4234e71 --- /dev/null +++ b/public/flair/tps.svg @@ -0,0 +1,15 @@ + diff --git a/src/assets/flair/basement.svg b/src/assets/flair/basement.svg new file mode 100644 index 0000000..60f32ab --- /dev/null +++ b/src/assets/flair/basement.svg @@ -0,0 +1,12 @@ + diff --git a/src/assets/flair/bobs.svg b/src/assets/flair/bobs.svg new file mode 100644 index 0000000..2cb6940 --- /dev/null +++ b/src/assets/flair/bobs.svg @@ -0,0 +1,17 @@ + diff --git a/src/assets/flair/coffee.svg b/src/assets/flair/coffee.svg new file mode 100644 index 0000000..187cfc3 --- /dev/null +++ b/src/assets/flair/coffee.svg @@ -0,0 +1,14 @@ + diff --git a/src/assets/flair/conclusions.svg b/src/assets/flair/conclusions.svg new file mode 100644 index 0000000..cc4d5bc --- /dev/null +++ b/src/assets/flair/conclusions.svg @@ -0,0 +1,17 @@ + diff --git a/src/assets/flair/extraction.svg b/src/assets/flair/extraction.svg new file mode 100644 index 0000000..d4aed1e --- /dev/null +++ b/src/assets/flair/extraction.svg @@ -0,0 +1,11 @@ + diff --git a/src/assets/flair/flair-badge.svg b/src/assets/flair/flair-badge.svg new file mode 100644 index 0000000..3e199e0 --- /dev/null +++ b/src/assets/flair/flair-badge.svg @@ -0,0 +1,16 @@ + diff --git a/src/assets/flair/memo.svg b/src/assets/flair/memo.svg new file mode 100644 index 0000000..6365b55 --- /dev/null +++ b/src/assets/flair/memo.svg @@ -0,0 +1,18 @@ + diff --git a/src/assets/flair/oface.svg b/src/assets/flair/oface.svg new file mode 100644 index 0000000..594a411 --- /dev/null +++ b/src/assets/flair/oface.svg @@ -0,0 +1,20 @@ + diff --git a/src/assets/flair/printer.svg b/src/assets/flair/printer.svg new file mode 100644 index 0000000..ccc9103 --- /dev/null +++ b/src/assets/flair/printer.svg @@ -0,0 +1,15 @@ + diff --git a/src/assets/flair/spreadsheet.svg b/src/assets/flair/spreadsheet.svg new file mode 100644 index 0000000..27839ea --- /dev/null +++ b/src/assets/flair/spreadsheet.svg @@ -0,0 +1,23 @@ + diff --git a/src/assets/flair/stapler.svg b/src/assets/flair/stapler.svg new file mode 100644 index 0000000..34be001 --- /dev/null +++ b/src/assets/flair/stapler.svg @@ -0,0 +1,17 @@ + diff --git a/src/assets/flair/tps.svg b/src/assets/flair/tps.svg new file mode 100644 index 0000000..4234e71 --- /dev/null +++ b/src/assets/flair/tps.svg @@ -0,0 +1,15 @@ + diff --git a/src/components/FlairBadge.astro b/src/components/FlairBadge.astro new file mode 100644 index 0000000..2e47128 --- /dev/null +++ b/src/components/FlairBadge.astro @@ -0,0 +1,979 @@ +--- +/** + * FlairBadge - Collect pieces of flair by spending time on key pages + * Adapted for Starlight documentation site + * + * "We need to talk about your flair..." - Stan, Manager + * + * Features: + * - Floating counter in bottom-right corner + * - Opens modal "flair board" showing collection + * - 15-second timer per page to earn flair + * - localStorage persistence across sessions + * - Astro view transition support + */ + +import flairConfig from '../data/flair-config.json'; + +interface Props { + currentPath: string; +} + +const { currentPath } = Astro.props; + +// Normalize path for matching (handle trailing slashes) +const normalizedPath = currentPath === '/' ? '/' : currentPath.replace(/\/$/, '') + '/'; +const altPath = currentPath === '/' ? '/' : currentPath.replace(/\/$/, ''); + +// Check if current page has flair (try both with and without trailing slash) +const currentFlair = flairConfig.flairs.find(f => + f.path === normalizedPath || f.path === altPath || f.path === currentPath +); +--- + + + + + +
+ + + + + + + + + + diff --git a/src/components/Footer.astro b/src/components/Footer.astro new file mode 100644 index 0000000..27f1cff --- /dev/null +++ b/src/components/Footer.astro @@ -0,0 +1,15 @@ +--- +/** + * Custom Footer component that includes the FlairBadge system + * Wraps Starlight's default Footer + */ +import type { Props } from '@astrojs/starlight/props'; +import Default from '@astrojs/starlight/components/Footer.astro'; +import FlairBadge from './FlairBadge.astro'; + +// Get current path for flair matching +const currentPath = Astro.url.pathname; +--- + +