Compare commits

...

2 Commits

Author SHA1 Message Date
69e4d7f496
feat: Add easy to change themes
All checks were successful
Build Docker / Build Image (push) Successful in 32s
2024-02-01 23:41:22 +11:00
50f3f07b63
fix: Check for node not being connected 2024-02-01 23:26:57 +11:00
7 changed files with 25 additions and 2 deletions

View File

@ -40,6 +40,11 @@ If you have HSD running on a different IP/container
sudo docker run -p 5000:5000 -e hsd_api=yourapikeyhere -e hsd_ip=hsdcontainer git.woodburn.au/nathanwoodburn/firewallet:latest sudo docker run -p 5000:5000 -e hsd_api=yourapikeyhere -e hsd_ip=hsdcontainer git.woodburn.au/nathanwoodburn/firewallet:latest
``` ```
## Themes
Set a theme in the .env file
**Available themes**
- dark-purple
- black
## Images ## Images
Login page Login page

View File

@ -87,7 +87,11 @@ def createWallet(account: str, password: str):
def listWallets(): def listWallets():
# List the wallets # List the wallets
response = hsw.listWallets() response = hsw.listWallets()
# Check if response is json or an array
if isinstance(response, list):
return response return response
return ['Wallet not connected']
def getBalance(account: str): def getBalance(account: str):
# Get the total balance # Get the total balance
@ -316,6 +320,9 @@ def setDNS(account,domain,records):
def getNodeSync(): def getNodeSync():
response = hsd.getInfo() response = hsd.getInfo()
if 'error' in response:
return 0
sync = response['chain']['progress']*100 sync = response['chain']['progress']*100
sync = round(sync, 2) sync = round(sync, 2)
return sync return sync

View File

@ -1,2 +1,3 @@
hsd_api=123480615465636893475aCwyaae6s45 hsd_api=123480615465636893475aCwyaae6s45
hsd_ip=localhost hsd_ip=localhost
theme=black

View File

@ -22,6 +22,8 @@ fees = 0.02
revokeCheck = random.randint(100000,999999) revokeCheck = random.randint(100000,999999)
theme = os.getenv("theme")
@app.route('/') @app.route('/')
def index(): def index():
# Check if the user is logged in # Check if the user is logged in
@ -982,6 +984,12 @@ def report():
def qr(data): def qr(data):
return send_file(qrcode(data, mode="raw"), mimetype="image/png") return send_file(qrcode(data, mode="raw"), mimetype="image/png")
# Theme
@app.route('/assets/css/styles.min.css')
def send_css():
print("Using theme: " + theme)
return send_from_directory('themes', f'{theme}.css')
@app.route('/assets/<path:path>') @app.route('/assets/<path:path>')
def send_assets(path): def send_assets(path):
return send_from_directory('templates/assets', path) return send_from_directory('templates/assets', path)

1
themes/black.css Normal file
View File

