优化首页样式、登陆页面样式
This commit is contained in:
parent
1a1fd0e9f3
commit
4e59384b56
@ -797,7 +797,10 @@ body.dark-theme .secondary-filters-container::after {
|
||||
border-top: 1px solid #eee;
|
||||
text-align: center;
|
||||
color: #777;
|
||||
width: 100%;
|
||||
width: 102%;
|
||||
margin-left: -13px;
|
||||
margin-right: -20px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
@ -830,6 +833,7 @@ body.dark-theme .secondary-filters-container::after {
|
||||
<span id="loadingSpinner" class="loading-spinner"></span>
|
||||
加载中...
|
||||
</button>
|
||||
<!-- 一级标签按钮将通过JS动态生成 -->
|
||||
</div>
|
||||
<div class="secondary-filters-wrapper" id="secondaryFiltersWrapper">
|
||||
<!-- 二级标签容器将通过JS动态生成 -->
|
||||
@ -1446,31 +1450,31 @@ body.dark-theme .secondary-filters-container::after {
|
||||
} else {
|
||||
// 如果未登录,先检查本地存储
|
||||
const localSettings = localStorage.getItem('navSettings');
|
||||
if (localSettings) {
|
||||
const localSettingsObj = JSON.parse(localSettings);
|
||||
// 从本地存储加载主题和卡片样式
|
||||
settings.theme = localSettingsObj.theme || guestSettings.theme;
|
||||
settings.card_style = localSettingsObj.card_style || guestSettings.card_style;
|
||||
settings.search_history = localSettingsObj.search_history || [];
|
||||
} else {
|
||||
// 首次访问,使用接口返回的默认配置
|
||||
settings.theme = guestSettings.theme;
|
||||
settings.card_style = guestSettings.card_style;
|
||||
}
|
||||
|
||||
// 设置背景图片(始终使用服务器配置)
|
||||
const lightBg = guestSettings.bg_image === 'none' ? 'none' :
|
||||
(guestSettings.bg_image || '/static/background_light.jpg');
|
||||
const darkBg = guestSettings.dark_bg_image === 'none' ? 'none' :
|
||||
(guestSettings.dark_bg_image || '/static/background_dark.jpg');
|
||||
|
||||
setBackgroundImages(lightBg, darkBg);
|
||||
}
|
||||
|
||||
applySettings();
|
||||
} catch (error) {
|
||||
console.error('加载设置失败:', error);
|
||||
if (localSettings) {
|
||||
const localSettingsObj = JSON.parse(localSettings);
|
||||
// 从本地存储加载主题和卡片样式
|
||||
settings.theme = localSettingsObj.theme || guestSettings.theme;
|
||||
settings.card_style = localSettingsObj.card_style || guestSettings.card_style;
|
||||
settings.search_history = localSettingsObj.search_history || [];
|
||||
} else {
|
||||
// 首次访问,使用接口返回的默认配置
|
||||
settings.theme = guestSettings.theme;
|
||||
settings.card_style = guestSettings.card_style;
|
||||
}
|
||||
|
||||
// 设置背景图片(始终使用服务器配置)
|
||||
const lightBg = guestSettings.bg_image === 'none' ? 'none' :
|
||||
(guestSettings.bg_image || '/static/background_light.jpg');
|
||||
const darkBg = guestSettings.dark_bg_image === 'none' ? 'none' :
|
||||
(guestSettings.dark_bg_image || '/static/background_dark.jpg');
|
||||
|
||||
setBackgroundImages(lightBg, darkBg);
|
||||
}
|
||||
|
||||
applySettings();
|
||||
} catch (error) {
|
||||
console.error('加载设置失败:', error);
|
||||
}
|
||||
}
|
||||
|
||||
// 设置背景图片
|
||||
|
||||
@ -3,32 +3,128 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>登录</title>
|
||||
<title>应用导航系统 - 登录</title>
|
||||
<link rel="stylesheet" href="/static/css/bootstrap.min.css">
|
||||
<style>
|
||||
:root {
|
||||
--primary-color: #4e73df;
|
||||
--secondary-color: #f8f9fc;
|
||||
--accent-color: #2e59d9;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #f5f5f5;
|
||||
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
min-height: 100vh;
|
||||
font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
|
||||
margin: 0;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.login-container {
|
||||
background-color: white;
|
||||
padding: 30px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 0 20px rgba(0,0,0,0.1);
|
||||
padding: 40px;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
|
||||
width: 100%;
|
||||
max-width: 400px;
|
||||
max-width: 420px;
|
||||
transition: all 0.3s ease;
|
||||
animation: fadeIn 0.5s ease-out;
|
||||
}
|
||||
|
||||
.login-container:hover {
|
||||
box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.login-title {
|
||||
text-align: center;
|
||||
margin-bottom: 30px;
|
||||
color: var(--primary-color);
|
||||
font-weight: 600;
|
||||
font-size: 28px;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.form-control {
|
||||
padding: 12px 15px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #e3e6f0;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.form-control:focus {
|
||||
border-color: var(--primary-color);
|
||||
box-shadow: 0 0 0 0.25rem rgba(78, 115, 223, 0.25);
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background-color: var(--primary-color);
|
||||
border: none;
|
||||
padding: 12px;
|
||||
border-radius: 8px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 1px;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
background-color: var(--accent-color);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.btn-primary:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.input-group-text {
|
||||
background-color: var(--secondary-color);
|
||||
border: 1px solid #e3e6f0;
|
||||
}
|
||||
|
||||
.captcha-img {
|
||||
cursor: pointer;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #e3e6f0;
|
||||
border-radius: 8px;
|
||||
height: 38px;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.captcha-img:hover {
|
||||
transform: scale(1.02);
|
||||
}
|
||||
|
||||
.form-label {
|
||||
font-weight: 500;
|
||||
color: #5a5c69;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.alert {
|
||||
border-radius: 8px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(20px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 576px) {
|
||||
.login-container {
|
||||
padding: 30px 20px;
|
||||
}
|
||||
|
||||
.login-title {
|
||||
font-size: 24px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
@ -40,30 +136,45 @@
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% if messages %}
|
||||
{% for category, message in messages %}
|
||||
<div class="alert alert-{{ category }}">{{ message }}</div>
|
||||
<div class="alert alert-{{ category }} alert-dismissible fade show" role="alert">
|
||||
{{ message }}
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
<form method="POST">
|
||||
<input type="hidden" name="next" value="{{ next }}">
|
||||
<div class="mb-3">
|
||||
<div class="mb-4">
|
||||
<label for="username" class="form-label">用户名</label>
|
||||
<input type="text" class="form-control" id="username" name="username" value="{{ request.form.username if request.form }}" required>
|
||||
<input type="text" class="form-control" id="username" name="username"
|
||||
value="{{ request.form.username if request.form }}" required
|
||||
placeholder="请输入用户名">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<div class="mb-4">
|
||||
<label for="password" class="form-label">密码</label>
|
||||
<input type="password" class="form-control" id="password" name="password" value="{{ request.form.password if request.form }}" required>
|
||||
<input type="password" class="form-control" id="password" name="password"
|
||||
value="{{ request.form.password if request.form }}" required
|
||||
placeholder="请输入密码">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<div class="mb-4">
|
||||
<label for="captcha" class="form-label">验证码</label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="captcha" name="captcha" required>
|
||||
<img src="{{ url_for('captcha') }}" class="captcha-img" onclick="this.src='{{ url_for('captcha') }}?'+Math.random()">
|
||||
<input type="text" class="form-control" id="captcha" name="captcha"
|
||||
required placeholder="请输入验证码">
|
||||
<img src="{{ url_for('captcha') }}" class="captcha-img"
|
||||
onclick="this.src='{{ url_for('captcha') }}?'+Math.random()"
|
||||
title="点击刷新验证码">
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary w-100">登录</button>
|
||||
<button type="submit" class="btn btn-primary w-100 mt-3">
|
||||
<i class="bi bi-box-arrow-in-right"></i> 登 录
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Bootstrap JS Bundle with Popper -->
|
||||
<script src="/static/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user