From 42dedfbd908b7994f30901378bbf96dfa1a8c3f4 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sat, 2 May 2020 18:27:53 -0400 Subject: [PATCH] Fine tune power button; fix no-popups switch visual regression --- src/css/popup-fenix.css | 1 + src/css/themes/default.css | 4 ++-- src/img/fontawesome/fontawesome-defs.svg | 4 ++-- src/js/fa-icons.js | 3 ++- src/js/popup-fenix.js | 8 ++++++++ src/popup-fenix.html | 14 +++++++++++++- 6 files changed, 28 insertions(+), 6 deletions(-) diff --git a/src/css/popup-fenix.css b/src/css/popup-fenix.css index 53ab2fcf5..70e1b7586 100644 --- a/src/css/popup-fenix.css +++ b/src/css/popup-fenix.css @@ -75,6 +75,7 @@ hr { margin: 0 var(--popup-gap-thin); padding: 0; stroke: none; + stroke-width: 64; } body.off #switch { fill: var(--default-surface); diff --git a/src/css/themes/default.css b/src/css/themes/default.css index 31921a315..c9524b22a 100644 --- a/src/css/themes/default.css +++ b/src/css/themes/default.css @@ -29,7 +29,7 @@ --light-gray-60: #afafba; --light-gray-70: #9f9fad; --light-gray-90: #80808f; - --red-70-a80: #c50042cc; + --red-60: #e22850; --violet-70: #592acb; --violet-80: #45278d; --yellow-30: #ffd567; @@ -143,7 +143,7 @@ --bg-popup-cell-block: hsla(0, 50%, 80%, 1); --bg-popup-cell-block-own: hsla(0, 100%, 40%, 1); --bg-popup-cell-label-mixed: hsla(45, 100%, 38%, 1); - --popup-icon-x-ink: var(--red-70-a80); + --popup-icon-x-ink: var(--red-60); } /** diff --git a/src/img/fontawesome/fontawesome-defs.svg b/src/img/fontawesome/fontawesome-defs.svg index 7e347c439..9ceadfa00 100644 --- a/src/img/fontawesome/fontawesome-defs.svg +++ b/src/img/fontawesome/fontawesome-defs.svg @@ -24,7 +24,7 @@ License - https://github.com/FortAwesome/Font-Awesome/tree/a8386aae19e200ddb0f68 --> - + @@ -57,7 +57,7 @@ License - https://github.com/FortAwesome/Font-Awesome/tree/a8386aae19e200ddb0f68 - + diff --git a/src/js/fa-icons.js b/src/js/fa-icons.js index 0d930b98b..18988a97a 100644 --- a/src/js/fa-icons.js +++ b/src/js/fa-icons.js @@ -29,9 +29,10 @@ const faIconsInit = function(root) { if ( icon.firstChild === null || icon.firstChild.nodeType !== 3 ) { continue; } + const name = icon.firstChild.nodeValue.trim(); + if ( name === '' ) { continue; } const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); const use = document.createElementNS('http://www.w3.org/2000/svg', 'use'); - const name = icon.firstChild.nodeValue; let file; if ( name.startsWith('ph-') ) { file = 'photon'; diff --git a/src/js/popup-fenix.js b/src/js/popup-fenix.js index cd1af9066..d4b1f27c4 100644 --- a/src/js/popup-fenix.js +++ b/src/js/popup-fenix.js @@ -397,6 +397,9 @@ const renderPrivacyExposure = function() { /******************************************************************************/ const updateHnSwitches = function() { + uDom.nodeFromId('no-popups').classList.toggle( + 'on', popupData.noPopups === true + ); uDom.nodeFromId('no-large-media').classList.toggle( 'on', popupData.noLargeMedia === true ); @@ -475,6 +478,11 @@ const renderPopup = function() { // Extra tools updateHnSwitches(); + // Report popup count on badge + total = popupData.popupBlockedCount; + uDom.nodeFromSelector('#no-popups .fa-icon-badge') + .textContent = total ? Math.min(total, 99).toLocaleString() : ''; + // Report large media count on badge total = popupData.largeMediaCount; uDom.nodeFromSelector('#no-large-media .fa-icon-badge') diff --git a/src/popup-fenix.html b/src/popup-fenix.html index 845d33339..9110cfd0e 100644 --- a/src/popup-fenix.html +++ b/src/popup-fenix.html @@ -20,7 +20,19 @@ eraser
- power-off + + + + + + +
refresh