From 33f78278c0b019aa80c59951a8b4a45e6746c9b4 Mon Sep 17 00:00:00 2001
From: filesite
Date: Thu, 24 Nov 2022 13:50:45 +0800
Subject: [PATCH] view improved
---
themes/beauty/views/layout/main.php | 10 ++--
themes/beauty/views/site/index.php | 87 ++++++-----------------------
www/js/beauty.js | 38 +++++++------
3 files changed, 42 insertions(+), 93 deletions(-)
diff --git a/themes/beauty/views/layout/main.php b/themes/beauty/views/layout/main.php
index 0ea0c9f..9ae238c 100644
--- a/themes/beauty/views/layout/main.php
+++ b/themes/beauty/views/layout/main.php
@@ -2,10 +2,8 @@
//常用方法
require_once __DIR__ . '/../../../../plugins/Html.php';
-?>
-
+?>
-
@@ -78,10 +76,13 @@ eof;
+
+
-
-// eof;
-// }
-
-// //当前目录的readme详细介绍
-// if (!empty($viewData['htmlCateReadme'])) {
-// echo <<{$viewData['htmlCateReadme']}
-// eof;
-// }
+ //当前目录的描述介绍
+ if (!empty($category['description'])) {
+ echo <<{$category['description']}
+eof;
+ }
+
+ //当前目录的readme详细介绍
+ if (!empty($viewData['htmlCateReadme'])) {
+ echo <<{$viewData['htmlCateReadme']}
+eof;
+ }
if (!empty($category['directories'])) { //两级目录支持
$index = 0;
@@ -132,7 +132,7 @@ eof;
eof;
} else {
echo <<
+
eof;
}
} else {
@@ -175,7 +175,7 @@ eof;
echo <<
-
+
eof;
@@ -187,59 +187,4 @@ eof;
?>
-
-
-
-
-
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/www/js/beauty.js b/www/js/beauty.js
index 57d5bf6..f4c8174 100644
--- a/www/js/beauty.js
+++ b/www/js/beauty.js
@@ -63,10 +63,12 @@ if ($('#image_site').get(0)) {
var lanpnum = 0;
$('#image_site .lampJS').click(function () {
if (lanpnum == 0) {
+ $('#markdowncss').attr('href', '/css/github-markdown-dark.css');
$(document.body).addClass('lampshow');
$('#image_site .navbarJS').removeClass('navbar-default').addClass('navbar-inverse'); // 导航栏用bootstrap主题切换
lanpnum = 1;
} else if (lanpnum == 1) {
+ $('#markdowncss').attr('href', '/css/github-markdown-light.css');
$(document.body).removeClass('lampshow');
$('#image_site .navbarJS').addClass('navbar-default').removeClass('navbar-inverse');
lanpnum = 0;
@@ -76,25 +78,27 @@ if ($('#image_site').get(0)) {
});
// 音乐播放
- var musicState = 0;
- $('#music_main').get(0).volume = 0.5; // 控制音量
- $('.musicJS').click(function () {
- if (musicState == 0) {
+ if ($('#music_main').length > 0) {
+ var musicState = 0;
+ $('#music_main').get(0).volume = 0.5; // 控制音量
+ $('.musicJS').click(function () {
+ if (musicState == 0) {
+ $('#music_main').get(0).play();
+ $('.musicJS').addClass('music_put');
+ musicState = 1;
+ } else {
+ $('#music_main').get(0).pause();
+ $('.musicJS').removeClass('music_put');
+ musicState = 0;
+ }
+ return;
+ })
+
+ $(document).one('touchstart mousedown', function () {
$('#music_main').get(0).play();
$('.musicJS').addClass('music_put');
musicState = 1;
- } else {
- $('#music_main').get(0).pause();
- $('.musicJS').removeClass('music_put');
- musicState = 0;
- }
- return;
- })
-
- $(document).one('touchstart mousedown', function () {
- $('#music_main').get(0).play();
- $('.musicJS').addClass('music_put');
- musicState = 1;
- });
+ });
+ }
}