1. 新增Python/JS版图标生成脚本,批量创建标准化SVG图标 2. 重构页面视图切换逻辑,添加平滑过渡动画 3. 升级登录日志分页系统,支持页码跳转与页大小调整 4. 完善暗黑模式样式适配,覆盖更多UI组件 5. 优化海报展示适配,根据图片比例自动调整布局
175 lines
5.7 KiB
Python
175 lines
5.7 KiB
Python
# Icon Generator Script
|
|
import os
|
|
|
|
icons_dir = 'public/icons'
|
|
os.makedirs(icons_dir, exist_ok=True)
|
|
|
|
# Color scheme
|
|
PRIMARY_COLOR = '#6366f1'
|
|
SUCCESS_COLOR = '#22c55e'
|
|
DANGER_COLOR = '#ef4444'
|
|
|
|
def create_svg(filename, elements, color=PRIMARY_COLOR, fill=False):
|
|
"""Create an SVG icon file"""
|
|
fill_attr = 'fill "{}"'.format(color) if fill else 'fill="none"'
|
|
svg_content = '''<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" {} stroke="{}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
{}
|
|
</svg>'''.format(fill_attr, color, '\n'.join(elements))
|
|
|
|
filepath = os.path.join(icons_dir, filename)
|
|
with open(filepath, 'w', encoding='utf-8') as f:
|
|
f.write(svg_content)
|
|
print(f'Created: {filename}')
|
|
|
|
# Home icon
|
|
create_svg('home.svg', [
|
|
'<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>',
|
|
'<polyline points="9 22 9 12 15 12 15 22"/>'
|
|
])
|
|
|
|
# Search icon
|
|
create_svg('search.svg', [
|
|
'<circle cx="11" cy="11" r="8"/>',
|
|
'<line x1="21" y1="21" x2="16.65" y2="16.65"/>'
|
|
])
|
|
|
|
# Settings icon
|
|
create_svg('settings.svg', [
|
|
'<circle cx="12" cy="12" r="3"/>',
|
|
'<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/>'
|
|
])
|
|
|
|
# User icon
|
|
create_svg('user.svg', [
|
|
'<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/>',
|
|
'<circle cx="12" cy="7" r="4"/>'
|
|
])
|
|
|
|
# Folder icon (filled)
|
|
create_svg('folder.svg', [
|
|
'<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/>'
|
|
], fill=True)
|
|
|
|
# File icon
|
|
create_svg('file.svg', [
|
|
'<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/>',
|
|
'<polyline points="14 2 14 8 20 8"/>'
|
|
])
|
|
|
|
# Download icon
|
|
create_svg('download.svg', [
|
|
'<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>',
|
|
'<polyline points="7 10 12 15 17 10"/>',
|
|
'<line x1="12" y1="15" x2="12" y2="3"/>'
|
|
])
|
|
|
|
# Upload icon
|
|
create_svg('upload.svg', [
|
|
'<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>',
|
|
'<polyline points="17 8 12 3 7 8"/>',
|
|
'<line x1="12" y1="3" x2="12" y2="15"/>'
|
|
])
|
|
|
|
# Share icon
|
|
create_svg('share.svg', [
|
|
'<circle cx="18" cy="5" r="3"/>',
|
|
'<circle cx="6" cy="12" r="3"/>',
|
|
'<circle cx="18" cy="19" r="3"/>',
|
|
'<line x1="8.59" y1="13.51" x2="15.42" y2="17.49"/>',
|
|
'<line x1="15.41" y1="6.51" x2="8.59" y2="10.49"/>'
|
|
])
|
|
|
|
# Favorite/Like icon (filled)
|
|
create_svg('favorite.svg', [
|
|
'<path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/>'
|
|
], fill=True)
|
|
|
|
# Delete icon
|
|
create_svg('delete.svg', [
|
|
'<polyline points="3 6 5 6 21 6"/>',
|
|
'<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/>'
|
|
], color=DANGER_COLOR)
|
|
|
|
# Edit icon
|
|
create_svg('edit.svg', [
|
|
'<path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/>',
|
|
'<path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/>'
|
|
])
|
|
|
|
# Add icon
|
|
create_svg('add.svg', [
|
|
'<circle cx="12" cy="12" r="10"/>',
|
|
'<line x1="12" y1="8" x2="12" y2="16"/>',
|
|
'<line x1="8" y1="12" x2="16" y2="12"/>'
|
|
])
|
|
|
|
# Back/Arrow Left icon
|
|
create_svg('back.svg', [
|
|
'<line x1="19" y1="12" x2="5" y2="12"/>',
|
|
'<polyline points="12 19 5 12 12 5"/>'
|
|
])
|
|
|
|
# More/Options icon (three dots)
|
|
create_svg('more.svg', [
|
|
'<circle cx="12" cy="12" r="1"/>',
|
|
'<circle cx="19" cy="12" r="1"/>',
|
|
'<circle cx="5" cy="12" r="1"/>'
|
|
], fill=True)
|
|
|
|
# Cloud icon
|
|
create_svg('cloud.svg', [
|
|
'<path d="M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z"/>'
|
|
])
|
|
|
|
# Drive/Server icon
|
|
create_svg('drive.svg', [
|
|
'<rect x="2" y="6" width="20" height="12" rx="2"/>',
|
|
'<circle cx="12" cy="12" r="2"/>',
|
|
'<path d="M6 12h.01 M18 12h.01"/>'
|
|
])
|
|
|
|
# Log/File Text icon
|
|
create_svg('log.svg', [
|
|
'<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/>',
|
|
'<polyline points="14 2 14 8 20 8"/>',
|
|
'<line x1="16" y1="13" x2="8" y2="13"/>',
|
|
'<line x1="16" y1="17" x2="8" y2="17"/>',
|
|
'<polyline points="10 9 9 9 8 9"/>'
|
|
])
|
|
|
|
# Close icon
|
|
create_svg('close.svg', [
|
|
'<line x1="18" y1="6" x2="6" y2="18"/>',
|
|
'<line x1="6" y1="6" x2="18" y2="18"/>'
|
|
])
|
|
|
|
# Check/Verify icon
|
|
create_svg('check.svg', [
|
|
'<polyline points="20 6 9 17 4 12"/>'
|
|
], color=SUCCESS_COLOR)
|
|
|
|
# Play icon
|
|
create_svg('play.svg', [
|
|
'<polygon points="5 3 19 12 5 21 5 3"/>'
|
|
], fill=True)
|
|
|
|
# Pause icon
|
|
create_svg('pause.svg', [
|
|
'<rect x="6" y="4" width="4" height="16"/>',
|
|
'<rect x="14" y="4" width="4" height="16"/>'
|
|
])
|
|
|
|
# Eye icon
|
|
create_svg('eye.svg', [
|
|
'<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/>',
|
|
'<circle cx="12" cy="12" r="3"/>'
|
|
])
|
|
|
|
# Eye Off icon
|
|
create_svg('eye-off.svg', [
|
|
'<path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"/>',
|
|
'<line x1="1" y1="1" x2="23" y2="23"/>'
|
|
])
|
|
|
|
print(f'\nTotal icons created: {len(os.listdir(icons_dir)) - 1}') # Exclude test.txt
|
|
print('Icon generation complete!') |