feat: add onload animation for banner
This commit is contained in:
parent
8565724eb3
commit
085fd62a79
|
@ -139,7 +139,7 @@ const bannerOffset = bannerOffsetByPosition[siteConfig.banner.position || 'cente
|
||||||
<ConfigCarrier></ConfigCarrier>
|
<ConfigCarrier></ConfigCarrier>
|
||||||
<GlobalStyles>
|
<GlobalStyles>
|
||||||
{siteConfig.banner.enable && <div id="banner-wrapper" class="absolute -top-[30vh] w-full transition duration-700 overflow-hidden">
|
{siteConfig.banner.enable && <div id="banner-wrapper" class="absolute -top-[30vh] w-full transition duration-700 overflow-hidden">
|
||||||
<ImageWrapper id="banner" alt="Banner image of the blog" class:list={["object-cover h-full transition duration-700"]}
|
<ImageWrapper id="banner" alt="Banner image of the blog" class:list={["object-cover h-full transition duration-700 opacity-0 scale-105"]}
|
||||||
src={siteConfig.banner.src} position={siteConfig.banner.position}
|
src={siteConfig.banner.src} position={siteConfig.banner.position}
|
||||||
>
|
>
|
||||||
</ImageWrapper>
|
</ImageWrapper>
|
||||||
|
@ -305,11 +305,21 @@ function initCustomScrollbar() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showBanner() {
|
||||||
|
const banner = document.getElementById('banner')
|
||||||
|
if (!banner) {
|
||||||
|
console.error('Failed to find the banner element')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
banner.classList.remove('opacity-0', 'scale-105')
|
||||||
|
}
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
// disableAnimation()() // TODO
|
// disableAnimation()() // TODO
|
||||||
loadTheme();
|
loadTheme();
|
||||||
loadHue();
|
loadHue();
|
||||||
initCustomScrollbar();
|
initCustomScrollbar();
|
||||||
|
showBanner();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Load settings when entering the site */
|
/* Load settings when entering the site */
|
||||||
|
|
Loading…
Reference in New Issue