feat: Add new templates with donate footer
All checks were successful
Build Docker / Build Main Image (push) Successful in 19s
Build Docker / Build SLDs Image (push) Successful in 21s

This commit is contained in:
Nathan Woodburn 2023-11-20 11:51:44 +11:00
parent e2522a61d6
commit b805c3e655
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
7 changed files with 157 additions and 8 deletions

View File

@ -87,7 +87,7 @@ This is the main body
## Crypto Address Placeholders
### Icons
These are the icons for the crypto addresses.
There are 2 versions of each icon. One with a contrast to the foreground colour and one without.
There are 2 versions of each icon. One with a contrast to the background colour and one without.
These return the path to the image of the icon (eg. `assets/img/HNS.png`)

10
main.py
View File

@ -34,7 +34,15 @@ if IMAGE_LOCATION == None:
random_sites = ""
# Templates available for user
templates = ['Standard', 'Original', 'No card around data', 'No card around data (2)','Blank']
templates = [
'Standard',
'Original',
'No card around data',
'No card around data (2)',
'Blank',
'Standard with donate footer'
'No card with donate footer'
]
#Assets routes
@app.route('/assets/<path:path>')

View File

@ -1,4 +1,4 @@
<div style="position: absolute;bottom: 10px;width: 100%;left:25px;">
<div style="position: fixed;bottom: 10px;width: 100%;left:25px;">
<div style="display: inline-block; background: {{fg_colour}};border-radius: 50%;padding: 10px;">
<img src="{{hns_icon}}" width="50px" height="50px">
</div>

View File

@ -52,7 +52,7 @@ def render(data,db_object):
bg_colour = db_object['bg_colour']
fg_colour = db_object['fg_colour']
text_colour = db_object['text_colour']
if (rgb_to_hex(generate_foreground_color(text_colour)) == "#000000"):
if (rgb_to_hex(generate_foreground_color(bg_colour)) == "#000000"):
hns_icon = "assets/img/HNSW.png"
btc_icon = "assets/img/BTCW.png"
eth_icon = "assets/img/ETHW.png"
@ -82,7 +82,7 @@ def render(data,db_object):
if eth != "":
eth = "<img src='" + eth_icon + "' width='20px' height='30px' style='margin-right: 5px;'>" + eth
eth_invert = "<img src='" + eth_icon_invert + "' width='20px' height='30px' style='margin-right: 5px;'>" + eth_address
hide_addresses = False
if hns == "" and btc == "" and eth == "":
@ -187,7 +187,9 @@ def get_template_file(template):
"original": "city_old.html",
"no card around data": "city_no_card.html",
"no card around data (2)": "city_no_card_2.html",
"blank": "city_blank.html"
"blank": "city_blank.html",
"standard with donate footer": "city_donate_footer.html",
"no card with donate footer": "city_no_card_donate_footer.html",
}
if template in templates:

View File

@ -16,8 +16,11 @@ db_object = {
'BTC': "bc1qhs94zzcw64qnwq4hvk056rwxwvgrkd7tq7d4xw",
'ETH' : "0x6cB4B39bEc23a921C9a20D061Bf17d4640B0d39e",
'bg_colour': "#000000",
'fg_colour': "#ffffff",
'text_colour': "#152D45",
# 'fg_colour': "#ffffff",
# 'text_colour': "#152D45",
'text_colour': "#ffffff",
'fg_colour': "#8f00db",
}
@app.route('/')

View File

@ -0,0 +1,66 @@
<!DOCTYPE html>
<html data-bs-theme="light" lang="en" style="width: 100vw;height: 99vh;">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<title>ShakeCities</title>
<meta name="twitter:description" content="Unlock web ownership's future with ShakeCities! Create your free, secure Handshake domain site. Integrate crypto payments, explore HNSChat, and join us in shaping the decentralized web!">
<meta name="description" content="Unlock web ownership's future with ShakeCities! Create your free, secure Handshake domain site. Integrate crypto payments, explore HNSChat, and join us in shaping the decentralized web!">
<meta name="twitter:card" content="summary">
<meta property="og:type" content="website">
<meta property="og:image" content="https://shakecities.com/assets/img/alexander-slattery-LI748t0BK8w-unsplash.webp">
<meta property="og:title" content="ShakeCities">
<meta name="twitter:title" content="ShakeCities">
<meta name="twitter:image" content="https://shakecities.com/assets/img/alexander-slattery-LI748t0BK8w-unsplash.webp">
<meta property="og:description" content="Unlock web ownership's future with ShakeCities! Create your free, secure Handshake domain site. Integrate crypto payments, explore HNSChat, and join us in shaping the decentralized web!">
<link rel="icon" type="image/png" sizes="670x700" href="assets/img/HNS.png">
<link rel="icon" type="image/png" sizes="670x700" href="assets/img/HNSW.png" media="(prefers-color-scheme: dark)">
<link rel="icon" type="image/png" sizes="670x700" href="assets/img/HNS.png">
<link rel="icon" type="image/png" sizes="670x700" href="assets/img/HNSW.png" media="(prefers-color-scheme: dark)">
<link rel="icon" type="image/png" sizes="670x700" href="assets/img/HNS.png">
<link rel="icon" type="image/png" sizes="670x700" href="assets/img/HNS.png">
<link rel="icon" type="image/png" sizes="670x700" href="assets/img/HNS.png">
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/styles.min.css">
</head>
<body style="height: 99vh;width: 100vw;color: #1fffff;background: #000000;overflow-x: hidden;">
<div class="text-center" style="margin: 10px;">
<div>{{avatar|safe}}</div>
<div style="color: #f1ffff;">
<div>
<p style="font-size: 24px;">{{hnschat|safe}}</p>
</div>
<div>
<p style="font-size: 24px;">{{email|safe}}</p>
</div>
<div>
<p style="font-size: 24px;">{{location|safe}}</p>
</div>
</div>
</div>
<div style="background: #f1ffff;border-radius: 10px;padding: 25px;padding-top: 2%;padding-left: 2%;padding-right: 2%;padding-bottom: 2%;margin: 22px;">
<p style="font-size: 24px;">{{data|safe}}</p>
</div>
<div id="addresses" style="position: absolute;bottom: 100px;width: 100%;text-align: center;">
<p style="font-size: 20px;margin-bottom: 0px;">
<a style="text-decoration: none;color: #f1ffff;" href="/.well-known/wallets/HNS" target="_blank">
<img src='{{hns_icon_invert}}' width='20px' height='20px' style='margin-right: 5px;'>
</a>
<a style="text-decoration: none;color: #f1ffff;" href="/.well-known/wallets/BTC" target="_blank">
<img src='{{btc_icon_invert}}' width='20px' height='25px' style='margin-right: 5px;'>
</a>
<a style="text-decoration: none;color: #f1ffff;" href="/.well-known/wallets/ETH" target="_blank">
<img src='{{eth_icon_invert}}' width='20px' height='30px' style='margin-right: 5px;'>
</a>
</p>
</div>
{{footer | safe}}
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
<script src="assets/js/script.min.js"></script>
</body>
</html>

