This repository was archived by the owner on Nov 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprompt.html
More file actions
155 lines (140 loc) · 4.42 KB
/
prompt.html
File metadata and controls
155 lines (140 loc) · 4.42 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
---
layout: default
title: prompt
description: "「侵权专线」"
header-img: "img/bg-download.jpg"
header-mask: 0.3
---
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<h1 class="my-4">开源prompt文件下载中心</h1>
<div class="search-box">
<input type="text" id="searchInput" class="form-control"
placeholder="根据描述搜索文件...">
</div>
<div class="post-container">
<table class="table table-hover table-bordered">
<thead class="thead-dark">
<tr>
<th>名称</th>
<th> 描述 </th>
<th> 版本 </th>
<th> 作者 </th>
<th> 发布时间 </th>
<th>文件类型</th>
<th>操作</th>
</tr>
</thead>
<tbody id="fileTableBody">
<tr id="loadingRow">
<td colspan="6" class="text-center">加载中...</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<script src="/js/jquery.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script>
// 加载并渲染文件数据
function loadFiles() {
fetch('/data/files.json')
.then(response => response.json())
.then(files => {
renderTable(files);
setupSearch(files);
});
}
// 渲染表格数据
function renderTable(files) {
const tbody = document.getElementById('fileTableBody');
tbody.innerHTML = files.map(file => `
<tr>
<td>${file.name}</td>
<td>${file.ds}</td>
<td>${file.vin}</td>
<td>${file.wrt}</td>
<td>${file.time}</td>
<td>${file.format}</td>
<td>
<a href="${file.url}" class="btn btn-primary btn-sm btn-download" download>
<i class="fa fa-download"></i>
<span>下载</span>
</a>
</td>
</tr>
`).join('');
}
// 设置搜索功能
function setupSearch(files) {
const searchInput = document.getElementById('searchInput');
searchInput.addEventListener('input', function(e) {
const keyword = e.target.value.toLowerCase();
const filtered = files.filter(file =>
file.ds.toLowerCase().includes(keyword) ||
file.name.toLowerCase().includes(keyword)
);
renderTable(filtered);
highlightKeyword(keyword);
});
}
// 高亮搜索关键词
function highlightKeyword(keyword) {
if (!keyword) return;
const cells = document.querySelectorAll('td:nth-child(1), td:nth-child(2)');
cells.forEach(cell => {
const text = cell.innerText;
const regex = new RegExp(`(${keyword})`, 'gi');
cell.innerHTML = text.replace(regex, '<span class="highlight">$1</span>');
});
}
// 初始化加载
window.onload = loadFiles;
</script>
{% if site.disqus_username %}
<!-- 复用about.html的disqus评论系统 -->
<div class="comment">
<div id="disqus_thread" class="disqus-thread"></div>
</div>
{% endif %}
<style>
/* 新增表格尺寸调整样式 */
.table {
font-size: 11px; /* 调大表格字体 */
line-height: 2; /* 增加行高 */
width: 300%; /* 表格宽度占满容器 */
}
.table th,
.table td {
padding: 24px 30px; /* 增大单元格内边距 */
vertical-align: middle;
}
.post-container {
max-width: 10000px; /* 增大表格容器宽度 */
margin: 0 auto;
}
/* 原有下载按钮样式保持不变 */
.btn-download {
padding: 5px 12px;
border-radius: 15px;
transition: all 0.3s ease;
color: #fff !important; /* 强制文字白色 */
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; /* 保持字体统一 */
}
.btn-download i {
margin-right: 5px;
vertical-align: middle; /* 图标文字垂直居中 */
}
.btn-download span {
font-size: 14px; /* 明确字号 */
display: inline-block; /* 解决span元素布局问题 */
}
.btn-download:hover {
transform: translateY(-2px);
box-shadow: 0 2px 6px rgba(0,0,0,0.15);
color: #fff; /* 悬浮保持白色 */
}
</style>