From b69243e51af2d6c9300d26bca8c84baf7f79c00d Mon Sep 17 00:00:00 2001 From: MasonLiu <2857911564@qq.com> Date: Mon, 1 Jun 2026 00:24:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=A1=A8=E6=A0=BC=E6=8E=92?= =?UTF-8?q?=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/css/style.css | 61 +++ simple.php => full.php | 46 ++- index.php | 103 +++++- table.php | 820 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 1019 insertions(+), 11 deletions(-) rename simple.php => full.php (87%) create mode 100644 table.php diff --git a/assets/css/style.css b/assets/css/style.css index 09973ef..be4b4b4 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -257,6 +257,67 @@ body.dark-mode .view-toggle:hover { transform: translateX(-50%) translateY(0); } +/* 视图切换下拉菜单 */ +.view-menu { + position: absolute; + top: 70px; + right: 15px; + background: white; + border: 1px solid #e2e8f0; + border-radius: 8px; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); + padding: 8px 0; + min-width: 150px; + z-index: 101; + display: none; +} + +body.dark-mode .view-menu { + background: #2d3748; + border-color: #4a5568; +} + +.view-menu.show { + display: block; +} + +.view-menu-item { + display: flex; + align-items: center; + padding: 10px 16px; + color: #2d3748; + text-decoration: none; + transition: background-color 0.2s ease; + cursor: pointer; + border: none; + background: none; + width: 100%; + font-size: 0.9em; + text-align: left; +} + +body.dark-mode .view-menu-item { + color: #e2e8f0; +} + +.view-menu-item:hover { + background-color: #f7fafc; +} + +body.dark-mode .view-menu-item:hover { + background-color: #4a5568; +} + +.view-menu-item.active { + background-color: #4299e1; + color: white; +} + +.view-menu-icon { + margin-right: 10px; + font-size: 1.1em; +} + .theme-tooltip { position: absolute; bottom: -35px; diff --git a/simple.php b/full.php similarity index 87% rename from simple.php rename to full.php index 7197a61..e042b63 100644 --- a/simple.php +++ b/full.php @@ -84,10 +84,24 @@ try { 🌙 切换主题 - +
+ + + +
$config): ?> @@ -342,6 +356,32 @@ try { }, 3000); } })(); + + // 视图切换下拉菜单 + (function() { + const viewToggle = document.getElementById('view-toggle'); + const viewMenu = document.getElementById('view-menu'); + + // 点击按钮显示/隐藏菜单 + viewToggle.addEventListener('click', function(e) { + e.stopPropagation(); + viewMenu.classList.toggle('show'); + }); + + // 点击其他地方关闭菜单 + document.addEventListener('click', function(e) { + if (!viewToggle.contains(e.target) && !viewMenu.contains(e.target)) { + viewMenu.classList.remove('show'); + } + }); + + // ESC 键关闭菜单 + document.addEventListener('keydown', function(e) { + if (e.key === 'Escape') { + viewMenu.classList.remove('show'); + } + }); + })(); \ No newline at end of file diff --git a/index.php b/index.php index 8dfd623..9ad7615 100644 --- a/index.php +++ b/index.php @@ -232,6 +232,54 @@ try { visibility: visible; } + /* 视图切换下拉菜单 */ + .view-menu { + position: fixed; + top: 60px; + right: 15px; + background-color: var(--bg-secondary); + border: 1px solid var(--border-color); + border-radius: 8px; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); + padding: 8px 0; + min-width: 150px; + z-index: 101; + display: none; + } + + .view-menu.show { + display: block; + } + + .view-menu-item { + display: flex; + align-items: center; + padding: 10px 16px; + color: var(--text-primary); + text-decoration: none; + transition: background-color 0.2s ease; + cursor: pointer; + border: none; + background: none; + width: 100%; + font-size: 0.9em; + text-align: left; + } + + .view-menu-item:hover { + background-color: var(--hover-bg); + } + + .view-menu-item.active { + background-color: var(--accent-color); + color: white; + } + + .view-menu-icon { + margin-right: 10px; + font-size: 1.1em; + } + /* 栏目区域 */ .section { margin-bottom: 20px; @@ -523,10 +571,23 @@ try { - +
+ + + +
$config): ?> @@ -713,20 +774,20 @@ try { const themeToggle = document.getElementById('theme-toggle'); const themeIcon = themeToggle.querySelector('.theme-icon'); const body = document.body; - - // 从localStorage读取主题设置 + + // 从 localStorage 读取主题设置 const currentTheme = localStorage.getItem('theme') || 'light'; - + // 应用保存的主题 if (currentTheme === 'dark') { body.classList.add('dark-mode'); themeIcon.textContent = '☀️'; } - + // 切换主题 themeToggle.addEventListener('click', function() { body.classList.toggle('dark-mode'); - + if (body.classList.contains('dark-mode')) { themeIcon.textContent = '☀️'; localStorage.setItem('theme', 'dark'); @@ -736,6 +797,32 @@ try { } }); })(); + + // 视图切换下拉菜单 + (function() { + const viewToggle = document.getElementById('view-toggle'); + const viewMenu = document.getElementById('view-menu'); + + // 点击按钮显示/隐藏菜单 + viewToggle.addEventListener('click', function(e) { + e.stopPropagation(); + viewMenu.classList.toggle('show'); + }); + + // 点击其他地方关闭菜单 + document.addEventListener('click', function(e) { + if (!viewToggle.contains(e.target) && !viewMenu.contains(e.target)) { + viewMenu.classList.remove('show'); + } + }); + + // ESC 键关闭菜单 + document.addEventListener('keydown', function(e) { + if (e.key === 'Escape') { + viewMenu.classList.remove('show'); + } + }); + })(); diff --git a/table.php b/table.php new file mode 100644 index 0000000..aa63840 --- /dev/null +++ b/table.php @@ -0,0 +1,820 @@ +syncJsonToDatabase(); + + // 获取栏目配置 + $sections = $database->getSectionsConfig(); +} catch (Exception $e) { + error_log("数据库初始化失败: " . $e->getMessage()); + $sections = []; +} +?> + + + + + + + + SecHub(表格版) + + + +
+
+

SecHub 网安工具集(表格版)

+

超高密度浏览模式 | 一行一条目

+ + +
+ +
+
+ + + +
+ + + +
+
+ + $config): ?> + getItemsBySection($key); + ?> + +
+
+

+ +

+ + +
+ + +
+

暂无数据

+
+ +
+ + + + + + + + + + + + + + + + + +
工具名称工具链接工具描述
+ + + + +
+ +
+
+
+ +
+ + + +
+ + + +