update 2025-01-15 09:24:24

This commit is contained in:
kenzok8 2025-01-15 09:24:24 +08:00
parent 4379b9216f
commit 05bcfcd9e4
7 changed files with 225 additions and 146 deletions

View File

@ -265,7 +265,7 @@ $razordVersion = getRazordVersion();
</tr>
<tr>
<td class="text-center">
<button class="btn btn-pink" id="checkCliverButton">🔍 检测版本</button>
<button class="btn btn-pink me-1" id="checkCliverButton">🔍 检测版本</button>
<button class="btn btn-info" id="updateButton" title="更新到最新版本" onclick="showVersionTypeModal()">🔄 更新版本</button>
</td>
</tr>
@ -287,7 +287,7 @@ $razordVersion = getRazordVersion();
</tr>
<tr>
<td class="text-center">
<button class="btn btn-pink" id="checkUiButton">🔍 检测版本</button>
<button class="btn btn-pink me-1" id="checkUiButton">🔍 检测版本</button>
<button class="btn btn-info" id="updateUiButton" title="更新面板" onclick="showPanelSelector()">🔄 更新版本</button>
</td>
</tr>
@ -313,7 +313,7 @@ $razordVersion = getRazordVersion();
</tr>
<tr>
<td class="text-center">
<button class="btn btn-pink" id="checkSingboxButton">🔍 检测版本</button>
<button class="btn btn-pink me-1" id="checkSingboxButton">🔍 检测版本</button>
<button class="btn btn-info" id="singboxOptionsButton" title="Singbox 相关操作">🔄 更新版本</button>
</td>
</tr>
@ -335,7 +335,7 @@ $razordVersion = getRazordVersion();
</tr>
<tr>
<td class="text-center">
<button class="btn btn-pink" id="checkMihomoButton">🔍 检测版本</button>
<button class="btn btn-pink me-1" id="checkMihomoButton">🔍 检测版本</button>
<button class="btn btn-info" id="updateCoreButton" title="更新 Mihomo 内核" onclick="showMihomoVersionSelector()">🔄 更新版本</button>
</td>
</tr>
@ -613,78 +613,110 @@ $razordVersion = getRazordVersion();
</div>
</div>
<div class="modal fade" id="colorModal" tabindex="-1" aria-labelledby="colorModalLabel" aria-hidden="true" data-bs-backdrop="static" data-bs-keyboard="false">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="colorModalLabel">选择主题颜色</h5>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<div class="modal fade" id="colorModal" tabindex="-1" aria-labelledby="colorModalLabel" aria-hidden="true" data-bs-backdrop="static" data-bs-keyboard="false">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="colorModalLabel">选择主题颜色</h5>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
</div>
<div class="modal-body">
<form method="POST" action="theme.php" id="themeForm" enctype="multipart/form-data">
<div class="row">
<div class="col-md-6 mb-3">
<label for="primaryColor" class="form-label">主色</label>
<input type="color" class="form-control" name="primaryColor" id="primaryColor" value="#ffcc00">
</div>
<div class="col-md-6 mb-3">
<label for="secondaryColor" class="form-label">副色</label>
<input type="color" class="form-control" name="secondaryColor" id="secondaryColor" value="#00ffff">
</div>
<div class="col-md-6 mb-3">
<label for="bodyBgColor" class="form-label">主背景色</label>
<input type="color" class="form-control" name="bodyBgColor" id="bodyBgColor" value="#087990">
</div>
<div class="col-md-6 mb-3">
<label for="infoBgSubtle" class="form-label">信息背景色</label>
<input type="color" class="form-control" name="infoBgSubtle" id="infoBgSubtle" value="#6a5acd">
</div>
<div class="col-md-6 mb-3">
<label for="primaryBorderSubtle" class="form-label">主边框颜色</label>
<input type="color" class="form-control" name="primaryBorderSubtle" id="primaryBorderSubtle" value="#87ceeb">
</div>
<div class="col-md-6 mb-3">
<label for="bodyColor" class="form-label">文本颜色 1</label>
<input type="color" class="form-control" name="bodyColor" id="bodyColor" value="#ffff00">
</div>
<div class="col-md-6 mb-3">
<label for="tertiaryColor" class="form-label">文本颜色 2</label>
<input type="color" class="form-control" name="tertiaryColor" id="tertiaryColor" value="#00ff00">
</div>
<div class="col-md-6 mb-3">
<label for="tertiaryRgbColor" class="form-label">文本颜色 3</label>
<input type="color" class="form-control" name="tertiaryRgbColor" id="tertiaryRgbColor" value="#1e90ff">
</div>
<div class="col-md-6 mb-3">
<label for="heading1Color" class="form-label">标题颜色 1</label>
<input type="color" class="form-control" name="heading1Color" id="heading1Color" value="#00a2e8">
</div>
<div class="col-md-6 mb-3">
<label for="heading2Color" class="form-label">标题颜色 2</label>
<input type="color" class="form-control" name="heading2Color" id="heading2Color" value="#00a2e8">
</div>
<div class="col-md-6 mb-3">
<label for="heading3Color" class="form-label">标题颜色 3</label>
<input type="color" class="form-control" name="heading3Color" id="heading3Color" value="#ffcc00">
</div>
<div class="col-md-6 mb-3">
<label for="heading4Color" class="form-label">标题颜色 4</label>
<input type="color" class="form-control" name="heading4Color" id="heading4Color" value="#ff4500">
</div>
<div class="col-md-6 mb-3">
<label for="heading5Color" class="form-label">标题颜色 5</label>
<input type="color" class="form-control" name="heading5Color" id="heading5Color" value="#7d5fff">
</div>
<div class="col-md-6 mb-3">
<label for="heading6Color" class="form-label">标题颜色 6</label>
<input type="color" class="form-control" name="heading6Color" id="heading6Color" value="#00ffff">
</div>
</div>
<div class="modal-body">
<form method="POST" action="theme.php" id="themeForm" enctype="multipart/form-data">
<div class="mb-3">
<label for="primaryColor" class="form-label">主色:</label>
<input type="color" class="form-control" name="primaryColor" id="primaryColor" value="#ffcc00">
</div>
<div class="mb-3">
<label for="secondaryColor" class="form-label">副色:</label>
<input type="color" class="form-control" name="secondaryColor" id="secondaryColor" value="#00ffff">
</div>
<div class="mb-3">
<label for="bodyBgColor" class="form-label">背景色:</label>
<input type="color" class="form-control" name="bodyBgColor" id="bodyBgColor" value="#087990">
</div>
<div class="mb-3">
<label for="bodyColor" class="form-label">文本颜色:</label>
<input type="color" class="form-control" name="bodyColor" id="bodyColor" value="#ffff00">
</div>
<div class="mb-3">
<label for="infoBgSubtle" class="form-label">信息背景色:</label>
<input type="color" class="form-control" name="infoBgSubtle" id="infoBgSubtle" value="#6A5ACD">
</div>
<div class="mb-3">
<label for="primaryBorderSubtle" class="form-label">主边框颜色:</label>
<input type="color" class="form-control" name="primaryBorderSubtle" id="primaryBorderSubtle" value="#87ceeb">
</div>
<div class="mb-3">
<label for="tertiaryColor" class="form-label">文本字体颜色2</label>
<input type="color" class="form-control" name="tertiaryColor" id="tertiaryColor" value="#00ff00">
</div>
<div class="mb-3">
<label for="tertiaryRgbColor" class="form-label">文本字体颜色3</label>
<input type="color" class="form-control" name="tertiaryRgbColor" id="tertiaryRgbColor" value="#1e90ff">
</div>
<div class="mb-3">
<label for="heading1Color" class="form-label">标题颜色1</label>
<input type="color" class="form-control" name="heading1Color" id="heading1Color" value="#00a2e8">
</div>
<div class="mb-3">
<label for="heading2Color" class="form-label">标题颜色2</label>
<input type="color" class="form-control" name="heading2Color" id="heading2Color" value="#00a2e8">
</div>
<div class="mb-3">
<label for="heading3Color" class="form-label">标题颜色3</label>
<input type="color" class="form-control" name="heading3Color" id="heading3Color" value="#ffcc00">
</div>
<div class="mb-3">
<label for="heading4Color" class="form-label">标题颜色4</label>
<input type="color" class="form-control" name="heading4Color" id="heading4Color" value="#ff4500">
</div>
<div class="mb-3">
<label for="heading5Color" class="form-label">标题颜色5</label>
<input type="color" class="form-control" name="heading5Color" id="heading5Color" value="#7d5fff">
</div>
<div class="mb-3">
<label for="heading6Color" class="form-label">标题颜色6</label>
<input type="color" class="form-control" name="heading6Color" id="heading6Color" value="#00ffff">
</div>
<button type="submit" class="btn btn-primary">保存主题</button>
<button type="button" class="btn btn-success" id="resetButton">恢复默认值</button>
</form>
<div class="mb-3 form-check">
<input type="checkbox" class="form-check-input" id="useBackgroundImage" name="useBackgroundImage">
<label class="form-check-label" for="useBackgroundImage">使用自定义背景图片</label>
</div>
</div>
<div class="mb-3" id="backgroundImageContainer" style="display:none;">
<label for="backgroundImage" class="form-label">选择背景图片</label>
<select class="form-select" id="backgroundImage" name="backgroundImage">
<option value="">请选择图片</option>
<?php
$dir = $_SERVER['DOCUMENT_ROOT'] . '/nekobox/assets/Pictures/';
$files = array_diff(scandir($dir), array('..', '.'));
foreach ($files as $file) {
if (in_array(strtolower(pathinfo($file, PATHINFO_EXTENSION)), ['jpg', 'jpeg', 'png'])) {
echo "<option value='/nekobox/assets/Pictures/$file'>$file</option>";
}
}
?>
</select>
</div>
<button type="submit" class="btn btn-primary me-2">保存主题</button>
<button type="button" class="btn btn-success me-2" id="resetButton">恢复默认值</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">取消</button>
</form>
</div>
</div>
</div>
</div>
<script>
document.getElementById('useBackgroundImage').addEventListener('change', function() {
const container = document.getElementById('backgroundImageContainer');
container.style.display = this.checked ? 'block' : 'none';
});
</script>
<div class="modal fade" id="filesModal" tabindex="-1" aria-labelledby="filesModalLabel" aria-hidden="true" data-bs-backdrop="static" data-bs-keyboard="false">
<div class="modal-dialog modal-xl">
@ -738,10 +770,12 @@ $razordVersion = getRazordVersion();
</tbody>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">取消</button>
</div>
</div>
</div>
</div>
<?php
if (isset($_GET['delete'])) {
$fileToDelete = $_GET['delete'];
@ -781,12 +815,34 @@ function formatSize($size) {
});
});
const useBackgroundImageCheckbox = document.getElementById('useBackgroundImage');
const backgroundImageContainer = document.getElementById('backgroundImageContainer');
const savedBackgroundImageState = localStorage.getItem('useBackgroundImage');
if (savedBackgroundImageState === 'true') {
useBackgroundImageCheckbox.checked = true;
backgroundImageContainer.style.display = 'block';
} else {
useBackgroundImageCheckbox.checked = false;
backgroundImageContainer.style.display = 'none';
}
useBackgroundImageCheckbox.addEventListener('change', function() {
if (useBackgroundImageCheckbox.checked) {
backgroundImageContainer.style.display = 'block';
} else {
backgroundImageContainer.style.display = 'none';
}
localStorage.setItem('useBackgroundImage', useBackgroundImageCheckbox.checked);
});
document.getElementById('resetButton').addEventListener('click', function() {
document.getElementById('primaryColor').value = '#ffcc00';
document.getElementById('secondaryColor').value = '#00ffff';
document.getElementById('bodyBgColor').value = '#087990';
document.getElementById('bodyColor').value = '#ffff00';
document.getElementById('infoBgSubtle').value = '#6A5ACD';
document.getElementById('infoBgSubtle').value = '#6a5acd';
document.getElementById('primaryBorderSubtle').value = '#87ceeb';
document.getElementById('tertiaryColor').value = '#00ff00';
document.getElementById('tertiaryRgbColor').value = '#1e90ff';
@ -796,7 +852,7 @@ function formatSize($size) {
document.getElementById('heading4Color').value = '#ff4500';
document.getElementById('heading5Color').value = '#7d5fff';
document.getElementById('heading6Color').value = '#00ffff';
localStorage.clear();
});
});

