Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MWPW-157116] - Add feature for pause animation on hover for PEP #3485

Merged
merged 3 commits into from
Jan 27, 2025

Conversation

Deva309
Copy link
Contributor

@Deva309 Deva309 commented Jan 15, 2025

Implemented the 'Pause On Hover' feature for Feds PEP content, allowing it to adopt the same functionality available for Express PEP.

Authoring changes via section metadata in the PEP content to support the ability to author this feature:
Screenshot 2024-09-03 at 6 02 52 PM

Due deligence wiki: https://wiki.corp.adobe.com/display/WEBT/%5BDue+Diligence%5D+PEP+-+Federalizing+Express

Resolves: MWPW-157116

Test URLs:

QA:

Copy link
Contributor

aem-code-sync bot commented Jan 15, 2025

Page Scores Audits Google
📱 /?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ /?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

Copy link

codecov bot commented Jan 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.07%. Comparing base (95d3ce2) to head (66461d1).
Report is 6 commits behind head on stage.

Additional details and impacted files
@@            Coverage Diff             @@
##            stage    #3485      +/-   ##
==========================================
- Coverage   96.46%   96.07%   -0.40%     
==========================================
  Files         255      179      -76     
  Lines       59430    50247    -9183     
==========================================
- Hits        57329    48273    -9056     
+ Misses       2101     1974     -127     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Deva309 Deva309 added the needs-verification PR requires E2E testing by a reviewer label Jan 15, 2025
Comment on lines 289 to 299
const startTimeout = () => {
startTime = Date.now();
timeoutId = setTimeout(() => {
this.close({ saveDismissal: false, dismissalActions: false });
AppPrompt.redirectTo(this.options['redirect-url']);
}, remainingTime);
};

const stopTimeout = () => {
clearTimeout(timeoutId);
remainingTime -= Date.now() - startTime;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use performance.now instead. Date depends on the user's system clock which may or may not be accurate.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.
Using performance.now instead of Date.now.

@@ -184,6 +184,10 @@
transform-origin: top right;
}

.appPrompt:hover .appPrompt-progress {
animation-play-state: paused;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may be mistaken but, since this class is always on the prompt, the animation will pause even if pause on hover is turned off, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated the implementation for this. Now, the class appPrompt-progressPauseOnHover is added when pause-on-hover is enabled. CSS has been applied specifically to this class, ensuring that the styles are applied only when pause-on-hover is enabled.

@@ -257,7 +260,7 @@ export class AppPrompt {
${this.elements.cta}
</div>
<div class="appPrompt-progressWrapper">
<div class="appPrompt-progress" style="background-color: ${this.options['loader-color']}; animation-duration: ${this.options['loader-duration']}ms;"></div>
<div class="appPrompt-progress" style="background-color: ${this.options['loader-color']}; animation-duration: ${this.options['loader-duration']}ms; ${!animationPlayState && 'animation-play-state: running;'}"></div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it have animation-play-state: running by default? In that case shouldn't this be in the css stylesheet rather than inline here; since you also have the animation-play-state: paused rule there as well it makes sense for them to be colocated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same is handled with adding class and removed animation-play-state: running.

@spadmasa spadmasa self-assigned this Jan 15, 2025
@Deva309 Deva309 requested a review from sharmrj January 15, 2025 14:48
Copy link
Contributor

This PR has not been updated recently and will be closed in 7 days if no action is taken. Please ensure all checks are passing, https://github.com/orgs/adobecom/discussions/997 provides instructions. If the PR is ready to be merged, please mark it with the "Ready for Stage" label.

@github-actions github-actions bot added the Stale label Jan 24, 2025
@spadmasa
Copy link

@spadmasa spadmasa added verified PR has been E2E tested by a reviewer Ready for Stage and removed needs-verification PR requires E2E testing by a reviewer Stale labels Jan 27, 2025
@milo-pr-merge milo-pr-merge bot merged commit 5520229 into adobecom:stage Jan 27, 2025
24 checks passed
@milo-pr-merge milo-pr-merge bot mentioned this pull request Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready for Stage verified PR has been E2E tested by a reviewer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants