}
}
-.woltlabNewsfeed__loading {
+.woltlabNewsfeed {
+ border: 1px solid var(--wcfContentBorderInner);
+ border-radius: var(--wcfBorderRadius);
+ height: 100vh;
+ max-width: 100%;
text-align: center;
width: 600px;
}
-.woltlabNewsfeed.loaded .woltlabNewsfeed__loading {
+.woltlabNewsfeed .loading-indicator {
+ margin-top: 40px;
+}
+
+.woltlabNewsfeed:not(.woltlabNewsfeed--loading) .loading-indicator {
display: none;
}
.woltlabNewsfeed__iframe {
- border: 1px solid var(--wcfContentBorderInner);
border-radius: var(--wcfBorderRadius);
height: 100vh;
max-width: 100%;
- visibility: hidden;
width: 600px;
}
-.woltlabNewsfeed.loaded .woltlabNewsfeed__iframe {
- visibility: visible;
+.woltlabNewsfeed--loading .woltlabNewsfeed__iframe {
+ visibility: hidden;
}
{if ENABLE_WOLTLAB_NEWS}
<div id="news" class="hidden tabMenuContent">
<div class="section">
- <div class="woltlabNewsfeed">
- <div class="woltlabNewsfeed__loading">{icon name='spinner' size=64}</div>
+ <div class="woltlabNewsfeed woltlabNewsfeed--loading">
+ <woltlab-core-loading-indicator size="48"></woltlab-core-loading-indicator>
<iframe
class="woltlabNewsfeed__iframe"
referrerpolicy="no-referrer"
{
const languageCode = "{if $__wcf->language->languageCode === 'de'}de{else}en{/if}";
let colorScheme = document.documentElement.dataset.colorScheme;
- const container = document.querySelector('.woltlabNewsfeed');
+ const container = document.querySelector(".woltlabNewsfeed");
const iframe = container.querySelector(".woltlabNewsfeed__iframe");
const updateColorScheme = () => {
- container.classList.remove('loaded');
- iframe.src = `https://newsfeed.woltlab.com/${ languageCode }_${ colorScheme }.html`;
+ container.classList.add("woltlabNewsfeed--loading");
iframe.addEventListener(
- 'load',
- () => container.classList.add('loaded'),
+ "load",
+ () => container.classList.remove("woltlabNewsfeed--loading"),
{ once: true }
);
+ iframe.src = `https://newsfeed.woltlab.com/${ languageCode }_${ colorScheme }.html`;
};
const observer = new MutationObserver(() => {