+ 新增L414-5相关物质计算
+ 主页变更日志改为显示10条 + 主页变更日志显示样式优化
This commit is contained in:
21
index.html
21
index.html
@@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh_CN">
|
||||
<html lang="zh-cmn-Hans">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
@@ -8,7 +8,7 @@
|
||||
<link rel="stylesheet" href="./theme.css">
|
||||
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script>
|
||||
let url = "https://api.github.com/repos/hbk01/hbk01.github.io/commits?per_page=5";
|
||||
let url = "https://api.github.com/repos/hbk01/hbk01.github.io/commits?per_page=10";
|
||||
|
||||
let functions = [
|
||||
{
|
||||
@@ -30,11 +30,17 @@
|
||||
{
|
||||
"name": "设备信息",
|
||||
"location": "./equipment.html"
|
||||
},
|
||||
{
|
||||
"name": "L414-5KR 相关物质计算",
|
||||
"location": "./L414-5KR-impurities.html"
|
||||
}
|
||||
];
|
||||
|
||||
$(document).ready(() => {
|
||||
|
||||
var getRandomColor = () => '#' + (Math.random() * 0xffffff << 0).toString(16)
|
||||
|
||||
// 加载功能列表
|
||||
functions.forEach(value => {
|
||||
let div = `<div class="item" onclick="window.location.href='${value.location}'">${value.name}</div>`;
|
||||
@@ -43,13 +49,19 @@
|
||||
|
||||
// 加载最近的 commit 记录
|
||||
$.getJSON(url, data => {
|
||||
let color1 = getRandomColor()
|
||||
let color2 = getRandomColor()
|
||||
let changeColor = false
|
||||
data.forEach(element => {
|
||||
let message = element.commit.message.replace("\n", "<br>");
|
||||
if (message.startsWith("+")) {
|
||||
message = message.replace("+", "");
|
||||
message = message.replace("+", "<br> •");
|
||||
}
|
||||
message = message.replace("+", " •")
|
||||
let time = element.commit.committer.date.slice(0, 10);
|
||||
$(".changelog").append(`${time}: ${message}<br>`);
|
||||
changeColor = !changeColor
|
||||
let msg = `<span style="color: ${changeColor ? color1 : color2}">${time}: ${message}</span><br>`
|
||||
$(".changelog").append(msg);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -62,6 +74,7 @@
|
||||
<div class="list"></div>
|
||||
<h4>关于</h4>
|
||||
<div class="about">
|
||||
<p>建议使用系统自带浏览器,以完善使用体验!</p>
|
||||
本项目开源于
|
||||
<a href="https://github.com/hbk01/hbk01.github.io">Github</a> ,并由
|
||||
<a href="https://docs.github.com/en/pages">Github Pages</a> 提供页面构建及部署服务。
|
||||
|
||||
Reference in New Issue
Block a user