From 3c496b5694a398976c639e1feade1930254ca47b Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Sat, 28 Dec 2024 20:22:46 +0100 Subject: [PATCH] Fixed on boarding search engine icons (closes https://github.com/zen-browser/desktop/issues/3575) and improved animation speed/delays as well (https://github.com/zen-browser/desktop/issues/4035) --- .../components/zen-welcome/welcome.css | 58 ++++++++++++++----- .../components/zen-welcome/welcome.html | 16 ++--- src/browser/components/zen-welcome/welcome.js | 17 ++++++ 3 files changed, 70 insertions(+), 21 deletions(-) diff --git a/src/browser/components/zen-welcome/welcome.css b/src/browser/components/zen-welcome/welcome.css index 27c7e5b20..5a3fcae44 100644 --- a/src/browser/components/zen-welcome/welcome.css +++ b/src/browser/components/zen-welcome/welcome.css @@ -50,6 +50,16 @@ body { justify-content: space-between; align-items: center; z-index: 2; + + & button { + opacity: 0; + animation: fadeIn .5s ease-in-out forwards; + animation-delay: .8s; + } + + & button:nth-child(2) { + animation-delay: 1s; + } } body:has(#welcome:not([hidden='true'])) { @@ -236,9 +246,11 @@ input[type='checkbox'] { display: flex; } -.page:not([hidden='true']) > * { +.page:not([hidden='true']) > *:not(:has(.delay-animation)), +.delay-animation, +.delay-animation-2 { opacity: 0; - animation: fadeInRight 0.3s ease-in-out forwards; + animation: fadeIn .5s ease-in-out forwards; } #importBrowser { @@ -281,7 +293,7 @@ input[type='checkbox'] { } } -@keyframes fadeInRight { +@keyframes fadeIn { from { opacity: 0; transform: translate3d(0, 40px, 0); @@ -296,20 +308,34 @@ input[type='checkbox'] { } /* There should be no more than 5 elements in a page */ -.page:not([hidden='true']) > *:nth-child(2), -#layoutList [layout]:nth-child(2) { - animation-delay: 0.1s; -} -.page:not([hidden='true']) > *:nth-child(3), -#layoutList [layout]:nth-child(3) { +.page:not([hidden='true']) > *:nth-child(2):not(:has(.delay-animation)) { animation-delay: 0.2s; } -.page:not([hidden='true']) > *:nth-child(4) { - animation-delay: 0.3s; -} -.page:not([hidden='true']) > *:nth-child(5) { +.page:not([hidden='true']) > *:nth-child(3), +.delay-animation:nth-child(1) { animation-delay: 0.4s; } +.page:not([hidden='true']) > *:nth-child(4), +.delay-animation:nth-child(2) { + animation-delay: 0.6s; +} +.page:not([hidden='true']) > *:nth-child(5), +.delay-animation:nth-child(3), +.delay-animation-2:nth-child(1) { + animation-delay: 0.8s; +} + +.page:not([hidden='true']) > *:nth-child(6), +.delay-animation:nth-child(4), +.delay-animation-2:nth-child(2) { + animation-delay: 1s; +} + +#welcome { + & h1 { + animation-duration: .8s !important; + } +} .card h3 { margin-top: 10px; @@ -412,4 +438,10 @@ input[type='checkbox'] { &.selected { transform: scale(1.01); } + + & img { + width: 30px; + height: 30px; + border-radius: 15px; + } } diff --git a/src/browser/components/zen-welcome/welcome.html b/src/browser/components/zen-welcome/welcome.html index 41523d404..43d014f64 100644 --- a/src/browser/components/zen-welcome/welcome.html +++ b/src/browser/components/zen-welcome/welcome.html @@ -58,12 +58,12 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.

-

-
+

+
-

+

- + @@ -92,7 +92,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. - + @@ -131,15 +131,15 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.

- +

- +

- +

diff --git a/src/browser/components/zen-welcome/welcome.js b/src/browser/components/zen-welcome/welcome.js index 35d6cd798..f7f869626 100644 --- a/src/browser/components/zen-welcome/welcome.js +++ b/src/browser/components/zen-welcome/welcome.js @@ -293,11 +293,20 @@ class Pages { if (this.pages.currentPage === 1) { this.prevEl.setAttribute('disabled', 'true'); } + + for (const button of document.getElementById('buttons-footer').children) { + button.style.display = 'none'; + // Re-animate the buttons + setTimeout(() => { + button.style.removeProperty('display'); + }); + } }); } next() { this.currentPage++; + document.getElementById('main-view').setAttribute('data-page', this.currentPage); if (this.currentPage >= this.pages.length) { // We can use internal js apis to close the window. We also want to set @@ -309,6 +318,14 @@ class Pages { return; } + for (const button of document.getElementById('buttons-footer').children) { + button.style.display = 'none'; + // Re-animate the buttons + setTimeout(() => { + button.style.removeProperty('display'); + }); + } + this._displayCurrentPage(); }