-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
75 lines (69 loc) · 3.34 KB
/
index.html
File metadata and controls
75 lines (69 loc) · 3.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>Code Snippet Manager - 代码片段管理器</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="app-container">
<!-- 头部 -->
<div class="header">
<h1>📋 Code Snippet Manager</h1>
<p>代码片段管理器 | 保存常用代码,一键复制</p>
</div>
<!-- 添加片段区域 -->
<div class="add-section">
<h3>➕ 添加代码片段</h3>
<input type="text" id="snippetName" placeholder="片段名称(如:fetch GET请求)" class="input-field">
<select id="snippetCategory" class="select-field">
<option value="JavaScript">JavaScript</option>
<option value="CSS">CSS</option>
<option value="HTML">HTML</option>
<option value="Python">Python</option>
<option value="其他">其他</option>
</select>
<textarea id="snippetCode" rows="6" placeholder="粘贴代码到这里..." class="textarea-field"></textarea>
<div class="tag-input">
<input type="text" id="snippetTags" placeholder="标签(用逗号分隔,如:api,请求)" class="input-field">
</div>
<button id="saveBtn" class="btn-primary">💾 保存片段</button>
</div>
<!-- 搜索和过滤区域 -->
<div class="search-section">
<input type="text" id="searchInput" placeholder="🔍 搜索片段名称、代码或标签..." class="input-field">
<div class="filter-buttons">
<button class="filter-btn active" data-category="all">全部</button>
<button class="filter-btn" data-category="JavaScript">JS</button>
<button class="filter-btn" data-category="CSS">CSS</button>
<button class="filter-btn" data-category="HTML">HTML</button>
<button class="filter-btn" data-category="Python">Python</button>
<button class="filter-btn" data-category="其他">其他</button>
</div>
</div>
<!-- 片段列表区域 -->
<div class="snippets-section">
<div class="section-header">
<h3>📚 我的代码片段</h3>
<div class="actions">
<button id="exportBtn" class="btn-small">📎 导出</button>
<button id="importBtn" class="btn-small">📂 导入</button>
<button id="clearAllBtn" class="btn-small danger">🗑️ 清空全部</button>
</div>
</div>
<input type="file" id="importFile" accept=".json" style="display: none;">
<div id="snippetsList" class="snippets-list">
<div class="empty-state">✨ 暂无代码片段<br>点击上方添加你的第一个代码片段</div>
</div>
</div>
<!-- 统计信息 -->
<div class="stats-section">
<span id="statsCount">0</span> 个片段
</div>
</div>
<!-- 复制提示浮层 -->
<div id="copyToast" class="toast">✅ 已复制到剪贴板</div>
<script src="js/snippet-manager.js"></script>
</body>
</html>