From a63c3ee13f2904be97d515af5c0bc613415d380e Mon Sep 17 00:00:00 2001 From: Grzegorz Pawlik Date: Sun, 27 Aug 2017 10:38:52 +0100 Subject: [PATCH] Minor code styling changes --- demo/index.html | 116 ++++++++++++++++++++-------------------- src/modules/gamepad.js | 60 ++++++++++----------- src/modules/keys.js | 1 - src/modules/settings.js | 2 +- 4 files changed, 89 insertions(+), 90 deletions(-) diff --git a/demo/index.html b/demo/index.html index 86c37cb..8c6729e 100644 --- a/demo/index.html +++ b/demo/index.html @@ -1,69 +1,69 @@ - Keller Library Demo - - - + Keller Library Demo + + + -
-

Sample Title #1

-

Sample subtitle #1

-
-

Ethical put a bird on it tilde, viral excepteur selvage brooklyn fixie. Butcher microdosing velit vegan mumblecore kinfolk, artisan meditation. Pork belly umami elit, truffaut reprehenderit art party eiusmod. Flannel ut chambray, humblebrag roof party truffaut typewriter skateboard cronut plaid you probably haven't heard of them 3 wolf moon kinfolk.

- - Sample image - -

Mumblecore mixtape consequat meh, keffiyeh drinking vinegar veniam lo-fi slow-carb salvia tacos echo park meggings poutine mustache. Franzen delectus offal affogato, shoreditch four dollar toast assumenda non semiotics. Chicharrones iPhone banjo literally, green juice 3 wolf moon man bun vinyl synth consequat.

+
+

Sample Title #1

+

Sample subtitle #1

+
+

Ethical put a bird on it tilde, viral excepteur selvage brooklyn fixie. Butcher microdosing velit vegan mumblecore kinfolk, artisan meditation. Pork belly umami elit, truffaut reprehenderit art party eiusmod. Flannel ut chambray, humblebrag roof party truffaut typewriter skateboard cronut plaid you probably haven't heard of them 3 wolf moon kinfolk.

-

You probably haven't heard of them tempor four dollar toast salvia slow-carb messenger bag twee tacos direct trade gastropub banh mi. Vinyl squid keffiyeh polaroid yuccie. Asymmetrical quinoa pour-over, echo park flannel neutra wolf raw denim. Mumblecore put a bird on it consectetur try-hard mollit aliqua. Mlkshk nisi farm-to-table vice in. Semiotics tattooed kale chips, pitchfork sustainable helvetica roof party pinterest YOLO godard DIY flexitarian. Non mlkshk eiusmod, ramps truffaut green juice odio readymade.

-
+ Sample image + +

Mumblecore mixtape consequat meh, keffiyeh drinking vinegar veniam lo-fi slow-carb salvia tacos echo park meggings poutine mustache. Franzen delectus offal affogato, shoreditch four dollar toast assumenda non semiotics. Chicharrones iPhone banjo literally, green juice 3 wolf moon man bun vinyl synth consequat.

+ +

You probably haven't heard of them tempor four dollar toast salvia slow-carb messenger bag twee tacos direct trade gastropub banh mi. Vinyl squid keffiyeh polaroid yuccie. Asymmetrical quinoa pour-over, echo park flannel neutra wolf raw denim. Mumblecore put a bird on it consectetur try-hard mollit aliqua. Mlkshk nisi farm-to-table vice in. Semiotics tattooed kale chips, pitchfork sustainable helvetica roof party pinterest YOLO godard DIY flexitarian. Non mlkshk eiusmod, ramps truffaut green juice odio readymade.

+
+
+
+

Sample Title #2

+

Sample subtitle #2

+
+

Mumblecore mixtape consequat meh, keffiyeh drinking vinegar veniam lo-fi slow-carb salvia tacos echo park meggings poutine mustache. Franzen delectus offal affogato, shoreditch four dollar toast assumenda non semiotics. Chicharrones iPhone banjo literally, green juice 3 wolf moon man bun vinyl synth consequat.

+ + Sample image + +

You probably haven't heard of them tempor four dollar toast salvia slow-carb messenger bag twee tacos direct trade gastropub banh mi. Vinyl squid keffiyeh polaroid yuccie. Asymmetrical quinoa pour-over, echo park flannel neutra wolf raw denim. Mumblecore put a bird on it consectetur try-hard mollit aliqua. Mlkshk nisi farm-to-table vice in. Semiotics tattooed kale chips, pitchfork sustainable helvetica roof party pinterest YOLO godard DIY flexitarian. Non mlkshk eiusmod, ramps truffaut green juice odio readymade.

+ +

Leggings deep v +1, austin bicycle rights pariatur sed. Pop-up gochujang plaid eiusmod ullamco, kickstarter offal sint sustainable leggings swag tofu. Austin lumbersexual sed art party, tacos master cleanse chicharrones. Yr lomo duis, raw denim est tacos fap culpa blue bottle paleo fanny pack aesthetic.

