-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproject.html
271 lines (221 loc) · 9.08 KB
/
project.html
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
<!DOCTYPE html>
<html lang="en">
<head>
<!-- 谷歌分析脚本 -->
<!-- 谷歌分析脚本待更新 -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XEN8DSJX72"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'G-XEN8DSJX72');
</script>
<script src="./assets/vendor/sql/sql-wasm.js"></script>
<script src="./assets/js/db/db.js"></script>
<script src="./assets/js/db/project.js"></script>
<meta charset="utf-8">
<!-- 设置视口,使页面在不同设备上自适应屏幕宽度,初始缩放比例为1.0 -->
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<!-- 页面标题 -->
<title>开源项目</title>
<!-- 页面描述 -->
<meta content="" name="description">
<!-- 页面关键词 -->
<meta content="" name="keywords">
<!-- 网站图标 -->
<link href="assets/img/logo/logo.jpeg" rel="icon">
<link href="assets/img/logo/logo.jpeg" rel="apple-touch-icon">
<!-- 引入谷歌字体 -->
<link
href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,700,700i|Raleway:300,400,500,700,800"
rel="stylesheet">
<!-- 引入 css 文件 -->
<link href="assets/vendor/aos/aos.css" rel="stylesheet">
<link href="assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="assets/vendor/bootstrap-icons/bootstrap-icons.css" rel="stylesheet">
<link href="assets/vendor/glightbox/css/glightbox.min.css" rel="stylesheet">
<link href="assets/vendor/swiper/swiper-bundle.min.css" rel="stylesheet">
<link href="assets/css/style.css" rel="stylesheet">
<link href="assets/css/committee.css" rel="stylesheet">
<link href="assets/css/project.css" rel="stylesheet">
<!-- Template Main CSS File -->
<script src="assets/js/jquery.min.js"></script>
</head>
<body>
<header id="header" class="d-flex align-items-center">
<div class="container-fluid container-xxl d-flex align-items-center">
<!-- 网站 logo -->
<div id="logo" class="me-auto row">
<a href="index.html" class="scrollto"><img src="assets/img/logo/logo-1.png" alt="" title=""></a>
</div>
<!-- 导航栏 -->
<nav id="navbar" class="navbar order-last order-lg-0">
<ul>
<li><a class="nav-link scrollto" href="index.html">首页</a></li>
<li><a class="nav-link scrollto" href="activity_category.html">学术活动</a></li>
<li><a class="nav-link scrollto active" href="project.html">开源项目</a></li>
<li><a class="nav-link scrollto" href="committee.html">社区成员</a></li>
<li><a class="nav-link scrollto" href="#footer">联系我们</a></li>
</ul>
<!-- 移动端导航切换图标 -->
<i class="bi bi-list mobile-nav-toggle"></i>
</nav>
</div>
</header>
<main id="main">
<section id="project" class="section-with-bg">
<div class="container">
<div id="project-title" class="section-header" data-aos="fade-up">
<p>Open Source Projects</p>
<h2>开源项目</h2>
<!-- <p id="project-title-tip">(按照姓名排序)</p>-->
</div>
<div id="project-container" class="section team">
<div class="tab-content container row justify-content-center aos-init aos-animate" data-aos="fade-up" data-aos-delay="200">
<div role="tabpanel" class="col-lg-11 tab-pane fade show active">
<div id="project-container-data" class="waterfall-container" data-aos="fade-up" >
</div>
</div>
</div>
</div>
</div>
</section>
</main>
<script>
// 页面加载完成后执行获取数据的操作
window.onload = async function () {
await initProjects();
};
/**
* 初始化开源项目信息。
*/
async function initProjects() {
try {
const result = await findAllProjects();
let html_str_list = [];
for (let i = 0; i < result.length; i++) {
project = result[i];
console.log(project)
html_str_list.push(`
<div class="waterfall-item d-flex align-items-stretch schedule-card">
<a class="project aos-init aos-animate" target="_blank" href="${project.html_url}">
<div class="row">
<div class="col-auto">
<i class="bi bi-github bi-github-info"></i>
</div>
<div class="project-info col">
<h4 class="project-name">${project.title}</h4>
<span class="project-description">${project.description}</span>
<div class="project-repo row">
<img alt="" src="https://img.shields.io/github/stars/${project.github_repo}?color=FF8000" />
<img alt="" src="https://img.shields.io/github/forks/${project.github_repo}?color=FF8000" />
</div>
</div>
</div>
</a>
</div>
`);
}
html_str_list.push(`</div></div></div>`);
const html_str = html_str_list.join('');
const parentContainer = document.getElementById('project-container-data');
parentContainer.innerHTML = html_str;
// 分配到多个列中
const columnCount = 2;
const columns = Array.from({ length: columnCount }, () => ({
height: 0,
children: [],
}));
const items = document.querySelectorAll('.waterfall-item');
items.forEach((item) => {
// 获取当前元素的高度
const itemHeight = item.offsetHeight;
// 找到高度最小的列
let minHeightColumnIndex = 0;
for (let i = 1; i < columns.length; i++) {
if (columns[i].height < columns[minHeightColumnIndex].height) {
minHeightColumnIndex = i;
}
}
// 将元素添加到高度最小的列
columns[minHeightColumnIndex].children.push(item);
columns[minHeightColumnIndex].height += itemHeight;
});
console.log(columns)
// 渲染到 DOM
columns.forEach((column, index) => {
const columnContainer = document.createElement('div');
columnContainer.className = `waterfall-column column-${index} col-6`;
column.children.forEach((item) => {
columnContainer.appendChild(item);
});
parentContainer.appendChild(columnContainer);
});
} catch (error) {
console.error('Error fetching seminar data:', error);
}
}
</script>
<footer id="footer">
<div class="footer-top">
<div class="container">
<div class="row">
<div class="col-lg-3 col-md-4 footer-info">
<img src="assets/img/logo/logo-footnote.png" alt="MLNLP">
<p>
MLNLP社区的愿景是促进国内外自然语言处理,机器学习学术界、产业界和广大爱好者之间的交流和进步,特别是初学者同学们的进步。</p>
</div>
<div class="col-lg-2 col-md-4 footer-wechat">
<h4>微信公众号</h4>
<img src="assets/img/qrcode/wechat.jpg" alt="MLNLP_wechat">
</div>
<div class="col-lg-2 col-md-4 footer-wechat">
<h4>Github</h4>
<img src="assets/img/qrcode/github.png" alt="MLNLP_wechat">
</div>
<div class="col-lg-2 col-md-4 footer-wechat">
<h4>Bilibili</h4>
<img src="assets/img/qrcode/bilibili.png" alt="MLNLP_wechat">
</div>
<div class="col-lg-2 col-md-6 footer-contact">
<h4>联系我们</h4>
<p>
<strong>邮箱:</strong><a href="mailto:contact@mlnlp2023.com"
style="color: #ffffff;">mlnlp2021@163.com</a><br>
</p>
<div class="social-links">
<a href="https://mp.weixin.qq.com/s/mRXbfm4aJQb0FMB6YQy1QQ" class="wechat"
target="_blank"><i class="bi bi-wechat"></i></a>
<a href="https://github.com/MLNLP-World" class="github" target="_blank"><i
class="bi bi-github"></i></a>
<a href="https://space.bilibili.com/168887299" class="bilibili" target="_blank"><i><img
src="assets/img/logo/bilibili-fill.svg" alt="Bootstrap" width="20"
height="20"></i></a>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="copyright">
© Copyright <strong>TheEvent</strong>. Modified by <strong>MLNLP</strong>. All Rights Reserved
</div>
<div class="credits">
Designed by <a href="https://bootstrapmade.com/">BootstrapMade</a>
</div>
</div>
</footer>
<a href="#" class="back-to-top d-flex align-items-center justify-content-center"><i
class="bi bi-arrow-up-short"></i></a>
<!-- Vendor JS Files -->
<script src="assets/vendor/aos/aos.js"></script>
<script src="assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="assets/vendor/glightbox/js/glightbox.min.js"></script>
<script src="assets/vendor/swiper/swiper-bundle.min.js"></script>
<script src="assets/vendor/php-email-form/validate.js"></script>
<!-- Template Main JS File -->
<script src="assets/js/main.js"></script>
</body>
</html>