@ -0,0 +1 @@
[data-bs-theme=dark]{--bs-primary:#000000;--bs-primary-rgb:0,0,0;--bs-primary-text-emphasis:#666666;--bs-primary-bg-subtle:#000000;--bs-primary-border-subtle:#000000;--bs-light:#404040;--bs-light-rgb:64,64,64;--bs-light-text-emphasis:#8C8C8C;--bs-light-bg-subtle:#0D0D0D;--bs-light-border-subtle:#262626;--bs-dark:#ffffff;--bs-dark-rgb:255,255,255;--bs-dark-text-emphasis:#FFFFFF;--bs-dark-bg-subtle:#333333;--bs-dark-border-subtle:#999999}.btn-primary[data-bs-theme=dark],[data-bs-theme=dark] .btn-primary{--bs-btn-color:#fff;--bs-btn-bg:#000000;--bs-btn-border-color:#000000;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:#000000;--bs-btn-hover-border-color:#000000;--bs-btn-focus-shadow-rgb:217,217,217;--bs-btn-active-color:#fff;--bs-btn-active-bg:#000000;--bs-btn-active-border-color:#000000;--bs-btn-disabled-color:#fff;--bs-btn-disabled-bg:#000000;--bs-btn-disabled-border-color:#000000}.btn-outline-primary[data-bs-theme=dark],[data-bs-theme=dark] .btn-outline-primary{--bs-btn-color:#000000;--bs-btn-border-color:#000000;--bs-btn-focus-shadow-rgb:0,0,0;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:#000000;--bs-btn-hover-border-color:#000000;--bs-btn-active-color:#fff;--bs-btn-active-bg:#000000;--bs-btn-active-border-color:#000000;--bs-btn-disabled-color:#000000;--bs-btn-disabled-bg:transparent;--bs-btn-disabled-border-color:#000000}.btn-light[data-bs-theme=dark],[data-bs-theme=dark] .btn-light{--bs-btn-color:#fff;--bs-btn-bg:#404040;--bs-btn-border-color:#404040;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:#363636;--bs-btn-hover-border-color:#333333;--bs-btn-focus-shadow-rgb:226,226,226;--bs-btn-active-color:#fff;--bs-btn-active-bg:#333333;--bs-btn-active-border-color:#303030;--bs-btn-disabled-color:#fff;--bs-btn-disabled-bg:#404040;--bs-btn-disabled-border-color:#404040}.btn-outline-light[data-bs-theme=dark],[data-bs-theme=dark] .btn-outline-light{--bs-btn-color:#404040;--bs-btn-border-color:#404040;--bs-btn-focus-shadow-rgb:64,64,64;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:#404040;--bs-btn-hover-border-color:#404040;--bs-btn-active-color:#fff;--bs-btn-active-bg:#404040;--bs-btn-active-border-color:#404040;--bs-btn-disabled-color:#404040;--bs-btn-disabled-bg:transparent;--bs-btn-disabled-border-color:#404040}.btn-dark[data-bs-theme=dark],[data-bs-theme=dark] .btn-dark{--bs-btn-color:#000000;--bs-btn-bg:#ffffff;--bs-btn-border-color:#ffffff;--bs-btn-hover-color:#000000;--bs-btn-hover-bg:#FFFFFF;--bs-btn-hover-border-color:#FFFFFF;--bs-btn-focus-shadow-rgb:38,38,38;--bs-btn-active-color:#000000;--bs-btn-active-bg:#FFFFFF;--bs-btn-active-border-color:#FFFFFF;--bs-btn-disabled-color:#000000;--bs-btn-disabled-bg:#ffffff;--bs-btn-disabled-border-color:#ffffff}.btn-outline-dark[data-bs-theme=dark],[data-bs-theme=dark] .btn-outline-dark{--bs-btn-color:#ffffff;--bs-btn-border-color:#ffffff;--bs-btn-focus-shadow-rgb:255,255,255;--bs-btn-hover-color:#000000;--bs-btn-hover-bg:#ffffff;--bs-btn-hover-border-color:#ffffff;--bs-btn-active-color:#000000;--bs-btn-active-bg:#ffffff;--bs-btn-active-border-color:#ffffff;--bs-btn-disabled-color:#ffffff;--bs-btn-disabled-bg:transparent;--bs-btn-disabled-border-color:#ffffff}.stick-right{position:absolute;right:25px}.error:after{content:attr(data-text);position:absolute;left:2px;text-shadow:-1px 0 #e74a3b;top:0;color:#5a5c69;background:var(--bs-primary);overflow:hidden;clip:rect(0,900px,0,0);animation:2s linear infinite alternate-reverse noise-anim}.error:before{content:attr(data-text);position:absolute;left:-2px;text-shadow:1px 0 #4e73df;top:0;color:#5a5c69;background:var(--bs-primary);overflow:hidden;clip:rect(0,900px,0,0);animation:3s linear infinite alternate-reverse noise-anim-2}

1
themes/dark-purple2.css Normal file
View File

@ -0,0 +1 @@
[data-bs-theme=dark]{--bs-primary:#1a0023;--bs-primary-rgb:26,0,35;--bs-primary-text-emphasis:#76667B;--bs-primary-bg-subtle:#050007;--bs-primary-border-subtle:#100015;--bs-light:#404040;--bs-light-rgb:64,64,64;--bs-light-text-emphasis:#8C8C8C;--bs-light-bg-subtle:#0D0D0D;--bs-light-border-subtle:#262626;--bs-dark:#ffffff;--bs-dark-rgb:255,255,255;--bs-dark-text-emphasis:#FFFFFF;--bs-dark-bg-subtle:#333333;--bs-dark-border-subtle:#999999}.btn-primary[data-bs-theme=dark],[data-bs-theme=dark] .btn-primary{--bs-btn-color:#fff;--bs-btn-bg:#1a0023;--bs-btn-border-color:#1a0023;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:#16001E;--bs-btn-hover-border-color:#15001C;--bs-btn-focus-shadow-rgb:221,217,222;--bs-btn-active-color:#fff;--bs-btn-active-bg:#15001C;--bs-btn-active-border-color:#14001A;--bs-btn-disabled-color:#fff;--bs-btn-disabled-bg:#1a0023;--bs-btn-disabled-border-color:#1a0023}.btn-outline-primary[data-bs-theme=dark],[data-bs-theme=dark] .btn-outline-primary{--bs-btn-color:#1a0023;--bs-btn-border-color:#1a0023;--bs-btn-focus-shadow-rgb:26,0,35;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:#1a0023;--bs-btn-hover-border-color:#1a0023;--bs-btn-active-color:#fff;--bs-btn-active-bg:#1a0023;--bs-btn-active-border-color:#1a0023;--bs-btn-disabled-color:#1a0023;--bs-btn-disabled-bg:transparent;--bs-btn-disabled-border-color:#1a0023}.btn-light[data-bs-theme=dark],[data-bs-theme=dark] .btn-light{--bs-btn-color:#fff;--bs-btn-bg:#404040;--bs-btn-border-color:#404040;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:#363636;--bs-btn-hover-border-color:#333333;--bs-btn-focus-shadow-rgb:226,226,226;--bs-btn-active-color:#fff;--bs-btn-active-bg:#333333;--bs-btn-active-border-color:#303030;--bs-btn-disabled-color:#fff;--bs-btn-disabled-bg:#404040;--bs-btn-disabled-border-color:#404040}.btn-outline-light[data-bs-theme=dark],[data-bs-theme=dark] .btn-outline-light{--bs-btn-color:#404040;--bs-btn-border-color:#404040;--bs-btn-focus-shadow-rgb:64,64,64;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:#404040;--bs-btn-hover-border-color:#404040;--bs-btn-active-color:#fff;--bs-btn-active-bg:#404040;--bs-btn-active-border-color:#404040;--bs-btn-disabled-color:#404040;--bs-btn-disabled-bg:transparent;--bs-btn-disabled-border-color:#404040}.btn-dark[data-bs-theme=dark],[data-bs-theme=dark] .btn-dark{--bs-btn-color:#000000;--bs-btn-bg:#ffffff;--bs-btn-border-color:#ffffff;--bs-btn-hover-color:#000000;--bs-btn-hover-bg:#FFFFFF;--bs-btn-hover-border-color:#FFFFFF;--bs-btn-focus-shadow-rgb:38,38,38;--bs-btn-active-color:#000000;--bs-btn-active-bg:#FFFFFF;--bs-btn-active-border-color:#FFFFFF;--bs-btn-disabled-color:#000000;--bs-btn-disabled-bg:#ffffff;--bs-btn-disabled-border-color:#ffffff}.btn-outline-dark[data-bs-theme=dark],[data-bs-theme=dark] .btn-outline-dark{--bs-btn-color:#ffffff;--bs-btn-border-color:#ffffff;--bs-btn-focus-shadow-rgb:255,255,255;--bs-btn-hover-color:#000000;--bs-btn-hover-bg:#ffffff;--bs-btn-hover-border-color:#ffffff;--bs-btn-active-color:#000000;--bs-btn-active-bg:#ffffff;--bs-btn-active-border-color:#ffffff;--bs-btn-disabled-color:#ffffff;--bs-btn-disabled-bg:transparent;--bs-btn-disabled-border-color:#ffffff}.stick-right{position:absolute;right:25px}.error:after{content:attr(data-text);position:absolute;left:2px;text-shadow:-1px 0 #e74a3b;top:0;color:#5a5c69;background:var(--bs-primary);overflow:hidden;clip:rect(0,900px,0,0);animation:2s linear infinite alternate-reverse noise-anim}.error:before{content:attr(data-text);position:absolute;left:-2px;text-shadow:1px 0 #4e73df;top:0;color:#5a5c69;background:var(--bs-primary);overflow:hidden;clip:rect(0,900px,0,0);animation:3s linear infinite alternate-reverse noise-anim-2}