View File

@ -4,7 +4,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$secondaryColor = $_POST['secondaryColor'] ?? '#00ffff';
$bodyBgColor = $_POST['bodyBgColor'] ?? '#087990';
$bodyColor = $_POST['bodyColor'] ?? '#ffff00';
$infoBgSubtle = $_POST['infoBgSubtle'] ?? '#6A5ACD';
$infoBgSubtle = $_POST['infoBgSubtle'] ?? '#6a5acd';
$primaryBorderSubtle = $_POST['primaryBorderSubtle'] ?? '#87ceeb';
$tertiaryColor = $_POST['tertiaryColor'] ?? '#00ff00';
$tertiaryRgbColor = $_POST['tertiaryRgbColor'] ?? '#1e90ff';
@ -27,6 +27,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
}
}
$backgroundImagePath = $_POST['backgroundImage'] ?? '';
$cssContent = "
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;700&family=Noto+Serif+SC:wght@400;700&display=swap');
@ -75,7 +76,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;
" . ($uploadedImagePath ? "background-image: url('$uploadedImagePath'); background-repeat: no-repeat; background-position: center center; background-attachment: fixed; background-size: cover;" : "") . "
" . ($backgroundImagePath ? "background-image: url('$backgroundImagePath'); background-repeat: no-repeat; background-position: center center; background-attachment: fixed; background-size: cover;" : "") . "
" . ($uploadedImagePath && empty($backgroundImagePath) ? "background-image: url('$uploadedImagePath'); background-repeat: no-repeat; background-position: center center; background-attachment: fixed; background-size: cover;" : "") . "
}
h1 { color: var(--bs-heading-1); }
@ -110,6 +112,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
color: var(--bs-tertiary-rgb) !important;
}
table td:nth-child(3) {
color: #ffffff !important;
}
table td:nth-child(4) {
color: #ffffff !important;
}
button {
background-color: var(--bs-primary);
border: 1px solid rgba(255, 255, 255, 0.5);
@ -143,6 +151,21 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
margin-bottom: 2rem;
}
.modal-header .close {
color: black !important;
opacity: 1 !important;
font-size: 1.5rem !important;
background: none !important;
border: none !important;
}
.modal-header .close:hover,
.modal-header .close:focus {
color: black !important;
background-color: transparent !important;
border: none !important;
}
button, .btn-warning, .btn-info, .card, .modal-content { transition: transform 0.2s ease, box-shadow 0.2s ease; }
button:active, .btn-warning:active, .btn-info:active, .card:active, .modal-content:active { transform: translateY(-6px); box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); }
button:hover, .btn-warning:hover, .btn-info:hover, .card:hover, .modal-content:hover { transform: translateY(-6px); box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1); }

