~rbdr/gemlog

2c95e54cfa2eaa1555e73e6ae42561d9eeca293a — Ruben Beltran del Rio 2 months ago 18a5367
Add static
3 files changed, 26 insertions(+), 0 deletions(-)

A static/favicon.ico
A static/favicon.png
A static/js/blog.js
A static/favicon.ico => static/favicon.ico +0 -0
A static/favicon.png => static/favicon.png +0 -0
A static/js/blog.js => static/js/blog.js +26 -0
@@ 0,0 1,26 @@
'use strict';

/* globals window */

((w) => {

  const internals = {
    // Application entry point, for now just band to keyboard

    main() {

      w.document.addEventListener('keydown', internals._onKeyDown);
    },

    // Handles key events to point to the correct blog post.

    _onKeyDown(e) {

      if (['1','2','3'].indexOf(e.key) > -1) {
        w.location.hash = e.key;
      }
    }
  };

  w.addEventListener('load', internals.main);
})(window);