mirror of https://gitlab.com/bashrc2/epicyon
Make pwa colors themeable
parent
0379733218
commit
a6b4e612a7
28
daemon.py
28
daemon.py
|
@ -6873,10 +6873,29 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
cookie, calling_domain)
|
cookie, calling_domain)
|
||||||
self.server.postreq_busy = False
|
self.server.postreq_busy = False
|
||||||
|
|
||||||
def _progressive_web_app_manifest(self, calling_domain: str,
|
def _progressive_web_app_manifest(self, base_dir: str,
|
||||||
|
calling_domain: str,
|
||||||
getreq_start_time) -> None:
|
getreq_start_time) -> None:
|
||||||
"""gets the PWA manifest
|
"""gets the PWA manifest
|
||||||
"""
|
"""
|
||||||
|
pwa_theme_color = 'grey'
|
||||||
|
pwa_theme_background_color = 'black'
|
||||||
|
|
||||||
|
css_filename = base_dir + '/epicyon.css'
|
||||||
|
if os.path.isfile(css_filename):
|
||||||
|
css_str = ''
|
||||||
|
with open(css_filename, 'r') as fp_css:
|
||||||
|
css_str = fp_css.read()
|
||||||
|
if '--pwa-theme-color:' in css_str:
|
||||||
|
pwa_theme_color = css_str.split('--pwa-theme-color:')[1]
|
||||||
|
if ';' in pwa_theme_color:
|
||||||
|
pwa_theme_color = pwa_theme_color.split(';')[0].strip()
|
||||||
|
if '--pwa-theme-background-color:' in css_str:
|
||||||
|
pwa_theme_background_color = \
|
||||||
|
css_str.split('--pwa-theme-background-color:')[1]
|
||||||
|
if ';' in pwa_theme_background_color:
|
||||||
|
pwa_theme_background_color = \
|
||||||
|
pwa_theme_background_color.split(';')[0].strip()
|
||||||
app1 = "https://f-droid.org/en/packages/eu.siacs.conversations"
|
app1 = "https://f-droid.org/en/packages/eu.siacs.conversations"
|
||||||
app2 = "https://staging.f-droid.org/en/packages/im.vector.app"
|
app2 = "https://staging.f-droid.org/en/packages/im.vector.app"
|
||||||
manifest = {
|
manifest = {
|
||||||
|
@ -6884,8 +6903,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
"short_name": "Epicyon",
|
"short_name": "Epicyon",
|
||||||
"start_url": "/index.html",
|
"start_url": "/index.html",
|
||||||
"display": "standalone",
|
"display": "standalone",
|
||||||
"background_color": "black",
|
"background_color": pwa_theme_background_color,
|
||||||
"theme_color": "grey",
|
"theme_color": pwa_theme_color,
|
||||||
"orientation": "portrait-primary",
|
"orientation": "portrait-primary",
|
||||||
"categories": ["microblog", "fediverse", "activitypub"],
|
"categories": ["microblog", "fediverse", "activitypub"],
|
||||||
"screenshots": [
|
"screenshots": [
|
||||||
|
@ -14045,7 +14064,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
if '/manifest.json' in self.path:
|
if '/manifest.json' in self.path:
|
||||||
if self._has_accept(calling_domain):
|
if self._has_accept(calling_domain):
|
||||||
if not self._request_http():
|
if not self._request_http():
|
||||||
self._progressive_web_app_manifest(calling_domain,
|
self._progressive_web_app_manifest(self.server.base_dir,
|
||||||
|
calling_domain,
|
||||||
getreq_start_time)
|
getreq_start_time)
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
@charset "UTF-8";
|
@charset "UTF-8";
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
|
--pwa-theme-color: apple-mobile-statusbar-color;
|
||||||
|
--pwa-theme-background-color: black-translucent;
|
||||||
--avatar-rounding: 10%;
|
--avatar-rounding: 10%;
|
||||||
--timeline-icon-width: 50px;
|
--timeline-icon-width: 50px;
|
||||||
--timeline-icon-width-mobile: 100px;
|
--timeline-icon-width-mobile: 100px;
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
{
|
{
|
||||||
|
"pwa-theme-color": "apple-mobile-statusbar-color",
|
||||||
|
"pwa-theme-background-color": "black-translucent",
|
||||||
"newswire-publish-icon": "True",
|
"newswire-publish-icon": "True",
|
||||||
"full-width-timeline-buttons": "False",
|
"full-width-timeline-buttons": "False",
|
||||||
"icons-as-buttons": "False",
|
"icons-as-buttons": "False",
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
{
|
{
|
||||||
|
"pwa-theme-color": "apple-mobile-statusbar-color",
|
||||||
|
"pwa-theme-background-color": "black-translucent",
|
||||||
"dropdown-fg-color": "#222",
|
"dropdown-fg-color": "#222",
|
||||||
"dropdown-bg-color": "white",
|
"dropdown-bg-color": "white",
|
||||||
"dropdown-bg-color-hover": "lightgrey",
|
"dropdown-bg-color-hover": "lightgrey",
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
{
|
{
|
||||||
|
"pwa-theme-color": "apple-mobile-statusbar-color",
|
||||||
|
"pwa-theme-background-color": "black-translucent",
|
||||||
"dropdown-fg-color": "#9ad791",
|
"dropdown-fg-color": "#9ad791",
|
||||||
"dropdown-bg-color": "#222",
|
"dropdown-bg-color": "#222",
|
||||||
"dropdown-bg-color-hover": "#444",
|
"dropdown-bg-color-hover": "#444",
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
{
|
{
|
||||||
|
"pwa-theme-color": "apple-mobile-statusbar-color",
|
||||||
|
"pwa-theme-background-color": "black-translucent",
|
||||||
"dropdown-fg-color": "white",
|
"dropdown-fg-color": "white",
|
||||||
"dropdown-bg-color": "#483335",
|
"dropdown-bg-color": "#483335",
|
||||||
"dropdown-bg-color-hover": "#583335",
|
"dropdown-bg-color-hover": "#583335",
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
{
|
{
|
||||||
|
"pwa-theme-color": "apple-mobile-statusbar-color",
|
||||||
|
"pwa-theme-background-color": "black-translucent",
|
||||||
"dropdown-fg-color": "white",
|
"dropdown-fg-color": "white",
|
||||||
"dropdown-bg-color": "#222",
|
"dropdown-bg-color": "#222",
|
||||||
"dropdown-bg-color-hover": "#444",
|
"dropdown-bg-color-hover": "#444",
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
{
|
{
|
||||||
|
"pwa-theme-color": "apple-mobile-statusbar-color",
|
||||||
|
"pwa-theme-background-color": "black-translucent",
|
||||||
"dropdown-fg-color": "black",
|
"dropdown-fg-color": "black",
|
||||||
"dropdown-bg-color": "#dedede",
|
"dropdown-bg-color": "#dedede",
|
||||||
"dropdown-bg-color-hover": "#ccc",
|
"dropdown-bg-color-hover": "#ccc",
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
{
|
{
|
||||||
|
"pwa-theme-color": "apple-mobile-statusbar-color",
|
||||||
|
"pwa-theme-background-color": "black-translucent",
|
||||||
"dropdown-fg-color": "#33390d",
|
"dropdown-fg-color": "#33390d",
|
||||||
"dropdown-bg-color": "#9fb42b",
|
"dropdown-bg-color": "#9fb42b",
|
||||||
"dropdown-bg-color-hover": "#33390d",
|
"dropdown-bg-color-hover": "#33390d",
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
{
|
{
|
||||||
|
"pwa-theme-color": "apple-mobile-statusbar-color",
|
||||||
|
"pwa-theme-background-color": "black-translucent",
|
||||||
"dropdown-fg-color": "#2d2c37",
|
"dropdown-fg-color": "#2d2c37",
|
||||||
"dropdown-bg-color": "#d6dbf0",
|
"dropdown-bg-color": "#d6dbf0",
|
||||||
"dropdown-bg-color-hover": "#b6bbf0",
|
"dropdown-bg-color-hover": "#b6bbf0",
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
{
|
{
|
||||||
|
"pwa-theme-color": "apple-mobile-statusbar-color",
|
||||||
|
"pwa-theme-background-color": "black-translucent",
|
||||||
"dropdown-fg-color": "#0481f5",
|
"dropdown-fg-color": "#0481f5",
|
||||||
"dropdown-bg-color": "#0d0d10",
|
"dropdown-bg-color": "#0d0d10",
|
||||||
"dropdown-bg-color-hover": "#0b0b10",
|
"dropdown-bg-color-hover": "#0b0b10",
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
{
|
{
|
||||||
|
"pwa-theme-color": "apple-mobile-statusbar-color",
|
||||||
|
"pwa-theme-background-color": "black-translucent",
|
||||||
"dropdown-fg-color": "black",
|
"dropdown-fg-color": "black",
|
||||||
"dropdown-bg-color": "#aba0d4",
|
"dropdown-bg-color": "#aba0d4",
|
||||||
"dropdown-bg-color-hover": "#cba0d4",
|
"dropdown-bg-color-hover": "#cba0d4",
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
{
|
{
|
||||||
|
"pwa-theme-color": "apple-mobile-statusbar-color",
|
||||||
|
"pwa-theme-background-color": "black-translucent",
|
||||||
"dropdown-fg-color": "#f98bb0",
|
"dropdown-fg-color": "#f98bb0",
|
||||||
"dropdown-bg-color": "#2f152d",
|
"dropdown-bg-color": "#2f152d",
|
||||||
"dropdown-bg-color-hover": "#3f152d",
|
"dropdown-bg-color-hover": "#3f152d",
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
{
|
{
|
||||||
|
"pwa-theme-color": "apple-mobile-statusbar-color",
|
||||||
|
"pwa-theme-background-color": "black-translucent",
|
||||||
"dropdown-fg-color": "white",
|
"dropdown-fg-color": "white",
|
||||||
"dropdown-bg-color": "#002a3a",
|
"dropdown-bg-color": "#002a3a",
|
||||||
"dropdown-bg-color-hover": "#025d84",
|
"dropdown-bg-color-hover": "#025d84",
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
{
|
{
|
||||||
|
"pwa-theme-color": "apple-mobile-statusbar-color",
|
||||||
|
"pwa-theme-background-color": "black-translucent",
|
||||||
"dropdown-fg-color": "#2d2c37",
|
"dropdown-fg-color": "#2d2c37",
|
||||||
"dropdown-bg-color": "#ddd",
|
"dropdown-bg-color": "#ddd",
|
||||||
"dropdown-bg-color-hover": "#ccc",
|
"dropdown-bg-color-hover": "#ccc",
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
{
|
{
|
||||||
|
"pwa-theme-color": "apple-mobile-statusbar-color",
|
||||||
|
"pwa-theme-background-color": "black-translucent",
|
||||||
"dropdown-fg-color": "#ffc4bc",
|
"dropdown-fg-color": "#ffc4bc",
|
||||||
"dropdown-bg-color": "#1f0d10",
|
"dropdown-bg-color": "#1f0d10",
|
||||||
"dropdown-bg-color-hover": "#222",
|
"dropdown-bg-color-hover": "#222",
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
{
|
{
|
||||||
|
"pwa-theme-color": "apple-mobile-statusbar-color",
|
||||||
|
"pwa-theme-background-color": "black-translucent",
|
||||||
"dropdown-fg-color": "#d5c7b7",
|
"dropdown-fg-color": "#d5c7b7",
|
||||||
"dropdown-bg-color": "#4c4e41",
|
"dropdown-bg-color": "#4c4e41",
|
||||||
"dropdown-bg-color-hover": "#3c4e41",
|
"dropdown-bg-color-hover": "#3c4e41",
|
||||||
|
|
Loading…
Reference in New Issue