From d1683d4c03c603e678064761cdabc0b55a968646 Mon Sep 17 00:00:00 2001 From: Chenx221 Date: Fri, 8 Mar 2024 15:26:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=AE=9E=E7=8E=B0=E5=A4=9C?= =?UTF-8?q?=E9=97=B4=E6=A8=A1=E5=BC=8F=20=E5=90=8C=E6=97=B6=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E4=BA=86=E4=B8=80=E4=BA=9B=E6=A0=B7=E5=BC=8F=E4=BB=A5?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E5=A4=9C=E9=97=B4=E6=A8=A1=E5=BC=8F=E4=B8=8B?= =?UTF-8?q?=E7=9A=84=E6=95=88=E6=9E=9C=20*=E7=A8=8D=E5=90=8E=E4=BC=9A?= =?UTF-8?q?=E5=81=9A=E4=B8=80=E4=B8=AA=E5=90=8E=E7=AB=AF=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- views/layouts/main.php | 18 ++++++++++++++---- views/user/info.php | 9 +-------- web/css/home_style.css | 12 +++++++++++- web/css/user-info.css | 17 +++++++++++++++-- web/js/darkmode.js | 10 ++++++++++ web/js/darkmode_auto.js | 16 ++++++++++++++++ 6 files changed, 67 insertions(+), 15 deletions(-) create mode 100644 web/js/darkmode.js create mode 100644 web/js/darkmode_auto.js diff --git a/views/layouts/main.php b/views/layouts/main.php index 874069a..6541128 100644 --- a/views/layouts/main.php +++ b/views/layouts/main.php @@ -10,6 +10,7 @@ use yii\bootstrap5\Breadcrumbs; use yii\bootstrap5\Html; use yii\bootstrap5\Nav; use yii\bootstrap5\NavBar; +use yii\web\View; AppAsset::register($this); @@ -19,10 +20,11 @@ $this->registerMetaTag(['name' => 'viewport', 'content' => 'width=device-width, $this->registerMetaTag(['name' => 'description', 'content' => $this->params['meta_description'] ?? '']); $this->registerMetaTag(['name' => 'keywords', 'content' => $this->params['meta_keywords'] ?? '']); $this->registerLinkTag(['rel' => 'icon', 'type' => 'image/x-icon', 'href' => Yii::getAlias('@web/favicon.ico')]); +$darkMode = Yii::$app->user->isGuest ? 0 : Yii::$app->user->identity->dark_mode; ?> beginPage() ?> - + > <?= Html::encode($this->title) ?> head() ?> @@ -45,8 +47,8 @@ $this->registerLinkTag(['rel' => 'icon', 'type' => 'image/x-icon', 'href' => Yii ['label' => '分享管理', 'url' => ['/share/index']], ['label' => '文件收集', 'url' => ['/collection/index']], ['label' => '个人设置', 'url' => ['/user/info']], - ['label' => '系统设置', 'url' => ['/site/contact']], - ['label' => '应用下载', 'url' => ['/site/contact']], +// ['label' => '系统设置', 'url' => ['/site/contact']], +// ['label' => '应用下载', 'url' => ['/site/contact']], Yii::$app->user->isGuest ? ['label' => '登录', 'url' => ['/user/login']] : '