no-style-please2 0.8.1 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_config.yml +3 -1
- data/_includes/head.html +2 -6
- data/_includes/heatmap.html +59 -0
- data/_includes/heatmap.js +375 -0
- data/_layouts/heatmap.html +61 -0
- data/_sass/heatmap.scss +217 -0
- data/_sass/no-style-please.scss +2 -1
- data/assets/css/main.scss +1 -2
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31940b0c8a705c64cab919daccb6dc915abbbfde6bc285a5d98c4489c1f6caaf
|
4
|
+
data.tar.gz: e574b7847b53a4c8ba85b8f05bc9a9e8eb707a3c590efdf3c9a17125fd07532c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8c196d08edd074df4b2153411233456c2e73b2a86f42f33ae61f8eb4e311a24237a1ab757ce742f40062c5e6bc1e8140dd127581d9abb03004590e63d3abbe3
|
7
|
+
data.tar.gz: 1628ace63e55094056a08e44c9a913445291667e1a495b95a1ff67f308046acb29407dbf688e5828005686d88f625e86f12742573a6231cbc311cb58d178bd83
|
data/_config.yml
CHANGED
@@ -6,7 +6,9 @@ baseurl: "/no-style-please" # subpath of the site, e.g. "/blog" (leave it blank
|
|
6
6
|
description: > # description of the site (multiple lines allowed)
|
7
7
|
A (nearly) no-CSS, fast, minimalist Jekyll theme.
|
8
8
|
|
9
|
-
destination:
|
9
|
+
destination: docs
|
10
|
+
|
11
|
+
permalink: "/post/:year/:month/:day/:title:output_ext"
|
10
12
|
|
11
13
|
|
12
14
|
favicon: "logo.png" # name+extension of favicon (which must be put on the root folder)
|
data/_includes/head.html
CHANGED
@@ -23,13 +23,9 @@
|
|
23
23
|
{% endif %}
|
24
24
|
|
25
25
|
<link rel="shortcut icon" type="image/x-icon" href="{{ site.favicon | relative_url }}" />
|
26
|
-
|
27
|
-
<style>
|
28
|
-
{%- include main.css -%}
|
29
|
-
</style>
|
30
|
-
{% else %}
|
26
|
+
|
31
27
|
<link rel="stylesheet" href="{{ "/assets/css/main.css" | relative_url }}" />
|
32
|
-
|
28
|
+
|
33
29
|
|
34
30
|
|
35
31
|
</head>
|
@@ -0,0 +1,59 @@
|
|
1
|
+
<div>
|
2
|
+
{%- if include.collection -%}
|
3
|
+
{%- assign posts = include.collection -%}
|
4
|
+
{%- else -%}
|
5
|
+
{%- assign posts = site.posts -%}
|
6
|
+
{%- endif -%}
|
7
|
+
|
8
|
+
{% if datemapidOnPage == nil %}
|
9
|
+
{%- assign datemapidOnPage = 0 -%}
|
10
|
+
{%- else -%}
|
11
|
+
{%- assign datemapidOnPage = datemapidOnPage | plus : 1-%}
|
12
|
+
|
13
|
+
{%- endif -%}
|
14
|
+
|
15
|
+
|
16
|
+
{% assign mapEleId = "heatmap-" | append: datemapidOnPage %}
|
17
|
+
<div class="heatmap-title">{{ include.title | default :"" }}</div>
|
18
|
+
|
19
|
+
<div class='heatmap' id="{{mapEleId}}">
|
20
|
+
|
21
|
+
</div>
|
22
|
+
{%- if datemapidOnPage == 0 -%}
|
23
|
+
|
24
|
+
{% comment %}
|
25
|
+
只加载一次
|
26
|
+
{% endcomment %}
|
27
|
+
<script >
|
28
|
+
function create_heatmap(heatmapid,endYear){
|
29
|
+
|
30
|
+
{%- assign MothStr = site.theme_config.heatMapMonth -%}
|
31
|
+
{%- assign HeatMapShowWeek = site.theme_config.heatMapShowWeek -%}
|
32
|
+
{%- assign heatMapLoadCount = site.theme_config.heatMapLoadCount | default: 8 -%}
|
33
|
+
|
34
|
+
const WeeKStartStr = "{{ site.theme_config.heatMapWeekStart | default: 0 }}" ;// 0 sunday 1 monday 2. tuesday ...
|
35
|
+
|
36
|
+
const heatMapLoadCount = {{heatMapLoadCount}};
|
37
|
+
var _MonthStr = '{{ MothStr | default: "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec" }}';
|
38
|
+
var _showWeek = '{{ HeatMapShowWeek | default: "Sun Mon Tue Wed Thu Fri Sat" }}';
|
39
|
+
var _allyearurl = '{{ "assets/dyn/allyear.json" | relative_url }}';
|
40
|
+
{% include heatmap.js %}
|
41
|
+
}
|
42
|
+
</script>
|
43
|
+
|
44
|
+
{% else %}
|
45
|
+
|
46
|
+
{%- endif -%}
|
47
|
+
|
48
|
+
|
49
|
+
{{child_initialized}}
|
50
|
+
|
51
|
+
<script>
|
52
|
+
!function(){
|
53
|
+
var endYear = "{{ include.endYear }}"
|
54
|
+
var mapid = "{{ mapEleId }}"
|
55
|
+
create_heatmap(mapid,endYear )
|
56
|
+
}()
|
57
|
+
</script>
|
58
|
+
|
59
|
+
</div>
|
@@ -0,0 +1,375 @@
|
|
1
|
+
;!(function () {
|
2
|
+
|
3
|
+
const WeeKStart = parseInt(WeeKStartStr)
|
4
|
+
|
5
|
+
|
6
|
+
var GDATA = window._G_DATA;
|
7
|
+
if (!GDATA) {
|
8
|
+
GDATA = {}
|
9
|
+
window._G_DATA = GDATA
|
10
|
+
}
|
11
|
+
|
12
|
+
|
13
|
+
function date2ymd(t) {
|
14
|
+
let m = t.getMonth() + 1;
|
15
|
+
let d = t.getDate();
|
16
|
+
return `${t.getFullYear()}-${m < 10 ? "0" + m : m}-${d < 10 ? "0" + d : d}`;
|
17
|
+
}
|
18
|
+
|
19
|
+
const todayYmd = date2ymd(new Date())
|
20
|
+
const strictMod = endYear && endYear.length == 4;
|
21
|
+
const maxDateYmd = `${endYear}-12-31`
|
22
|
+
const dateEnd =
|
23
|
+
endYear && endYear.length == 4 ? new Date(maxDateYmd) : new Date();
|
24
|
+
|
25
|
+
const endStamp = dateEnd.getTime();
|
26
|
+
const dayEleId = Math.random().toString(16).substring(2);
|
27
|
+
let arr = _allyearurl.split("/");
|
28
|
+
arr.pop();
|
29
|
+
const jsonUrlBase = arr.join("/");
|
30
|
+
|
31
|
+
const nLastColumnCount = (dateEnd.getDay() - WeeKStart + 7) % 7 + 1
|
32
|
+
const ColumnsCount = 53;
|
33
|
+
const RowCount = 7;
|
34
|
+
const DayCount = (ColumnsCount - 1) * RowCount + nLastColumnCount;
|
35
|
+
|
36
|
+
let queue = window._y_queue || []
|
37
|
+
window._y_queue = queue;
|
38
|
+
|
39
|
+
|
40
|
+
function getAllYearCfg(){
|
41
|
+
|
42
|
+
|
43
|
+
if (GDATA['_allYear']) {
|
44
|
+
return GDATA['_allYear'];
|
45
|
+
}
|
46
|
+
|
47
|
+
if (window._isFetchAllYearData == 1) {
|
48
|
+
return new Promise(r=>{
|
49
|
+
queue.push(r);
|
50
|
+
})
|
51
|
+
}
|
52
|
+
|
53
|
+
|
54
|
+
window._isFetchAllYearData = 1;
|
55
|
+
return fetch(_allyearurl)
|
56
|
+
.then((r) => r.json())
|
57
|
+
.then(d => {
|
58
|
+
window._isFetchAllYearData = 0;
|
59
|
+
if (queue.length) {
|
60
|
+
queue.forEach(calback=>{calback(d)});
|
61
|
+
queue.length = 0;
|
62
|
+
}
|
63
|
+
GDATA['_allYear'] = d ;return d ;})
|
64
|
+
}
|
65
|
+
!(function fillData() {
|
66
|
+
let year = "" + dateEnd.getFullYear();
|
67
|
+
let preYear = "" + (year - 1);
|
68
|
+
getAllYearCfg()
|
69
|
+
.then((d) => {
|
70
|
+
let yearCfg = d;
|
71
|
+
let arr = [];
|
72
|
+
if (yearCfg[year]) {
|
73
|
+
arr.push(getYearData(year));
|
74
|
+
}
|
75
|
+
|
76
|
+
if (yearCfg[preYear]) {
|
77
|
+
arr.push(getYearData(preYear));
|
78
|
+
}
|
79
|
+
Promise.all(arr).then((alldata) => {
|
80
|
+
let combineData = {};
|
81
|
+
let d1 = alldata[0];
|
82
|
+
let d2 = alldata[1];
|
83
|
+
|
84
|
+
for (const key in d1) {
|
85
|
+
if (Object.prototype.hasOwnProperty.call(d1, key)) {
|
86
|
+
const element = d1[key];
|
87
|
+
let keyNew = "K1-" + key;
|
88
|
+
combineData[keyNew] = element;
|
89
|
+
}
|
90
|
+
}
|
91
|
+
|
92
|
+
for (const key in d2) {
|
93
|
+
if (Object.prototype.hasOwnProperty.call(d2, key)) {
|
94
|
+
const element = d2[key];
|
95
|
+
let keyNew = "K2-" + key;
|
96
|
+
combineData[keyNew] = element;
|
97
|
+
}
|
98
|
+
}
|
99
|
+
|
100
|
+
updateCell(combineData);
|
101
|
+
});
|
102
|
+
});
|
103
|
+
|
104
|
+
function getIndex(ymd) {
|
105
|
+
return (
|
106
|
+
DayCount -
|
107
|
+
Math.floor((endStamp - new Date(ymd).getTime()) / (24 * 3600000)) -
|
108
|
+
1
|
109
|
+
);
|
110
|
+
}
|
111
|
+
|
112
|
+
function idx2Ymd(idx) {
|
113
|
+
let t = new Date(endStamp - (DayCount - 1 - idx) * 3600000 * 24);
|
114
|
+
let m = t.getMonth() + 1;
|
115
|
+
let d = t.getDate();
|
116
|
+
return `${t.getFullYear()}-${m < 10 ? "0" + m : m}-${
|
117
|
+
d < 10 ? "0" + d : d
|
118
|
+
}`;
|
119
|
+
}
|
120
|
+
|
121
|
+
function updateCell(data) {
|
122
|
+
if (!data) return;
|
123
|
+
|
124
|
+
|
125
|
+
let daysEle = document.getElementById(dayEleId);
|
126
|
+
let dayCells = daysEle.childNodes;
|
127
|
+
|
128
|
+
let Map = {};
|
129
|
+
|
130
|
+
for (const key in data) {
|
131
|
+
if (Object.prototype.hasOwnProperty.call(data, key)) {
|
132
|
+
const element = data[key];
|
133
|
+
if (Array.isArray(element)) {
|
134
|
+
element.forEach((e) => {
|
135
|
+
if (e.date && e.title && e.url) {
|
136
|
+
let arr = Map[e.date];
|
137
|
+
if (!arr) {
|
138
|
+
arr = [];
|
139
|
+
Map[e.date] = arr;
|
140
|
+
}
|
141
|
+
arr.push(e);
|
142
|
+
}
|
143
|
+
});
|
144
|
+
}
|
145
|
+
}
|
146
|
+
}
|
147
|
+
|
148
|
+
let ymdArr = [];
|
149
|
+
|
150
|
+
for (const dateKeyYmd in Map) {
|
151
|
+
if (Object.prototype.hasOwnProperty.call(Map, dateKeyYmd)) {
|
152
|
+
ymdArr.push(dateKeyYmd);
|
153
|
+
}
|
154
|
+
}
|
155
|
+
|
156
|
+
var G_idxOfDay = DayCount - 1;
|
157
|
+
|
158
|
+
function shuffle(array) {
|
159
|
+
let currentIndex = array.length;
|
160
|
+
|
161
|
+
// While there remain elements to shuffle...
|
162
|
+
while (currentIndex != 0) {
|
163
|
+
// Pick a remaining element...
|
164
|
+
let randomIndex = Math.floor(Math.random() * currentIndex);
|
165
|
+
currentIndex--;
|
166
|
+
|
167
|
+
// And swap it with the current element.
|
168
|
+
[array[currentIndex], array[randomIndex]] = [
|
169
|
+
array[randomIndex],
|
170
|
+
array[currentIndex],
|
171
|
+
];
|
172
|
+
}
|
173
|
+
}
|
174
|
+
|
175
|
+
const SEQ = new Array(DayCount);
|
176
|
+
let tmp = DayCount;
|
177
|
+
while (tmp-- > 0) {
|
178
|
+
SEQ[tmp] = tmp;
|
179
|
+
}
|
180
|
+
|
181
|
+
shuffle(SEQ);
|
182
|
+
|
183
|
+
const minYmd = `${endYear - 1}${maxDateYmd.substring(4)}`
|
184
|
+
function update1Day() {
|
185
|
+
if (G_idxOfDay < 0) {
|
186
|
+
return;
|
187
|
+
}
|
188
|
+
const idxOfDay = SEQ[G_idxOfDay--];
|
189
|
+
let dateKeyYmd = idx2Ymd(idxOfDay);
|
190
|
+
let arrPostInOneDay = Map[dateKeyYmd];
|
191
|
+
|
192
|
+
let hideblock = false
|
193
|
+
if (strictMod) {
|
194
|
+
hideblock = dateKeyYmd <= minYmd;
|
195
|
+
}
|
196
|
+
|
197
|
+
let isFuture = dateKeyYmd > todayYmd;
|
198
|
+
|
199
|
+
const dayCell = dayCells[idxOfDay];
|
200
|
+
if (hideblock) {
|
201
|
+
dayCell.classList = 'heatmap-day-cell hm-check-notyet'
|
202
|
+
}else if(isFuture){
|
203
|
+
dayCell.classList = parseInt(dateKeyYmd.substring(5, 7)) % 2 == 1 ? 'heatmap-day-cell hm-check-future-b' : 'heatmap-day-cell hm-check-future-a'
|
204
|
+
}
|
205
|
+
else{
|
206
|
+
|
207
|
+
const nobg =
|
208
|
+
parseInt(dateKeyYmd.substring(5, 7)) % 2 == 1
|
209
|
+
? "hm-check-no-b"
|
210
|
+
: "hm-check-no-a";
|
211
|
+
dayCell.classList = `heatmap-day-cell ${
|
212
|
+
!arrPostInOneDay
|
213
|
+
? nobg
|
214
|
+
: arrPostInOneDay.length > 1
|
215
|
+
? "hm-check2"
|
216
|
+
: "hm-check"
|
217
|
+
}`;
|
218
|
+
|
219
|
+
if (arrPostInOneDay && arrPostInOneDay.length > 0) {
|
220
|
+
let isDirectly = arrPostInOneDay.length == 1;
|
221
|
+
let tip = document.createElement("div");
|
222
|
+
|
223
|
+
if (isDirectly) {
|
224
|
+
let lnk = document.createElement("a");
|
225
|
+
lnk.href = arrPostInOneDay[0].url;
|
226
|
+
dayCell.appendChild(lnk);
|
227
|
+
}
|
228
|
+
|
229
|
+
tip.className = "hm-tip";
|
230
|
+
let desc = "";
|
231
|
+
arrPostInOneDay.forEach((element) => {
|
232
|
+
let lnk = document.createElement("a");
|
233
|
+
lnk.className = "hm-tiplink";
|
234
|
+
lnk.href = element.url;
|
235
|
+
tip.appendChild(lnk);
|
236
|
+
|
237
|
+
let t = document.createElement("span");
|
238
|
+
t.className = "hm-date";
|
239
|
+
t.innerText = dateKeyYmd.substring(5);
|
240
|
+
lnk.appendChild(t);
|
241
|
+
|
242
|
+
let t2 = document.createElement("span");
|
243
|
+
t2.className = "hm-title";
|
244
|
+
t2.innerText = element.title;
|
245
|
+
lnk.appendChild(t2);
|
246
|
+
});
|
247
|
+
dayCell.appendChild(tip);
|
248
|
+
}
|
249
|
+
}
|
250
|
+
|
251
|
+
|
252
|
+
}
|
253
|
+
|
254
|
+
function updateMultiDays() {
|
255
|
+
let day = heatMapLoadCount;
|
256
|
+
if (!day || day <= 0) {
|
257
|
+
day = 8;
|
258
|
+
}
|
259
|
+
while (day--) {
|
260
|
+
update1Day();
|
261
|
+
}
|
262
|
+
|
263
|
+
if (G_idxOfDay >= 0) {
|
264
|
+
requestAnimationFrame(updateMultiDays);
|
265
|
+
}
|
266
|
+
}
|
267
|
+
requestAnimationFrame(updateMultiDays);
|
268
|
+
|
269
|
+
return;
|
270
|
+
}
|
271
|
+
|
272
|
+
function getYearData(year) {
|
273
|
+
year = '' + year
|
274
|
+
|
275
|
+
|
276
|
+
if(GDATA[year]){
|
277
|
+
|
278
|
+
return GDATA[year]
|
279
|
+
}
|
280
|
+
|
281
|
+
let queueFlgKey = '_singleyearFlg' + year
|
282
|
+
let queueArrKey = '_singleyearQueue' + year
|
283
|
+
if (GDATA[queueFlgKey] == 1) {
|
284
|
+
// console.log('put in queue',year,Math.random())
|
285
|
+
let arrQueue = GDATA[queueArrKey]
|
286
|
+
if (!arrQueue) {
|
287
|
+
arrQueue = []
|
288
|
+
GDATA[queueArrKey] = arrQueue;
|
289
|
+
}
|
290
|
+
|
291
|
+
return new Promise(r=>{
|
292
|
+
arrQueue.push(r);
|
293
|
+
});
|
294
|
+
}
|
295
|
+
|
296
|
+
|
297
|
+
GDATA[queueFlgKey] = 1;
|
298
|
+
// console.log('RealQuery',year,Math.random())
|
299
|
+
return fetch(`${jsonUrlBase}/${year}.json`)
|
300
|
+
.then((r) => r.json())
|
301
|
+
.then(d=>{
|
302
|
+
GDATA[queueFlgKey] = 0 ;GDATA[year] = d;
|
303
|
+
let queue = GDATA[queueArrKey];
|
304
|
+
// console.log('queryFinish',year)
|
305
|
+
if(queue && queue.length){
|
306
|
+
queue.forEach(cb=>{
|
307
|
+
// console.log('queryFinishQueue',year,queue.length,Math.random());
|
308
|
+
cb(d);})
|
309
|
+
queue.length = 0;
|
310
|
+
GDATA[queueArrKey] = undefined
|
311
|
+
}
|
312
|
+
|
313
|
+
return d})
|
314
|
+
.catch((e) => {
|
315
|
+
return null;
|
316
|
+
});
|
317
|
+
}
|
318
|
+
})();
|
319
|
+
(function initMap() {
|
320
|
+
let Father = document.getElementById(heatmapid);
|
321
|
+
|
322
|
+
const Frag = document.createDocumentFragment();
|
323
|
+
|
324
|
+
const monthEle = document.createElement("div");
|
325
|
+
monthEle.className = "heatmap-month";
|
326
|
+
Frag.appendChild(monthEle);
|
327
|
+
const monthStr = _MonthStr.split(" ");
|
328
|
+
|
329
|
+
let nowM = dateEnd.getMonth();
|
330
|
+
let nowWeekIdx = nLastColumnCount - 1;
|
331
|
+
|
332
|
+
for (let i = 0; i < monthStr.length; i++) {
|
333
|
+
let m = document.createElement("span");
|
334
|
+
m.className = "heatmap-month-cell";
|
335
|
+
m.innerHTML = `${monthStr[(i + nowM + 1) % 12]}`;
|
336
|
+
monthEle.appendChild(m);
|
337
|
+
}
|
338
|
+
|
339
|
+
const weekEle = document.createElement("div");
|
340
|
+
weekEle.className = "heatmap-week";
|
341
|
+
const WeekStr = _showWeek.split(" ");
|
342
|
+
|
343
|
+
for (let i = 0; i < WeekStr.length; i++) {
|
344
|
+
const idx = (i + WeeKStart) % 7
|
345
|
+
let m = document.createElement("div");
|
346
|
+
m.className = "heatmap-week-cell";
|
347
|
+
m.innerHTML = i % 2 ? `<span>${WeekStr[idx]}</span>` : ''
|
348
|
+
weekEle.appendChild(m);
|
349
|
+
}
|
350
|
+
|
351
|
+
Frag.appendChild(weekEle);
|
352
|
+
|
353
|
+
const dayEle = document.createElement("div");
|
354
|
+
|
355
|
+
dayEle.className = "heatmap-day";
|
356
|
+
dayEle.id = dayEleId;
|
357
|
+
|
358
|
+
// console.log(nowWeekIdx, firstDateDayDiff);
|
359
|
+
|
360
|
+
for (let c = 0; c < ColumnsCount; c++) {
|
361
|
+
for (let r = 0; r < RowCount; r++) {
|
362
|
+
if (r > nowWeekIdx && c == ColumnsCount - 1) {
|
363
|
+
break;
|
364
|
+
}
|
365
|
+
|
366
|
+
let m = document.createElement("span");
|
367
|
+
m.classList = `heatmap-day-cell hm-check-nodata`;
|
368
|
+
dayEle.appendChild(m);
|
369
|
+
}
|
370
|
+
}
|
371
|
+
|
372
|
+
Frag.appendChild(dayEle);
|
373
|
+
Father.append(Frag);
|
374
|
+
})();
|
375
|
+
})();
|
@@ -0,0 +1,61 @@
|
|
1
|
+
---
|
2
|
+
layout: default
|
3
|
+
---
|
4
|
+
|
5
|
+
<br/><br/><br/>
|
6
|
+
{%- include heatmap.html -%}
|
7
|
+
|
8
|
+
|
9
|
+
{% comment %}
|
10
|
+
generate this page only once。
|
11
|
+
{% endcomment %}
|
12
|
+
{% assign ALLJSON = "{" %}
|
13
|
+
|
14
|
+
{% assign postsByYear = site.posts | group_by_exp: "post", "post.date | date: '%Y' " %}
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
{%- for post in postsByYear -%}
|
19
|
+
{%- capture kv %}
|
20
|
+
"{{ post.name }}":1
|
21
|
+
{%- unless forloop.last -%},
|
22
|
+
{%- endunless -%}
|
23
|
+
{%- endcapture -%}
|
24
|
+
{% assign ALLJSON = ALLJSON | append:kv %}
|
25
|
+
|
26
|
+
|
27
|
+
{% assign itemM = post.items | group_by_exp: "post", "post.date | date: '%m' " %}
|
28
|
+
|
29
|
+
{%- capture SingleYearJson -%}
|
30
|
+
{
|
31
|
+
"year":"{{post.name}}",
|
32
|
+
{%- for item0 in itemM %}
|
33
|
+
"{{item0.name }}":
|
34
|
+
[
|
35
|
+
{%- for item00 in item0.items -%}
|
36
|
+
{
|
37
|
+
"title":"{{ item00.title | replace: '"', ' '}}",
|
38
|
+
"url":"{{ item00.url | relative_url}}",
|
39
|
+
"date": "{{ item00.date | date:"%Y-%m-%d"}}"
|
40
|
+
}{%- unless forloop.last -%},{%- endunless -%}
|
41
|
+
{%- endfor -%}
|
42
|
+
]
|
43
|
+
{%- unless forloop.last -%},{%- endunless -%}
|
44
|
+
{%- endfor -%}
|
45
|
+
}
|
46
|
+
{%- endcapture -%}
|
47
|
+
|
48
|
+
{%- capture FILENAME -%}
|
49
|
+
assets/dyn/{{post.name}}.json
|
50
|
+
{%- endcapture -%}
|
51
|
+
|
52
|
+
{{ SingleYearJson | write_file: FILENAME }}
|
53
|
+
{%- endfor -%}
|
54
|
+
|
55
|
+
{% assign ALLJSON = ALLJSON | append: " }" %}
|
56
|
+
{{ ALLJSON | write_file: "assets/dyn/allyear.json" }}
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
<br>
|
61
|
+
{{ content }}
|
data/_sass/heatmap.scss
ADDED
@@ -0,0 +1,217 @@
|
|
1
|
+
|
2
|
+
$color-red: #FF0000;
|
3
|
+
$color-black: #333;
|
4
|
+
$color-blue: #0064c1;
|
5
|
+
$color-hove: #0064c1;
|
6
|
+
$color-gray: #9ca3af;
|
7
|
+
$color-lightGray: #9ca3af;
|
8
|
+
$color-lightGrayBg: #F0f2f4;
|
9
|
+
|
10
|
+
$dbgBorder:none;//ssolid 1px red;
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
$hmbloksizeH:13px;
|
16
|
+
$dayGap:1px;
|
17
|
+
$heatFont:Georgia,"Nimbus Roman No9 L","Songti SC",STSong,"AR PL New Sung","AR PL SungtiL GB",NSimSun,SimSun,"TW\-Sung","WenQuanYi Bitmap Song","AR PL UMing CN","AR PL UMing HK","AR PL UMing TW","AR PL UMing TW MBE",sans-serif;
|
18
|
+
|
19
|
+
.heatmap{
|
20
|
+
display: grid;
|
21
|
+
grid-template-rows: auto 1fr;
|
22
|
+
grid-template-columns: auto 1fr;
|
23
|
+
max-width: 640px;
|
24
|
+
}
|
25
|
+
|
26
|
+
.heatmap-title{
|
27
|
+
color: $color-black;
|
28
|
+
font-size: 1.6rem;
|
29
|
+
font-weight: 600;
|
30
|
+
padding:3rem 0rem 0.2rem 0;
|
31
|
+
}
|
32
|
+
|
33
|
+
|
34
|
+
.heatmap-month{
|
35
|
+
|
36
|
+
grid-column-start: 2;
|
37
|
+
grid-column-end: 3;
|
38
|
+
|
39
|
+
display: grid;
|
40
|
+
grid-template-columns: repeat(12,1fr);
|
41
|
+
|
42
|
+
border: $dbgBorder;
|
43
|
+
|
44
|
+
}
|
45
|
+
|
46
|
+
|
47
|
+
.heatmap-month-cell{
|
48
|
+
display: flex;
|
49
|
+
align-items: center;
|
50
|
+
justify-content: center;
|
51
|
+
|
52
|
+
font-family: $heatFont;
|
53
|
+
font-size: 0.8rem;
|
54
|
+
|
55
|
+
height: 12px;
|
56
|
+
|
57
|
+
padding: 0.2em 0;
|
58
|
+
|
59
|
+
}
|
60
|
+
|
61
|
+
|
62
|
+
.heatmap-week{
|
63
|
+
|
64
|
+
grid-row-start: 2;
|
65
|
+
grid-row-end: 3;
|
66
|
+
display: grid;
|
67
|
+
// grid-template-rows:repeat(4,1fr);
|
68
|
+
|
69
|
+
|
70
|
+
grid-auto-flow: row;
|
71
|
+
height: $hmbloksizeH * 7 + $dayGap * 6;
|
72
|
+
}
|
73
|
+
|
74
|
+
|
75
|
+
.heatmap-week-cell{
|
76
|
+
display: flex;
|
77
|
+
align-items: center;
|
78
|
+
justify-content: center;
|
79
|
+
padding-right: 0.2em;
|
80
|
+
font-size: 0.8rem;
|
81
|
+
font-family: $heatFont;
|
82
|
+
line-height: $hmbloksizeH;
|
83
|
+
height: $hmbloksizeH;
|
84
|
+
}
|
85
|
+
|
86
|
+
.heatmap-day{
|
87
|
+
|
88
|
+
display: grid;
|
89
|
+
grid-template-columns: repeat(53,1fr);
|
90
|
+
grid-template-rows: repeat(7,1fr);
|
91
|
+
grid-auto-flow: column;
|
92
|
+
gap: $dayGap;
|
93
|
+
}
|
94
|
+
|
95
|
+
.heatmap-day-cell{
|
96
|
+
|
97
|
+
border-radius: 2px;
|
98
|
+
// height: 20px;
|
99
|
+
// width: $hmbloksizeW;
|
100
|
+
height: $hmbloksizeH;
|
101
|
+
}
|
102
|
+
|
103
|
+
.heatmap-day-cell a{
|
104
|
+
height: 100%;
|
105
|
+
width: 100%;
|
106
|
+
display: block;
|
107
|
+
white-space: nowrap;
|
108
|
+
overflow:hidden;
|
109
|
+
}
|
110
|
+
|
111
|
+
|
112
|
+
.hm-check-nodata{
|
113
|
+
background-color: #93d5dc;
|
114
|
+
}
|
115
|
+
|
116
|
+
.hm-check{
|
117
|
+
background-color: #40c463bb;
|
118
|
+
position: relative;
|
119
|
+
cursor: pointer;
|
120
|
+
}
|
121
|
+
|
122
|
+
.hm-check2{
|
123
|
+
background-color: #40c463ff;
|
124
|
+
position: relative;
|
125
|
+
}
|
126
|
+
|
127
|
+
.hm-check-no-a{
|
128
|
+
background-color: #edebf0;;
|
129
|
+
}
|
130
|
+
|
131
|
+
|
132
|
+
.hm-check-no-b{
|
133
|
+
background-color: #edebf0aa;
|
134
|
+
}
|
135
|
+
|
136
|
+
.hm-check-notyet{
|
137
|
+
visibility: hidden;
|
138
|
+
}
|
139
|
+
|
140
|
+
|
141
|
+
$bh:2px;
|
142
|
+
.hm-check-future-b{
|
143
|
+
background:repeating-linear-gradient(
|
144
|
+
45deg, /* 斜条纹角度 */
|
145
|
+
#edebf0aa, /* 第一种颜色 */
|
146
|
+
#edebf0aa $bh, /* 第一种颜色的宽度 */
|
147
|
+
#ffffff $bh , /* 第二种颜色的起点 */
|
148
|
+
#ffffff $bh * 2 /* 第二种颜色的宽度 */
|
149
|
+
)
|
150
|
+
}
|
151
|
+
|
152
|
+
|
153
|
+
.hm-check-future-a{
|
154
|
+
background:repeating-linear-gradient(
|
155
|
+
45deg, /* 斜条纹角度 */
|
156
|
+
#ffffff, /* 第一种颜色 */
|
157
|
+
#ffffff $bh, /* 第一种颜色的宽度 */
|
158
|
+
#edebf0 $bh , /* 第二种颜色的起点 */
|
159
|
+
#edebf0 $bh * 2 /* 第二种颜色的宽度 */
|
160
|
+
)
|
161
|
+
}
|
162
|
+
|
163
|
+
.heatmap-day-cell:hover{
|
164
|
+
transform: scale(1.3);
|
165
|
+
z-index: 999;
|
166
|
+
}
|
167
|
+
|
168
|
+
.heatmap-day-cell:hover .hm-tip{
|
169
|
+
display: block;
|
170
|
+
}
|
171
|
+
|
172
|
+
.hm-tip{
|
173
|
+
position: absolute; /* 让子元素浮动 */
|
174
|
+
bottom: 100%;
|
175
|
+
left: 50%;
|
176
|
+
transform: translateX(-50%);
|
177
|
+
background-color: rgba(0, 0, 0, 0.8);
|
178
|
+
color: white;
|
179
|
+
padding: 10px;
|
180
|
+
border-radius: 5px;
|
181
|
+
z-index: 999;
|
182
|
+
|
183
|
+
width: auto;
|
184
|
+
font-size: 0.8rem;
|
185
|
+
display: none;
|
186
|
+
}
|
187
|
+
|
188
|
+
.hm-date{
|
189
|
+
color: #fff;
|
190
|
+
text-align: center;
|
191
|
+
|
192
|
+
padding: 0;
|
193
|
+
}
|
194
|
+
|
195
|
+
.hm-title{
|
196
|
+
color: #fff;
|
197
|
+
white-space: nowrap;
|
198
|
+
overflow:hidden;
|
199
|
+
text-overflow: ellipsis;
|
200
|
+
text-align: left;
|
201
|
+
padding-left:0.5rem;
|
202
|
+
|
203
|
+
max-width: 600px;
|
204
|
+
|
205
|
+
}
|
206
|
+
|
207
|
+
.hm-tiplink{
|
208
|
+
padding: 0.2rem 0;
|
209
|
+
}
|
210
|
+
|
211
|
+
.red{
|
212
|
+
background-color: #ee5500;
|
213
|
+
}
|
214
|
+
|
215
|
+
.border{
|
216
|
+
border:solid 1px red;
|
217
|
+
}
|
data/_sass/no-style-please.scss
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
@import "heatmap";
|
1
2
|
// -------------- THEME SWITCHER -------------- //
|
2
3
|
@mixin dark-appearance {
|
3
4
|
filter: invert(1);
|
@@ -25,7 +26,7 @@ html { height: 100%; }
|
|
25
26
|
|
26
27
|
body {
|
27
28
|
color: black;
|
28
|
-
font-family:'
|
29
|
+
// font-family:'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
|
29
30
|
font-size: 16px;
|
30
31
|
line-height: 1.6;
|
31
32
|
margin: 0;
|
data/assets/css/main.scss
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: no-style-please2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vitock
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -53,16 +53,20 @@ files:
|
|
53
53
|
- _includes/encrypted.html
|
54
54
|
- _includes/goat_counter.html
|
55
55
|
- _includes/head.html
|
56
|
+
- _includes/heatmap.html
|
57
|
+
- _includes/heatmap.js
|
56
58
|
- _includes/main.css
|
57
59
|
- _includes/menu_item.html
|
58
60
|
- _includes/post_list.html
|
59
61
|
- _layouts/archive.html
|
60
62
|
- _layouts/default.html
|
63
|
+
- _layouts/heatmap.html
|
61
64
|
- _layouts/home.html
|
62
65
|
- _layouts/page.html
|
63
66
|
- _layouts/post.html
|
64
67
|
- _layouts/tagpage.html
|
65
68
|
- _layouts/tags.html
|
69
|
+
- _sass/heatmap.scss
|
66
70
|
- _sass/no-style-please.scss
|
67
71
|
- assets/css/main.scss
|
68
72
|
- assets/js/mouse_coords.js
|