From 27b97f7f2c4969464677f1c9d8411e80f36f9f22 Mon Sep 17 00:00:00 2001 From: Denis Knauf Date: Thu, 8 Jun 2023 18:53:06 +0200 Subject: [PATCH] export: sorted by player. controls: centered. shell.nix added. makefile: clean, haml cli changes --- .gitignore | 2 ++ Makefile | 11 +++++++---- app.css.sass | 7 ++++++- app.js.coffee | 1 + index.html.haml | 6 ++++-- shell.nix | 9 +++++++++ 6 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 shell.nix diff --git a/.gitignore b/.gitignore index 2132c7e..854ae3b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +.*.sw[po] *.css *.html *.js +*.map diff --git a/Makefile b/Makefile index 52c0b73..9940b05 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,14 @@ all: index.html app.js app.css .PHONY: all -index.html: index.html.haml - haml $^ $@ +index.html: index.html.haml app.js app.css + haml render $< >$@ app.js: app.js.coffee - coffee -cs >$@ <$^ + coffee -cs <$< >$@ app.css: app.css.sass - sassc $^ $@ + sass $< $@ + +clean: + rm -f index.html app.js app.css diff --git a/app.css.sass b/app.css.sass index 0d2379d..3866925 100644 --- a/app.css.sass +++ b/app.css.sass @@ -7,6 +7,9 @@ h1 text-align: center .controls + margin: 0 auto + width: 30em + text-align: center button, a display: inline-block border: none @@ -20,6 +23,8 @@ h1 font-size: 2em border-radius: 1ex outline: none + width: 3em + height: 3em &:hover, &:active box-shadow: inset 0 0 0.7ex white, 0 0 1ex white background: #ddd @@ -28,7 +33,7 @@ h1 outline: none > * display: none - &[data-state=loaded] > .if_loaded, + &[data-state=loaded] > .if_loaded, &[data-state=started] > .if_started, &[data-state=stopped] > .if_stopped display: initial diff --git a/app.js.coffee b/app.js.coffee index 6610878..1fa4c8c 100644 --- a/app.js.coffee +++ b/app.js.coffee @@ -94,6 +94,7 @@ window.addEventListener 'load', -> exporthelper = clock.element.querySelector ':scope .exporthelper' download.addEventListener 'click', (e) -> t = '' + window.list.sort (a,b) -> a[2].value-b[2].value for en in window.list t += "#{en[0]}\t#{en[1]}\t#{en[2].value}\n" exporthelper.href = "data:text/csv;name=schplitted.csv,#{encodeURIComponent t}" diff --git a/index.html.haml b/index.html.haml index 9cf9591..14c3ecb 100644 --- a/index.html.haml +++ b/index.html.haml @@ -5,8 +5,10 @@ %meta(http-equiv="X-UA-Compatible" content="IE=edge") %meta(name="viewport" content="width=device-width, initial-scale=1") %title Zeitschplitter - %link(rel="stylesheet" href="app.css") - %script(type="text/javascript" src="app.js") + :css + #{File.read 'app.css'} + :javascript + #{File.read 'app.js'} %body %header diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..6063f64 --- /dev/null +++ b/shell.nix @@ -0,0 +1,9 @@ +with (import {}); +stdenv.mkDerivation { + name = "zeitschplitter-env"; + buildInputs = [ + #ruby rubyPackages.openssl env.gems.coffee-script env.gems.haml + gnumake git dart-sass nodePackages.coffee-script rubyPackages.haml + ]; + LANG = "de_AT.UTF-8"; +}