From 654dabec151d58da53e7a17b454d2ba1d25a5fba Mon Sep 17 00:00:00 2001 From: dnorhoj Date: Fri, 19 Nov 2021 00:13:20 +0100 Subject: [PATCH 1/3] First draft --- AntiRickRoll/popup/assets/img/icon48.png | Bin 0 -> 4288 bytes AntiRickRoll/popup/popup.css | 34 ---------- AntiRickRoll/popup/popup.html | 49 +++++++++----- AntiRickRoll/popup/popup.js | 25 +------ AntiRickRoll/popup/style.css | 79 +++++++++++++++++++++++ AntiRickRoll/popup/testpopup.html | 38 +++++++++++ 6 files changed, 151 insertions(+), 74 deletions(-) create mode 100644 AntiRickRoll/popup/assets/img/icon48.png delete mode 100644 AntiRickRoll/popup/popup.css create mode 100644 AntiRickRoll/popup/style.css create mode 100644 AntiRickRoll/popup/testpopup.html diff --git a/AntiRickRoll/popup/assets/img/icon48.png b/AntiRickRoll/popup/assets/img/icon48.png new file mode 100644 index 0000000000000000000000000000000000000000..ef8c0a01db62f070aebf2e37a47fa0c8b3003c0d GIT binary patch literal 4288 zcmV;x5I^sUP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D5LHP;K~!i%y;*6H z9OZd_`tIqOo_lxp(6PEew}c9Z6cwD5oeP(9{ml;pwkpn5#=$OEev&FzNJ=h~;5hb= zq$mD?%dPUXP&Qjr1I|0iro93yz%hE|0fc+MIgXO!0UWz zTj$mq@QX|3dcDzfz!zoS6Su{a_&M)|{3p(Q5M8 zG(&;Rt@?WUpg_gw)GTHzHH38ijTc{vv*O5?UXaT{7J_KyvDZ`}pO*!J>BcZl=xF}{V?A*Qu zz1cjL<`(f^|M?=0lEA=VU%c+N`|n3{dK&ZR&c)ZdQ%^NBeV_YuyZ)_LKy9p&H3S5B z8vUdiMg5&yYrtQhT*8yzzW`m;kc5k%JOMMP!J?9EHAEqy!ysroArUmNwI_p8+CVZX zVRmK;VXK99rHt+UHY^f<_FtaIzK>b*MzMM@r3b3uOKu2}aY&B7?R1x?A zigud7fxbc(+xmN;sS3XH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+ +
+
+ +
+
- + + \ No newline at end of file diff --git a/AntiRickRoll/popup/popup.js b/AntiRickRoll/popup/popup.js index 348c6e7..0ffdd02 100644 --- a/AntiRickRoll/popup/popup.js +++ b/AntiRickRoll/popup/popup.js @@ -1,24 +1 @@ -(() => { - // Get elements - let toggler = document.querySelector('#toggler'); - let total = document.querySelector('#total'); - - // Set toggler's initial value - chrome.storage.local.get('disabled', res => { - toggler.innerHTML = !res.disabled ? "Disable" : "Enable"; - }); - - // Give toggler functionality - toggler.addEventListener('click', () => { - chrome.storage.local.get('disabled', res => { - chrome.storage.local.set({"disabled": !res.disabled}, () => { - toggler.innerHTML = !!res.disabled ? "Disable" : "Enable"; - }); - }); - }); - - // Display rickrolls blocked - chrome.storage.local.get('total', res => { - total.innerHTML = res['total'] || 0; - }); -})(); \ No newline at end of file +// TODO \ No newline at end of file diff --git a/AntiRickRoll/popup/style.css b/AntiRickRoll/popup/style.css new file mode 100644 index 0000000..ce583af --- /dev/null +++ b/AntiRickRoll/popup/style.css @@ -0,0 +1,79 @@ +@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.1/font/bootstrap-icons.css"); +html, body { + width: 375px !important; + height: 600px !important; + overflow: hidden; + color: #000; + background-color: #f0f0f0; + margin: 0px; +} + +* { + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; +} + +.header { + border-bottom: #000 solid 1px; + background-color: #fff; + display: flex; + padding: 10px; +} + +.header > img { + width: 36px; + height: 36px; + user-select: none; +} + +.close { + font-size: 36px; + padding: 0px; +} + +.nav { + background-color: #fff; + box-sizing: border-box; + padding: 0; + margin: 0; + width: 100%; + height: 55px; + border-top: 1px solid #000; + bottom: 0; + left: 0; + right: 0; + border-top: rgb(0, 0, 0) solid 1px; + position: fixed; +} + +.nav ul { + list-style: none; + padding: 0; + margin: 0; + display: flex; + align-items: center; + align-self: center; +} + +.nav li { + display: flex; + flex-grow: 1; + align-self: center; + align-items: center; +} + +.nav a { + display: block; + text-align: center; + font-size: 20px; + color: rgb(0, 0, 0); + min-width: 100%; + height: 55px; +} + +.nav a:hover { + background-color: #efefef; +} + +.nav .selected { + background-color: #efefef; +} \ No newline at end of file diff --git a/AntiRickRoll/popup/testpopup.html b/AntiRickRoll/popup/testpopup.html new file mode 100644 index 0000000..08a3cca --- /dev/null +++ b/AntiRickRoll/popup/testpopup.html @@ -0,0 +1,38 @@ + + + + + + + + Document + + + + +
+ +
+ + + \ No newline at end of file From 15491ef652a1b59d80fb9656d25424cecb132969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Norh=C3=B8j?= Date: Mon, 29 Nov 2021 21:13:02 +0100 Subject: [PATCH 2/3] changes --- AntiRickRoll/popup/popup.html | 35 ++++++++++++++------------- AntiRickRoll/popup/style.css | 40 +++++++------------------------ AntiRickRoll/popup/testpopup.html | 4 ++-- 3 files changed, 28 insertions(+), 51 deletions(-) diff --git a/AntiRickRoll/popup/popup.html b/AntiRickRoll/popup/popup.html index d67f9e8..a9d52de 100644 --- a/AntiRickRoll/popup/popup.html +++ b/AntiRickRoll/popup/popup.html @@ -14,25 +14,26 @@
-
- +
+
+
+ Toggles +
+
+
+ Enabled + +
+
+
+ + + + + + \ No newline at end of file diff --git a/AntiRickRoll/popup/style.css b/AntiRickRoll/popup/style.css index ce583af..fd06227 100644 --- a/AntiRickRoll/popup/style.css +++ b/AntiRickRoll/popup/style.css @@ -19,55 +19,31 @@ html, body { padding: 10px; } -.header > img { +.header img { width: 36px; height: 36px; user-select: none; } -.close { - font-size: 36px; - padding: 0px; -} - .nav { background-color: #fff; - box-sizing: border-box; - padding: 0; - margin: 0; width: 100%; - height: 55px; border-top: 1px solid #000; bottom: 0; left: 0; - right: 0; border-top: rgb(0, 0, 0) solid 1px; position: fixed; -} - -.nav ul { - list-style: none; - padding: 0; - margin: 0; display: flex; - align-items: center; - align-self: center; -} - -.nav li { - display: flex; - flex-grow: 1; - align-self: center; - align-items: center; + justify-content: space-around; } .nav a { - display: block; - text-align: center; - font-size: 20px; + font-size: 26px; color: rgb(0, 0, 0); - min-width: 100%; - height: 55px; + width: 100%; + text-align: center; + padding: 12px; + transition: all 0.1s ease; } .nav a:hover { @@ -75,5 +51,5 @@ html, body { } .nav .selected { - background-color: #efefef; + background-color: #dfdfdf; } \ No newline at end of file diff --git a/AntiRickRoll/popup/testpopup.html b/AntiRickRoll/popup/testpopup.html index 08a3cca..fe3b95a 100644 --- a/AntiRickRoll/popup/testpopup.html +++ b/AntiRickRoll/popup/testpopup.html @@ -31,8 +31,8 @@
- +
- \ No newline at end of file + From 2814193ed52c3651c9c3bd9ce8a6a8bbc7b854fa Mon Sep 17 00:00:00 2001 From: dnorhoj Date: Mon, 29 Nov 2021 22:17:20 +0100 Subject: [PATCH 3/3] First beta of popup --- AntiRickRoll/popup/popup.html | 18 ++++--- AntiRickRoll/popup/popup.js | 18 ++++++- AntiRickRoll/popup/style.css | 89 +++++++++++++++++++++++++++++-- AntiRickRoll/popup/testpopup.html | 2 +- 4 files changed, 113 insertions(+), 14 deletions(-) diff --git a/AntiRickRoll/popup/popup.html b/AntiRickRoll/popup/popup.html index a9d52de..d607a80 100644 --- a/AntiRickRoll/popup/popup.html +++ b/AntiRickRoll/popup/popup.html @@ -13,27 +13,31 @@
+ (BETA)
- Toggles + TOGGLES
-
+
Enabled - +
+ \ No newline at end of file diff --git a/AntiRickRoll/popup/popup.js b/AntiRickRoll/popup/popup.js index 0ffdd02..91a4f36 100644 --- a/AntiRickRoll/popup/popup.js +++ b/AntiRickRoll/popup/popup.js @@ -1 +1,17 @@ -// TODO \ No newline at end of file +(() => { + // Get elements + let toggler = document.querySelector('#enableToggle'); + console.log(toggler); + console.log("toggler"); + toggler.checked = true; + + // Set toggler's initial value + chrome.storage.local.get('disabled', res => { + toggler.checked = !res.disabled; + }); + + // Give toggler functionality + toggler.addEventListener('click', () => { + chrome.storage.local.set({"disabled": !toggler.checked}); + }); +})(); diff --git a/AntiRickRoll/popup/style.css b/AntiRickRoll/popup/style.css index fd06227..cff847d 100644 --- a/AntiRickRoll/popup/style.css +++ b/AntiRickRoll/popup/style.css @@ -16,6 +16,8 @@ html, body { border-bottom: #000 solid 1px; background-color: #fff; display: flex; + flex-direction: row; + justify-content: space-between; padding: 10px; } @@ -25,6 +27,12 @@ html, body { user-select: none; } +.header span { + font-weight: bold; + font-size: 15px; + user-select: none; +} + .nav { background-color: #fff; width: 100%; @@ -38,12 +46,21 @@ html, body { } .nav a { - font-size: 26px; - color: rgb(0, 0, 0); + font-size: 20px; + color: #000; width: 100%; text-align: center; - padding: 12px; - transition: all 0.1s ease; + padding: 10px; + transition: hover 0.1s ease; + display: flex; + text-decoration: none; + flex-direction: column; + cursor: default; +} + +.nav a span { + font-size: 14px; + display: block; } .nav a:hover { @@ -52,4 +69,66 @@ html, body { .nav .selected { background-color: #dfdfdf; -} \ No newline at end of file +} + +.block-header { + padding: 0.5rem 0.5rem 0.2rem 0.5rem; + background-color: #f0f0f0; + font-size: 15px; + font-weight: 500; +} + +.block-content { + font-size: 15px; + padding: 0.5rem; + background-color: #ffffff; + border-top: 10px black; +} + +.block-content:hover { + background-color: #dfdfdf; +} + +.setting { + display: flex; + flex-direction: row; + justify-content: space-between; +} + +input[type="checkbox"] { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + -webkit-tap-highlight-color: transparent; + cursor: pointer; } + input[type="checkbox"]:focus { + outline: 0; + } + +.toggle { + height: 22px; + width: 37px; + border-radius: 16px; + display: inline-block; + position: relative; + margin: 0; + border: 2px solid #474755; + background: rgb(184, 0, 0); + transition: all .2s ease; } + .toggle:after { + content: ''; + position: absolute; + top: 2px; + left: 2px; + width: 14px; + height: 14px; + border-radius: 100%; + background: white; + box-shadow: 0 1px 2px rgba(44, 44, 44, 0.2); + transition: all 0.2s cubic-bezier(0.5, 0.1, 0.75, 1.35); } + .toggle:checked { + background: rgb(0, 187, 0); + } + .toggle:checked:after { + transform: translatex(16px); } + \ No newline at end of file diff --git a/AntiRickRoll/popup/testpopup.html b/AntiRickRoll/popup/testpopup.html index fe3b95a..08d1c3b 100644 --- a/AntiRickRoll/popup/testpopup.html +++ b/AntiRickRoll/popup/testpopup.html @@ -31,7 +31,7 @@
- +