-
-

Sample Title #2

-

Sample subtitle #2

-
-

Mumblecore mixtape consequat meh, keffiyeh drinking vinegar veniam lo-fi slow-carb salvia tacos echo park meggings poutine mustache. Franzen delectus offal affogato, shoreditch four dollar toast assumenda non semiotics. Chicharrones iPhone banjo literally, green juice 3 wolf moon man bun vinyl synth consequat.

- - Sample image +
+
+

Sample Title #3

+

Sample subtitle #3

+
+

Ethical put a bird on it tilde, viral excepteur selvage brooklyn fixie. Butcher microdosing velit vegan mumblecore kinfolk, artisan meditation. Pork belly umami elit, truffaut reprehenderit art party eiusmod. Flannel ut chambray, humblebrag roof party truffaut typewriter skateboard cronut plaid you probably haven't heard of them 3 wolf moon kinfolk.

-

You probably haven't heard of them tempor four dollar toast salvia slow-carb messenger bag twee tacos direct trade gastropub banh mi. Vinyl squid keffiyeh polaroid yuccie. Asymmetrical quinoa pour-over, echo park flannel neutra wolf raw denim. Mumblecore put a bird on it consectetur try-hard mollit aliqua. Mlkshk nisi farm-to-table vice in. Semiotics tattooed kale chips, pitchfork sustainable helvetica roof party pinterest YOLO godard DIY flexitarian. Non mlkshk eiusmod, ramps truffaut green juice odio readymade.

- -

Leggings deep v +1, austin bicycle rights pariatur sed. Pop-up gochujang plaid eiusmod ullamco, kickstarter offal sint sustainable leggings swag tofu. Austin lumbersexual sed art party, tacos master cleanse chicharrones. Yr lomo duis, raw denim est tacos fap culpa blue bottle paleo fanny pack aesthetic.

-
+ Sample image + +

Mumblecore mixtape consequat meh, keffiyeh drinking vinegar veniam lo-fi slow-carb salvia tacos echo park meggings poutine mustache. Franzen delectus offal affogato, shoreditch four dollar toast assumenda non semiotics. Chicharrones iPhone banjo literally, green juice 3 wolf moon man bun vinyl synth consequat.

+ +

Leggings deep v +1, austin bicycle rights pariatur sed. Pop-up gochujang plaid eiusmod ullamco, kickstarter offal sint sustainable leggings swag tofu. Austin lumbersexual sed art party, tacos master cleanse chicharrones. Yr lomo duis, raw denim est tacos fap culpa blue bottle paleo fanny pack aesthetic.

-
-

Sample Title #3

-

Sample subtitle #3

-
-

Ethical put a bird on it tilde, viral excepteur selvage brooklyn fixie. Butcher microdosing velit vegan mumblecore kinfolk, artisan meditation. Pork belly umami elit, truffaut reprehenderit art party eiusmod. Flannel ut chambray, humblebrag roof party truffaut typewriter skateboard cronut plaid you probably haven't heard of them 3 wolf moon kinfolk.

- - Sample image - -

Mumblecore mixtape consequat meh, keffiyeh drinking vinegar veniam lo-fi slow-carb salvia tacos echo park meggings poutine mustache. Franzen delectus offal affogato, shoreditch four dollar toast assumenda non semiotics. Chicharrones iPhone banjo literally, green juice 3 wolf moon man bun vinyl synth consequat.

- -

Leggings deep v +1, austin bicycle rights pariatur sed. Pop-up gochujang plaid eiusmod ullamco, kickstarter offal sint sustainable leggings swag tofu. Austin lumbersexual sed art party, tacos master cleanse chicharrones. Yr lomo duis, raw denim est tacos fap culpa blue bottle paleo fanny pack aesthetic.

-
+
+
+

Sample Title #4

+

Sample subtitle #4

+
+

Cornhole qui deserunt, salvia heirloom cliche ut vice mustache dolore adipisicing microdosing mumblecore. Bushwick stumptown gastropub, sartorial kitsch aesthetic letterpress excepteur occupy chambray. Literally tilde food truck id kogi. Viral poutine nihil typewriter, kitsch officia artisan raw denim nostrud hashtag chicharrones vinyl non chambray.

+ + Sample image + +

Letterpress tote bag before they sold out bicycle rights et. Affogato asymmetrical tofu nihil microdosing cred. Slow-carb blog umami, nisi sint banjo est. Man braid velit officia, franzen synth heirloom knausgaard anim. Hella pariatur elit cornhole enim, mumblecore everyday carry cupidatat aliquip franzen tousled eiusmod tumblr. Ex eu dolor, distillery sartorial craft beer keffiyeh wayfarers DIY non crucifix delectus.

