diff --git a/.gitignore b/.gitignore index 7628e4d..ac6d7b6 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ nohup.out *.tsv *.rulestate *.log +*.css # currently not using /screenshot*.png diff --git a/requirements.txt b/requirements.txt index d780ced..6cfecc9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,3 +4,4 @@ doreah>=1.0 nimrodel>=0.4.9 setproctitle>=1.1.10 wand>=0.5.4 +lesscpy>=0.13 diff --git a/server.py b/server.py index 814e270..0ef7784 100755 --- a/server.py +++ b/server.py @@ -31,6 +31,16 @@ HOST = settings.get_settings("HOST") webserver = Bottle() +import lesscpy +css = "" +for f in os.listdir("website/less"): + css += lesscpy.compile("website/less/" + f) + +os.makedirs("website/css",exist_ok=True) +with open("website/css/style.css","w") as f: + f.write(css) + + @webserver.route("") @webserver.route("/") def mainpage(): @@ -128,7 +138,7 @@ def static(name): @webserver.route("/") def static_html(name): - linkheaders = ["; rel=preload; as=style"] + linkheaders = ["; rel=preload; as=style"] keys = remove_identical(FormsDict.decode(request.query)) with open("website/" + name + ".html") as htmlfile: diff --git a/website/common/header.html b/website/common/header.html index b11b5de..6f791ff 100644 --- a/website/common/header.html +++ b/website/common/header.html @@ -1,8 +1,9 @@ - + - + + --> + diff --git a/website/less/grisons.less b/website/less/grisons.less index 985b0ef..fd2efc9 100644 --- a/website/less/grisons.less +++ b/website/less/grisons.less @@ -4,7 +4,7 @@ @BASE_COLOR: #333337; -@BASE_COLOR_DARK: rgba(10,10,10,1); +@BASE_COLOR_DARK: #0a0a0a; @BASE_COLOR_LIGHT: #444447; @TEXT_COLOR: beige; @@ -23,7 +23,9 @@ @BUTTON_FOCUS_FG_COLOR: @BASE_COLOR; -@import url('https://fonts.googleapis.com/css?family=Ubuntu'); +//@import url('https://fonts.googleapis.com/css?family=Ubuntu'); + + body { background-color: @BASE_COLOR; color: @TEXT_COLOR; diff --git a/website/less/grisonsfont.less b/website/less/grisonsfont.less new file mode 100644 index 0000000..e424fbf --- /dev/null +++ b/website/less/grisonsfont.less @@ -0,0 +1,45 @@ +/* cyrillic-ext */ +@font-face { + font-family: 'Ubuntu'; + font-style: normal; + font-weight: 400; + src: local('Ubuntu Regular'), local('Ubuntu-Regular'), url(https://fonts.gstatic.com/s/ubuntu/v14/4iCs6KVjbNBYlgoKcg72j00.woff2) format('woff2'); +} +/* cyrillic */ +@font-face { + font-family: 'Ubuntu'; + font-style: normal; + font-weight: 400; + src: local('Ubuntu Regular'), local('Ubuntu-Regular'), url(https://fonts.gstatic.com/s/ubuntu/v14/4iCs6KVjbNBYlgoKew72j00.woff2) format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* greek-ext */ +@font-face { + font-family: 'Ubuntu'; + font-style: normal; + font-weight: 400; + src: local('Ubuntu Regular'), local('Ubuntu-Regular'), url(https://fonts.gstatic.com/s/ubuntu/v14/4iCs6KVjbNBYlgoKcw72j00.woff2) format('woff2'); + unicode-range: U+1F00-1FFF; +} +/* greek */ +@font-face { + font-family: 'Ubuntu'; + font-style: normal; + font-weight: 400; + src: local('Ubuntu Regular'), local('Ubuntu-Regular'), url(https://fonts.gstatic.com/s/ubuntu/v14/4iCs6KVjbNBYlgoKfA72j00.woff2) format('woff2'); + unicode-range: U+0370-03FF; +} +/* latin-ext */ +@font-face { + font-family: 'Ubuntu'; + font-style: normal; + font-weight: 400; + src: local('Ubuntu Regular'), local('Ubuntu-Regular'), url(https://fonts.gstatic.com/s/ubuntu/v14/4iCs6KVjbNBYlgoKcQ72j00.woff2) format('woff2'); +} +/* latin */ +@font-face { + font-family: 'Ubuntu'; + font-style: normal; + font-weight: 400; + src: local('Ubuntu Regular'), local('Ubuntu-Regular'), url(https://fonts.gstatic.com/s/ubuntu/v14/4iCs6KVjbNBYlgoKfw72.woff2) format('woff2'); +} diff --git a/website/less/maloja.less b/website/less/maloja.less index 6f4e90a..8d77309 100644 --- a/website/less/maloja.less +++ b/website/less/maloja.less @@ -1,4 +1,4 @@ -@import "grisons"; +@import "website/less/grisons"; body { padding:15px; @@ -61,7 +61,7 @@ div.footer { position:fixed; height:20px; /**width:100%;**/ - background-color:fadeout(@BASE_COLOR_DARK,10%); + background-color:@BASE_COLOR_DARK; bottom:0px; left:0px; right:0px; @@ -170,7 +170,7 @@ div.searchresults table.searchresults_tracks td span:nth-child(1) { position:fixed; /*height:30px;*/ /**width:100%;**/ - background-color:fadeout(@BASE_COLOR_DARK,10%); + background-color:@BASE_COLOR_DARK; bottom:0px; left:0px; right:0px;