Set envs to animate on loading only (except PROD) (#18)

Simply update the code with what i've been using lately so it only animate when the `.Loader` is created by react. Except for PROD where animation runs anytime.

Use both the new `:has()` pseudo-class and fallback to regular `:not(:only-child())` for unsupported browser (Firefox)
This commit is contained in:
Simon Priet 2023-05-25 23:15:05 +02:00 committed by GitHub
parent 18ff7c284e
commit d258f86c9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 91 additions and 30 deletions

View File

@ -1,21 +1,43 @@
@-moz-document domain("ltg-stream.alkemics.com"), @-moz-document domain("ltg-app.supplierxm.salsify.com"),
domain("ltg-admin.alkemics.com") { domain("ltg-admin.supplierxm.salsify.com") {
:root { :root {
--stripe-size: 100px; --stripe-size: 100px;
--color1: hsl(261, 65%, 51%); --color1: hsl(180, 63%, 30%);
--color2: hsl(261, 80%, 59%); --color2: hsl(180, 63%, 37%);
--duration: 30s; --duration: 1s;
--state: running;
} }
.AuthLayoutFooter, .AuthLayoutFooter,
.Navbar.navbar.bg-inverse { .Navbar.navbar.Navbar--PPR.bg-inverse {
background: repeating-linear-gradient(-45deg, var(--color2) 25%, var(--color1) 75%); background: repeating-linear-gradient(-45deg, hsla(261, 80%, 59%, 0) 25%, var(--color1) 50%, var(--color1) 75%);
background-color: var(--color2);
background-size: var(--stripe-size) var(--stripe-size); background-size: var(--stripe-size) var(--stripe-size);
animation: alkegrad var(--duration) linear infinite; animation: alkegrad var(--duration) linear 0s infinite normal var(--state);
transition: background 200ms linear;
} }
.AuthLayoutFooter {
--stripe-size: 200px;
--duration: 40s;
}
.PageTop>.navbar:where( :has(+ .Loader),
:not(:only-child)) {
--state: running;
}
.PageTop>.Loader {
visibility: hidden;
animation: none;
}
@keyframes alkegrad { @keyframes alkegrad {
from { from {
background-position: 0 0; background-position: 0 0;
} }
to { to {
background-position: var(--stripe-size) 0; background-position: var(--stripe-size) 0;
} }

View File

@ -1,20 +1,41 @@
@-moz-document domain("pillar.alkemics.com") { @-moz-document domain("pillar.alkemics.com"),
:root { domain("localstream.alkemics.com") {
:root {
--stripe-size: 100px; --stripe-size: 100px;
--color1: hsl(205, 70%, 45%); --color1: hsl(205, 84%, 41%);
--color2: hsl(205, 70%, 50%); --color2: hsl(205, 70%, 50%);
--duration: 30s; --duration: 1s;
--state: paused;
} }
.AuthLayoutFooter, .AuthLayoutFooter,
.Navbar.navbar.bg-inverse { .Navbar.navbar.Navbar--PPR.bg-inverse {
background: repeating-linear-gradient(-45deg, var(--color2) 25%, var(--color1) 75%); background: repeating-linear-gradient(-45deg, var(--color2) 25%, var(--color2) 50%, var(--color1) 50%, var(--color1) 75%);
background-color: var(--color1);
background-size: var(--stripe-size) var(--stripe-size); background-size: var(--stripe-size) var(--stripe-size);
animation: alkegrad var(--duration) linear infinite; animation: alkegrad var(--duration) linear 0s infinite normal var(--state);
} }
.AuthLayoutFooter {
--stripe-size: 200px;
--duration: 40s;
}
.PageTop>.navbar:where( :has(+ .Loader),
:not(:only-child)) {
--state: running;
}
.PageTop>.Loader {
visibility: hidden;
animation: none;
}
@keyframes alkegrad { @keyframes alkegrad {
from { from {
background-position: 0 0; background-position: 0 0;
} }
to { to {
background-position: var(--stripe-size) 0; background-position: var(--stripe-size) 0;
} }

View File

@ -1,17 +1,20 @@
@-moz-document domain("ppr-app.supplierxm.salsify.com"), @-moz-document domain("ppr-app.supplierxm.salsify.com"),
domain("ppr-admin.alkemics.com") { domain("ppr-admin.supplierxm.salsify.com/") {
:root { :root {
--stripe-size: 100px; --stripe-size: 100px;
--color1: hsl(194, 71%, 30%); --color1: hsla(194, 71%, 30%, 1);
--color2: hsl(194, 77%, 35%); --color2: hsla(194, 77%, 35%, 1);
--duration: 20s; --duration: 1s;
--state: paused;
} }
.AuthLayoutFooter, .AuthLayoutFooter,
.Navbar.navbar.Navbar--PPR.bg-inverse { .Navbar.navbar.Navbar--PPR.bg-inverse {
background: repeating-linear-gradient(-45deg, var(--color2) 25%, var(--color1) 50%, var(--color1) 75%); background: repeating-linear-gradient(-45deg, var(--color2) 25%, var(--color2) 50%, var(--color1) 50%, var(--color1) 75%);
background-color: var(--color1);
background-size: var(--stripe-size) var(--stripe-size); background-size: var(--stripe-size) var(--stripe-size);
animation: alkegrad var(--duration) linear infinite; animation: alkegrad var(--duration) linear 0s infinite normal var(--state);
will-change: background-position;
} }
.AuthLayoutFooter { .AuthLayoutFooter {
@ -19,6 +22,16 @@ domain("ppr-admin.alkemics.com") {
--duration: 40s; --duration: 40s;
} }
.PageTop>.navbar:where( :has(+ .Loader),
:not(:only-child)) {
--state: running;
}
.PageTop>.Loader {
visibility: hidden;
animation: none;
}
@keyframes alkegrad { @keyframes alkegrad {
from { from {
background-position: 0 0; background-position: 0 0;

View File

@ -1,18 +1,22 @@
@-moz-document domain("app.supplierxm.salsify.com"), @-moz-document domain("app.supplierxm.salsify.com"),
domain("admin.supplierxm.salsify.com") { domain("admin.supplierxm.salsify.com") {
.AuthLayoutFooter, .AuthLayoutFooter,
.Navbar.navbar.bg-inverse { .Navbar.navbar.bg-inverse {
background: linear-gradient(-45deg, rgb(60, 180, 255),rgb(46, 112, 255), rgb(118, 55, 252)); background: linear-gradient(-45deg, rgb(60, 180, 255), rgb(46, 112, 255), rgb(118, 55, 252));
background-size: 200% 100% !important; background-size: 200% 100% !important;
animation: salsigrad 60s linear infinite !important; animation: salsigrad 60s linear infinite !important;
} }
@keyframes salsigrad { @keyframes salsigrad {
0% { 0% {
background-position: 0% 0%; background-position: 0% 0%;
} }
50% { 50% {
background-position: 100% 50%; background-position: 100% 50%;
} }
100% { 100% {
background-position: 0% 0%; background-position: 0% 0%;
} }

View File

@ -19,13 +19,14 @@ Repeate for each styles you want to enables.
## What each styles do? ## What each styles do?
* `PPR banner.css`: Change the Preproduction banner and login's footer * `PREP banner.css`: Change the Preproduction banner and login's footer
![example of PPR banner](public/PPR_banner_ex.png) ![example of PREP banner](public/PREP_banner_animated.mov)
* `PLR banner.css`: Change your Pillar banner and login's footer * `PLLR banner.css`: Change your Pillar banner and login's footer
![example of Pillar banner](public/PLR_banner_ex.png) ![example of PLLR banner](public/PLLR_banner_animated.mov)
* `LTG banner.css`: Change the Load Testing banner and login's footer * `PERF banner.css`: Change the Load Testing banner and login's footer
* `PRD banner.css`: Change the Production banner and login's footer ![example of PERF banner](public/PERF_banner_animated.mov)
![example of Prod banner](public/PRD_banner_ex.png) * `PROD banner.css`: Change the Production banner and login's footer
![example of Prod banner](public/PROD_banner_animated.mov)
* `Whiter banner.css`: Look & feel, mainly changing text to pure white and the hover and active elements. A _must have_. Works with the others files. * `Whiter banner.css`: Look & feel, mainly changing text to pure white and the hover and active elements. A _must have_. Works with the others files.
* `Sigils.css`: Change the top-right user icon to a Shop or Factory depending on if you are logged as ar Retailer or a Supplier. * `Sigils.css`: Change the top-right user icon to a Shop or Factory depending on if you are logged as ar Retailer or a Supplier.
* ![example of orange shop icon](public/user-orange-shop.png) ![example of violet factory icon](public/user-violet-factory.png) * ![example of orange shop icon](public/user-orange-shop.png) ![example of violet factory icon](public/user-violet-factory.png)

BIN
public/PERF_banner.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

BIN
public/PLLR_banner.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

BIN
public/PREP_banner.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

BIN
public/PROD_banner.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.