woocommerce/plugins/woocommerce-blocks/assets/js/blocks/product-collection/style.scss

47 lines
1.0 KiB
SCSS
Raw Normal View History

Product Collection: Add loading indicator for client-side pagination (#44571) * Add animation for client-side pagination This includes: - Addition of animation state management in the frontend file to control the visual transition between pagination states. - Introduction of new SCSS rules for the start and finish animations, ensuring a seamless and visually appealing pagination experience. - Modification of the PHP logic to inject necessary HTML for the animation to be applied. These updates aim to provide a more engaging and responsive interface for users navigating through product collection. * Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce * Allow user clicks under product collection's loading animation This commit enhances the user experience of the loading animation for the product collection block. Changes include: - Specifying `transform-origin: 0% 0%;` directly within the block's initial style to indicate the animation should start from the left - Adding `pointer-events: none;` to allow user interactions with elements underneath the loading animation, thus improving usability by not blocking clicks. Additionally, redundant `transform-origin` properties were removed from the `@keyframes` declaration to clean up the code and avoid unnecessary repetition. This simplification contributes to both the maintainability and readability of the stylesheet. * Fix linting errors in SCSS file --------- Co-authored-by: github-actions <github-actions@github.com>
2024-02-16 10:13:58 +00:00
// This animation will be shown when user change the pages in the product collection block
.wc-block-product-collection__pagination-animation {
position: fixed;
top: 0;
left: 0;
margin: 0;
padding: 0;
width: 100vw;
max-width: 100vw;
height: 4px;
background-color: var(--wp--preset--color--primary, #000);
opacity: 0; // Hide the animation by default.
transform-origin: 0% 0%; // Start the animation from the left.
pointer-events: none; // Allows click events to pass through to elements underneath.
&.start-animation {
animation: wc-block-product-collection__pagination-start-animation 30s cubic-bezier(0.03, 0.5, 0, 1) forwards;
}
&.finish-animation {
animation: wc-block-product-collection__pagination-finish-animation 300ms ease-in;
}
}
@keyframes wc-block-product-collection__pagination-start-animation {
0% {
transform: scaleX(0);
opacity: 1;
}
100% {
transform: scaleX(1);
opacity: 1;
}
}
@keyframes wc-block-product-collection__pagination-finish-animation {
0% {
opacity: 1;
}
50% {
opacity: 1;
}
100% {
opacity: 0;
}
}