diff --git a/capsulflask/__init__.py b/capsulflask/__init__.py index 55643bb..4c18525 100644 --- a/capsulflask/__init__.py +++ b/capsulflask/__init__.py @@ -2,6 +2,7 @@ import logging from logging.config import dictConfig as logging_dict_config import atexit +import jinja2 import os import hashlib import requests @@ -71,7 +72,9 @@ app.config.from_mapping( #STRIPE_WEBHOOK_SECRET=os.environ.get("STRIPE_WEBHOOK_SECRET", default="") BTCPAY_PRIVATE_KEY=os.environ.get("BTCPAY_PRIVATE_KEY", default="").replace("\\n", "\n"), - BTCPAY_URL=os.environ.get("BTCPAY_URL", default="") + BTCPAY_URL=os.environ.get("BTCPAY_URL", default=""), + + THEME=os.environ.get("THEME", default="") ) app.config['HUB_URL'] = os.environ.get("HUB_URL", default=app.config['BASE_URL']) @@ -154,6 +157,15 @@ is_running_server = ('flask run' in command_line) or ('gunicorn' in command_line app.logger.info(f"is_running_server: {is_running_server}") +if app.config['THEME'] != "": + my_loader = jinja2.ChoiceLoader([ + app.jinja_loader, + jinja2.FileSystemLoader( + [os.path.join('capsulflask', 'themes', app.config['THEME']), + 'capsulflask/templates']), + ]) + app.jinja_loader = my_loader + if app.config['HUB_MODE_ENABLED']: if app.config['HUB_MODEL'] == "capsul-flask": diff --git a/capsulflask/static/style.css b/capsulflask/static/style.css index 2bf6f0d..515f1a6 100644 --- a/capsulflask/static/style.css +++ b/capsulflask/static/style.css @@ -1,8 +1,8 @@ html { - color: #241e1e; + color: #bdc7b8; font: calc(0.40rem + 1vmin) monospace; overflow-y: scroll; - background-color: #bdc7b8; + background-color: #241e1e; } body { @@ -19,8 +19,8 @@ body { } a { - color:#00517a; - text-shadow: 1px 1px 0px #eee; + color:#6CF; + text-shadow: 1px 1px 0px #000c; } a.no-shadow { @@ -28,7 +28,7 @@ a.no-shadow { } a:hover, a:active, a:visited { - color: #323417; + color: #b5bd68; } .nav-links a { @@ -59,11 +59,11 @@ h1, h2, h3, h4, h5 { margin: initial; padding: initial; text-transform: uppercase; - text-shadow: 2px 2px 0px #eee; + text-shadow: 2px 2px 0px #0007; } main { - border: 1px dashed #241e1e; + border: 1px dashed #bdc7b8; padding: 1rem; margin-bottom: 2em; @@ -143,7 +143,7 @@ input, textarea, select, label { input, select, textarea { outline: 0; padding: 0.25em 0.5em; - color: #241e1e; + color: #bdc7b8; background-color: #bdc7b805; } @@ -277,7 +277,7 @@ td.metrics img { width: 4.3em; } th { - border-right: 1px solid #eee; + border-right: 4px solid #241e1e; text-align: left; } td { diff --git a/capsulflask/static/style.yolocolo.css b/capsulflask/static/style.yolocolo.css new file mode 100644 index 0000000..5ab0fd7 --- /dev/null +++ b/capsulflask/static/style.yolocolo.css @@ -0,0 +1,30 @@ +html { + color: #241e1e; + background-color: #bdc7b8; +} + +a { + color:#00517a; + text-shadow: 1px 1px 0px #eee; +} + +a:hover, a:active, a:visited { + color: #323417; +} + +.nav-links a { + text-shadow: 2px 2px 0px #eee; +} + +main { + border: 1px dashed #241e1e; + + +input, select, textarea { + color: #241e1e; +} + +th { + border-right: 1px solid #eee; + text-align: left; +} diff --git a/capsulflask/templates/account-balance.html b/capsulflask/templates/account-balance.html index 3028baa..3d47e70 100644 --- a/capsulflask/templates/account-balance.html +++ b/capsulflask/templates/account-balance.html @@ -49,6 +49,8 @@ {% if btcpay_enabled %}