View File

@ -0,0 +1,70 @@
<!DOCTYPE html>
<html style="width: 100vw;height: 99vh;">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<title>ShakeCities</title>
<meta name="twitter:description" content="Unlock web ownership's future with ShakeCities! Create your free, secure Handshake domain site. Integrate crypto payments, explore HNSChat, and join us in shaping the decentralized web!">
<meta name="description" content="Unlock web ownership's future with ShakeCities! Create your free, secure Handshake domain site. Integrate crypto payments, explore HNSChat, and join us in shaping the decentralized web!">
<meta name="twitter:card" content="summary">
<meta property="og:type" content="website">
<meta property="og:image" content="https://shakecities.com/assets/img/alexander-slattery-LI748t0BK8w-unsplash.webp">
<meta property="og:title" content="ShakeCities">
<meta name="twitter:title" content="ShakeCities">
<meta name="twitter:image" content="https://shakecities.com/assets/img/alexander-slattery-LI748t0BK8w-unsplash.webp">
<meta property="og:description" content="Unlock web ownership's future with ShakeCities! Create your free, secure Handshake domain site. Integrate crypto payments, explore HNSChat, and join us in shaping the decentralized web!">
<link rel="icon" type="image/png" sizes="670x700" href="assets/img/HNS.png">
<link rel="icon" type="image/png" sizes="670x700" href="assets/img/HNSW.png" media="(prefers-color-scheme: dark)">
<link rel="icon" type="image/png" sizes="670x700" href="assets/img/HNS.png">
<link rel="icon" type="image/png" sizes="670x700" href="assets/img/HNSW.png" media="(prefers-color-scheme: dark)">
<link rel="icon" type="image/png" sizes="670x700" href="assets/img/HNS.png">
<link rel="icon" type="image/png" sizes="670x700" href="assets/img/HNS.png">
<link rel="icon" type="image/png" sizes="670x700" href="assets/img/HNS.png">
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/styles.min.css">
</head>
<!-- Template colours
#f1ffff foreground colour
#1fffff text colour
#000000 background colour
These colours will be overriden with the user's colour scheme
-->
<body style="height: 99vh;width: 100vw;color: #1fffff;background: #000000;overflow-x: hidden;">
<div class="text-center" style="margin: 10px;">
<div>{{avatar|safe}}</div> <!-- This needs the safe filter to allow HTML to be rendered -->
<div style="color: #f1ffff;">
<p style="font-size: 24px;">{{hnschat|safe}}</p>
<p style="font-size: 24px;">{{email|safe}}</p>
<p style="font-size: 24px;">{{location|safe}}</p>
</div>
</div>
<div style="padding: 2%;margin: 22px;">
<p style="font-size: 24px;">
{{data|safe}} <!-- This needs the safe filter to allow HTML to be rendered -->
</p>
</div>
<div id="addresses" style="position: absolute;bottom: 100px;width: 100%;text-align: center;">
<p style="font-size: 20px;margin-bottom: 0px;">
<a style="text-decoration: none;color: #f1ffff;" href="/.well-known/wallets/HNS" target="_blank">
<img src='{{hns_icon_invert}}' width='20px' height='20px' style='margin-right: 5px;'>
</a>
<a style="text-decoration: none;color: #f1ffff;" href="/.well-known/wallets/BTC" target="_blank">
<img src='{{btc_icon_invert}}' width='20px' height='25px' style='margin-right: 5px;'>
</a>
<a style="text-decoration: none;color: #f1ffff;" href="/.well-known/wallets/ETH" target="_blank">
<img src='{{eth_icon_invert}}' width='20px' height='30px' style='margin-right: 5px;'>
</a>
</p>
</div>
<!-- Footer to display the powered by ShakeCities. -->
{{footer|safe}}
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
<script src="assets/js/script.min.js"></script>
</body>
</html>