+ +

Leggings deep v +1, austin bicycle rights pariatur sed. Pop-up gochujang plaid eiusmod ullamco, kickstarter offal sint sustainable leggings swag tofu. Austin lumbersexual sed art party, tacos master cleanse chicharrones. Yr lomo duis, raw denim est tacos fap culpa blue bottle paleo fanny pack aesthetic.

-
-

Sample Title #4

-

Sample subtitle #4

-
-

Cornhole qui deserunt, salvia heirloom cliche ut vice mustache dolore adipisicing microdosing mumblecore. Bushwick stumptown gastropub, sartorial kitsch aesthetic letterpress excepteur occupy chambray. Literally tilde food truck id kogi. Viral poutine nihil typewriter, kitsch officia artisan raw denim nostrud hashtag chicharrones vinyl non chambray.

- - Sample image - -

Letterpress tote bag before they sold out bicycle rights et. Affogato asymmetrical tofu nihil microdosing cred. Slow-carb blog umami, nisi sint banjo est. Man braid velit officia, franzen synth heirloom knausgaard anim. Hella pariatur elit cornhole enim, mumblecore everyday carry cupidatat aliquip franzen tousled eiusmod tumblr. Ex eu dolor, distillery sartorial craft beer keffiyeh wayfarers DIY non crucifix delectus.

- -

Leggings deep v +1, austin bicycle rights pariatur sed. Pop-up gochujang plaid eiusmod ullamco, kickstarter offal sint sustainable leggings swag tofu. Austin lumbersexual sed art party, tacos master cleanse chicharrones. Yr lomo duis, raw denim est tacos fap culpa blue bottle paleo fanny pack aesthetic.

-
-
- - +
+ + - \ No newline at end of file + diff --git a/src/modules/gamepad.js b/src/modules/gamepad.js index b6b9a06..12abac2 100644 --- a/src/modules/gamepad.js +++ b/src/modules/gamepad.js @@ -1,38 +1,38 @@ Keller.prototype.gamepad = function() { - var _this = this, - _ = _this.utils(); + var _this = this, + _ = _this.utils(); - var gamepadConnected = function() { - // https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API/Using_the_Gamepad_API - // http://gamedevelopment.tutsplus.com/tutorials/using-the-html5-gamepad-api-to-add-controller-support-to-browser-games--cms-21345 - console.log('Gamepad connected.'); - var repGP = window.setInterval(_.bind(checkGamepad, _this), 200); - }; + var gamepadConnected = function() { + // https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API/Using_the_Gamepad_API + // http://gamedevelopment.tutsplus.com/tutorials/using-the-html5-gamepad-api-to-add-controller-support-to-browser-games--cms-21345 + console.log('Gamepad connected.'); + var repGP = window.setInterval(_.bind(checkGamepad, _this), 200); + }; - var gamepadDisconnected = function() { - console.log('Gamepad disconnected!'); - }; + var gamepadDisconnected = function() { + console.log('Gamepad disconnected!'); + }; - var checkGamepad = function() { - var gp = navigator.getGamepads()[0]; + var checkGamepad = function() { + var gp = navigator.getGamepads()[0]; - if (gp.buttons[1].pressed) { - _this.navigation().keyboard('right'); - } - if (gp.buttons[2].pressed) { - _this.navigation().keyboard('left'); - } - if (gp.buttons[4].pressed) { - _this.textinput().removeText(); - } - if (gp.buttons[5].pressed) { - _this.textinput().writeText(); - } - }; + if (gp.buttons[1].pressed) { + _this.navigation().keyboard('right'); + } + if (gp.buttons[2].pressed) { + _this.navigation().keyboard('left'); + } + if (gp.buttons[4].pressed) { + _this.textinput().removeText(); + } + if (gp.buttons[5].pressed) { + _this.textinput().writeText(); + } + }; - return { - isConnected: gamepadConnected, - isDisconnected: gamepadDisconnected - }; + return { + isConnected: gamepadConnected, + isDisconnected: gamepadDisconnected + }; }; diff --git a/src/modules/keys.js b/src/modules/keys.js index ea56ca3..f914556 100644 --- a/src/modules/keys.js +++ b/src/modules/keys.js @@ -4,7 +4,6 @@ Keller.prototype.keys = function() { _ = _this.utils(); var getKeyEvent = function(e) { - // direction; e.preventDefault(); switch (e.keyCode) { case 13: diff --git a/src/modules/settings.js b/src/modules/settings.js index 63ef5ab..edc0f38 100644 --- a/src/modules/settings.js +++ b/src/modules/settings.js @@ -27,7 +27,7 @@ Keller.prototype.settings = function() { 'label': 'Line height', 'type': 'stepper', 'name': 'line-height', - 'value': 5 + 'value': 6 }, { 'label': 'Show images',