Mercurial > code > home > repos > light9
changeset 1844:736784c0db93
ascoltami: Go button, style updates
Ignore-this: df26b8c9e6774055a0196592151adfe8
author | drewp@bigasterisk.com |
---|---|
date | Sun, 10 Jun 2018 19:45:36 +0000 |
parents | 741bfcc0b47c |
children | 9141cd4b4908 |
files | light9/ascoltami/index.html light9/ascoltami/webapp.py light9/web/style.css |
diffstat | 3 files changed, 39 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/light9/ascoltami/index.html Sun Jun 10 04:36:24 2018 +0000 +++ b/light9/ascoltami/index.html Sun Jun 10 19:45:36 2018 +0000 @@ -9,6 +9,9 @@ <script type="text/javascript" src="/lib/jquery-ui/jquery-ui.min.js"></script> <link rel="Stylesheet" type="text/css" href="/lib/jquery-ui/themes/smoothness/jquery-ui.min.css"/> <link rel="Stylesheet" type="text/css" href="/style.css"/> + <style> + #cmd-go { min-width: 5em; } + </style> </head> <body> <h1>ascoltami on ${host}</h1> @@ -41,7 +44,7 @@ <button id="cmd-play" class="playMode">Play <div class="key">p</div></button> <button id="cmd-intro">Skip intro <div class="key">i</div></button> <button id="cmd-post">Skip to Post <div class="key">t</div></button> - <button id="cmd-go">Go <div class="key">space</div></button> + <button id="cmd-go">Go <div class="key">g</div><div id="next"></div></button> <button id="cmd-out0">Output 0</button> <button id="cmd-out1">Output 1</button> @@ -90,6 +93,7 @@ $(data.playing ? "#cmd-play" : "#cmd-stop").addClass("active"); lastPlaying = data.playing; } + $("#next").text(data.next); doneCallback(); }); } @@ -134,7 +138,10 @@ if (ev.which == 105) { $("#cmd-intro").click(); return false; } if (ev.which == 116) { $("#cmd-post").click(); return false; } - if (ev.which == 32) { $("#cmd-go").click(); return false; } + if (ev.key == 'g') { + $("#cmd-go").click(); + return false; + } return true; });
--- a/light9/ascoltami/webapp.py Sun Jun 10 04:36:24 2018 +0000 +++ b/light9/ascoltami/webapp.py Sun Jun 10 19:45:36 2018 +0000 @@ -39,6 +39,14 @@ player = self.settings.app.player graph = self.settings.app.graph self.set_header("Content-Type", "application/json") + + if player.isAutostopped(): + nextAction = 'finish' + elif player.isPlaying(): + nextAction = 'disabled' + else: + nextAction = 'play' + self.write(json.dumps({ "song" : playerSongUri(graph, player), "started" : player.playStartTime, @@ -46,6 +54,7 @@ "playing" : player.isPlaying(), "t" : player.currentTime(), "state" : player.states(), + "next" : nextAction, })) def post(self): @@ -109,7 +118,9 @@ """ graph, player = self.settings.app.graph, self.settings.app.player - if player.isPlaying(): + if player.isAutostopped(): + player.resume() + elif player.isPlaying(): pass else: player.resume()
--- a/light9/web/style.css Sun Jun 10 04:36:24 2018 +0000 +++ b/light9/web/style.css Sun Jun 10 19:45:36 2018 +0000 @@ -40,13 +40,19 @@ } .songs button { display: inline-block; - width: 200px; + width: 15em; height: 50px; text-align: left; background: black; color: white; margin: 2px; - font-size: 115%; + font-size: 130% !important; + font-weight: bold; + text-shadow: -1px -1px 0 #000, + 1px -1px 0 #000, + -1px 1px 0 #000, + 1px 1px 0 #000; + white-space: nowrap; } button a { color: white; @@ -62,13 +68,13 @@ padding: 20px } .commands button.active { - background: #1C4054; + background: #a90707; } .key { color: #888; } .currentSong button { - background: #55A5C9; + background: #a90707; } .timeRow { margin: 14px; @@ -80,7 +86,13 @@ font-size: 27px; color: rgb(233, 122, 122); display: inline-block; - padding: 10px + padding: 10px; + font-size: 200% !important; + font-weight: bold; + text-shadow: -1px -1px 0 #000, + 1px -1px 0 #000, + -1px 1px 0 #000, + 1px 1px 0 #000; } .dropTarget { @@ -122,7 +134,7 @@ /* ascoltami mini mode */ @media (max-height: 600px) { .songs { - -webkit-column-width: 9em; + -webkit-column-width: 12em; } .songs button { font-size: initial;