This repository has been archived by the owner on Jan 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
67 lines (66 loc) · 2.66 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Alan-Liang Today</title>
<link rel="shortcut icon" href="/identicon.png">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@material/[email protected]/dist/mdc.button.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@material/[email protected]/dist/mdc.top-app-bar.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@material/[email protected]/dist/mdc.typography.min.css">
<link rel="stylesheet" href="/styles.css">
</head>
<body class="mdc-typography">
<header class="mdc-top-app-bar mdc-top-app-bar--fixed">
<div class="mdc-top-app-bar__row">
<section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-start">
<span id="logo-wrapper">
<img id="header-logo" src="/identicon.png" />
</span>
<span class="mdc-typography--headline6 title">Alan-Liang Today</span>
</section>
</div>
</header>
<main class="mdc-top-app-bar--fixed-adjust" id="main">
<p class="mdc-typography--body1">加载中……</p>
</main>
<script src="https://cdn.jsdelivr.net/npm/@alan-liang/utils/utils.js"></script>
<script language="x/template" id="template">
<div id="{{id}}">
<h1 class="mdc-typography--headline5">{{id}}</h1>
<p class="mdc-typography--body1">
{{content}}
</p>
<a href="/comments/?id={{id}}&">评论</a>
</div>
</script>
<script>
httpget('/log', function(_, resp) {
var logs = resp.split(/\r?\n\r?\n/)
var t = $('template').innerHTML
var html = ''
for(var i = 0; i < logs.length; i++) {
var log = logs[i].split(/\r?\n/)
var title = log[0]
log[0] = ''
html += template(t, {
id: title,
content: log.join('\n')
})
}
$('main').innerHTML = html
setTimeout(function () {
window.scrollTo(0, $(location.hash.replace('#', '')).offsetTop);
}, 1);
})
window.GoogleAnalyticsObject = 'ga'
window.ga = window.ga || function() {
;(window.ga.q = window.ga.q || []).push(arguments)
}
window.ga.l = 1 * new Date()
ga('create', 'UA-135036985-3', 'auto')
ga('send', 'pageview')
</script>
<script async src="https://www.google-analytics.com/analytics.js"></script>
</body>
</html>