Skip to content

Platane/ampokedex

Repository files navigation

pokeball icon ampokedex

type definitions code style GitHub Workflow Status

Pokedex App powered by amp

app screenshot

ampokedex

Featuring:

  • ⚡ amp pages **
  • 🎠 nice page transition
  • 🚀 sweet lighthouse score **

Table of Contents

Install

yarn

Usage

# build pages and service worker and app shell script and prepare images
yarn build

# serves pages
yarn serve

Motivation

This app demonstrate the use of an app shell using amp shell.

Usually to have this kind of interaction means having to serve amp pages + a react app with the exact same rendering. This solution is much simpler.

Implementation

Static pages

All pages are build in github action and served from github pages.

Data is pulled from pokeapi. With restrictions to respect fair use.

App shell

Upon first visit, the page install a service worker.

Next navigation will redirect to the app shell (which is not an amp page).

The app shell leverage amp shadow doc to display content.

Page transition

When navigating inside the app shell, the page is not reloaded.

Allowing for continuous animation (such as the rolling pokeball in the nav bar ). As Well as page transition.

Thanks

Thanks to the pokeapi community for the work.

Pokémon and Pokémon character names are trademarks of Nintendo