diff --git a/src/components/GlobalStyles.astro b/src/components/GlobalStyles.astro index b1aa636..4b2422d 100644 --- a/src/components/GlobalStyles.astro +++ b/src/components/GlobalStyles.astro @@ -49,9 +49,6 @@ rainbow-dark = linear-gradient(to right, oklch(0.70 0.10 0), oklch(0.70 0.10 30) :root --radius-large 1rem - --banner-height-home 65vh - --banner-height 35vh - --content-delay 150ms color_set({ diff --git a/src/constants/constants.ts b/src/constants/constants.ts index df8706d..a472358 100644 --- a/src/constants/constants.ts +++ b/src/constants/constants.ts @@ -3,6 +3,14 @@ export const UNCATEGORIZED = '__uncategorized__' export const PAGE_SIZE = 8 export const LIGHT_MODE = 'light', - DARK_MODE = 'dark', - AUTO_MODE = 'auto' + DARK_MODE = 'dark', + AUTO_MODE = 'auto' export const DEFAULT_THEME = AUTO_MODE + +// Banner height unit: vh +export const BANNER_HEIGHT = 35 +export const BANNER_HEIGHT_EXTEND = 30 +export const BANNER_HEIGHT_HOME = BANNER_HEIGHT + BANNER_HEIGHT_EXTEND + +// The height the main panel overlaps the banner, unit: rem +export const MAIN_PANEL_OVERLAPS_BANNER_HEIGHT = 3.5 \ No newline at end of file diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 8195b76..0d807db 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -12,6 +12,9 @@ import { DARK_MODE, DEFAULT_THEME, LIGHT_MODE, + BANNER_HEIGHT, + BANNER_HEIGHT_EXTEND, + BANNER_HEIGHT_HOME, } from '../constants/constants' import { defaultFavicons } from '../constants/icon' import type { Favicon } from '../types/config' @@ -61,8 +64,8 @@ if (!lang) { const siteLang = lang.replace('_', '-') const bannerOffsetByPosition = { - top: '30vh', - center: '15vh', + top: `${BANNER_HEIGHT_EXTEND}vh`, + center: `${BANNER_HEIGHT_EXTEND / 2}vh`, bottom: '0', } const bannerOffset = @@ -153,11 +156,16 @@ const bannerOffset = } -