<html lang="en">
<head>
<meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="Rubén Beltrán del Río">
<meta name="description" content="{{ page.description }}">
- <link rel="stylesheet" type="text/css" href="/css/application.css">
+
+ <meta name="theme-color" content="#db5945">
+
<title>Unlimited 🍕 {{ page.title }}</title>
+ <link rel="manifest" href="/manifest.webmanifest">
+
+ <link rel="stylesheet" type="text/css" href="/css/application.css" media="none" onload="if (media!=='all') { media = 'all'; }">
+ <noscript>
+ <link rel="stylesheet" type="text/css" href="/css/application.css">
+ </noscript>
+
+ <script src="/js/offline_support.js" defer></script>
+
<!--
/\
/ O\ U N L I M I T E D
body {
+ margin: 0;
background-color: white;
font-family: times, 'Times New Roman', serif;
font-smooth: never;
h1,
h2,
h3 {
+ margin-left: 10px;
font-weight: 300;
}
color: purple;
}
+ul, p {
+ margin-left: 10px;
+}
+
ul {
list-style: square;
}
li {
line-height: 1.82em;
}
+
+img,
+video {
+ max-width: 100vw;
+}
<h2>Even more stuff.</h2>
- <p><img src="/img/selfie.gif" alt="An image of @pigeonfolk."/></p>
+ <video autoplay muted loop>
+ <source src="/video/selfie.webm" type="video/webm">
+ <source src="/video/selfie.mp4" type="video/mp4">
+ </video>
<p>🍕 Unlimited pizza 🍕 is brought to you by blood magic, ancient rituals and
me, Rubén Beltrán del Río. I have words written <span lang="es-mx">(español e inglés)</span> on
--- /dev/null
+if ('serviceWorker' in navigator) {
+
+ navigator.serviceWorker.register('/service_worker.js');
+}
--- /dev/null
+{
+ "name": "Unlimited Pizza",
+ "short_name": "Unlmtd 🍕",
+ "start_url": "/",
+ "display": "minimal-ui",
+ "background_color": "#fff",
+ "theme_color": "#fff",
+ "description": "unlimited.pizza - ruben beltran del río surfs the internet: programming, music, fun times, hugs, bad jokes, and unlimited pizza",
+ "lang": "en-US",
+ "icons": [
+ {
+ "src": "img/touch/homescreen48.png",
+ "sizes": "48x48",
+ "type": "image/png"
+ },
+ {
+ "src": "img/touch/homescreen72.png",
+ "sizes": "72x72",
+ "type": "image/png"
+ },
+ {
+ "src": "img/touch/homescreen96.png",
+ "sizes": "96x96",
+ "type": "image/png"
+ },
+ {
+ "src": "img/touch/homescreen144.png",
+ "sizes": "144x144",
+ "type": "image/png"
+ },
+ {
+ "src": "img/touch/homescreen168.png",
+ "sizes": "168x168",
+ "type": "image/png"
+ },
+ {
+ "src": "img/touch/homescreen192.png",
+ "sizes": "192x192",
+ "type": "image/png"
+ },
+ {
+ "src": "img/touch/homescreen256.png",
+ "sizes": "256x256",
+ "type": "image/png"
+ },
+ {
+ "src": "img/touch/homescreen512.png",
+ "sizes": "512x512",
+ "type": "image/png"
+ }
+ ]
+}
--- /dev/null
+'use strict';
+
+const internals = {
+ version: '1',
+ offlineEssentials: [
+ '/',
+ '/css/application.css'
+ ],
+
+ // Response for when network is not available
+
+ errorResponse: '<h1>Service Unavailable</h1>',
+
+ // Main entry point, adds event listeners for service worker
+
+ main() {
+
+ self.addEventListener('install', internals.onInstall);
+ self.addEventListener('fetch', internals.onFetch);
+ self.addEventListener('activate', internals.onActivate);
+ },
+
+ // Runs on installation of the service worker
+
+ onInstall(event) {
+
+ event.waitUntil(
+ caches.open(`${internals.version}/essentials`)
+ .then((cache) => {
+
+ return cache.addAll(internals.offlineEssentials)
+ })
+ );
+ },
+
+ // Runs when a path is fetched, returns files from cache
+
+ onFetch(event) {
+
+ if (event.request.method !== 'GET') {
+ return;
+ }
+
+ event.respondWith(
+ caches.match(event.request)
+ .then((cached) => {
+
+ const freshContent = fetch(event.request)
+ .then((response) => {
+
+ caches.open(`${internals.version}/paths`)
+ .then((cache) => cache.put(event.request, response.clone()));
+ }, internals.onFetchFail)
+ .catch(internals.onFetchFail);
+
+ return cached || freshContent;
+ })
+ );
+ },
+
+ onActivate(event) {
+
+ event.waitUntil(
+ caches.keys()
+ .then((keys) => {
+
+ return Promise.all(keys
+ .filter((key) => !key.startsWith(internals.version))
+ .map((key) => caches.delete(key))
+ );
+ })
+ );
+ },
+
+ // Responds with Servie Unavailable if we can't fetch a
+ // file from network
+
+ onFetchFail() {
+
+ return new Response(internals.errorResponse, {
+ status: 503,
+ statusText: 'Service Unavailable',
+ headers: new Headers({
+ 'Content-Type': 'text/html'
+ })
+ });
+ }
+};
+
+internals.main();