From 085fd62a7911f7d913ad0199350d4e4707400ae4 Mon Sep 17 00:00:00 2001 From: saicaca Date: Fri, 20 Sep 2024 01:08:02 +0800 Subject: [PATCH] feat: add onload animation for banner --- src/layouts/Layout.astro | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 0a0dfe7..f8b0fdf 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -139,8 +139,8 @@ const bannerOffset = bannerOffsetByPosition[siteConfig.banner.position || 'cente {siteConfig.banner.enable && } @@ -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() { // disableAnimation()() // TODO loadTheme(); loadHue(); initCustomScrollbar(); + showBanner(); } /* Load settings when entering the site */