diff options
author | cyfraeviolae <cyfraeviolae> | 2022-02-26 02:09:17 -0500 |
---|---|---|
committer | cyfraeviolae <cyfraeviolae> | 2022-02-26 02:09:17 -0500 |
commit | d7683c7f82ff87171bf17192866f8a6a47185b14 (patch) | |
tree | cd79e4dd87df5d579f9508b976abfc96d59c8419 /static | |
parent | b2f8387cb4be4e2ab0febd5185a0df6f990bbbd4 (diff) |
arrows
Diffstat (limited to 'static')
-rw-r--r-- | static/poems.js | 52 | ||||
-rw-r--r-- | static/script.js | 6 |
2 files changed, 31 insertions, 27 deletions
diff --git a/static/poems.js b/static/poems.js index fd5d0bd..89e8701 100644 --- a/static/poems.js +++ b/static/poems.js @@ -1,31 +1,5 @@ var challenges = [ { - "line": [["In", "/fin", "ite"], ["/wrath"], ["and"], ["/in", "fin", "/ite"], ["des", "/pair"]], - "title": "Book IV", - "collection": "Paradise Lost", - "author": "John Milton", - "meter": "iambic pentameter", - "ctx": `Me miserable! which way shall I flie -Infinite wrauth, and infinite despaire? -Which way I flie is Hell; my self am Hell; -And in the lowest deep a lower deep -Still threatning to devour me opens wide, -To which the Hell I suffer seems a Heav'n.`, - "link": "https://milton.host.dartmouth.edu/reading_room/pl/book_4/text.shtml", - }, - { - "line": [["For"], ["the"], ["/An", "gel"], ["of"], ["/Death"], ["spread"], ["his"], ["/wings"], ["on"], ["the"], ["/blast"]], - "title": "The Destruction of Sennacherib", - "collection": "Hebrew Melodies", - "author": "Lord Byron", - "meter": "anapestic tetrameter", - "ctx": `For the Angel of Death spread his wings on the blast, -And breathed in the face of the foe as he passed; -And the eyes of the sleepers waxed deadly and chill, -And their hearts but once heaved, and for ever grew still!`, - "link": "https://www.poetryfoundation.org/poems/43827/the-destruction-of-sennacherib", - }, - { "line": [["A"], ["/pre", "sence"], ["/that"], ["dis", "/turbs"], ["me"], ["/with"], ["the"], ["/joy"]], "title": "Lines written a few miles above Tintern Abbey", "collection": "Lyrical Ballads", @@ -43,4 +17,30 @@ All thinking things, all objects of all thought, And rolls through all things.`, "link": "https://www.gutenberg.org/files/9622/9622-h/9622-h.htm#poem23", }, + { + "line": [["For"], ["the"], ["/An", "gel"], ["of"], ["/Death"], ["spread"], ["his"], ["/wings"], ["on"], ["the"], ["/blast"]], + "title": "The Destruction of Sennacherib", + "collection": "Hebrew Melodies", + "author": "Lord Byron", + "meter": "anapestic tetrameter", + "ctx": `For the Angel of Death spread his wings on the blast, +And breathed in the face of the foe as he passed; +And the eyes of the sleepers waxed deadly and chill, +And their hearts but once heaved, and for ever grew still!`, + "link": "https://www.poetryfoundation.org/poems/43827/the-destruction-of-sennacherib", + }, + { + "line": [["In", "/fin", "ite"], ["/wrath"], ["and"], ["/in", "fin", "/ite"], ["des", "/pair"]], + "title": "Book IV", + "collection": "Paradise Lost", + "author": "John Milton", + "meter": "iambic pentameter", + "ctx": `Me miserable! which way shall I flie +Infinite wrauth, and infinite despaire? +Which way I flie is Hell; my self am Hell; +And in the lowest deep a lower deep +Still threatning to devour me opens wide, +To which the Hell I suffer seems a Heav'n.`, + "link": "https://milton.host.dartmouth.edu/reading_room/pl/book_4/text.shtml", + }, ] diff --git a/static/script.js b/static/script.js index 9692f36..7585efa 100644 --- a/static/script.js +++ b/static/script.js @@ -167,6 +167,10 @@ function keyHandler(key) { if (key == 'Backspace') { el.innerText = ''; nextel = document.querySelector(`[data-offset="${offset-1}"]`); + } else if (key == 'ArrowLeft') { + nextel = document.querySelector(`[data-offset="${offset-1}"]`); + } else if (key == 'ArrowRight') { + nextel = document.querySelector(`[data-offset="${offset+1}"]`); } else { el.innerText = key.toUpperCase(); nextel = document.querySelector(`[data-offset="${offset+1}"]`); @@ -184,7 +188,7 @@ document.addEventListener('keydown', function(e) { // if (e.ctrlKey || e.altKey || (e.key.length != 1 && e.key != 'Backspace')) { // return; // } - if (e.ctrlKey || e.altKey || (!"ABCDEFGHIJKLMNOPQRSTUVWXYZ".includes(e.key.toUpperCase()) && e.key != 'Backspace' && e.key != 'Enter')) { + if (e.ctrlKey || e.altKey || (!"ABCDEFGHIJKLMNOPQRSTUVWXYZ".includes(e.key.toUpperCase()) && e.key != 'Backspace' && e.key != 'Enter' && e.key != 'ArrowLeft' && e.key != 'ArrowRight')) { return; } if (e.target.id == 'share') { |