初始化项目:云下飞个人网站

功能:
- 精美欢迎页面
- 用户登录/注册
- 主题切换(明/暗模式)
- 快捷导航栏(思源/Gitea/NocoDB)

技术栈:Python 3.12 + Flask 3.0 + SQLite
This commit is contained in:
小白
2026-03-12 08:35:52 +08:00
commit 6e38e6914d
10 changed files with 905 additions and 0 deletions

388
static/css/style.css Normal file
View File

@@ -0,0 +1,388 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
:root {
--bg-gradient-start: #667eea;
--bg-gradient-end: #764ba2;
--card-bg: rgba(255, 255, 255, 0.95);
--text-primary: #333;
--text-secondary: #666;
--text-muted: #999;
--accent-color: #667eea;
--border-color: #eee;
--input-bg: white;
--input-border: #eee;
--flash-success-bg: #d4edda;
--flash-success-text: #155724;
--flash-error-bg: #f8d7da;
--flash-error-text: #721c24;
}
[data-theme="dark"] {
--bg-gradient-start: #1a1a2e;
--bg-gradient-end: #16213e;
--card-bg: rgba(30, 30, 46, 0.95);
--text-primary: #e0e0e0;
--text-secondary: #b0b0b0;
--text-muted: #808080;
--accent-color: #a78bfa;
--border-color: #3a3a5a;
--input-bg: #2a2a3a;
--input-border: #4a4a6a;
--flash-success-bg: #1a3a2a;
--flash-success-text: #6ee7b7;
--flash-error-bg: #3a1a1a;
--flash-error-text: #f87171;
}
body {
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
transition: background 0.3s ease;
}
.container {
text-align: center;
padding: 60px 40px;
background: var(--card-bg);
border-radius: 20px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
max-width: 600px;
width: 90%;
animation: fadeIn 0.6s ease-out;
position: relative;
transition: background 0.3s ease;
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.avatar {
width: 120px;
height: 120px;
background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
border-radius: 50%;
margin: 0 auto 30px;
display: flex;
justify-content: center;
align-items: center;
font-size: 60px;
color: white;
box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
transition: all 0.3s ease;
}
h1 {
font-size: 42px;
color: var(--text-primary);
margin-bottom: 15px;
font-weight: 700;
transition: color 0.3s ease;
}
.welcome {
font-size: 24px;
color: var(--accent-color);
margin-bottom: 25px;
font-weight: 500;
transition: color 0.3s ease;
}
.message {
font-size: 16px;
color: var(--text-secondary);
line-height: 1.8;
margin-bottom: 30px;
transition: color 0.3s ease;
}
.auth-buttons {
display: flex;
gap: 15px;
justify-content: center;
margin-bottom: 20px;
}
.btn {
display: inline-block;
padding: 12px 30px;
border-radius: 25px;
text-decoration: none;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
border: none;
}
.btn-primary {
background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
color: white;
}
.btn-primary:hover {
transform: translateY(-2px);
box-shadow: 0 5px 20px rgba(102, 126, 234, 0.5);
}
.btn-secondary {
background: var(--card-bg);
color: var(--accent-color);
border: 2px solid var(--accent-color);
}
.btn-secondary:hover {
background: var(--accent-color);
color: white;
}
.btn-danger {
background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
color: white;
}
.btn-danger:hover {
transform: translateY(-2px);
box-shadow: 0 5px 20px rgba(238, 90, 90, 0.5);
}
.btn-full {
width: 100%;
}
.footer {
font-size: 14px;
color: var(--text-muted);
padding-top: 20px;
border-top: 1px solid var(--border-color);
margin-top: 20px;
transition: all 0.3s ease;
}
.footer span {
color: var(--accent-color);
font-weight: 600;
}
.sparkle {
animation: sparkle 2s infinite;
}
@keyframes sparkle {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
/* 快捷导航栏 */
.quick-nav {
position: fixed;
top: 15px;
right: 15px;
display: flex;
align-items: center;
gap: 8px;
z-index: 100;
}
.nav-btn {
display: flex;
align-items: center;
gap: 6px;
padding: 8px 14px;
background: rgba(255, 255, 255, 0.9);
border: none;
border-radius: 20px;
font-size: 14px;
font-weight: 500;
color: #333;
text-decoration: none;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
white-space: nowrap;
}
[data-theme="dark"] .nav-btn {
background: rgba(40, 40, 60, 0.9);
color: #e0e0e0;
}
.nav-btn:hover {
transform: translateY(-2px);
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
[data-theme="dark"] .nav-btn:hover {
background: rgba(60, 60, 80, 0.95);
}
/* 移动端导航 */
@media (max-width: 600px) {
.quick-nav {
position: absolute;
top: auto;
bottom: -60px;
right: 50%;
transform: translateX(50%);
background: rgba(255, 255, 255, 0.95);
padding: 10px 15px;
border-radius: 25px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
[data-theme="dark"] .quick-nav {
background: rgba(40, 40, 60, 0.95);
}
.nav-btn {
padding: 6px 10px;
font-size: 12px;
}
}
/* 主题切换按钮 - 集成到导航栏 */
.theme-toggle {
width: 40px;
height: 40px;
border-radius: 50%;
border: none;
background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
color: white;
font-size: 20px;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
display: flex;
align-items: center;
justify-content: center;
touch-action: manipulation;
-webkit-tap-highlight-color: transparent;
-webkit-touch-callout: none;
user-select: none;
}
.theme-toggle:hover {
transform: rotate(20deg) scale(1.1);
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}
.theme-toggle:active {
transform: scale(0.95);
}
/* 表单样式 */
.auth-container {
max-width: 400px;
}
.form-group {
margin-bottom: 20px;
}
.form-group input {
width: 100%;
padding: 15px 20px;
border: 2px solid var(--input-border);
border-radius: 25px;
font-size: 16px;
transition: all 0.3s ease;
outline: none;
background: var(--input-bg);
color: var(--text-primary);
}
.form-group input:focus {
border-color: var(--accent-color);
}
.form-group input::placeholder {
color: var(--text-muted);
}
.auth-link {
margin-top: 20px;
color: var(--text-secondary);
font-size: 14px;
}
.auth-link a {
color: var(--accent-color);
text-decoration: none;
font-weight: 600;
}
.auth-link a:hover {
text-decoration: underline;
}
/* 消息提示 */
.flash-success {
background: var(--flash-success-bg);
color: var(--flash-success-text);
padding: 12px 20px;
border-radius: 10px;
margin-bottom: 20px;
border: 1px solid transparent;
}
.flash-error {
background: var(--flash-error-bg);
color: var(--flash-error-text);
padding: 12px 20px;
border-radius: 10px;
margin-bottom: 20px;
border: 1px solid transparent;
}
.flash-messages {
position: fixed;
top: 20px;
right: 20px;
z-index: 1000;
}
/* 响应式 */
@media (max-width: 480px) {
.container {
padding: 40px 25px;
}
h1 {
font-size: 32px;
}
.welcome {
font-size: 20px;
}
.auth-buttons {
flex-direction: column;
}
.btn {
width: 100%;
}
.theme-toggle {
top: 10px;
right: 10px;
width: 40px;
height: 40px;
font-size: 20px;
}
}