Merge pull request #110 from neon-mmd/improve-and-fix-settings-page
Browse files- Cargo.lock +15 -15
- Cargo.toml +1 -1
- public/static/cookies.js +18 -0
- public/static/settings.js +83 -0
- public/static/themes/simple.css +240 -38
- public/templates/cookies_tab.html +12 -0
- public/templates/engines_tab.html +31 -0
- public/templates/footer.html +1 -0
- public/templates/general_tab.html +4 -0
- public/templates/header.html +5 -3
- public/templates/navbar.html +4 -4
- public/templates/settings.html +19 -2
- public/templates/user_interface_tab.html +27 -0
Cargo.lock
CHANGED
|
@@ -535,9 +535,9 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa"
|
|
| 535 |
|
| 536 |
[[package]]
|
| 537 |
name = "cpufeatures"
|
| 538 |
-
version = "0.2.
|
| 539 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 540 |
-
checksum = "
|
| 541 |
dependencies = [
|
| 542 |
"libc",
|
| 543 |
]
|
|
@@ -1773,9 +1773,9 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94"
|
|
| 1773 |
|
| 1774 |
[[package]]
|
| 1775 |
name = "pest"
|
| 1776 |
-
version = "2.6.
|
| 1777 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 1778 |
-
checksum = "
|
| 1779 |
dependencies = [
|
| 1780 |
"thiserror",
|
| 1781 |
"ucd-trie",
|
|
@@ -1783,9 +1783,9 @@ dependencies = [
|
|
| 1783 |
|
| 1784 |
[[package]]
|
| 1785 |
name = "pest_derive"
|
| 1786 |
-
version = "2.6.
|
| 1787 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 1788 |
-
checksum = "
|
| 1789 |
dependencies = [
|
| 1790 |
"pest",
|
| 1791 |
"pest_generator",
|
|
@@ -1793,9 +1793,9 @@ dependencies = [
|
|
| 1793 |
|
| 1794 |
[[package]]
|
| 1795 |
name = "pest_generator"
|
| 1796 |
-
version = "2.6.
|
| 1797 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 1798 |
-
checksum = "
|
| 1799 |
dependencies = [
|
| 1800 |
"pest",
|
| 1801 |
"pest_meta",
|
|
@@ -1806,9 +1806,9 @@ dependencies = [
|
|
| 1806 |
|
| 1807 |
[[package]]
|
| 1808 |
name = "pest_meta"
|
| 1809 |
-
version = "2.6.
|
| 1810 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 1811 |
-
checksum = "
|
| 1812 |
dependencies = [
|
| 1813 |
"once_cell",
|
| 1814 |
"pest",
|
|
@@ -2555,9 +2555,9 @@ dependencies = [
|
|
| 2555 |
|
| 2556 |
[[package]]
|
| 2557 |
name = "serde_json"
|
| 2558 |
-
version = "1.0.
|
| 2559 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 2560 |
-
checksum = "
|
| 2561 |
dependencies = [
|
| 2562 |
"itoa 1.0.6",
|
| 2563 |
"ryu",
|
|
@@ -2617,9 +2617,9 @@ checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012"
|
|
| 2617 |
|
| 2618 |
[[package]]
|
| 2619 |
name = "sha2"
|
| 2620 |
-
version = "0.10.
|
| 2621 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 2622 |
-
checksum = "
|
| 2623 |
dependencies = [
|
| 2624 |
"cfg-if 1.0.0",
|
| 2625 |
"cpufeatures",
|
|
@@ -3381,7 +3381,7 @@ dependencies = [
|
|
| 3381 |
|
| 3382 |
[[package]]
|
| 3383 |
name = "websurfx"
|
| 3384 |
-
version = "0.
|
| 3385 |
dependencies = [
|
| 3386 |
"actix-files",
|
| 3387 |
"actix-web",
|
|
|
|
| 535 |
|
| 536 |
[[package]]
|
| 537 |
name = "cpufeatures"
|
| 538 |
+
version = "0.2.8"
|
| 539 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 540 |
+
checksum = "03e69e28e9f7f77debdedbaafa2866e1de9ba56df55a8bd7cfc724c25a09987c"
|
| 541 |
dependencies = [
|
| 542 |
"libc",
|
| 543 |
]
|
|
|
|
| 1773 |
|
| 1774 |
[[package]]
|
| 1775 |
name = "pest"
|
| 1776 |
+
version = "2.6.1"
|
| 1777 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 1778 |
+
checksum = "16833386b02953ca926d19f64af613b9bf742c48dcd5e09b32fbfc9740bf84e2"
|
| 1779 |
dependencies = [
|
| 1780 |
"thiserror",
|
| 1781 |
"ucd-trie",
|
|
|
|
| 1783 |
|
| 1784 |
[[package]]
|
| 1785 |
name = "pest_derive"
|
| 1786 |
+
version = "2.6.1"
|
| 1787 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 1788 |
+
checksum = "7763190f9406839f99e5197afee8c9e759969f7dbfa40ad3b8dbee8757b745b5"
|
| 1789 |
dependencies = [
|
| 1790 |
"pest",
|
| 1791 |
"pest_generator",
|
|
|
|
| 1793 |
|
| 1794 |
[[package]]
|
| 1795 |
name = "pest_generator"
|
| 1796 |
+
version = "2.6.1"
|
| 1797 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 1798 |
+
checksum = "249061b22e99973da1f5f5f1410284419e283bb60b79255bf5f42a94b66a2e00"
|
| 1799 |
dependencies = [
|
| 1800 |
"pest",
|
| 1801 |
"pest_meta",
|
|
|
|
| 1806 |
|
| 1807 |
[[package]]
|
| 1808 |
name = "pest_meta"
|
| 1809 |
+
version = "2.6.1"
|
| 1810 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 1811 |
+
checksum = "457c310cfc9cf3f22bc58901cc7f0d3410ac5d6298e432a4f9a6138565cb6df6"
|
| 1812 |
dependencies = [
|
| 1813 |
"once_cell",
|
| 1814 |
"pest",
|
|
|
|
| 2555 |
|
| 2556 |
[[package]]
|
| 2557 |
name = "serde_json"
|
| 2558 |
+
version = "1.0.97"
|
| 2559 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 2560 |
+
checksum = "bdf3bf93142acad5821c99197022e170842cdbc1c30482b98750c688c640842a"
|
| 2561 |
dependencies = [
|
| 2562 |
"itoa 1.0.6",
|
| 2563 |
"ryu",
|
|
|
|
| 2617 |
|
| 2618 |
[[package]]
|
| 2619 |
name = "sha2"
|
| 2620 |
+
version = "0.10.7"
|
| 2621 |
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 2622 |
+
checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8"
|
| 2623 |
dependencies = [
|
| 2624 |
"cfg-if 1.0.0",
|
| 2625 |
"cpufeatures",
|
|
|
|
| 3381 |
|
| 3382 |
[[package]]
|
| 3383 |
name = "websurfx"
|
| 3384 |
+
version = "0.13.0"
|
| 3385 |
dependencies = [
|
| 3386 |
"actix-files",
|
| 3387 |
"actix-web",
|
Cargo.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
[package]
|
| 2 |
name = "websurfx"
|
| 3 |
-
version = "0.
|
| 4 |
edition = "2021"
|
| 5 |
description = "An open-source alternative to Searx that provides clean, ad-free, and organic results with incredible speed while keeping privacy and security in mind."
|
| 6 |
repository = "https://github.com/neon-mmd/websurfx"
|
|
|
|
| 1 |
[package]
|
| 2 |
name = "websurfx"
|
| 3 |
+
version = "0.13.0"
|
| 4 |
edition = "2021"
|
| 5 |
description = "An open-source alternative to Searx that provides clean, ad-free, and organic results with incredible speed while keeping privacy and security in mind."
|
| 6 |
repository = "https://github.com/neon-mmd/websurfx"
|
public/static/cookies.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This function is executed when any page on the website finsihes loading and
|
| 2 |
+
// this function retrieves the cookies if it is present on the user's machine.
|
| 3 |
+
// If it is available then the saved cookies is display in the cookies tab
|
| 4 |
+
// otherwise an appropriate message is displayed if it is not available.
|
| 5 |
+
document.addEventListener(
|
| 6 |
+
'DOMContentLoaded',
|
| 7 |
+
() => {
|
| 8 |
+
try {
|
| 9 |
+
let cookie = decodeURIComponent(document.cookie)
|
| 10 |
+
document.querySelector('.cookies input').value =
|
| 11 |
+
cookie !== '' ? cookie : 'No cookies have been saved on your system'
|
| 12 |
+
} catch (error) {
|
| 13 |
+
console.error('Error decoding cookie:', error)
|
| 14 |
+
document.querySelector('.cookies input').value = 'Error decoding cookie'
|
| 15 |
+
}
|
| 16 |
+
},
|
| 17 |
+
false
|
| 18 |
+
)
|
public/static/settings.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This function handles the toggling of selections of all upstream search engines
|
| 2 |
+
// options in the settings page under the tab engines.
|
| 3 |
+
function toggleAllSelection() {
|
| 4 |
+
document
|
| 5 |
+
.querySelectorAll('.engine')
|
| 6 |
+
.forEach(
|
| 7 |
+
(engine_checkbox) =>
|
| 8 |
+
(engine_checkbox.checked =
|
| 9 |
+
document.querySelector('.select_all').checked)
|
| 10 |
+
)
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
// This function adds the functionality to sidebar buttons to only show settings
|
| 14 |
+
// related to that tab.
|
| 15 |
+
function setActiveTab(current_tab) {
|
| 16 |
+
document
|
| 17 |
+
.querySelectorAll('.tab')
|
| 18 |
+
.forEach((tab) => tab.classList.remove('active'))
|
| 19 |
+
document
|
| 20 |
+
.querySelectorAll('.btn')
|
| 21 |
+
.forEach((tab) => tab.classList.remove('active'))
|
| 22 |
+
current_tab.classList.add('active')
|
| 23 |
+
document
|
| 24 |
+
.querySelector(`.${current_tab.innerText.toLowerCase().replace(' ', '_')}`)
|
| 25 |
+
.classList.add('active')
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
// This function adds the functionality to save all the user selected preferences
|
| 29 |
+
// to be saved in a cookie on the users machine.
|
| 30 |
+
function setClientSettings() {
|
| 31 |
+
let cookie_dictionary = new Object()
|
| 32 |
+
document.querySelectorAll('select').forEach((select_tag) => {
|
| 33 |
+
if (select_tag.name === 'themes') {
|
| 34 |
+
cookie_dictionary['theme'] = select_tag.value
|
| 35 |
+
} else if (select_tag.name === 'colorschemes') {
|
| 36 |
+
cookie_dictionary['colorscheme'] = select_tag.value
|
| 37 |
+
}
|
| 38 |
+
})
|
| 39 |
+
let engines = []
|
| 40 |
+
document.querySelectorAll('.engine').forEach((engine_checkbox) => {
|
| 41 |
+
if (engine_checkbox.checked === true) {
|
| 42 |
+
engines.push(engine_checkbox.parentNode.parentNode.innerText.trim())
|
| 43 |
+
}
|
| 44 |
+
})
|
| 45 |
+
cookie_dictionary['engines'] = engines
|
| 46 |
+
let expiration_date = new Date()
|
| 47 |
+
expiration_date.setFullYear(expiration_date.getFullYear() + 1)
|
| 48 |
+
document.cookie = `appCookie=${JSON.stringify(
|
| 49 |
+
cookie_dictionary
|
| 50 |
+
)}; expires=${expiration_date.toUTCString()}`
|
| 51 |
+
|
| 52 |
+
document.querySelector('.message').innerText =
|
| 53 |
+
'✅ The settings have been saved sucessfully!!'
|
| 54 |
+
|
| 55 |
+
setTimeout(() => {
|
| 56 |
+
document.querySelector('.message').innerText = ''
|
| 57 |
+
}, 10000)
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
// This functions gets the saved cookies if it is present on the user's machine If it
|
| 61 |
+
// is available then it is parsed and converted to an object which is then used to
|
| 62 |
+
// retrieve the preferences that the user had selected previously and is then loaded in the
|
| 63 |
+
// website otherwise the function does nothing and the default server side settings are loaded.
|
| 64 |
+
function getClientSettings() {
|
| 65 |
+
let cookie = decodeURIComponent(document.cookie)
|
| 66 |
+
|
| 67 |
+
if (cookie !== '') {
|
| 68 |
+
let cookie_value = decodeURIComponent(document.cookie)
|
| 69 |
+
.split(';')
|
| 70 |
+
.map((item) => item.split('='))
|
| 71 |
+
.reduce((acc, [_, v]) => (acc = JSON.parse(v)) && acc, {})
|
| 72 |
+
|
| 73 |
+
let links = Array.from(document.querySelectorAll('link')).forEach(
|
| 74 |
+
(item) => {
|
| 75 |
+
if (item.href.includes('static/themes')) {
|
| 76 |
+
item.href = `static/themes/${cookie_value['theme']}.css`
|
| 77 |
+
} else if (item.href.includes('static/colorschemes')) {
|
| 78 |
+
item.href = `static/colorschemes/${cookie_value['colorscheme']}.css`
|
| 79 |
+
}
|
| 80 |
+
}
|
| 81 |
+
)
|
| 82 |
+
}
|
| 83 |
+
}
|
public/static/themes/simple.css
CHANGED
|
@@ -263,41 +263,243 @@ footer {
|
|
| 263 |
|
| 264 |
/* Styles for the about page */
|
| 265 |
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 263 |
|
| 264 |
/* Styles for the about page */
|
| 265 |
|
| 266 |
+
.about-container article {
|
| 267 |
+
font-size: 1.5rem;
|
| 268 |
+
color: var(--fg);
|
| 269 |
+
padding-bottom: 10px;
|
| 270 |
+
}
|
| 271 |
+
|
| 272 |
+
.about-container article h1 {
|
| 273 |
+
color: var(--2);
|
| 274 |
+
font-size: 2.8rem;
|
| 275 |
+
}
|
| 276 |
+
|
| 277 |
+
.about-container article div {
|
| 278 |
+
padding-bottom: 15px;
|
| 279 |
+
}
|
| 280 |
+
|
| 281 |
+
.about-container a {
|
| 282 |
+
color: var(--3);
|
| 283 |
+
}
|
| 284 |
+
|
| 285 |
+
.about-container article h2 {
|
| 286 |
+
color: var(--3);
|
| 287 |
+
font-size: 1.8rem;
|
| 288 |
+
padding-bottom: 10px;
|
| 289 |
+
}
|
| 290 |
+
|
| 291 |
+
.about-container p {
|
| 292 |
+
color: var(--fg);
|
| 293 |
+
font-size: 1.6rem;
|
| 294 |
+
padding-bottom: 10px;
|
| 295 |
+
}
|
| 296 |
+
|
| 297 |
+
.about-container h3 {
|
| 298 |
+
font-size: 1.5rem;
|
| 299 |
+
}
|
| 300 |
+
|
| 301 |
+
.about-container {
|
| 302 |
+
width: 80%;
|
| 303 |
+
}
|
| 304 |
+
|
| 305 |
+
/* Styles for the settings page */
|
| 306 |
+
.settings_container {
|
| 307 |
+
display: flex;
|
| 308 |
+
justify-content: space-around;
|
| 309 |
+
width: 80dvw;
|
| 310 |
+
}
|
| 311 |
+
|
| 312 |
+
.settings h1 {
|
| 313 |
+
color: var(--2);
|
| 314 |
+
font-size: 2.5rem;
|
| 315 |
+
}
|
| 316 |
+
|
| 317 |
+
.settings hr {
|
| 318 |
+
border-color: var(--3);
|
| 319 |
+
margin: 0.3rem 0 1rem 0;
|
| 320 |
+
}
|
| 321 |
+
|
| 322 |
+
.settings_container .sidebar {
|
| 323 |
+
width: 30%;
|
| 324 |
+
cursor: pointer;
|
| 325 |
+
font-size: 2rem;
|
| 326 |
+
display: flex;
|
| 327 |
+
flex-direction: column;
|
| 328 |
+
margin-right: 0.5rem;
|
| 329 |
+
margin-left: -0.7rem;
|
| 330 |
+
padding: 0.7rem;
|
| 331 |
+
border-radius: 5px;
|
| 332 |
+
font-weight: bold;
|
| 333 |
+
margin-bottom: 0.5rem;
|
| 334 |
+
color: var(--fg);
|
| 335 |
+
text-transform: capitalize;
|
| 336 |
+
gap: 1.5rem;
|
| 337 |
+
}
|
| 338 |
+
|
| 339 |
+
.settings_container .sidebar .btn {
|
| 340 |
+
padding: 0.5rem;
|
| 341 |
+
border-radius: 0.5rem;
|
| 342 |
+
}
|
| 343 |
+
|
| 344 |
+
.settings_container .sidebar .btn.active {
|
| 345 |
+
background-color: var(--2);
|
| 346 |
+
}
|
| 347 |
+
|
| 348 |
+
.settings_container .main_container {
|
| 349 |
+
width: 70%;
|
| 350 |
+
border-left: 1.5px solid var(--3);
|
| 351 |
+
padding-left: 3rem;
|
| 352 |
+
}
|
| 353 |
+
|
| 354 |
+
.settings_container .tab {
|
| 355 |
+
display: none;
|
| 356 |
+
}
|
| 357 |
+
|
| 358 |
+
.settings_container .tab.active {
|
| 359 |
+
display: flex;
|
| 360 |
+
flex-direction: column;
|
| 361 |
+
justify-content: space-around;
|
| 362 |
+
}
|
| 363 |
+
|
| 364 |
+
.settings_container button {
|
| 365 |
+
margin-top: 1rem;
|
| 366 |
+
padding: 1rem 2rem;
|
| 367 |
+
font-size: 1.5rem;
|
| 368 |
+
background: var(--3);
|
| 369 |
+
color: var(--bg);
|
| 370 |
+
border-radius: 0.5rem;
|
| 371 |
+
border: 2px solid transparent;
|
| 372 |
+
font-weight: bold;
|
| 373 |
+
transition: all 0.1s ease-out;
|
| 374 |
+
cursor: pointer;
|
| 375 |
+
box-shadow: 5px 5px;
|
| 376 |
+
outline: none;
|
| 377 |
+
}
|
| 378 |
+
|
| 379 |
+
.settings_container button:active {
|
| 380 |
+
box-shadow: none;
|
| 381 |
+
translate: 5px 5px;
|
| 382 |
+
}
|
| 383 |
+
|
| 384 |
+
.settings_container .main_container .message {
|
| 385 |
+
font-size: 1.5rem;
|
| 386 |
+
color: var(--fg);
|
| 387 |
+
}
|
| 388 |
+
|
| 389 |
+
.settings_container .tab h3 {
|
| 390 |
+
font-size: 2rem;
|
| 391 |
+
font-weight: bold;
|
| 392 |
+
color: var(--4);
|
| 393 |
+
margin-top: 1.5rem;
|
| 394 |
+
text-transform: capitalize;
|
| 395 |
+
}
|
| 396 |
+
|
| 397 |
+
.settings_container .tab .description {
|
| 398 |
+
font-size: 1.5rem;
|
| 399 |
+
margin-bottom: 0.5rem;
|
| 400 |
+
color: var(--fg);
|
| 401 |
+
}
|
| 402 |
+
|
| 403 |
+
.settings_container .user_interface select {
|
| 404 |
+
margin: 0.7rem 0;
|
| 405 |
+
width: 20rem;
|
| 406 |
+
background-color: var(--bg);
|
| 407 |
+
color: var(--fg);
|
| 408 |
+
padding: 1rem 2rem;
|
| 409 |
+
border-radius: 0.5rem;
|
| 410 |
+
outline: none;
|
| 411 |
+
border: none;
|
| 412 |
+
text-transform: capitalize;
|
| 413 |
+
}
|
| 414 |
+
|
| 415 |
+
.settings_container .user_interface option:hover {
|
| 416 |
+
background-color: var(--1);
|
| 417 |
+
}
|
| 418 |
+
|
| 419 |
+
.settings_container .engines .engine_selection {
|
| 420 |
+
display: flex;
|
| 421 |
+
flex-direction: column;
|
| 422 |
+
justify-content: center;
|
| 423 |
+
gap: 1rem;
|
| 424 |
+
padding: 1rem 0;
|
| 425 |
+
}
|
| 426 |
+
|
| 427 |
+
.settings_container .engines .toggle_btn {
|
| 428 |
+
color: var(--fg);
|
| 429 |
+
font-size: 1.5rem;
|
| 430 |
+
display: flex;
|
| 431 |
+
gap: 0.5rem;
|
| 432 |
+
align-items: center;
|
| 433 |
+
}
|
| 434 |
+
|
| 435 |
+
.settings_container .engines hr {
|
| 436 |
+
margin: 0;
|
| 437 |
+
}
|
| 438 |
+
|
| 439 |
+
.settings_container .cookies input {
|
| 440 |
+
margin: 1rem 0rem;
|
| 441 |
+
}
|
| 442 |
+
|
| 443 |
+
/* Styles for the toggle button */
|
| 444 |
+
/* The switch - the box around the slider */
|
| 445 |
+
.switch {
|
| 446 |
+
position: relative;
|
| 447 |
+
display: inline-block;
|
| 448 |
+
width: 6rem;
|
| 449 |
+
height: 3.4rem;
|
| 450 |
+
}
|
| 451 |
+
|
| 452 |
+
/* Hide default HTML checkbox */
|
| 453 |
+
.switch input {
|
| 454 |
+
opacity: 0;
|
| 455 |
+
width: 0;
|
| 456 |
+
height: 0;
|
| 457 |
+
}
|
| 458 |
+
|
| 459 |
+
/* The slider */
|
| 460 |
+
.slider {
|
| 461 |
+
position: absolute;
|
| 462 |
+
cursor: pointer;
|
| 463 |
+
top: 0;
|
| 464 |
+
left: 0;
|
| 465 |
+
right: 0;
|
| 466 |
+
bottom: 0;
|
| 467 |
+
background-color: var(--bg);
|
| 468 |
+
-webkit-transition: 0.4s;
|
| 469 |
+
transition: 0.4s;
|
| 470 |
+
}
|
| 471 |
+
|
| 472 |
+
.slider:before {
|
| 473 |
+
position: absolute;
|
| 474 |
+
content: '';
|
| 475 |
+
height: 2.6rem;
|
| 476 |
+
width: 2.6rem;
|
| 477 |
+
left: 0.4rem;
|
| 478 |
+
bottom: 0.4rem;
|
| 479 |
+
background-color: var(--fg);
|
| 480 |
+
-webkit-transition: 0.4s;
|
| 481 |
+
transition: 0.4s;
|
| 482 |
+
}
|
| 483 |
+
|
| 484 |
+
input:checked + .slider {
|
| 485 |
+
background-color: var(--3);
|
| 486 |
+
}
|
| 487 |
+
|
| 488 |
+
input:focus + .slider {
|
| 489 |
+
box-shadow: 0 0 1px var(--3);
|
| 490 |
+
}
|
| 491 |
+
|
| 492 |
+
input:checked + .slider:before {
|
| 493 |
+
-webkit-transform: translateX(2.6rem);
|
| 494 |
+
-ms-transform: translateX(2.6rem);
|
| 495 |
+
transform: translateX(2.6rem);
|
| 496 |
+
}
|
| 497 |
+
|
| 498 |
+
/* Rounded sliders */
|
| 499 |
+
.slider.round {
|
| 500 |
+
border-radius: 3.4rem;
|
| 501 |
+
}
|
| 502 |
+
|
| 503 |
+
.slider.round:before {
|
| 504 |
+
border-radius: 50%;
|
| 505 |
+
}
|
public/templates/cookies_tab.html
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<div class="cookies tab">
|
| 2 |
+
<h1>Cookies</h1>
|
| 3 |
+
<p class="description">
|
| 4 |
+
This is the cookies are saved on your system and it contains the preferences
|
| 5 |
+
you chose in the settings page
|
| 6 |
+
</p>
|
| 7 |
+
<input type="text" name="cookie_field" value="" readonly />
|
| 8 |
+
<p class="description">
|
| 9 |
+
The cookies stored are not used by us for any malicious intend or for
|
| 10 |
+
tracking you in any way.
|
| 11 |
+
</p>
|
| 12 |
+
</div>
|
public/templates/engines_tab.html
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<div class="engines tab">
|
| 2 |
+
<h3>select search engines</h3>
|
| 3 |
+
<p class="description">
|
| 4 |
+
Select the search engines from the list of engines that you want results
|
| 5 |
+
from
|
| 6 |
+
</p>
|
| 7 |
+
<div class="engine_selection">
|
| 8 |
+
<div class="toggle_btn">
|
| 9 |
+
<label class="switch">
|
| 10 |
+
<input type="checkbox" class="select_all" onchange="toggleAllSelection()" />
|
| 11 |
+
<span class="slider round"></span>
|
| 12 |
+
</label>
|
| 13 |
+
Select All
|
| 14 |
+
</div>
|
| 15 |
+
<hr />
|
| 16 |
+
<div class="toggle_btn">
|
| 17 |
+
<label class="switch">
|
| 18 |
+
<input type="checkbox" class="engine" />
|
| 19 |
+
<span class="slider round"></span>
|
| 20 |
+
</label>
|
| 21 |
+
Duckduckgo
|
| 22 |
+
</div>
|
| 23 |
+
<div class="toggle_btn">
|
| 24 |
+
<label class="switch">
|
| 25 |
+
<input type="checkbox" class="engine" />
|
| 26 |
+
<span class="slider round"></span>
|
| 27 |
+
</label>
|
| 28 |
+
Searx
|
| 29 |
+
</div>
|
| 30 |
+
</div>
|
| 31 |
+
</div>
|
public/templates/footer.html
CHANGED
|
@@ -10,6 +10,7 @@
|
|
| 10 |
</ul>
|
| 11 |
</div>
|
| 12 |
</footer>
|
|
|
|
| 13 |
</body>
|
| 14 |
|
| 15 |
</html>
|
|
|
|
| 10 |
</ul>
|
| 11 |
</div>
|
| 12 |
</footer>
|
| 13 |
+
<script src="static/settings.js"></script>
|
| 14 |
</body>
|
| 15 |
|
| 16 |
</html>
|
public/templates/general_tab.html
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<div class="general tab active">
|
| 2 |
+
<h1>General</h1>
|
| 3 |
+
<p class="description">Coming soon!!</p>
|
| 4 |
+
</div>
|
public/templates/header.html
CHANGED
|
@@ -1,12 +1,14 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en">
|
| 3 |
-
|
|
|
|
| 4 |
<title>Websurfx</title>
|
| 5 |
<meta charset="UTF-8" />
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
| 7 |
<link href="static/colorschemes/{{colorscheme}}.css" rel="stylesheet" type="text/css" />
|
| 8 |
<link href="static/themes/{{theme}}.css" rel="stylesheet" type="text/css" />
|
| 9 |
-
|
| 10 |
|
| 11 |
-
|
| 12 |
<header>{{>navbar}}</header>
|
|
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en">
|
| 3 |
+
|
| 4 |
+
<head>
|
| 5 |
<title>Websurfx</title>
|
| 6 |
<meta charset="UTF-8" />
|
| 7 |
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
| 8 |
<link href="static/colorschemes/{{colorscheme}}.css" rel="stylesheet" type="text/css" />
|
| 9 |
<link href="static/themes/{{theme}}.css" rel="stylesheet" type="text/css" />
|
| 10 |
+
</head>
|
| 11 |
|
| 12 |
+
<body onload="getClientSettings()">
|
| 13 |
<header>{{>navbar}}</header>
|
| 14 |
+
|
public/templates/navbar.html
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<nav>
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
</nav>
|
|
|
|
| 1 |
<nav>
|
| 2 |
+
<ul>
|
| 3 |
+
<li><a href="about">about</a></li>
|
| 4 |
+
<li><a href="settings">settings</a></li>
|
| 5 |
+
</ul>
|
| 6 |
</nav>
|
public/templates/settings.html
CHANGED
|
@@ -1,5 +1,22 @@
|
|
| 1 |
{{>header this}}
|
| 2 |
-
<main class="settings">
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
</main>
|
|
|
|
|
|
|
| 5 |
{{>footer}}
|
|
|
|
| 1 |
{{>header this}}
|
| 2 |
+
<main class="settings" >
|
| 3 |
+
<h1>Settings</h1>
|
| 4 |
+
<hr />
|
| 5 |
+
<div class="settings_container">
|
| 6 |
+
<div class="sidebar">
|
| 7 |
+
<div class="btn active" onclick="setActiveTab(this)">general</div>
|
| 8 |
+
<div class="btn" onclick="setActiveTab(this)">user interface</div>
|
| 9 |
+
<div class="btn" onclick="setActiveTab(this)">engines</div>
|
| 10 |
+
<div class="btn" onclick="setActiveTab(this)">cookies</div>
|
| 11 |
+
</div>
|
| 12 |
+
<div class="main_container">
|
| 13 |
+
{{> general_tab}} {{> user_interface_tab}} {{> engines_tab}} {{>
|
| 14 |
+
cookies_tab}}
|
| 15 |
+
<p class="message"></p>
|
| 16 |
+
<button type="submit" onclick="setClientSettings()">Save</button>
|
| 17 |
+
</div>
|
| 18 |
+
</div>
|
| 19 |
</main>
|
| 20 |
+
<script src="static/settings.js"></script>
|
| 21 |
+
<script src="static/cookies.js"></script>
|
| 22 |
{{>footer}}
|
public/templates/user_interface_tab.html
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<div class="user_interface tab">
|
| 2 |
+
<h3>select theme</h3>
|
| 3 |
+
<p class="description">
|
| 4 |
+
Select the theme from the available themes to be used in user interface
|
| 5 |
+
</p>
|
| 6 |
+
<select name="themes">
|
| 7 |
+
<option value="simple">simple</option>
|
| 8 |
+
</select>
|
| 9 |
+
<h3>select color scheme</h3>
|
| 10 |
+
<p class="description">
|
| 11 |
+
Select the color scheme for your theme to be used in user interface
|
| 12 |
+
</p>
|
| 13 |
+
<select name="colorschemes">
|
| 14 |
+
<option value="catppuccin-mocha">catppuccin mocha</option>
|
| 15 |
+
<option value="dark-chocolate">dark chocolate</option>
|
| 16 |
+
<option value="dracula">dracula</option>
|
| 17 |
+
<option value="gruvbox-dark">gruvbox dark</option>
|
| 18 |
+
<option value="monokai">monokai</option>
|
| 19 |
+
<option value="nord">nord</option>
|
| 20 |
+
<option value="oceanic-next">oceanic next</option>
|
| 21 |
+
<option value="one-dark">one dark</option>
|
| 22 |
+
<option value="solarized-dark">solarized dark</option>
|
| 23 |
+
<option value="solarized-light">solarized light</option>
|
| 24 |
+
<option value="tokyo-night">tokyo night</option>
|
| 25 |
+
<option value="tomorrow-night">tomorrow night</option>
|
| 26 |
+
</select>
|
| 27 |
+
</div>
|