From 155eddbf07d73f12639ed6470497f925a33e32f2 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Thu, 27 Jan 2022 14:58:10 +0300 Subject: Updating and Cleaning UI #9 --- src/_locales/de/messages.json | 2 +- src/_locales/es/messages.json | 2 +- src/_locales/fr/messages.json | 2 +- src/_locales/it/messages.json | 2 +- src/_locales/pl/messages.json | 2 +- src/_locales/ru/messages.json | 2 +- src/_locales/tr/messages.json | 2 +- src/_locales/zh_CN/messages.json | 2 +- src/assets/images/chevron-down.svg | 2 +- src/assets/images/icon128.png | Bin 1773 -> 0 bytes src/assets/images/icon16.png | Bin 709 -> 0 bytes src/assets/images/icon32.png | Bin 1162 -> 0 bytes src/assets/images/icon48.png | Bin 690 -> 0 bytes src/assets/images/logo-small.png | Bin 14128 -> 0 bytes src/assets/images/logo-store.png | Bin 89803 -> 0 bytes src/assets/images/logo-tile.png | Bin 14751 -> 0 bytes src/assets/images/logo.png | Bin 16364 -> 0 bytes src/assets/stylesheets/styles.css | 538 --------------------- src/pages/options/options.html | 951 ++++++++++++------------------------- src/pages/options/options.js | 58 ++- src/pages/popup/popup.html | 356 ++++---------- src/pages/popup/popup.js | 6 +- src/pages/stylesheets/styles.css | 615 ++++++++++++++++++++++++ 23 files changed, 1035 insertions(+), 1507 deletions(-) delete mode 100644 src/assets/images/icon128.png delete mode 100644 src/assets/images/icon16.png delete mode 100644 src/assets/images/icon32.png delete mode 100644 src/assets/images/icon48.png delete mode 100644 src/assets/images/logo-small.png delete mode 100644 src/assets/images/logo-store.png delete mode 100644 src/assets/images/logo-tile.png delete mode 100644 src/assets/images/logo.png delete mode 100644 src/assets/stylesheets/styles.css create mode 100644 src/pages/stylesheets/styles.css diff --git a/src/_locales/de/messages.json b/src/_locales/de/messages.json index 431ed1d4..4a63b5f4 100644 --- a/src/_locales/de/messages.json +++ b/src/_locales/de/messages.json @@ -1,6 +1,6 @@ { "extensionName": { - "message": "Privacy Redirect", + "message": "LibRedirect", "description": "Name of the extension." }, "extensionDescription": { diff --git a/src/_locales/es/messages.json b/src/_locales/es/messages.json index 128ee823..68da2d1e 100644 --- a/src/_locales/es/messages.json +++ b/src/_locales/es/messages.json @@ -1,6 +1,6 @@ { "extensionName": { - "message": "Privacy Redirect", + "message": "LibRedirect", "description": "Nombre de la extensión." }, "extensionDescription": { diff --git a/src/_locales/fr/messages.json b/src/_locales/fr/messages.json index 7b66ab42..8ff43ae5 100644 --- a/src/_locales/fr/messages.json +++ b/src/_locales/fr/messages.json @@ -1,6 +1,6 @@ { "extensionName": { - "message": "Privacy Redirect", + "message": "LibRedirect", "description": "Nom du module complémentaire." }, "extensionDescription": { diff --git a/src/_locales/it/messages.json b/src/_locales/it/messages.json index 69996c5a..46bbb084 100644 --- a/src/_locales/it/messages.json +++ b/src/_locales/it/messages.json @@ -1,6 +1,6 @@ { "extensionName": { - "message": "Privacy Redirect", + "message": "LibRedirect", "description": "Name of the extension." }, "extensionDescription": { diff --git a/src/_locales/pl/messages.json b/src/_locales/pl/messages.json index 85877663..e2a59069 100644 --- a/src/_locales/pl/messages.json +++ b/src/_locales/pl/messages.json @@ -1,6 +1,6 @@ { "extensionName": { - "message": "Privacy Redirect", + "message": "LibRedirect", "description": "Nazwa rozszerzenia." }, "extensionDescription": { diff --git a/src/_locales/ru/messages.json b/src/_locales/ru/messages.json index c371532e..6a80c555 100644 --- a/src/_locales/ru/messages.json +++ b/src/_locales/ru/messages.json @@ -1,6 +1,6 @@ { "extensionName": { - "message": "Privacy Redirect", + "message": "LibRedirect", "description": "Название расширения." }, "extensionDescription": { diff --git a/src/_locales/tr/messages.json b/src/_locales/tr/messages.json index fdf07ac7..15ecad27 100644 --- a/src/_locales/tr/messages.json +++ b/src/_locales/tr/messages.json @@ -1,6 +1,6 @@ { "extensionName": { - "message": "Privacy Redirect", + "message": "LibRedirect", "description": "Uzantı ismi." }, "extensionDescription": { diff --git a/src/_locales/zh_CN/messages.json b/src/_locales/zh_CN/messages.json index 8c19e2de..72e480a2 100644 --- a/src/_locales/zh_CN/messages.json +++ b/src/_locales/zh_CN/messages.json @@ -1,6 +1,6 @@ { "extensionName": { - "message": "Privacy Redirect", + "message": "LibRedirect", "description": "Name of the extension." }, "extensionDescription": { diff --git a/src/assets/images/chevron-down.svg b/src/assets/images/chevron-down.svg index 7679f267..4b093598 100644 --- a/src/assets/images/chevron-down.svg +++ b/src/assets/images/chevron-down.svg @@ -1,3 +1,3 @@ - + \ No newline at end of file diff --git a/src/assets/images/icon128.png b/src/assets/images/icon128.png deleted file mode 100644 index cd16befd..00000000 Binary files a/src/assets/images/icon128.png and /dev/null differ diff --git a/src/assets/images/icon16.png b/src/assets/images/icon16.png deleted file mode 100644 index f896608b..00000000 Binary files a/src/assets/images/icon16.png and /dev/null differ diff --git a/src/assets/images/icon32.png b/src/assets/images/icon32.png deleted file mode 100644 index c5b417cf..00000000 Binary files a/src/assets/images/icon32.png and /dev/null differ diff --git a/src/assets/images/icon48.png b/src/assets/images/icon48.png deleted file mode 100644 index 24dd5af7..00000000 Binary files a/src/assets/images/icon48.png and /dev/null differ diff --git a/src/assets/images/logo-small.png b/src/assets/images/logo-small.png deleted file mode 100644 index 27ca660a..00000000 Binary files a/src/assets/images/logo-small.png and /dev/null differ diff --git a/src/assets/images/logo-store.png b/src/assets/images/logo-store.png deleted file mode 100644 index f321de43..00000000 Binary files a/src/assets/images/logo-store.png and /dev/null differ diff --git a/src/assets/images/logo-tile.png b/src/assets/images/logo-tile.png deleted file mode 100644 index 101c6b3a..00000000 Binary files a/src/assets/images/logo-tile.png and /dev/null differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png deleted file mode 100644 index ad854aaa..00000000 Binary files a/src/assets/images/logo.png and /dev/null differ diff --git a/src/assets/stylesheets/styles.css b/src/assets/stylesheets/styles.css deleted file mode 100644 index a86cfa2b..00000000 --- a/src/assets/stylesheets/styles.css +++ /dev/null @@ -1,538 +0,0 @@ -body { - --text: #fff; - --bg-main: #3c4043; - --bg-secondary: #292a2d; - --active: #ff5b56; - --space: 5px; - --danger: #f04141; - --danger-light: #f9d0d5; - --dark-grey: #767676; - --light-grey: #c3c3c3; -} - -body.light-theme { - --text: #000; - --bg-main: #e3e7ea; - --bg-secondary: #fff; -} - -.light-theme.popup, -.light-theme .popup { - background-color: var(--bg-secondary); -} - -body { - margin: 0; - width: 400px; - margin: auto; - min-height: 572px; - font-family: Sans-Serif; - background-color: var(--bg-secondary); - color: var(--text); -} - -.popup { - width: 300px; - min-height: auto; - overflow: hidden; - background-color: var(--bg-main); -} - -input { - appearance: none; - -moz-appearance: none; - -webkit-appearance: none; -} - -header { - background-color: var(--bg-main); - color: var(--text); - display: flex; - padding: var(--space); -} - -header .logo-container { - width: 100%; - margin: var(--space) 0 var(--space) 0; - display: flex; - align-items: center; -} - -header .logo-container img { - height: 30px; - float: left; -} - -header .logo-container h1 { - font-size: 14px; - float: left; - margin-left: 15px; - text-transform: uppercase; - font-weight: normal; -} - -header .privacy { - letter-spacing: 0.13em; -} - -header .version { - font-size: 8.5px; - font-weight: bold; - position: absolute; - top: var(--space); - right: var(--space); -} - -h1 { - font-size: 14px; - margin: 7px auto; -} - -i { - font-size: 12px; -} - -h2 { - clear: both; - font-size: 12px; - font-weight: normal; - margin: 0; -} - -h3 { - font-size: 16px; -} - -h1, -h2 { - color: var(--text); -} - -footer { - width: 100%; -} - -footer a.button { - margin: var(--space); -} - -input[type="url"], -input[type="text"], -select { - width: 100%; - box-sizing: border-box; - margin-bottom: var(--space); - background-color: var(--bg-main); - border-style: inset; - color: var(--text); -} - -input[type="url"] { - padding: 1px 2px; -} - -input[type="checkbox"] { - opacity: 0; -} - -input[type="radio"] { - appearance: radio; - -moz-appearance: radio; - -webkit-appearance: radio; -} - -input[type="radio"]:checked + label { - background: transparent; -} - -.checkbox-label { - margin-left: 5px; - background: grey; - border-radius: 25px; - color: var(--text); - cursor: pointer; - display: block; - float: right; - font-weight: bold; - height: 30px; - position: relative; - text-indent: -400px; - width: 50px; -} - -.checkbox-label:after { - background: white; - border-radius: 90px; - content: ""; - height: 20px; - left: var(--space); - position: absolute; - top: var(--space); - transition: 0.3s; - width: 20px; -} - -input:checked + label { - background: var(--active); -} - -input:checked + label:after { - left: calc(100% - var(--space)); - transform: translateX(-100%); -} - -.settings-block { - display: block; - padding: 5px 10px 5px 10px; -} - -.settings-block h1 { - float: left; -} - -.button { - border: var(--active) solid 1px; - color: var(--text); - stroke: var(--text); - display: block; - font-size: 12px; - font-weight: bold; - margin: var(--space) auto; - padding: 10px; - text-align: center; - text-decoration: none; - cursor: pointer; - -webkit-transition-duration: 0.4s; - transition-duration: 0.4s; -} - -.button * { - vertical-align: middle; -} - -.button:hover { - background-color: var(--active); - color: var(--text); - stroke: var(--text); -} - -.button:active { - background-color: var(--active); - box-shadow: 0 var(--space) var(--bg-main); - transform: translateY(4px); -} - -input:invalid { - color: var(--danger); - border-color: var(--danger); - background-color: var(--danger-light); -} - -.margin-bottom { - margin-bottom: 20px; -} - -.tab { - overflow: hidden; - background-color: var(--bg-secondary); - position: fixed; - top: 0; - width: 400px; - z-index: 2; -} - -.tab button { - border-top-left-radius: 10px; - border-top-right-radius: 10px; - color: var(--text); - background-color: inherit; - float: left; - border: none; - outline: none; - cursor: pointer; - padding: 14px 16px; - transition: 0.3s; - border: solid 1px var(--bg-main); - width: 33.333%; - font-size: 14px; -} - -.tab button:hover { - background-color: var(--active); -} - -.tab button.active { - background-color: var(--bg-main); -} - -.tabcontent { - padding-top: 50px; - display: none; - background-color: var(--bg-main); - min-height: 510px; -} - -div.exceptions { - clear: left; -} - -div.exceptions > input { - width: 240px; - float: left; -} - -#add-to-exceptions { - float: right; - border: var(--active) solid 1px; - background-color: var(--active); - color: var(--text); - font-weight: bold; - cursor: pointer; - border-radius: 50%; - padding: 1px 1px 0px 1px; - margin-right: 5px; -} - -#add-to-exceptions svg { - height: 20px; - width: 20px; -} - -ul { - padding: 0; - list-style-type: none; - color: var(--text); - margin: 20px 20px 0 20px; -} - -li { - border-bottom: solid 0.5px var(--bg-secondary); - padding: 20px 0px 20px 20px; -} - -#exceptions-items button { - float: right; - margin-right: -5px; - border: var(--active) solid 1px; - background-color: var(--active); - color: var(--text); - font-weight: bold; - cursor: pointer; - border-radius: 50%; - padding: 2px 2px 0px 2px; -} - -.button svg { - height: 18px; - width: 18px; -} - -.autocomplete { - position: relative; - display: inline-block; - width: 100%; -} - -.autocomplete input { - background: url(../images/chevron-down.svg) right no-repeat; -} - -.autocomplete-items { - position: absolute; - border: 1px solid var(--bg-main); - border-bottom: none; - border-top: none; - z-index: 99; - top: 85%; - left: 0; - right: 0; - overflow-y: auto; - max-height: 175px; - color: var(--text); - overflow-x: hidden; - max-width: 380px; -} - -.autocomplete-items div { - padding: 10px; - cursor: pointer; - background-color: var(--bg-secondary); - border-bottom: 1px solid var(--bg-main); -} - -.autocomplete-items div:hover { - background-color: var(--active); -} - -.autocomplete-active { - background-color: var(--active); - color: var(--text); -} - -.option { - width: 100%; -} - -.option td { - vertical-align: middle; -} - -input[type="range"] { - -webkit-appearance: none; - margin: 18px 0; - width: 100%; -} - -input[type="range"]:focus { - outline: none; -} - -input[type="range"]::-webkit-slider-runnable-track { - width: 100%; - height: 8.4px; - cursor: pointer; - border-color: var(--dark-grey), var(--light-grey); - background: var(--bg-main); - border-radius: 1.3px; - border: 0.2px inset var(--dark-grey); -} - -input[type="range"]::-webkit-slider-thumb { - border-color: var(--active); - border: 1px solid var(--dark-grey); - height: 36px; - width: 16px; - border-radius: 3px; - background: var(--active); - cursor: pointer; - -webkit-appearance: none; - margin-top: -14px; -} - -input[type="range"]:focus::-webkit-slider-runnable-track { - background: var(--bg-main); -} - -input[type="range"]::-moz-range-track { - width: 100%; - height: 8.4px; - cursor: pointer; - border-color: var(--dark-grey), var(--light-grey); - background: var(--bg-main); - border-radius: 1.3px; - border: 0.2px inset var(--dark-grey); -} - -input[type="range"]::-moz-range-thumb { - border-color: var(--active); - border: 1px solid var(--dark-grey); - height: 36px; - width: 16px; - border-radius: 3px; - background: var(--active); - cursor: pointer; -} - -::placeholder { - color: var(--text); - opacity: 0.7; -} - -*:focus { - outline: var(--active) solid 2px; -} - -@media (prefers-color-scheme: light) { - body { - --text: #000; - --text-secondary: #fff; - --bg-main: #e3e7ea; - --bg-secondary: #fff; - } - - body.dark-theme { - --text: #fff; - --text-secondary: #000; - --bg-main: #3c4043; - --bg-secondary: #292a2d; - } - - .popup { - background-color: var(--bg-secondary); - } -} - -#volume-value { - float: right; -} - -.collapsible { - background-color: var(--bg-main); - cursor: pointer; - color: var(--active); - padding: 18px; - width: 100%; - border: none; - text-align: left; - outline: none; - font-size: 15px; - border-bottom: solid var(--active); - font-weight: bold; -} - -.collapsible:after { - content: "\25BE"; - color: var(--active); - font-weight: bold; - float: right; - margin-left: 5px; -} - -.collapsible-active, -.collapsible:hover, -.collapsible:hover::after { - background-color: var(--active); - color: var(--text-secondary); -} - -.collapsible-active:after { - content: "\25B4"; - color: var(--text-secondary); - font-weight: bold; - float: right; - margin-left: 5px; -} - -.collapsible-content { - padding: 0 18px; - display: none; - overflow: hidden; -} - -hr { - height: 2px; - background-color: var(--active); - border: none; -} - -.new-badge { - position: relative; -} - -.new-badge[data-new-badge]:after { - content: "New!"; - position: absolute; - top: -10px; - right: -42px; - font-size: 0.9em; - background: var(--active); - color: white; - width: 35px; - height: 18px; - text-align: center; - line-height: 18px; - border-radius: 25px; - padding: 2px; - box-shadow: 0 0 1px var(--bg-secondary); - font-weight: bold; -} diff --git a/src/pages/options/options.html b/src/pages/options/options.html index 5b68ed10..286cef51 100644 --- a/src/pages/options/options.html +++ b/src/pages/options/options.html @@ -1,692 +1,323 @@ - - - - - - Privacy Redirect Options - - - -
- - - + + + + + + + LibRedirect Options + + + +
+ + + +
+ +
+ +
+

