Skip to content

andreasvirkus/xkcd-vuer

Repository files navigation

xkcd vuer

forthebadge

forthebadge

forthebadge


This light PWA uses the XKCD JSON version to query a comic strip's data via AWS lambda functions (comfily through Netlify functions).

It's more of a silly learning project to dip my toes in serverless and Go.

It also displays the title/alt text of an image so you wouldn't have to hover and wait for it.
You're welcome.

This app also tries to make the comics more accessible, exposing the transcript of each comic in an aria-label attribute (for screen-readers).


Interesting tidbits

A collection of findings discovered along the way.

Encoding

xkcd JSON "API"'s encoding seems to be buggy. For example, em dash gets encoded as \u00e2\u0080\u0094

ref1 - xkcd forum; ref2 - SO meta

A workaround: decodeURIComponent(escape(transcript))

TODO

  • Handle 404s both client-side (when our serverless returns a 404) and server-side (ie on weird routes or when the route structure doesn't match a digits-only regex / "about")
  • Add either page transitions or UI skeletons

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Lints and fixes files

npm run lint

Run your unit tests

npm run test:unit