Files
leonapp/router.php
Leonmmcoset b8fb7a6b5b feat(ui): 在所有页面导航栏添加统一logo
为增强品牌一致性,在所有页面的导航栏左侧添加了统一的logo图标,并应用统一的圆角样式。同时在全局样式中添加了圆角变量定义。
2025-07-12 17:03:42 +08:00

39 lines
1.5 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// 路由脚本用于PHP内置服务器
// 将所有/api开头的请求转发到api.php
// 顶栏样式
echo '<style>
.navbar.scrolled {
background-color: rgba(255, 255, 255, 0.95) !important;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
</style>';
// 导航栏
echo '<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top">
<div class="container">
<a href="index.php"><img src="/favicon.jpeg" alt="Logo" style="height: 30px; margin-right: 10px; border-radius: var(--border-radius);"></a>
<a class="navbar-brand" href="index.php">'. APP_STORE_NAME . '</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="index.php">首页</a>
</li>
</ul>
</div>
</div>
</nav>';
// 为内容添加顶部内边距
echo '<div style="padding-top: 70px;">';
if (preg_match('/^\/api/', $_SERVER['REQUEST_URI'])) {
include 'api.php';
exit;
}
// 其他请求按正常方式处理
return false;