Theme

+
-
-
- - - - - - - -
-

Nitter Redirects

-
-   - -
-
-
- - - - - - - -
-

- Invidious Redirects -

-
-   - -
-
-
- - - - - - - -
-

- Bibliogram Redirects -

-
-   - -
-
-
- - - - - - - -
-

- OpenStreetMap Redirects -

-
-   - -
-
-
- - - - - - - -
-

- Reddit Redirects -

-
-   - -
-
-
- - - - - - - -
-

- Scribe Redirects -

-
-   - -
-
-
- - - - - - - -
-

- Search Engine Redirects -

-
-   - -
-
-
- - - - - - - -
-

SimplyTranslate Redirects

-
-   - -
-
-
- - - - - - - -
-

Wikipedia Redirects

-
-   - -
-
-
-

Nitter Instance

-
- -
-
-
-

Invidious Instance

-
- -
-
-
-

Bibliogram Instance

-
- -
-
+
+

Youtube (Invidious)

+ +
+
+
+ +
+
+ +
+

Twitter (Nitter)

+ +
+
+
+ +
+
+ +
+

Instagram (Bibliogram)

+ +
+
+
+ +
+
+ +
+

Reddit (LibReddit)

+ +
+
+
+ +
+
+ +
+

Search

+ +
+
+
+ +
+
+ +
+

