mistpe's picture
Update app/templates/admin/login.html
c2a1150 verified
{% extends "base.html" %}
{% block title %}管理员登录 - Wisdom Hub{% endblock %}
{% block content %}
<div class="login-container" style="
min-height: calc(100vh - 8rem);
display: flex;
align-items: center;
justify-content: center;
padding: 2rem;
background: linear-gradient(135deg, #FEEEDA 0%, #B3CFEF 100%);
">
<div class="login-form" style="
width: 100%;
max-width: 420px;
background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.8));
backdrop-filter: blur(10px);
padding: 3rem;
border-radius: 24px;
box-shadow: 0 8px 32px rgba(99, 145, 197, 0.15);
border: 1px solid rgba(99, 145, 197, 0.2);
">
<div class="form-header" style="
text-align: center;
margin-bottom: 2.5rem;
">
<div class="logo-container" style="
margin-bottom: 1.5rem;
">
<i class="fas fa-feather" style="
font-size: 3rem;
background: linear-gradient(135deg, #6391C5, #C5CDFD);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
"></i>
</div>
<h2 style="
font-size: 1.75rem;
font-weight: 600;
color: #6391C5;
margin-bottom: 0.5rem;
">管理员登录</h2>
<p style="
color: #6391C5;
font-size: 0.9375rem;
">请输入您的管理员账号密码</p>
</div>
<form method="POST" style="display: flex; flex-direction: column; gap: 1.5rem;">
{% with messages = get_flashed_messages() %}
{% if messages %}
<div style="
background: rgba(99, 145, 197, 0.1);
border: 1px solid #B3CFEF;
padding: 1rem;
border-radius: 12px;
color: #6391C5;
font-size: 0.875rem;
text-align: center;
">
{{ messages[0] }}
</div>
{% endif %}
{% endwith %}
<div class="form-group" style="position: relative;">
<div style="
position: absolute;
left: 1rem;
top: 50%;
transform: translateY(-50%);
color: #6391C5;
">
<i class="fas fa-user"></i>
</div>
<input type="text" name="username" placeholder="用户名" required style="
width: 100%;
padding: 1rem 1rem 1rem 2.75rem;
border: 2px solid #B3CFEF;
border-radius: 12px;
font-size: 1rem;
transition: all 0.3s ease;
color: #6391C5;
background: rgba(255, 255, 255, 0.7);
">
</div>
<div class="form-group" style="position: relative;">
<div style="
position: absolute;
left: 1rem;
top: 50%;
transform: translateY(-50%);
color: #6391C5;
">
<i class="fas fa-lock"></i>
</div>
<input type="password" name="password" placeholder="密码" required style="
width: 100%;
padding: 1rem 1rem 1rem 2.75rem;
border: 2px solid #B3CFEF;
border-radius: 12px;
font-size: 1rem;
transition: all 0.3s ease;
color: #6391C5;
background: rgba(255, 255, 255, 0.7);
">
</div>
<button type="submit" style="
width: 100%;
padding: 1rem;
background: linear-gradient(135deg, #6391C5, #C5CDFD);
color: white;
border: none;
border-radius: 12px;
font-size: 1rem;
font-weight: 500;
cursor: pointer;
transition: all 0.3s ease;
margin-top: 1rem;
">登录</button>
<div style="
text-align: center;
margin-top: 1.5rem;
font-size: 0.875rem;
">
<a href="{{ url_for('main.index') }}" style="
color: #6391C5;
text-decoration: none;
transition: color 0.3s ease;
">
<i class="fas fa-arrow-left" style="margin-right: 0.5rem;"></i>返回首页
</a>
</div>
</form>
</div>
</div>
<script>
document.querySelectorAll('input').forEach(input => {
input.addEventListener('focus', () => {
input.style.borderColor = '#6391C5';
input.style.background = 'rgba(255, 255, 255, 0.9)';
input.style.boxShadow = '0 0 0 4px rgba(99, 145, 197, 0.1)';
});
input.addEventListener('blur', () => {
input.style.borderColor = '#B3CFEF';
input.style.background = 'rgba(255, 255, 255, 0.7)';
input.style.boxShadow = 'none';
});
});
document.querySelector('button[type="submit"]').addEventListener('mouseenter', function() {
this.style.transform = 'translateY(-2px)';
this.style.boxShadow = '0 4px 12px rgba(99, 145, 197, 0.2)';
});
document.querySelector('button[type="submit"]').addEventListener('mouseleave', function() {
this.style.transform = 'none';
this.style.boxShadow = 'none';
});
document.querySelector('a').addEventListener('mouseenter', function() {
this.style.color = '#C5CDFD';
});
document.querySelector('a').addEventListener('mouseleave', function() {
this.style.color = '#6391C5';
});
</script>
{% endblock %}