From 3422a49c56dc53d7b2f6e6713e809c38a65b85c9 Mon Sep 17 00:00:00 2001 From: msidolphin Date: Fri, 25 Feb 2022 17:09:41 +0800 Subject: [PATCH] fix(docs): fix banner covering sponsor problem (#6269) --- .../vitepress/components/globals/parallax-home.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/.vitepress/vitepress/components/globals/parallax-home.vue b/docs/.vitepress/vitepress/components/globals/parallax-home.vue index 17d259f4b9..1d621f7c67 100644 --- a/docs/.vitepress/vitepress/components/globals/parallax-home.vue +++ b/docs/.vitepress/vitepress/components/globals/parallax-home.vue @@ -5,6 +5,7 @@ import { useParallax, useThrottleFn, useEventListener } from '@vueuse/core' import { useLang } from '../../composables/lang' import homeLocale from '../../../i18n/pages/home.json' import sponsorLocale from '../../../i18n/component/sponsors-home.json' +import { isDark } from '../../composables/dark' import type { CSSProperties } from 'vue' const target = ref(null) @@ -28,12 +29,13 @@ const containerStyle: CSSProperties = { } const cardStyle = computed(() => ({ - background: '#fff', + background: 'var(--bg-color)', minHeight: '30rem', width: '50rem', borderRadius: '5px', transition: '.3s ease-out all', - boxShadow: '0 0 20px 0 rgba(255, 255, 255, 0.25)', + boxShadow: + isDark && !isDark.value ? '0 0 20px 0 rgba(255, 255, 255, 0.25)' : 'none', transform: `rotateX(${parallax.roll}deg) rotateY(${parallax.tilt}deg)`, })) @@ -59,7 +61,7 @@ const handleScroll = useThrottleFn(() => { const ele = jumbotronRef.value if (ele) { const rect = ele.getBoundingClientRect() - const eleHeight = ele.clientHeight + 55 + const eleHeight = ele.clientHeight let calHeight = (180 - rect.top) * 2 if (calHeight < 0) calHeight = 0 if (calHeight > eleHeight) calHeight = eleHeight @@ -429,7 +431,6 @@ useEventListener(window, 'scroll', handleScroll) } .jumbotron-red { transition: height 0.1s; - background: #fff; position: absolute; left: 0; top: 0;