Translate (SimplyTranslate)

+ +
+
+
+ +
+
+ +
+

Maps (OpenStreetMaps)

+ +
+
+
+ +
+
+ +
+

Wikipedia (Wikiless)

+ +
+
+
+ +
+
+ +
+

Medium (Scribe)

+ +
+
+
+ +
+
+ + +
+ +
+ + +
-

OpenStreetMap Instance

-
- -
+

+ Invidious random instance pool (comma-separated) +

+
+ +
+

Use FreeTube over Invidious when possible

+ +
+ +
+

Always proxy videos through Invidious

+ +
+ +
+

Only redirect embedded video to Invidious

+ +
+
-

Reddit Instance

-
- -
+

Invidious Video Quality

+
+ + +
+

Invidious dark mode always on

+ +
+
-

Scribe Instance

-
- -
+

+ Invidious Volume:  +

+ +
+ +
+ +
+

Invidious Player Style

+ +
+ +
-

Search Engine Instance

-
- -
+

+ Invidious Subtitles - language codes (comma-separated) +

+
+ +
+

Invidious automatically play video on load

+ +
+ +
+

Persist Invidious preferences (as cookie)

+ +
+
+ +
-

SimplyTranslate Instance

-
- -
+

+ Nitter random instance pool (comma-separated) +

