mirror of
https://github.com/saicaca/fuwari.git
synced 2026-01-12 15:22:52 +01:00
fix: The banner configuration is not enabled, resulting in console error (#293)
Some checks failed
Code quality / quality (push) Failing after 4s
Build and Check / Astro Check for Node.js 22 (push) Failing after 4s
Build and Check / Astro Check for Node.js 23 (push) Failing after 3s
Build and Check / Astro Build for Node.js 22 (push) Failing after 4s
Build and Check / Astro Build for Node.js 23 (push) Failing after 4s
Some checks failed
Code quality / quality (push) Failing after 4s
Build and Check / Astro Check for Node.js 22 (push) Failing after 4s
Build and Check / Astro Check for Node.js 23 (push) Failing after 3s
Build and Check / Astro Build for Node.js 22 (push) Failing after 4s
Build and Check / Astro Build for Node.js 23 (push) Failing after 4s
* fix: The banner configuration is not enabled, resulting in console errors * refactor: simplify banner visibility check and improve error handling in showBanner function --------- Co-authored-by: jump-and-jump <984292420@qq.com> Co-authored-by: L4Ph <4ranci0ne@gmail.com>
This commit is contained in:
@@ -208,7 +208,9 @@ import {
|
|||||||
BANNER_HEIGHT,
|
BANNER_HEIGHT,
|
||||||
BANNER_HEIGHT_HOME,
|
BANNER_HEIGHT_HOME,
|
||||||
BANNER_HEIGHT_EXTEND,
|
BANNER_HEIGHT_EXTEND,
|
||||||
MAIN_PANEL_OVERLAPS_BANNER_HEIGHT} from "../constants/constants";
|
MAIN_PANEL_OVERLAPS_BANNER_HEIGHT
|
||||||
|
} from "../constants/constants";
|
||||||
|
import { siteConfig } from '../config';
|
||||||
|
|
||||||
/* Preload fonts */
|
/* Preload fonts */
|
||||||
// (async function() {
|
// (async function() {
|
||||||
@@ -325,12 +327,15 @@ function initCustomScrollbar() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function showBanner() {
|
function showBanner() {
|
||||||
const banner = document.getElementById('banner')
|
if (!siteConfig.banner.enable) return;
|
||||||
|
|
||||||
|
const banner = document.getElementById('banner');
|
||||||
if (!banner) {
|
if (!banner) {
|
||||||
console.error('Failed to find the banner element')
|
console.error('Banner element not found');
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
banner.classList.remove('opacity-0', 'scale-105')
|
|
||||||
|
banner.classList.remove('opacity-0', 'scale-105');
|
||||||
}
|
}
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
|
|||||||
Reference in New Issue
Block a user