diff --git a/app/filter.py b/app/filter.py index e56dc67..1a83c3f 100644 --- a/app/filter.py +++ b/app/filter.py @@ -15,6 +15,7 @@ class Filter: self.near = config['near'] if 'near' in config else '' self.dark = config['dark'] if 'dark' in config else False self.nojs = config['nojs'] if 'nojs' in config else False + self.theme = config['theme'] if 'theme' in config else None self.new_tab = config['new_tab'] if 'new_tab' in config else False self.alt_redirect = config['alts'] if 'alts' in config else False self.mobile = mobile @@ -35,7 +36,7 @@ class Filter: pattern = re.compile('4285f4|ea4335|fbcc05|34a853|fbbc05', re.IGNORECASE) page = pattern.sub('685e79', page) if self.dark: - page = page.replace('fff', '000').replace('202124', 'ddd').replace('1967D2', '3b85ea') + page = page.replace('fff', '2E3440').replace('202124', 'ddd').replace('1967D2', '3b85ea') return page diff --git a/app/models/config.py b/app/models/config.py index 0d4c995..0382ad6 100644 --- a/app/models/config.py +++ b/app/models/config.py @@ -312,7 +312,7 @@ class Config: self.dark = False self.nojs = False self.near = '' - self.theme = None + self.theme = 'whoogle' self.alts = False self.new_tab = False self.get_only = False diff --git a/app/routes.py b/app/routes.py index 56bc6de..85412fe 100644 --- a/app/routes.py +++ b/app/routes.py @@ -59,7 +59,7 @@ def before_request_func(): if https_only and request.url.startswith('http://'): return redirect(request.url.replace('http://', 'https://', 1), code=308) - + g.user_config = Config(**session['config']) if not g.user_config.url: @@ -104,6 +104,7 @@ def index(): return render_template('index.html', languages=Config.LANGUAGES, countries=Config.COUNTRIES, + themes=Config.THEMES, config=g.user_config, version_number=app.config['VERSION_NUMBER']) @@ -160,11 +161,13 @@ def search(): query=urlparse.unquote(query), search_type=search_util.search_type, dark_mode=g.user_config.dark, + theme=g.user_config.theme, response=response, version_number=app.config['VERSION_NUMBER'], search_header=render_template( 'header.html', dark_mode=g.user_config.dark, + theme=g.user_config.theme, query=urlparse.unquote(query), search_type=search_util.search_type, mobile=g.user_request.mobile) if 'isch' not in search_util.search_type else '') diff --git a/app/templates/display.html b/app/templates/display.html index 6a8a609..ed879de 100644 --- a/app/templates/display.html +++ b/app/templates/display.html @@ -1,26 +1,33 @@ - - - - - - - - - - {% if dark_mode %} - - {% endif %} - {{ query }} - Whoogle Search - - + + + + + + + + {% if theme %} + + {% else %} + + {% endif %} + + + {% if theme %} + + {% else %} + + {% endif %} + {{ query }} - Whoogle Search + + {{ search_header|safe }} {{ response|safe }} - - + + diff --git a/app/templates/header.html b/app/templates/header.html index 5573b99..53bc35e 100644 --- a/app/templates/header.html +++ b/app/templates/header.html @@ -13,7 +13,7 @@
diff --git a/app/templates/index.html b/app/templates/index.html index ee88539..54a8a1c 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -22,13 +22,21 @@ - - {% if config.dark %} - + {% if config['theme'] %} + + {% else %} + + {% endif %} + {% if config['theme'] %} + + {% else %} + {% endif %} Whoogle Search +