+
+
+

Proactively remove Twitter service worker

+ +
+
+ +
-

Wikipedia Instance

-
- -
+

+ Bibliogram random instance pool (comma-separated) +

+
+ +
+ +
-

Theme

- +

+ Scribe random instance pool (comma-separated) +

+
+
-
- -
-
-

- Invidious random instance pool (comma-separated) -

- -
-
- - - - - - - -
-

- Use FreeTube over Invidious when possible -

-
-   - -
-
-
- - - - - - - -
-

- Always proxy videos through Invidious -

-
-   - -
-
-
- - - - - - - -
-

- Only redirect embedded video to Invidious -

-
-   - -
-
-
-

Invidious Video Quality

- -
-
- - - - - - - -
-

- Invidious dark mode always on -

-
-   - -
-
-
-

- Invidious Volume -

- -
-
-

- Invidious Player Style -

- -
-
-

- Invidious Subtitles - language codes (comma-separated) -

- -
-
- - - - - - - -
-

- Invidious automatically play video on load -

-
-   - -
-
-
- - - - - - - -
-

- Persist Invidious preferences (as cookie) -

-
-   - -
-
-
-
- -
-
-

- Nitter random instance pool (comma-separated) -

- -
-
- - - - - - - -
-

- Proactively remove Twitter service worker -

