Files
aitsc/flask_prompt_master/templates/base.html
2025-02-23 09:07:52 +08:00

165 lines
4.5 KiB
HTML

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>提示词大师 - {% block title %}{% endblock %}</title>
<!-- 添加 Google Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
<style>
/* 全局样式 */
:root {
--primary-color: #2196f3;
--primary-dark: #1976d2;
--secondary-color: #6c757d;
--success-color: #28a745;
--background-color: #f8f9fa;
--border-color: #e0e0e0;
--text-color: #2c3e50;
--text-light: #666;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
line-height: 1.5;
color: var(--text-color);
background-color: var(--background-color);
}
/* 导航栏样式 */
header {
background: white;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
position: sticky;
top: 0;
z-index: 100;
}
nav {
max-width: 1200px;
margin: 0 auto;
padding: 1rem;
display: flex;
justify-content: space-between;
align-items: center;
}
.nav-brand {
font-size: 1.25rem;
font-weight: 600;
color: var(--primary-color);
text-decoration: none;
display: flex;
align-items: center;
gap: 0.5rem;
}
.nav-brand i {
font-size: 1.5rem;
}
/* 主要内容区域 */
main {
min-height: calc(100vh - 120px);
}
/* 闪现消息样式 */
.flash-messages {
position: fixed;
top: 1rem;
right: 1rem;
z-index: 1000;
}
.flash-message {
background: white;
padding: 1rem;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
margin-bottom: 0.5rem;
animation: slideIn 0.3s ease-out;
}
@keyframes slideIn {
from {
transform: translateX(100%);
opacity: 0;
}
to {
transform: translateX(0);
opacity: 1;
}
}
/* 页脚样式 */
footer {
background: white;
padding: 2rem 1rem;
text-align: center;
color: var(--text-light);
margin-top: 3rem;
}
/* 响应式设计 */
@media (max-width: 768px) {
nav {
padding: 1rem;
}
}
</style>
{% block extra_css %}{% endblock %}
</head>
<body>
<header>
<nav>
<a href="{{ url_for('main.index') }}" class="nav-brand">
<i class="fas fa-magic"></i>
提示词大师
</a>
</nav>
</header>
<main>
{% with messages = get_flashed_messages() %}
{% if messages %}
<div class="flash-messages">
{% for message in messages %}
<div class="flash-message">{{ message }}</div>
{% endfor %}
</div>
{% endif %}
{% endwith %}
{% block content %}{% endblock %}
</main>
<footer>
<p>&copy; 2025 提示词大师 - 让AI更好地理解您的需求</p>
</footer>
{% block extra_js %}{% endblock %}
<script>
// 自动隐藏闪现消息
document.addEventListener('DOMContentLoaded', function() {
const messages = document.querySelectorAll('.flash-message');
messages.forEach(message => {
setTimeout(() => {
message.style.opacity = '0';
message.style.transform = 'translateX(100%)';
setTimeout(() => message.remove(), 300);
}, 3000);
});
});
</script>
</body>
</html>