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

New: Add html classes depending on the loading screen's visibility (fixes #423) #435

Merged
merged 1 commit into from
Sep 12, 2023

Conversation

swashbuck
Copy link
Contributor

@swashbuck swashbuck commented Aug 28, 2023

Fixes #423

Fix

Adds the following HTML classes:

  • is-loading-visible - Loading overlay is visible
  • is-loading-hidden - Loading overlay is hidden

Also

  • Updates isReady() in contentObjectView.js so that it uses router.hideLoading() instead of the current $('.js-loading').hide()

Testing

Add some CSS that animates an element once the loading screen has been removed.

You may want to enable device throttling or add a large image to the page to increase the loading time.

.page__title {
  transition: 0.5s all ease-in-out;
}
html.is-loading-visible .page__title {
  color: deepskyblue;
}
html.is-loading-hidden .page__title {
  color: fuchsia;
  transform: scale(1.05) rotate(-1deg) translate(1rem, -1rem);
}

The animation should not play until the loading screen has been removed.

Related

The following plugins should be updated to use router.hideLoading() instead of the current $('.js-loading').hide(). Without this fix, the new classes will not be available.

…h new classes when the loading screen is visible or hidden
@swashbuck swashbuck added the enhancement New feature or request label Aug 28, 2023
@swashbuck swashbuck self-assigned this Aug 28, 2023
@swashbuck swashbuck marked this pull request as ready for review August 28, 2023 22:08
Copy link
Contributor

Choose a reason for hiding this comment

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

👀

@joe-allen-89 joe-allen-89 merged commit b2c2335 into master Sep 12, 2023
1 check passed
@joe-allen-89 joe-allen-89 deleted the issue/423 branch September 12, 2023 15:12
@oliverfoster
Copy link
Member

🎉 This PR is included in version 6.40.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add html class after all assets are loaded for a page
4 participants