-
-   - -
-
-
-
- -
-
-

- Bibliogram random instance pool (comma-separated) -

- -
-
-

- Scribe random instance pool (comma-separated) -

- -
-
-
-
-
-
-

- Enter a URL or Regular Expression to be excluded from redirects. -

-

- All requests for or initiating from a URL that matches your exception - will be excluded from redirects. -

-

- Note - Supports JavaScript regular expressions, excluding the - enclosing forward slashes. -

-
-
- - - - - - - - - + + +
-

Add Exception

-
- - - - - - - - +
+
+
    +
    + + + + - - - - + \ No newline at end of file diff --git a/src/pages/options/options.js b/src/pages/options/options.js index fea94110..639d351b 100644 --- a/src/pages/options/options.js +++ b/src/pages/options/options.js @@ -29,10 +29,8 @@ let bibliogramInstance = document.getElementById("bibliogram-instance"); let osmInstance = document.getElementById("osm-instance"); let redditInstance = document.getElementById("reddit-instance"); let scribeInstance = document.getElementById("scribe-instance"); -let searchEngineInstance = document.getElementById("search-engine-instance"); -let simplyTranslateInstance = document.getElementById( - "simply-translate-instance" -); +let searchEngineInstance = document.getElementById("searchEngine-instance"); +let simplyTranslateInstance = document.getElementById("simplyTranslate-instance"); let wikipediaInstance = document.getElementById("wikipedia-instance"); let disableNitter = document.getElementById("disable-nitter"); let disableInvidious = document.getElementById("disable-invidious"); @@ -40,9 +38,9 @@ let disableBibliogram = document.getElementById("disable-bibliogram"); let disableOsm = document.getElementById("disable-osm"); let disableReddit = document.getElementById("disable-reddit"); let disableScribe = document.getElementById("disable-scribe"); -let disableSearchEngine = document.getElementById("disable-search-engine"); +let disableSearchEngine = document.getElementById("disable-searchEngine"); let disableSimplyTranslate = document.getElementById( - "disable-simply-translate" + "disable-simplyTranslate" ); let disableWikipedia = document.getElementById("disable-wikipedia"); let alwaysProxy = document.getElementById("always-proxy"); @@ -177,22 +175,22 @@ browser.storage.sync.get( result.scribeRandomPool || commonHelper.filterInstances(scribeInstances); autocompletes = [ - { id: "nitter-instance", instances: nitterRandomPool.value.split(',') }, - { id: "invidious-instance", instances: invidiousRandomPool.value.split(',') }, - { id: "bibliogram-instance", instances: bibliogramRandomPool.value.split(',') }, - { id: "scribe-instance", instances: scribeRandomPool.value.split(',') }, - { id: "reddit-instance", instances: redditInstances }, - { id: "osm-instance", instances: osmInstances }, - { - id: "search-engine-instance", - instances: searchEngineInstances.map((instance) => instance.link), - }, - { id: "simply-translate-instance", instances: simplyTranslateInstances }, - { id: "wikipedia-instance", instances: wikipediaInstances }, - ]; + { id: "nitter-instance", instances: nitterRandomPool.value.split(',') }, + { id: "invidious-instance", instances: invidiousRandomPool.value.split(',') }, + { id: "bibliogram-instance", instances: bibliogramRandomPool.value.split(',') }, + { id: "scribe-instance", instances: scribeRandomPool.value.split(',') }, + { id: "reddit-instance", instances: redditInstances }, + { id: "osm-instance", instances: osmInstances }, + { + id: "searchEngine-instance", + instances: searchEngineInstances.map((instance) => instance.link), + }, + { id: "simplyTranslate-instance", instances: simplyTranslateInstances }, + { id: "wikipedia-instance", instances: wikipediaInstances }, + ]; autocompletes.forEach((value) => { autocomplete(document.getElementById(value.id), value.instances); - }); + }); } ); @@ -449,7 +447,7 @@ const invidiousVolumeChange = debounce(() => { browser.storage.sync.set({ invidiousVolume: invidiousVolume.value, }); -}, 500); +}, 1); invidiousVolume.addEventListener("input", invidiousVolumeChange); invidiousPlayerStyle.addEventListener("change", (event) => { @@ -604,7 +602,6 @@ function autocomplete(input, list) { var coll = document.getElementsByClassName("collapsible"); var i; - for (i = 0; i < coll.length; i++) { coll[i].addEventListener("click", function () { this.classList.toggle("collapsible-active"); @@ -616,3 +613,20 @@ for (i = 0; i < coll.length; i++) { } }); } + +const apiEndpoint = 'https://raw.githubusercontent.com/libredirect/instances/main/data.json'; +document.querySelector("#update-instances").addEventListener("click", () => { + document.querySelector("#update-instances").innerHTML = '...'; + let request = new XMLHttpRequest(); + request.open('GET', apiEndpoint, false); + request.send(null); + + if (request.status === 200) { + const instances = JSON.parse(request.responseText); + const nitterRandomPool = instances.twitter.join(','); + const invidiousRandomPool = instances.youtube.join(','); + const bibliogramRandomPool = instances.instagram.join(','); + browser.storage.sync.set({ nitterRandomPool, invidiousRandomPool, bibliogramRandomPool }); + document.querySelector("#update-instances").innerHTML = 'Done!'; + } +}); \ No newline at end of file diff --git a/src/pages/popup/popup.html b/src/pages/popup/popup.html index 5ab3378b..900f6256 100644 --- a/src/pages/popup/popup.html +++ b/src/pages/popup/popup.html @@ -1,287 +1,97 @@ - - - - - - - - + + + + + + -
    - - - - - - - -
    -

    Twitter Redirects

    -
    -   - -
    -
    + -
    - - - - - - - -
    -

    - YouTube Redirects -

    -
    -   - -
    -
    -
    - - - - - - - -
    -

    - Instagram Redirects -

    -
    -   - -
    -
    -
    - - - - - - - -
    -

    - GoogleMap Redirects -

    -
    -   - -
    -
    +
    +

    Youtube

    + +
    -
    - - - - - - - -
    -

    Reddit Redirects

    -
    -   - -
    -
    +
    +

    Twitter

    + +
    -
    - - - - - - - -
    -

    - Search Engine Redirects -

    -
    -   - -
    -
    +
    +

    Instagram

    + +
    -
    - - - - - - - -
    -

    - SimplyTranslate Redirects -

    -
    -   - -
    -
    +
    +

    Reddit

    + +
    -
    - - - - - - - -
    -

    - Wikipedia Redirects -

    -
    -   - -
    -
    +
    +

    Search

    + +
    -
    - - - - - - - -
    -

    - Scribe Redirects -

    -
    -   - -
    -
    +
    +

    Translate

    + +
    - +
    +

    Maps

    + +
    - - - - +
    +

    Wikipedia

    + +
    + +
    +

    Medium

    + +
    + + + + + + + + + \ No newline at end of file diff --git a/src/pages/popup/popup.js b/src/pages/popup/popup.js index d2b33b6a..01497cad 100644 --- a/src/pages/popup/popup.js +++ b/src/pages/popup/popup.js @@ -9,7 +9,6 @@ let disableSearchEngine = document.querySelector("#disable-searchEngine"); let disableSimplyTranslate = document.querySelector("#disable-simplyTranslate"); let disableWikipedia = document.querySelector("#disable-wikipedia"); let disableScribe = document.querySelector("#disable-scribe"); -let version = document.querySelector("#version"); window.browser = window.browser || window.chrome; @@ -40,8 +39,6 @@ browser.storage.sync.get( } ); -version.textContent = browser.runtime.getManifest().version; - disableNitter.addEventListener("change", (event) => { browser.storage.sync.set({ disableNitter: !event.target.checked }); }); @@ -79,14 +76,13 @@ disableScribe.addEventListener("change", (event) => { }); const apiEndpoint = 'https://raw.githubusercontent.com/libredirect/instances/main/data.json'; - document.querySelector("#update-instances").addEventListener("click", () => { let request = new XMLHttpRequest(); request.open('GET', apiEndpoint, false); request.send(null); if (request.status === 200) { - document.querySelector("#update-instances").innerHTML = 'gav'; + document.querySelector("#update-instances").innerHTML = 'gav'; const instances = JSON.parse(request.responseText); const nitterRandomPool = instances.twitter.join(','); const invidiousRandomPool = instances.youtube.join(','); diff --git a/src/pages/stylesheets/styles.css b/src/pages/stylesheets/styles.css new file mode 100644 index 00000000..363bdf3c --- /dev/null +++ b/src/pages/stylesheets/styles.css @@ -0,0 +1,615 @@ +body { + --text: #fff; + --bg-main: #121212; + --bg-secondary: #202020; + --active: #fbc117; + --space: 5px; + --danger: #f04141; + --danger-light: #f9d0d5; + --dark-grey: #767676; + --light-grey: #c3c3c3; +} + +body.light-theme { + --text: #000; + --bg-main: #e3e7ea; + --bg-secondary: #fff; +} + +body { + width: 400px; + margin: auto; + padding: 0; + min-height: 572px; + font-family: Sans-Serif; + background-color: var(--bg-secondary); + color: var(--text); +} + +input { + appearance: none; + -moz-appearance: none; + -webkit-appearance: none; +} + +h1 { + font-size: 14px; + margin: 7px auto; +} + +i { + font-size: 12px; +} + +h2 { + clear: both; + font-size: 12px; + font-weight: normal; + margin: 0; +} + +h3 { + font-size: 16px; +} + +h1, +h2 { + color: var(--text); +} + +footer { + width: 100%; +} + + +input[type="url"], +input[type="text"], +select { + width: 100%; + margin: auto; + border-radius: 3px; + box-sizing: border-box; + margin-bottom: var(--space); + background-color: var(--bg-main); + border-style: solid; + border-color: #767676; + color: var(--text); +} + +select{ + margin: 0; + width: auto; + border-radius: 3px; +} + +input[type="url"] { + padding: 5px; +} + +input[type="radio"] { + appearance: radio; + -moz-appearance: radio; + -webkit-appearance: radio; +} + +input[type="radio"]:checked+label { + background: transparent; +} + +.checkbox-label { + margin-left: 5px; + background: grey; + border-radius: 25px; + color: var(--text); + cursor: pointer; + display: block; + float: right; + font-weight: bold; + height: 30px; + position: relative; + text-indent: -400px; + width: 50px; +} + +.checkbox-label:after { + background: white; + border-radius: 90px; + content: ""; + height: 20px; + left: var(--space); + position: absolute; + top: var(--space); + transition: 0.3s; + width: 20px; +} + +input:checked+label { + background: var(--active); +} + +input:checked+label:after { + left: calc(100% - var(--space)); + transform: translateX(-100%); +} + +.settings-block { + display: block; + padding: 5px 15px; +} + +.settings-block h1 { + float: left; +} + +.button { + border: var(--active) solid 1px; + color: var(--text); + stroke: var(--text); + display: block; + font-size: 12px; + font-weight: bold; + margin: var(--space) auto; + padding: 10px; + text-align: center; + text-decoration: none; + cursor: pointer; + -webkit-transition-duration: 0.4s; + transition-duration: 0.4s; +} + +.button * { + vertical-align: middle; +} + +.button:hover { + background-color: var(--active); + color: var(--text); + stroke: var(--text); +} + +.button:active { + background-color: var(--active); + box-shadow: 0 var(--space) var(--bg-main); + transform: translateY(4px); +} + +input:invalid { + color: var(--danger); + border-color: var(--danger); + background-color: var(--danger-light); +} + +.margin-bottom { + margin-bottom: 20px; +} + +.tab { + overflow: hidden; + background-color: var(--bg-secondary); + position: fixed; + top: 0; + width: 400px; + z-index: 2; +} + +.tab button { + color: var(--text); + background-color: inherit; + float: left; + border: none; + outline: none; + cursor: pointer; + padding: 14px 16px; + transition: 0.3s; + border: solid 1px var(--bg-main); + width: 33.333%; + font-size: 14px; +} + +.tab button.left { + border-top-left-radius: 7px; +} + +.tab button.right { + border-top-right-radius: 7px; +} + +.tab button:hover { + background-color: var(--active); +} + +.tab button.active { + background-color: var(--bg-main); +} + +.tabcontent { + padding-top: 50px; + display: none; + background-color: var(--bg-main); + min-height: 510px; +} + +div.exceptions { + clear: left; +} + +div.exceptions>input { + width: 240px; + float: left; +} + +#add-to-exceptions { + float: right; + border: var(--active) solid 1px; + background-color: var(--active); + color: var(--text); + font-weight: bold; + cursor: pointer; + border-radius: 50%; + padding: 1px 1px 0px 1px; + margin-right: 5px; +} + +#add-to-exceptions svg { + height: 20px; + width: 20px; +} + +ul { + padding: 0; + list-style-type: none; + color: var(--text); + margin: 20px 20px 0 20px; +} + +li { + border-bottom: solid 0.5px var(--bg-secondary); + padding: 20px 0px 20px 20px; +} + +#exceptions-items button { + float: right; + margin-right: -5px; + border: var(--active) solid 1px; + background-color: var(--active); + color: var(--text); + font-weight: bold; + cursor: pointer; + border-radius: 50%; + padding: 2px 2px 0px 2px; +} + +.button svg { + height: 18px; + width: 18px; +} + +.autocomplete { + position: relative; + display: inline-block; + width: 100%; +} + +.autocomplete input { + background: url(../../assets/images/chevron-down.svg) right no-repeat; +} + +.autocomplete-items { + position: absolute; + border: 1px solid var(--bg-main); + border-bottom: none; + border-top: none; + z-index: 99; + top: 85%; + left: 0; + right: 0; + overflow-y: auto; + max-height: 175px; + color: var(--text); + overflow-x: hidden; + max-width: 380px; +} + +.autocomplete-items div { + padding: 10px; + cursor: pointer; + background-color: var(--bg-secondary); + border-bottom: 1px solid var(--bg-main); +} + +.autocomplete-items div:hover { + background-color: var(--active); +} + +.autocomplete-active { + background-color: var(--active); + color: var(--text); +} + +.option { + width: 100%; +} + +.option td { + vertical-align: middle; +} + +input[type="range"] { + -webkit-appearance: none; + margin: 18px 0; + width: 100%; +} + +input[type="range"]:focus { + outline: none; +} + +input[type="range"]::-webkit-slider-runnable-track { + width: 100%; + height: 8.4px; + cursor: pointer; + border-color: var(--dark-grey), var(--light-grey); + background: var(--bg-main); + border-radius: 1.3px; + border: 0.2px inset var(--dark-grey); +} + +input[type="range"]::-webkit-slider-thumb { + border-color: var(--active); + border: 1px solid var(--dark-grey); + height: 36px; + width: 16px; + border-radius: 3px; + background: var(--active); + cursor: pointer; + -webkit-appearance: none; + margin-top: -14px; +} + +input[type="range"]:focus::-webkit-slider-runnable-track { + background: var(--bg-main); +} + +input[type="range"]::-moz-range-track { + width: 100%; + height: 8.4px; + cursor: pointer; + border-color: var(--dark-grey), var(--light-grey); + background: var(--bg-main); + border-radius: 1.3px; + border: 0.2px inset var(--dark-grey); +} + +input[type="range"]::-moz-range-thumb { + border-color: var(--active); + border: 1px solid var(--dark-grey); + height: 36px; + width: 16px; + border-radius: 3px; + background: var(--active); + cursor: pointer; +} + +::placeholder { + color: var(--text); + opacity: 0.7; +} + +input[type="url"]:focus { + outline: none; +} + +@media (prefers-color-scheme: light) { + body { + --text: #000; + --text-secondary: #fff; + --bg-main: #e3e7ea; + --bg-secondary: #fff; + } + + body.dark-theme { + --text: #fff; + --text-secondary: #000; + --bg-main: #3c4043; + --bg-secondary: #292a2d; + } + + .popup { + background-color: var(--bg-secondary); + } +} + +#volume-value { + float: right; +} + +.collapsible { + background-color: var(--bg-main); + cursor: pointer; + color: var(--active); + padding: 18px; + width: 100%; + border: none; + text-align: left; + outline: none; + font-size: 15px; + border-bottom: solid var(--active); + font-weight: bold; +} + +.collapsible:after { + content: "\25BE"; + color: var(--active); + font-weight: bold; + float: right; + margin-left: 5px; +} + +.collapsible-active, +.collapsible:hover, +.collapsible:hover::after { + background-color: var(--active); + color: var(--text-secondary); +} + +.collapsible-active:after { + content: "\25B4"; + color: var(--text-secondary); + font-weight: bold; + float: right; + margin-left: 5px; +} + +.collapsible-content { + padding: 0 18px; + display: none; + overflow: hidden; +} + +hr { + height: 2px; + background-color: var(--active); + border: none; +} + +.new-badge { + position: relative; +} + +.new-badge[data-new-badge]:after { + content: "New!"; + position: absolute; + top: -10px; + right: -42px; + font-size: 0.9em; + background: var(--active); + color: white; + width: 35px; + height: 18px; + text-align: center; + line-height: 18px; + border-radius: 25px; + padding: 2px; + box-shadow: 0 0 1px var(--bg-secondary); + font-weight: bold; +} + + + + +.light-theme.popup, +.light-theme .popup { + background-color: var(--bg-secondary); +} + +body.light-theme { + --text: #000; + --bg-main: #e3e7ea; + --bg-secondary: #fff; +} + +body.popup { + width: 200px; + min-height: auto; + background-color: var(--bg-main); +} + +div.some-block { + padding: 0 15px; + justify-content: space-between; + display: flex; + align-items: center; + margin-top: 10px; + margin-bottom: 10px; + +} + +div.some-block h4 { + margin: 0; + width: 70%; +} + +textarea { + resize: vertical; + width: 100%; + height: 200px; +} + +div.some-block input[type="checkbox"] { + width: 48px; + height: 25px; + background-color: var(--light-grey); + border-radius: 50px; + transition: .4s; + cursor: pointer; +} + +div.some-block input[type="checkbox"]:checked { + background-color: var(--active); + +} + +div.some-block input[type="checkbox"]:focus { + outline: none; +} + +div.some-block input[type="checkbox"]::before { + content: ""; + display: inline-block; + width: 20px; + height: 20px; + box-sizing: border-box; + position: relative; + top: 2.5px; + left: 4px; + height: 20px; + background-color: white; + border-radius: 50%; + transition: .4s; +} + +div.some-block input[type="checkbox"]:checked::before { + left: 24px; +} + +div.buttons { + margin-bottom: 15px; +} + +a.button { + border-radius: 5px; + border: var(--active) solid 1px; + color: var(--text); + stroke: var(--text); + display: block; + font-size: 12px; + font-weight: bold; + margin: 7.5px 15px; + padding: 10px; + text-align: center; + text-decoration: none; + cursor: pointer; + transition-duration: 0.1s; +} + +a.button * { + vertical-align: middle; +} + +a.button:hover { + background-color: var(--active); + color: var(--text); + stroke: var(--text); +} + +a.button:active { + background-color: var(--active); + box-shadow: 0 var(--space) var(--bg-main); + transform: translateY(1px); +} + + +a.button svg { + height: 18px; + width: 18px; +} \ No newline at end of file -- cgit 1.4.1