From 2d88613b5aabe372793106ee3e08ec6b0b210025 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Fri, 14 Jul 2023 18:36:19 +0800 Subject: [PATCH] heo-theme-slug --- themes/heo/components/Header.js | 8 +- themes/heo/components/Hero.js | 2 +- themes/heo/components/MenuItemDrop.js | 4 +- themes/heo/components/PostHeader.js | 122 ++++++++++++++------------ themes/heo/components/WavesArea.js | 60 +++++++++++++ themes/heo/index.js | 19 +--- 6 files changed, 137 insertions(+), 78 deletions(-) create mode 100644 themes/heo/components/WavesArea.js diff --git a/themes/heo/components/Header.js b/themes/heo/components/Header.js index 411cf070..f654d230 100644 --- a/themes/heo/components/Header.js +++ b/themes/heo/components/Header.js @@ -11,6 +11,7 @@ import throttle from 'lodash.throttle' const Header = props => { const [isOpen, changeShow] = useState(false) const [headerBgShow, setHeaderBgShow] = useState(false) + const [whiteTitle, setWhiteTitle] = useState(false) const toggleMenuOpen = () => { changeShow(!isOpen) @@ -33,18 +34,23 @@ const Header = props => { const scrollTrigger = useCallback(throttle(() => { const scrollS = window.scrollY const header = document.querySelector('#header') + const postHeader = document.querySelector('#post-bg') // 导航栏设置 白色背景 if (header && scrollS > 60) { setHeaderBgShow(true) + setWhiteTitle(false) } else { + if (postHeader) { + setWhiteTitle(true) + } setHeaderBgShow(false) } }, throttleMs)) return (<> {/* 头条 */} -