From 0c6e5d6960999b6de98ca2d202c8e4b3bf6d6d4f Mon Sep 17 00:00:00 2001 From: OldTaoge <51744784+OldTaoge@users.noreply.github.com> Date: Wed, 26 Aug 2026 09:16:05 +0800 Subject: [PATCH] feat: make site navigation and pages configurable --- .../assets/js/landing-hero-canvas.js | 11 +------ themes/ITStudioMainSite/functions.php | 2 +- themes/ITStudioMainSite/header.php | 31 +++++-------------- .../ITStudioMainSite/page-announcements.php | 6 ++++ themes/ITStudioMainSite/page-news.php | 6 ++++ 5 files changed, 21 insertions(+), 35 deletions(-) create mode 100644 themes/ITStudioMainSite/page-announcements.php create mode 100644 themes/ITStudioMainSite/page-news.php diff --git a/themes/ITStudioMainSite/assets/js/landing-hero-canvas.js b/themes/ITStudioMainSite/assets/js/landing-hero-canvas.js index 7b83c1b..68e3a51 100644 --- a/themes/ITStudioMainSite/assets/js/landing-hero-canvas.js +++ b/themes/ITStudioMainSite/assets/js/landing-hero-canvas.js @@ -818,24 +818,15 @@ stop(); resizeCanvas(); startAt = performance.now(); - if (reducedMotionQuery.matches) { - drawStatic(); - return; - } rafId = requestAnimationFrame(render); }; const onResize = () => { resizeCanvas(); - if (reducedMotionQuery.matches) { - drawStatic(); - } }; const themeObserver = new MutationObserver(() => { - if (reducedMotionQuery.matches) { - drawStatic(); - } + if (!rafId) render(performance.now()); }); themeObserver.observe(document.documentElement, { diff --git a/themes/ITStudioMainSite/functions.php b/themes/ITStudioMainSite/functions.php index ab494e1..fdca133 100644 --- a/themes/ITStudioMainSite/functions.php +++ b/themes/ITStudioMainSite/functions.php @@ -111,7 +111,7 @@ function itstudio_enqueue_scripts() { // 仅在首页加载首页样式 if (is_front_page() || is_home()) { wp_enqueue_style('itstudio-front-page', get_template_directory_uri() . '/assets/css/front-page.css', array('itstudio-style'), '2.1.2'); - wp_enqueue_script('itstudio-landing-hero-canvas', get_template_directory_uri() . '/assets/js/landing-hero-canvas.js', array(), '1.0.0', true); + wp_enqueue_script('itstudio-landing-hero-canvas', get_template_directory_uri() . '/assets/js/landing-hero-canvas.js', array(), '1.0.1', true); } // 仅在工作室介绍页加载(包含 /about fallback) diff --git a/themes/ITStudioMainSite/header.php b/themes/ITStudioMainSite/header.php index 50d0a84..37025a0 100644 --- a/themes/ITStudioMainSite/header.php +++ b/themes/ITStudioMainSite/header.php @@ -75,32 +75,15 @@ 'primary', + 'container' => false, + 'menu_class' => 'nav-menu', + 'fallback_cb' => false, + 'depth' => 1, + )); ?> - -