This repository was archived by the owner on Aug 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcalendar.html
More file actions
443 lines (371 loc) · 11.2 KB
/
calendar.html
File metadata and controls
443 lines (371 loc) · 11.2 KB
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
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta description="同人女老黄历">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>同人女老黄历</title>
<script id="jquery_183" type="text/javascript" class="library" src="js/jquery-1.11.3.min.js"></script>
</head>
<body>
<div class="container">
<div class="title">
同人女老黄历<sup>alpha</sup>
</div>
<div class="date">
</div>
<div class="good">
<div class="title">
<table>
<tr><td>宜</td></tr>
</table>
</div>
<div class="content">
<ul></ul>
</div>
<div class="clear"></div>
</div>
<div class="split"></div>
<div class="bad">
<div class="title">
<table>
<tr><td>不宜</td></tr>
</table>
</div>
<div class="content">
<ul></ul>
</div>
<div class="clear"></div>
</div>
<div class="split"></div>
<div class="line-tip">
<strong>座位朝向:</strong>面向<span class="direction_value"></span>产出,手感最佳。
</div>
<div class="line-tip">
<strong>今日宜饮:</strong><span class="drink_value"></span>
</div>
<div class="line-tip">
<strong>灵感指数:</strong><span class="goddes_value"></span>
</div>
<!-- <div class="adlink">-->
<!-- <a href="secondpages.html" target="dev_qiu_qian">想求签?</a>-->
<!-- </div>-->
<div class="comment">
<ul>
<li>本页面代码引用自:<a href = "http://www.widuu.com/date/index.html">程序员老黄历</a></li>
<li>本老黄历仅面向同人女;</li>
<li>本人不对老黄历产出的任何结果负责。</li>
</ul>
</div>
</div>
</body>
</html>
<style>body * {
font-family:"Consolas","Microsoft Yahei", Arial, sans-serif;
}
body {
background: white;
margin: 0;
padding: 0;
}
.container {
width: 320px;
margin: 0 auto 50px;
}
.container>.title {
color: #bbb;
font-weight: bold;
margin-bottom: 10px;
background: #555;
padding: 5px 15px;
}
.adlink {
text-align: center;
font-size: 11pt;
}
.adlink a {
text-decoration: none;
display:block;
color: #666;
font-weight: bold;
margin-bottom: 10px;
background: #eee;
border: 1px solid #ddd;
border-radius: 4px;
padding: 10pt;
margin-top: 10pt;
}
.date{
font-size:17pt;
font-weight: bold;
line-height: 30pt;
text-align: center;
}
.split, .clear {
clear: both;
height: 1px;
overflow-y: hidden;
}
.good, .bad {
clear: both;
position: relative;
}
.bad {
/*top: -1px;*/
}
.good .title, .bad .title {
float: left;
width: 100px;
font-weight: bold;
text-align: center;
font-size: 30pt;
position:absolute;
top:0;
bottom:0;
}
.good .title>table, .bad .title>table {
position:absolute;
width:100%;
height:100%;
border:none;
}
.good .title {
background: #ffee44;
}
.someday .good .title {
background: #aaaaaa;
}
.bad .title {
background: #ff4444;
color: #fff;
}
.someday .bad .title {
background: #666666;
color: #fff;
}
.good .content, .bad .content {
margin-left: 115px;
padding-right: 10px;
padding-top: 1px;
font-size:15pt;
}
.someday .good {
background: #dddddd;
}
.someday .bad {
background: #aaaaaa;
}
.good {
background: #ffffaa;
}
.bad {
background: #ffddd3;
}
.content ul {
list-style: none;
margin:10px 0 0;
padding:0;
}
.content ul li {
line-height:150%;
font-size: 15pt;
font-weight: bold;
color: #444;
}
.content ul li div.description {
font-size: 11pt;
font-weight: normal;
color: #777;
line-height: 110%;
margin-bottom: 10px;
}
.line-tip {
font-size: 11pt;
margin-top: 10px;
margin-left: 10px;
}
.direction_value {
color:#4a4;
font-weight: bold;
}
.someday .direction_value {
color:#888;
}
.goddes_value {
color: #f87;
}
.someday .goddes_value {
color: #777;
}
.comment {
margin-top: 50px;
font-size: 11pt;
margin-left: 10px;
}
.comment ul {
margin-left: 0;
padding-left: 20px;
color: #999;
}</style>
<script>//
/*
* 注意:本程序中的“随机”都是伪随机概念,以当前的天为种子。
*/
function random(dayseed, indexseed) {
var n = dayseed % 11117;
for (var i = 0; i < 100 + indexseed; i++) {
n = n * n;
n = n % 11117; // 11117 是个质数
}
return n;
}
var today = new Date();
var iday = today.getFullYear() * 10000 + (today.getMonth() + 1) * 100 + today.getDate();
var weeks = ["日","一","二","三","四","五","六"];
var directions = ["北方","东北方","东方","东南方","南方","西南方","西方","西北方"];
var activities = [
{name:"写文", good:"今天灵感爆发",bad:"你的文混乱不堪,你自己都看不懂", weekend: true},
{name:"画图", good:"今天手感绝佳",bad:"你的画混乱不堪,你自己都看不懂", weekend: true},
{name:"上Lofter", good:"太太们产粮了,快去看",bad:"对家找上门", weekend: true},
{name:"上推特", good:"太太们产粮了,快去看",bad:"vpn又挂了", weekend: true},
{name:"上微博", good:"太太们产粮了,快去看",bad:"又撕起来了", weekend: true},
{name:"产黄", good:"非常安全",bad:"会被屏蔽", weekend: true},
{name:"买谷", good:"心动不如行动",bad:"抢不到的,洗洗睡吧", weekend: true},
{name:"使用%t", good:"神仙工具,方便好用",bad:"程序会崩溃", weekend: true},
<!-- {name:"参加企划", good:"可以结交新的太太",bad:"策划半路跑路", weekend: true},-->
{name:"晚上产出", good:"晚上是同人女精神最好的时候",bad:"精神状态不佳", weekend: true},
{name:"白天产出", good:"美好的一天从产粮开始",bad:"精神状态不佳", weekend: true},
{name:"文章复审", good:"发现问题的几率大大增加",bad:"什么问题都发现不了", weekend: true},
{name:"抽卡", good:"今天欧气爆棚",bad:"玄不救非,氪不改命", weekend: true},
{name:"上B站", good:"首页有好东西",bad:"对家视频上首页了", weekend: true},
{name:"搞OC", good:"是个可爱的孩子呢",bad:"不知不觉就写了非常刀的背景故事", weekend: true},
{name:"干饭", good:"饭饭,香香",bad:"突如其来的刀", weekend: true},
{name:"早睡", good:"早早睡觉明天才能更有精神干饭",bad:"浪费了今天绝佳的灵感"},
{name:"晚睡", good:"可以等到太太刚做的饭",bad:"睡吧,今天太太也不会更新的", weekend: true},
{name:"写超过%l行的文", good:"下笔行云流水",bad:"逻辑会逐渐混乱"}
<!-- {name:"\"%v\"", good:"",bad:""},-->
];
var specials = [
{date:20140214, type:'bad', name:' ', description:' '}
];
var tools = ["Sai画图", "Word写文", "记事本写文", "PS画图", "CSP画图", "Procreate画图"];
<!--var varNames = ["jieguo", "huodong", "pay", "expire", "zhangdan", "every", "free", "i1", "a", "virtual", "ad", "spider", "mima", "pass", "ui"];-->
var drinks = ["水","豆浆","红茶","绿茶","咖啡","奶茶","可乐","牛奶","豆奶","果汁","果味汽水","苏打水","运动饮料","酸奶"];
function is_someday() {
return today.getMonth() == 5 && today.getDate() == 4;
}
function getTodayString() {
return "今天是" + today.getFullYear() + "年" + (today.getMonth() + 1) + "月" + today.getDate() + "日 星期" + weeks[today.getDay()];
}
function star(num) {
var result = "";
var i = 0;
while (i < num) {
result += "★";
i++;
}
while(i < 5) {
result += "☆";
i++;
}
return result;
}
// 生成今日运势
function pickTodaysLuck() {
var _activities = filter(activities);
var numGood = random(iday, 98) % 3 + 2;
var numBad = random(iday, 87) % 3 + 2;
var eventArr = pickRandomActivity(_activities, numGood + numBad);
var specialSize = pickSpecials();
for (var i = 0; i < numGood; i++) {
addToGood(eventArr[i]);
}
for (var i = 0; i < numBad; i++) {
addToBad(eventArr[numGood + i]);
}
}
// 去掉一些不合今日的事件
function filter(activities) {
var result = [];
// 周末的话,只留下 weekend = true 的事件
if (isWeekend()) {
for (var i = 0; i < activities.length; i++) {
if (activities[i].weekend) {
result.push(activities[i]);
}
}
return result;
}
return activities;
}
function isWeekend() {
return today.getDay() == 0 || today.getDay() == 6;
}
// 添加预定义事件
function pickSpecials() {
var specialSize = [0,0];
for (var i = 0; i < specials.length; i++) {
var special = specials[i];
if (iday == special.date) {
if (special.type == 'good') {
specialSize[0]++;
addToGood({name: special.name, good: special.description});
} else {
specialSize[1]++;
addToBad({name: special.name, bad: special.description});
}
}
}
return specialSize;
}
// 从 activities 中随机挑选 size 个
function pickRandomActivity(activities, size) {
var picked_events = pickRandom(activities, size);
for (var i = 0; i < picked_events.length; i++) {
picked_events[i] = parse(picked_events[i]);
}
return picked_events;
}
// 从数组中随机挑选 size 个
function pickRandom(array, size) {
var result = [];
for (var i = 0; i < array.length; i++) {
result.push(array[i]);
}
for (var j = 0; j < array.length - size; j++) {
var index = random(iday, j) % result.length;
result.splice(index, 1);
}
return result;
}
// 解析占位符并替换成随机内容
function parse(event) {
var result = {name: event.name, good: event.good, bad: event.bad}; // clone
if (result.name.indexOf('%v') != -1) {
result.name = result.name.replace('%v', varNames[random(iday, 12) % varNames.length]);
}
if (result.name.indexOf('%t') != -1) {
result.name = result.name.replace('%t', tools[random(iday, 11) % tools.length]);
}
if (result.name.indexOf('%l') != -1) {
result.name = result.name.replace('%l', (random(iday, 12) % 247 + 1).toString());
}
return result;
}
// 添加到“宜”
function addToGood(event) {
$('.good .content ul').append('<li><div class="name">' + event.name + '</div><div class="description">' + event.good + '</div></li>');
}
// 添加到“不宜”
function addToBad(event) {
$('.bad .content ul').append('<li><div class="name">' + event.name + '</div><div class="description">' + event.bad + '</div></li>');
}
$(function(){
if (is_someday()) {document.body.className = 'someday'};
$('.date').html(getTodayString());
$('.direction_value').html(directions[random(iday, 2) % directions.length]);
$('.drink_value').html(pickRandom(drinks,2).join(','));
$('.goddes_value').html(star(random(iday, 6) % 5 + 1));
pickTodaysLuck();
});</script>
<!-- Generated by RunJS (Wed Aug 10 10:23:55 CST 2016) 1ms -->