View File

@ -30,8 +30,8 @@
name="theme-color"
content="#FFFFFF"
/>
<script type="module" crossorigin src="./assets/index-0PmD-pCq.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-D0PuVjwC.css">
<script type="module" crossorigin src="./assets/index-9kSOIiXf.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-Djns9Xh3.css">
<link rel="manifest" href="./manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="./registerSW.js"></script></head>
<body>
<div id="app"></div>

View File

@ -1 +1 @@
if(!self.define){let e,i={};const s=(s,n)=>(s=new URL(s+".js",n).href,i[s]||new Promise((i=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=i,document.head.appendChild(e)}else e=s,importScripts(s),i()})).then((()=>{let e=i[s];if(!e)throw new Error(`Module ${s} didnt register its module`);return e})));self.define=(n,r)=>{const f=e||("document"in self?document.currentScript.src:"")||location.href;if(i[f])return;let c={};const d=e=>s(e,f),o={module:{uri:f},exports:c,require:d};i[f]=Promise.all(n.map((e=>o[e]||d(e)))).then((e=>(r(...e),c)))}}define(["./workbox-3e8df8c8"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"assets/index-0PmD-pCq.js",revision:null},{url:"assets/index-D0PuVjwC.css",revision:null},{url:"index.html",revision:"52366c25823272eeba3fdc1c7a82f1ed"},{url:"registerSW.js",revision:"402b66900e731ca748771b6fc5e7a068"},{url:"favicon.svg",revision:"7f1c4521acc10694fefef8f72dd2ea5f"},{url:"pwa-192x192.png",revision:"021df52501f4357c03eebd808f40dc6a"},{url:"pwa-512x512.png",revision:"d2f759aaabcb2c44ff52b27fde3de6e0"},{url:"pwa-maskable-192x192.png",revision:"7cd11dc5f0490b349d23eef5591d10e5"},{url:"pwa-maskable-512x512.png",revision:"8c97dc367a85a5a1eba523b24f79d03b"},{url:"manifest.webmanifest",revision:"c452912633990899ffe790f985ad0db9"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}));
if(!self.define){let e,i={};const s=(s,n)=>(s=new URL(s+".js",n).href,i[s]||new Promise((i=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=i,document.head.appendChild(e)}else e=s,importScripts(s),i()})).then((()=>{let e=i[s];if(!e)throw new Error(`Module ${s} didnt register its module`);return e})));self.define=(n,r)=>{const f=e||("document"in self?document.currentScript.src:"")||location.href;if(i[f])return;let c={};const d=e=>s(e,f),o={module:{uri:f},exports:c,require:d};i[f]=Promise.all(n.map((e=>o[e]||d(e)))).then((e=>(r(...e),c)))}}define(["./workbox-3e8df8c8"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"assets/index-9kSOIiXf.js",revision:null},{url:"assets/index-Djns9Xh3.css",revision:null},{url:"index.html",revision:"f9c159115a0c689761e730287fd6d8ce"},{url:"registerSW.js",revision:"402b66900e731ca748771b6fc5e7a068"},{url:"favicon.svg",revision:"7f1c4521acc10694fefef8f72dd2ea5f"},{url:"pwa-192x192.png",revision:"021df52501f4357c03eebd808f40dc6a"},{url:"pwa-512x512.png",revision:"d2f759aaabcb2c44ff52b27fde3de6e0"},{url:"pwa-maskable-192x192.png",revision:"7cd11dc5f0490b349d23eef5591d10e5"},{url:"pwa-maskable-512x512.png",revision:"8c97dc367a85a5a1eba523b24f79d03b"},{url:"manifest.webmanifest",revision:"c452912633990899ffe790f985ad0db9"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}));

View File

@ -1 +1 @@
v1.49.1
v1.50.0