Files
leonapp/router.php
Leonmmcoset 2f3a99263a feat(ui): 为多个页面添加统一的导航栏和样式
为router.php、开发者登录/注册页面、管理员登录页面和管理开发者页面添加统一的导航栏组件
实现导航栏滚动效果和响应式设计
使用Bootstrap改进管理开发者页面的表格和表单样式
2025-07-07 21:49:18 +08:00

38 lines
1.2 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 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;