diff --git a/app/routes.py b/app/routes.py
index b949f65..bb15295 100644
--- a/app/routes.py
+++ b/app/routes.py
@@ -15,8 +15,8 @@ from app.models.endpoint import Endpoint
from app.request import Request, TorError
from app.utils.bangs import resolve_bang
from app.utils.misc import read_config_bool, get_client_ip, get_request_url
-from app.utils.results import add_ip_card
-from app.utils.results import bold_search_terms
+from app.utils.results import add_ip_card, bold_search_terms,\
+ add_currency_card, check_currency
from app.utils.search import *
from app.utils.session import generate_user_key, valid_user_session
from bs4 import BeautifulSoup as bsoup
@@ -318,6 +318,12 @@ def search():
html_soup = bsoup(str(response), 'html.parser')
response = add_ip_card(html_soup, get_client_ip(request))
+ # Feature to display currency_card
+ conversion = check_currency(str(response))
+ if conversion:
+ html_soup = bsoup(str(response), 'html.parser')
+ response = add_currency_card(html_soup, conversion)
+
return render_template(
'display.html',
newest_version=newest_version,
diff --git a/app/static/css/dark-theme.css b/app/static/css/dark-theme.css
index 68b7cad..c30b151 100644
--- a/app/static/css/dark-theme.css
+++ b/app/static/css/dark-theme.css
@@ -187,6 +187,10 @@ path {
color: var(--whoogle-dark-text) !important;
}
-.ip-text-div, .update_available {
+.ip-text-div, .update_available, .cb_label, .cb {
color: var(--whoogle-dark-secondary-text) !important;
}
+
+.cb:focus {
+ color: var(--whoogle-dark-contrast-text) !important;
+}
diff --git a/app/static/css/input.css b/app/static/css/input.css
index 96cc108..2da2aa3 100644
--- a/app/static/css/input.css
+++ b/app/static/css/input.css
@@ -12,3 +12,30 @@
height: 40px;
width: 50px;
}
+.ZINbbc.xpd.O9g5cc.uUPGi input::-webkit-outer-spin-button,
+input::-webkit-inner-spin-button {
+ -webkit-appearance: none;
+ margin: 0;
+}
+
+.cb {
+ width: 40%;
+ overflow: hidden;
+ text-align: left;
+ line-height: 28px;
+ background: transparent;
+ border-radius: 6px;
+ border: 1px solid #5f6368;
+ font-size: 14px !important;
+ height: 36px;
+ padding: 0 0 0 12px;
+ margin: 10px 10px 10px 0;
+}
+
+.conversion_box {
+ margin-top: 15px;
+}
+
+.ZINbbc.xpd.O9g5cc.uUPGi input:focus-visible {
+ outline: 0;
+}
diff --git a/app/static/css/light-theme.css b/app/static/css/light-theme.css
index de37157..bc17952 100644
--- a/app/static/css/light-theme.css
+++ b/app/static/css/light-theme.css
@@ -175,6 +175,10 @@ path {
border-bottom: 0px;
}
-.ip-text-div, .update_available {
+.ip-text-div, .update_available, .cb_label, .cb {
color: var(--whoogle-secondary-text) !important;
}
+
+.cb:focus {
+ color: var(--whoogle-text) !important;
+}
diff --git a/app/static/js/currency.js b/app/static/js/currency.js
new file mode 100644
index 0000000..b669596
--- /dev/null
+++ b/app/static/js/currency.js
@@ -0,0 +1,9 @@
+const convert = (n1, n2, conversionFactor) => {
+ // id's for currency input boxes
+ let id1 = "cb" + n1;
+ let id2 = "cb" + n2;
+ // getting the value of the input box that just got filled
+ let inputBox = document.getElementById(id1).value;
+ // updating the other input box after conversion
+ document.getElementById(id2).value = ((inputBox * conversionFactor).toFixed(2));
+}
diff --git a/app/templates/display.html b/app/templates/display.html
index 3cd76b6..fe39df7 100644
--- a/app/templates/display.html
+++ b/app/templates/display.html
@@ -38,4 +38,5 @@
+