jekyll-zeta 0.10.4 → 0.10.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/_includes/encrypt_page.js +17 -0
- data/_includes/encrypted.html +15 -241
- data/_includes/getPostData.js +6 -128
- data/_includes/getmapdata.js +17 -280
- data/_includes/heatmap.html +3 -6
- data/_includes/heatmap.js +28 -463
- data/_includes/heatmap_svg.js +38 -489
- data/_includes/js_source/encrypt_page.js +229 -0
- data/_includes/js_source/getPostData.js +128 -0
- data/_includes/js_source/getmapdata.js +280 -0
- data/_includes/js_source/heatmap.js +463 -0
- data/_includes/js_source/heatmap_svg.js +490 -0
- data/_includes/js_source/terser.json +11 -0
- data/_includes/lovemap_layout.html +6 -2
- metadata +8 -1
data/_includes/heatmap.js
CHANGED
|
@@ -1,463 +1,28 @@
|
|
|
1
|
-
function __filldata(
|
|
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
|
-
if (!GDATA) {
|
|
30
|
-
GDATA = {}
|
|
31
|
-
window._G_DATA = GDATA
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
function date2ymd(t) {
|
|
36
|
-
let m = t.getMonth() + 1;
|
|
37
|
-
let d = t.getDate();
|
|
38
|
-
return `${t.getFullYear()}-${m < 10 ? "0" + m : m}-${d < 10 ? "0" + d : d}`;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const todayYmd = date2ymd(new Date())
|
|
42
|
-
// 指定日期,可以是年2014 或者 年月 2012-12-03
|
|
43
|
-
|
|
44
|
-
var maxDateYmd = `${endYear}-12-31`
|
|
45
|
-
if (endYear && endYear.length == 4) {
|
|
46
|
-
maxDateYmd = `${endYear}-12-31`
|
|
47
|
-
}else if(endYear && endYear.length == 10) { ///
|
|
48
|
-
maxDateYmd = endYear
|
|
49
|
-
}else if(!endYear){
|
|
50
|
-
maxDateYmd = todayYmd
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
endYear = maxDateYmd.substring(0, 4)
|
|
54
|
-
|
|
55
|
-
const minYmd = `${Number(endYear) - 1}${maxDateYmd.substring(4)}`
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const dateEnd =
|
|
61
|
-
endYear && endYear.length == 4 ? new Date(maxDateYmd) : new Date();
|
|
62
|
-
|
|
63
|
-
const endStamp = dateEnd.getTime();
|
|
64
|
-
const dayEleId = Math.random().toString(16).substring(2);
|
|
65
|
-
let arr = _allyearurl.split("/");
|
|
66
|
-
arr.pop();
|
|
67
|
-
const jsonUrlBase = arr.join("/");
|
|
68
|
-
|
|
69
|
-
const nLastColumnCount = (dateEnd.getDay() - WeeKStart + 7) % 7 + 1
|
|
70
|
-
const ColumnsCount = 53;
|
|
71
|
-
const RowCount = 7;
|
|
72
|
-
const DayCount = (ColumnsCount - 1) * RowCount + nLastColumnCount;
|
|
73
|
-
|
|
74
|
-
let queue = window._y_queue || []
|
|
75
|
-
window._y_queue = queue;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
function getAllYearCfg(){
|
|
80
|
-
/// 如果直接有数据,那么组装成
|
|
81
|
-
if (dataSourceObj && dataSourceObj.allYear) {
|
|
82
|
-
return Promise.resolve(dataSourceObj.allYear)
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
if (GDATA['_allYear']) {
|
|
88
|
-
return GDATA['_allYear'];
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
if (window._isFetchAllYearData == 1) {
|
|
92
|
-
return new Promise(r=>{
|
|
93
|
-
queue.push(r);
|
|
94
|
-
})
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
window._isFetchAllYearData = 1;
|
|
99
|
-
return fetch(_allyearurl)
|
|
100
|
-
.then((r) => r.json())
|
|
101
|
-
.then(d => {
|
|
102
|
-
window._isFetchAllYearData = 0;
|
|
103
|
-
if (queue.length) {
|
|
104
|
-
queue.forEach(calback=>{calback(d)});
|
|
105
|
-
queue.length = 0;
|
|
106
|
-
}
|
|
107
|
-
GDATA['_allYear'] = d ;return d ;})
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
!(function fillData() {
|
|
111
|
-
let year = "" + dateEnd.getFullYear();
|
|
112
|
-
let preYear = "" + (year - 1);
|
|
113
|
-
getAllYearCfg()
|
|
114
|
-
.then((d) => {
|
|
115
|
-
let yearCfg = d;
|
|
116
|
-
let arr = [];
|
|
117
|
-
if (yearCfg[year]) {
|
|
118
|
-
arr.push(getYearData(year));
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
if (yearCfg[preYear]) {
|
|
122
|
-
arr.push(getYearData(preYear));
|
|
123
|
-
}
|
|
124
|
-
Promise.all(arr).then((alldata) => {
|
|
125
|
-
let combineData = {};
|
|
126
|
-
let d1 = alldata[0];
|
|
127
|
-
let d2 = alldata[1];
|
|
128
|
-
|
|
129
|
-
for (const key in d1) {
|
|
130
|
-
if (Object.prototype.hasOwnProperty.call(d1, key)) {
|
|
131
|
-
const element = d1[key];
|
|
132
|
-
let keyNew = "K1-" + key;
|
|
133
|
-
combineData[keyNew] = element;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
for (const key in d2) {
|
|
138
|
-
if (Object.prototype.hasOwnProperty.call(d2, key)) {
|
|
139
|
-
const element = d2[key];
|
|
140
|
-
let keyNew = "K2-" + key;
|
|
141
|
-
combineData[keyNew] = element;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
updateCell(combineData);
|
|
146
|
-
});
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
function getIndex(ymd) {
|
|
150
|
-
return (
|
|
151
|
-
DayCount -
|
|
152
|
-
Math.floor((endStamp - new Date(ymd).getTime()) / (24 * 3600000)) -
|
|
153
|
-
1
|
|
154
|
-
);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
function updateCell(data) {
|
|
160
|
-
if (!data) return;
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
let daysEle = document.getElementById(dayEleId);
|
|
164
|
-
let dayCells = daysEle.childNodes;
|
|
165
|
-
|
|
166
|
-
let Map = {};
|
|
167
|
-
|
|
168
|
-
for (const key in data) {
|
|
169
|
-
if (Object.prototype.hasOwnProperty.call(data, key)) {
|
|
170
|
-
const element = data[key];
|
|
171
|
-
if (Array.isArray(element)) {
|
|
172
|
-
element.forEach((e) => {
|
|
173
|
-
if (e.date ) {
|
|
174
|
-
let arr = Map[e.date];
|
|
175
|
-
if (!arr) {
|
|
176
|
-
arr = [];
|
|
177
|
-
Map[e.date] = arr;
|
|
178
|
-
}
|
|
179
|
-
arr.push(e);
|
|
180
|
-
}
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
let ymdArr = [];
|
|
187
|
-
|
|
188
|
-
for (const dateKeyYmd in Map) {
|
|
189
|
-
if (Object.prototype.hasOwnProperty.call(Map, dateKeyYmd)) {
|
|
190
|
-
ymdArr.push(dateKeyYmd);
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
var G_idxOfDay = DayCount - 1;
|
|
195
|
-
|
|
196
|
-
function shuffle(array) {
|
|
197
|
-
let currentIndex = array.length;
|
|
198
|
-
|
|
199
|
-
// While there remain elements to shuffle...
|
|
200
|
-
while (currentIndex != 0) {
|
|
201
|
-
// Pick a remaining element...
|
|
202
|
-
let randomIndex = Math.floor(Math.random() * currentIndex);
|
|
203
|
-
currentIndex--;
|
|
204
|
-
|
|
205
|
-
// And swap it with the current element.
|
|
206
|
-
[array[currentIndex], array[randomIndex]] = [
|
|
207
|
-
array[randomIndex],
|
|
208
|
-
array[currentIndex],
|
|
209
|
-
];
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
const SEQ = new Array(DayCount);
|
|
214
|
-
let tmp = DayCount;
|
|
215
|
-
while (tmp-- > 0) {
|
|
216
|
-
SEQ[tmp] = tmp;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
shuffle(SEQ);
|
|
220
|
-
|
|
221
|
-
function update1Day() {
|
|
222
|
-
if (G_idxOfDay < 0) {
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
const idxOfDay = SEQ[G_idxOfDay--];
|
|
226
|
-
let dateKeyYmd = idx2Ymd(idxOfDay);
|
|
227
|
-
let arrPostInOneDay = Map[dateKeyYmd];
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
let hideblock = false
|
|
232
|
-
if (minYmd) {
|
|
233
|
-
hideblock = dateKeyYmd < minYmd;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
let isFuture = dateKeyYmd > todayYmd;
|
|
237
|
-
|
|
238
|
-
const dayCell = dayCells[idxOfDay];
|
|
239
|
-
dayCell.dataset.x = dateKeyYmd
|
|
240
|
-
if (hideblock) {
|
|
241
|
-
dayCell.classList = 'heatmap-day-cell hm-check-notyet'
|
|
242
|
-
}else if(isFuture){
|
|
243
|
-
dayCell.classList = parseInt(dateKeyYmd.substring(5, 7)) % 2 == 1 ? 'heatmap-day-cell hm-check-future-b' : 'heatmap-day-cell hm-check-future-a'
|
|
244
|
-
}
|
|
245
|
-
else if(beginDate && dateKeyYmd < beginDate && (!arrPostInOneDay || arrPostInOneDay.length == 0)){
|
|
246
|
-
const nobg =
|
|
247
|
-
parseInt(dateKeyYmd.substring(5, 7)) % 2 == 1
|
|
248
|
-
? "hm-check-future-b"
|
|
249
|
-
: "hm-check-future-a";
|
|
250
|
-
|
|
251
|
-
dayCell.classList = `heatmap-day-cell ${nobg}`;
|
|
252
|
-
}
|
|
253
|
-
else{
|
|
254
|
-
|
|
255
|
-
const nobg =
|
|
256
|
-
parseInt(dateKeyYmd.substring(5, 7)) % 2 == 1
|
|
257
|
-
? "hm-check-no-b"
|
|
258
|
-
: "hm-check-no-a";
|
|
259
|
-
dayCell.classList = `heatmap-day-cell ${
|
|
260
|
-
!arrPostInOneDay
|
|
261
|
-
? nobg
|
|
262
|
-
: arrPostInOneDay.length > 2
|
|
263
|
-
? ("hm-check3")
|
|
264
|
-
: arrPostInOneDay.length == 2 ?
|
|
265
|
-
( "hm-check2")
|
|
266
|
-
: "hm-check"
|
|
267
|
-
}`;
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
if(arrPostInOneDay && arrPostInOneDay.length){
|
|
271
|
-
// arrPostInOneDay
|
|
272
|
-
let objWithColor = arrPostInOneDay.find(function(e){return e.color})
|
|
273
|
-
if(objWithColor){
|
|
274
|
-
dayCell.style.backgroundColor = objWithColor.color ;//+ (arrPostInOneDay.length > 2 ? "ff" : arrPostInOneDay.length > 1 ? 'cc' : '99')
|
|
275
|
-
}else{
|
|
276
|
-
dayCell.style.backgroundColor = color + (arrPostInOneDay.length > 2 ? "ff" : arrPostInOneDay.length > 1 ? 'cc' : '99')
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
if (arrPostInOneDay && arrPostInOneDay.length > 0) {
|
|
284
|
-
let isDirectly = arrPostInOneDay.length == 1;
|
|
285
|
-
let tip = document.createElement("div");
|
|
286
|
-
|
|
287
|
-
if (isDirectly) {
|
|
288
|
-
let lnk = document.createElement("a");
|
|
289
|
-
|
|
290
|
-
lnk.href = arrPostInOneDay[0].url ? arrPostInOneDay[0].url : 'javascript:void(0);';
|
|
291
|
-
dayCell.appendChild(lnk);
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
tip.className = "hm-tip";
|
|
295
|
-
let desc = "";
|
|
296
|
-
arrPostInOneDay.forEach((element) => {
|
|
297
|
-
let lnk = document.createElement("a");
|
|
298
|
-
lnk.className = "hm-tiplink";
|
|
299
|
-
lnk.href = element.url || 'javascript:void(0);'
|
|
300
|
-
tip.appendChild(lnk);
|
|
301
|
-
|
|
302
|
-
let t = document.createElement("span");
|
|
303
|
-
t.className = "hm-date";
|
|
304
|
-
t.innerText = dateKeyYmd.substring(5);
|
|
305
|
-
lnk.appendChild(t);
|
|
306
|
-
|
|
307
|
-
let t2 = document.createElement("span");
|
|
308
|
-
t2.className = "hm-title";
|
|
309
|
-
t2.innerText = element.title;
|
|
310
|
-
lnk.appendChild(t2);
|
|
311
|
-
});
|
|
312
|
-
dayCell.appendChild(tip);
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
function updateMultiDays() {
|
|
320
|
-
let day = heatMapLoadCount;
|
|
321
|
-
if (!day || day <= 0) {
|
|
322
|
-
day = 8;
|
|
323
|
-
}
|
|
324
|
-
while (day--) {
|
|
325
|
-
update1Day();
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
if (G_idxOfDay >= 0) {
|
|
329
|
-
requestAnimationFrame(updateMultiDays);
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
requestAnimationFrame(updateMultiDays);
|
|
333
|
-
|
|
334
|
-
return;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
function getYearData(year) {
|
|
338
|
-
year = '' + year
|
|
339
|
-
|
|
340
|
-
if (dataSourceObj ) {return Promise.resolve(dataSourceObj[year])}
|
|
341
|
-
if(GDATA[year]){
|
|
342
|
-
|
|
343
|
-
return GDATA[year]
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
let queueFlgKey = '_singleyearFlg' + year
|
|
347
|
-
let queueArrKey = '_singleyearQueue' + year
|
|
348
|
-
if (GDATA[queueFlgKey] == 1) {
|
|
349
|
-
// console.log('put in queue',year,Math.random())
|
|
350
|
-
let arrQueue = GDATA[queueArrKey]
|
|
351
|
-
if (!arrQueue) {
|
|
352
|
-
arrQueue = []
|
|
353
|
-
GDATA[queueArrKey] = arrQueue;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
return new Promise(r=>{
|
|
357
|
-
arrQueue.push(r);
|
|
358
|
-
});
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
GDATA[queueFlgKey] = 1;
|
|
363
|
-
// console.log('RealQuery',year,Math.random())
|
|
364
|
-
return fetch(`${jsonUrlBase}/${year}.json`)
|
|
365
|
-
.then((r) => r.json())
|
|
366
|
-
.then(d=>{
|
|
367
|
-
GDATA[queueFlgKey] = 0 ;GDATA[year] = d;
|
|
368
|
-
let queue = GDATA[queueArrKey];
|
|
369
|
-
// console.log('queryFinish',year)
|
|
370
|
-
if(queue && queue.length){
|
|
371
|
-
queue.forEach(cb=>{
|
|
372
|
-
// console.log('queryFinishQueue',year,queue.length,Math.random());
|
|
373
|
-
cb(d);})
|
|
374
|
-
queue.length = 0;
|
|
375
|
-
GDATA[queueArrKey] = undefined
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
return d})
|
|
379
|
-
.catch((e) => {
|
|
380
|
-
return null;
|
|
381
|
-
});
|
|
382
|
-
}
|
|
383
|
-
})();
|
|
384
|
-
(function initMap() {
|
|
385
|
-
let Father = document.getElementById(heatmapid);
|
|
386
|
-
|
|
387
|
-
const Frag = document.createDocumentFragment();
|
|
388
|
-
|
|
389
|
-
const monthEle = document.createElement("div");
|
|
390
|
-
monthEle.className = "heatmap-month";
|
|
391
|
-
Frag.appendChild(monthEle);
|
|
392
|
-
const monthStrArr = _MonthStr.split(" ");
|
|
393
|
-
|
|
394
|
-
let nowM = dateEnd.getMonth();
|
|
395
|
-
let nowWeekIdx = nLastColumnCount - 1;
|
|
396
|
-
|
|
397
|
-
let monthEleArr = []
|
|
398
|
-
for (let i = 0; i < monthStrArr.length; i++) {
|
|
399
|
-
let m = document.createElement("span");
|
|
400
|
-
m.className = "heatmap-month-cell";
|
|
401
|
-
// m.innerHTML = `${monthStr[(i + nowM + 1) % 12]}`;
|
|
402
|
-
monthEle.appendChild(m);
|
|
403
|
-
monthEleArr.push(m)
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
/// reset month cell postion
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
for (let index = 0 ,j = 0; index < ColumnsCount && j < monthStrArr.length; index++) {
|
|
410
|
-
const ymd = idx2Ymd(index * 7)
|
|
411
|
-
const m = ymd.substring(5,7)
|
|
412
|
-
const d = ymd.substring(8,10)
|
|
413
|
-
|
|
414
|
-
if (d <= '07') {
|
|
415
|
-
let ele = monthEleArr[j ++]
|
|
416
|
-
console.log(ymd,m,d)
|
|
417
|
-
ele.innerText = monthStrArr[Number(m) - 1]
|
|
418
|
-
ele.style.gridColumnStart = index + 1
|
|
419
|
-
ele.style.gridColumnEnd = 'span 4'
|
|
420
|
-
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
const weekEle = document.createElement("div");
|
|
428
|
-
weekEle.className = "heatmap-week";
|
|
429
|
-
const WeekStr = _showWeek.split(" ");
|
|
430
|
-
|
|
431
|
-
for (let i = 0; i < WeekStr.length; i++) {
|
|
432
|
-
const idx = (i + WeeKStart) % 7
|
|
433
|
-
let m = document.createElement("div");
|
|
434
|
-
m.className = "heatmap-week-cell";
|
|
435
|
-
m.innerHTML = i % 2 ? `<span>${WeekStr[idx]}</span>` : ''
|
|
436
|
-
weekEle.appendChild(m);
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
Frag.appendChild(weekEle);
|
|
440
|
-
|
|
441
|
-
const dayEle = document.createElement("div");
|
|
442
|
-
|
|
443
|
-
dayEle.className = "heatmap-day";
|
|
444
|
-
dayEle.id = dayEleId;
|
|
445
|
-
|
|
446
|
-
// console.log(nowWeekIdx, firstDateDayDiff);
|
|
447
|
-
|
|
448
|
-
for (let c = 0; c < ColumnsCount; c++) {
|
|
449
|
-
for (let r = 0; r < RowCount; r++) {
|
|
450
|
-
if (r > nowWeekIdx && c == ColumnsCount - 1) {
|
|
451
|
-
break;
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
let m = document.createElement("span");
|
|
455
|
-
m.classList = `heatmap-day-cell hm-check-nodata`;
|
|
456
|
-
dayEle.appendChild(m);
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
Frag.appendChild(dayEle);
|
|
461
|
-
Father.append(Frag);
|
|
462
|
-
})();
|
|
463
|
-
};
|
|
1
|
+
function __filldata(e,t,n,a,l,r,c,s){function o(e){let t=new Date(y-36e5*($-1-e)*24),n=t.getMonth()+1,a=t.getDate();return`${t.getFullYear()}-${n<10?"0"+n:n}-${a<10?"0"+a:a}`}
|
|
2
|
+
const i=parseInt(n),h=s&&s.color;var m=s&&s.beginDate;m&&10!=m.length&&(beginDateArr=m.split("-"),
|
|
3
|
+
3==beginDateArr.length&&(m=`${beginDateArr[0]}-${beginDateArr[1].padStart(2,"0")}-${beginDateArr[2].padStart(2,"0")}`));var d=window._G_DATA;d||(d={},window._G_DATA=d);const u=function(e){
|
|
4
|
+
let t=e.getMonth()+1,n=e.getDate();return`${e.getFullYear()}-${t<10?"0"+t:t}-${n<10?"0"+n:n}`}(new Date);var p=`${t}-12-31`;t&&4==t.length?p=`${t}-12-31`:t&&10==t.length?p=t:t||(p=u),
|
|
5
|
+
t=p.substring(0,4);const f=`${Number(t)-1}${p.substring(4)}`,g=t&&4==t.length?new Date(p):new Date,y=g.getTime(),w=Math.random().toString(16).substring(2);let b=c.split("/");b.pop()
|
|
6
|
+
;const D=b.join("/"),E=(g.getDay()-i+7)%7+1,$=364+E;let _=window._y_queue||[];window._y_queue=_,function(){let e=""+g.getFullYear(),t=""+(e-1);function n(e){if(e=""+e,s)return Promise.resolve(s[e])
|
|
7
|
+
;if(d[e])return d[e];let t="_singleyearFlg"+e,n="_singleyearQueue"+e;if(1==d[t]){let e=d[n];return e||(e=[],d[n]=e),new Promise((t=>{e.push(t)}))}return d[t]=1,
|
|
8
|
+
fetch(`${D}/${e}.json`).then((e=>e.json())).then((a=>{d[t]=0,d[e]=a;let l=d[n];return l&&l.length&&(l.forEach((e=>{e(a)})),l.length=0,d[n]=void 0),a})).catch((e=>null))}
|
|
9
|
+
(s&&s.allYear?Promise.resolve(s.allYear):d._allYear?d._allYear:1==window._isFetchAllYearData?new Promise((e=>{_.push(e)})):(window._isFetchAllYearData=1,
|
|
10
|
+
fetch(c).then((e=>e.json())).then((e=>(window._isFetchAllYearData=0,_.length&&(_.forEach((t=>{t(e)})),_.length=0),d._allYear=e,e))))).then((l=>{let r=l,c=[];r[e]&&c.push(n(e)),r[t]&&c.push(n(t)),
|
|
11
|
+
Promise.all(c).then((e=>{let t={},n=e[0],l=e[1];for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)){const a=n[e];t["K1-"+e]=a}for(const e in l)if(Object.prototype.hasOwnProperty.call(l,e)){
|
|
12
|
+
const n=l[e];t["K2-"+e]=n}!function(e){if(!e)return;let t=document.getElementById(w).childNodes,n={};for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const a=e[t]
|
|
13
|
+
;Array.isArray(a)&&a.forEach((e=>{if(e.date){let t=n[e.date];t||(t=[],n[e.date]=t),t.push(e)}}))}let l=[];for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&l.push(e);var r=$-1;function c(e){
|
|
14
|
+
let t=e.length;for(;0!=t;){let n=Math.floor(Math.random()*t);t--,[e[t],e[n]]=[e[n],e[t]]}}const s=new Array($);let i=$;for(;i-- >0;)s[i]=i;function d(){if(r<0)return;const e=s[r--]
|
|
15
|
+
;let a=o(e),l=n[a],c=!1;f&&(c=a<f);let i=a>u;const d=t[e]
|
|
16
|
+
;if(d.dataset.x=a,c)d.classList="heatmap-day-cell hm-check-notyet";else if(i)d.classList=parseInt(a.substring(5,7))%2==1?"heatmap-day-cell hm-check-future-b":"heatmap-day-cell hm-check-future-a";else if(m&&a<m&&(!l||0==l.length)){
|
|
17
|
+
const e=parseInt(a.substring(5,7))%2==1?"hm-check-future-b":"hm-check-future-a";d.classList=`heatmap-day-cell ${e}`}else{const e=parseInt(a.substring(5,7))%2==1?"hm-check-no-b":"hm-check-no-a"
|
|
18
|
+
;if(d.classList=`heatmap-day-cell ${l?l.length>2?"hm-check3":2==l.length?"hm-check2":"hm-check":e}`,l&&l.length){let e=l.find((function(e){return e.color}))
|
|
19
|
+
;d.style.backgroundColor=e?e.color:h+(l.length>2?"ff":l.length>1?"cc":"99")}if(l&&l.length>0){let e=1==l.length,t=document.createElement("div");if(e){let e=document.createElement("a")
|
|
20
|
+
;e.href=l[0].url?l[0].url:"javascript:void(0);",d.appendChild(e)}t.className="hm-tip";l.forEach((e=>{let n=document.createElement("a");n.className="hm-tiplink",n.href=e.url||"javascript:void(0);",
|
|
21
|
+
t.appendChild(n);let l=document.createElement("span");l.className="hm-date",l.innerText=a.substring(5),n.appendChild(l);let r=document.createElement("span");r.className="hm-title",r.innerText=e.title,
|
|
22
|
+
n.appendChild(r)})),d.appendChild(t)}}}function p(){let e=a;for((!e||e<=0)&&(e=8);e--;)d();r>=0&&requestAnimationFrame(p)}c(s),requestAnimationFrame(p)}(t)}))}))}(),function(){
|
|
23
|
+
let t=document.getElementById(e);const n=document.createDocumentFragment(),a=document.createElement("div");a.className="heatmap-month",n.appendChild(a);const c=l.split(" ");g.getMonth();let s=E-1,h=[]
|
|
24
|
+
;for(let e=0;e<c.length;e++){let e=document.createElement("span");e.className="heatmap-month-cell",a.appendChild(e),h.push(e)}for(let e=0,t=0;e<53&&t<c.length;e++){
|
|
25
|
+
const n=o(7*e),a=n.substring(5,7),l=n.substring(8,10);if(l<="07"){let n=h[t++];n.innerText=c[Number(a)-1],n.style.gridColumnStart=e+1,n.style.gridColumnEnd="span 4"}}
|
|
26
|
+
const m=document.createElement("div");m.className="heatmap-week";const d=r.split(" ");for(let e=0;e<d.length;e++){const t=(e+i)%7;let n=document.createElement("div");n.className="heatmap-week-cell",
|
|
27
|
+
n.innerHTML=e%2?`<span>${d[t]}</span>`:"",m.appendChild(n)}n.appendChild(m);const u=document.createElement("div");u.className="heatmap-day",u.id=w
|
|
28
|
+
;for(let e=0;e<53;e++)for(let t=0;t<7&&!(t>s&&52==e);t++){let e=document.createElement("span");e.classList="heatmap-day-cell hm-check-nodata",u.appendChild(e)}n.appendChild(u),t.append(n)}()}
|