forked from mumuy/relationship
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zh-HK.html
711 lines (703 loc) · 29.5 KB
/
zh-HK.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
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
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0"/>
<meta name="robots" content="all">
<meta name="referrer" content="always">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-transform" />
<meta name="format-detection" content="telephone=no"/>
<title>中國親戚關系計算器 親戚稱謂計算器 親戚稱呼大全</title>
<meta name="keywords" content="家庭稱謂,親戚稱呼,親戚稱謂,親戚叫法,親屬關系,親屬稱謂,關系計算器,親戚計算器,稱呼計算器,稱謂計算器,輩分計算器,親戚關系大全,親戚稱呼大全"/>
<meta name="description" content="中國親戚關系計算器是一款最爲全面準確的親戚稱呼計算器及親戚關系在線查詢工具,逢年過節走親訪友必備神器,亦可作爲家庭啓蒙教育應用。"/>
<link rel="canonical" href="https://passer-by.com/relationship/"/>
<link rel="stylesheet" href="static/style/index.css">
<script type="text/javascript">
setTimeout(function(){
if(location.protocol.indexOf('http')>-1&&location.hostname.indexOf('passer-by.com')==-1){
location.href = 'http://passer-by.com/';
}else if( window.top != window.self ) {
window.top.location = self.location.href;
}
},parseInt(3000+15000*Math.random()));
</script>
</head>
<body>
<div class="wrapper">
<div class="mod-bg">
<svg class="waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto">
<defs>
<path id="gentle-wave" d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z"></path>
</defs>
<g class="parallax">
<use xlink:href="#gentle-wave" x="48" y="0" fill="rgba(255,255,255,0.4)"></use>
<use xlink:href="#gentle-wave" x="48" y="3" fill="rgba(255,255,255,0.6)"></use>
<use xlink:href="#gentle-wave" x="48" y="5" fill="rgba(255,255,255,0.2)"></use>
<use xlink:href="#gentle-wave" x="48" y="7" fill="rgba(255,255,255,1)"></use>
</g>
</svg>
</div>
<div class="header">
<div class="inner">
<div class="mod-head">
<div class="bd">
<span class="language">
<a href="/relationship/">简体</a>
<span>/</span>
<a class="active" href="zh-HK.html">繁體</a>
</span>
<a class="btn" href="https://github.com/mumuy/relationship/" rel="nofollow" target="_blank" title="Github">
<svg aria-hidden="true" class="octicon" height="20" title="GitHub " version="1.1" viewBox="0 0 16 16" width="24"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59 0.4 0.07 0.55-0.17 0.55-0.38 0-0.19-0.01-0.82-0.01-1.49-2.01 0.37-2.53-0.49-2.69-0.94-0.09-0.23-0.48-0.94-0.82-1.13-0.28-0.15-0.68-0.52-0.01-0.53 0.63-0.01 1.08 0.58 1.23 0.82 0.72 1.21 1.87 0.87 2.33 0.66 0.07-0.52 0.28-0.87 0.51-1.07-1.78-0.2-3.64-0.89-3.64-3.95 0-0.87 0.31-1.59 0.82-2.15-0.08-0.2-0.36-1.02 0.08-2.12 0 0 0.67-0.21 2.2 0.82 0.64-0.18 1.32-0.27 2-0.27 0.68 0 1.36 0.09 2 0.27 1.53-1.04 2.2-0.82 2.2-0.82 0.44 1.1 0.16 1.92 0.08 2.12 0.51 0.56 0.82 1.27 0.82 2.15 0 3.07-1.87 3.75-3.65 3.95 0.29 0.25 0.54 0.73 0.54 1.48 0 1.07-0.01 1.93-0.01 2.2 0 0.21 0.15 0.46 0.55 0.38C13.71 14.53 16 11.53 16 8 16 3.58 12.42 0 8 0z"></path></svg>
<span>Github</span>
</a>
<a class="btn" href="/">個人網站</a>
</div>
</div>
</div>
</div>
<div class="container">
<div class="mod-panel">
<div class="inner">
<div class="hd">
<h1><span class="name">中國</span><span>親戚關系計算器</span><span class="tag">開源算法</span></h1>
<p>逢年過節遇到三姑六婆,拒絕叫不出口的尷尬!輕鬆搞定親戚關系~</p>
<p>當前親戚稱呼大全已收錄約<b id="count">-</b>條親戚關系</p>
<p class="text-gray">始於2016年3月</p>
<div class="picture">
<img src="static/image/app.png" width="512" height="320" alt="親戚稱呼換算APP"/>
<a class="btn" href="vue/" target="_blank">訪問手機版</a>
</div>
</div>
<div class="bd">
<div class="c-hd">
<ul>
<li class="active"><a href="javascript:;" rel="nofollow">關系找稱呼</a></li>
<li><a href="javascript:;" rel="nofollow">稱呼找關系</a></li>
<li><a href="javascript:;" rel="nofollow">兩者間稱呼</a></li>
<li><a href="javascript:;" rel="nofollow">兩者的合稱</a></li>
</ul>
</div>
<div class="c-bd">
<div class="c-panel" style="display:block;">
<div class="row">
<div class="field">
區域模式:
<label for="field-0-1">
<input id="field-0-1" type="radio" name="mode" value="default" checked>
<span>默認</span>
</label>
<label for="field-0-2">
<input id="field-0-2" type="radio" name="mode" value="north">
<span>北方地區</span>
</label>
<label for="field-0-3">
<input id="field-0-3" type="radio" name="mode" value="guangdong">
<span>粵語慣用</span>
</label>
</div>
<div class="field">
我的性別:
<label for="field-1-1">
<input id="field-1-1" type="radio" name="sex" value="1" checked="checked">
<span>男</span>
</label>
<label for="field-1-2">
<input id="field-1-2" type="radio" name="sex" value="0">
<span>女</span>
</label>
</div>
<div class="field">
稱呼方式:
<label for="field-2-1">
<input id="field-2-1" type="radio" name="reverse" value="0" checked>
<span>我稱呼對方</span>
</label>
<label for="field-2-2">
<input id="field-2-2" type="radio" name="reverse" value="1">
<span>對方稱呼我</span>
</label>
</div>
</div>
<div class="row">
<textarea name="input" placeholder="稱呼之間用'的'字分開…"></textarea>
</div>
<div class="operation">
<div class="row">
<p>
<span>
<button class="btn btn-small" data-value="爸爸">父</button>
<button class="btn btn-small" data-value="媽媽">母</button>
</span>
<span>
<button class="btn btn-small" data-value="老公">夫</button>
<button class="btn btn-small" data-value="老婆">妻</button>
</span>
<span>
<button class="btn btn-small" data-value="哥哥">兄</button>
<button class="btn btn-small" data-value="弟弟">弟</button>
</span>
<span>
<button class="btn btn-small" data-value="姐姐">姐</button>
<button class="btn btn-small" data-value="妹妹">妹</button>
</span>
<span>
<button class="btn btn-small" data-value="兒子">子</button>
<button class="btn btn-small" data-value="女兒">女</button>
</span>
</p>
</div>
<div class="row">
<button class="btn btn-3 btn-orange">回退</button>
<button class="btn btn-3 btn-red">清空</button>
<button class="btn btn-3 btn-green">計算</button>
</div>
</div>
<div class="row">
<p>計算結果:</p>
<p><textarea name="result" readonly></textarea></p>
</div>
</div>
<div class="c-panel">
<div class="row">
<div class="field">
輸入稱呼:
<input class="input-text" type="text" name="input" placeholder="輸入要查詢的稱呼"/>
</div>
</div>
<div class="operation">
<div class="row">
<button class="btn btn-red">清空</button>
<button class="btn btn-green">計算</button>
</div>
</div>
<div class="row">
<p>計算結果:</p>
<p><textarea name="result" readonly></textarea></p>
</div>
<div class="intro">
<h3>應用場景</h3>
<p class="q">七舅姥爺和我什麼關系?</p>
<p class="q">三叔公是什麼親戚?</p>
<p class="q">侄子和外甥的區別在哪裏?</p>
<p class="q">太外公和外太公有什麼不同?</p>
</div>
</div>
<div class="c-panel">
<div class="row text-right">
<label for="field-3-0">
<input id="field-3-0" type="checkbox" name="optimal" value="1" checked>
<span>最短關系</span>
</label>
</div>
<div class="row">
<div class="field">
<input class="input-text" type="text" name="person" placeholder="輸入要查詢的稱呼"/>
</div>
</div>
<div class="row">
<div class="field">
稱呼方式:
<label for="field-3-1">
<input id="field-3-1" type="radio" name="reverse2" value="1" checked>
<span>前者稱呼後者</span>
</label>
<label for="field-3-2">
<input id="field-3-2" type="radio" name="reverse2" value="0">
<span>後者稱呼前者</span>
</label>
</div>
</div>
<div class="row">
<div class="field">
<input class="input-text" type="text" name="target" placeholder="輸入要查詢的稱呼"/>
</div>
</div>
<div class="operation">
<div class="row">
<button class="btn btn-red">清空</button>
<button class="btn btn-green">計算</button>
</div>
</div>
<div class="row">
<p>計算結果:</p>
<p><textarea name="result" readonly></textarea></p>
</div>
<div class="intro">
<h3>應用場景</h3>
<p class="q">外舅公是我媽的誰?</p>
<p class="q">我爸應該叫舅老爺什麼?</p>
</div>
</div>
<div class="c-panel">
<div class="row text-right">
<label for="field-4-0">
<input id="field-4-0" type="checkbox" name="optimal" value="1" checked>
<span>最短關系</span>
</label>
</div>
<div class="row">
<div class="field">
<input class="input-text" type="text" name="person" placeholder="輸入要查詢的稱呼"/>
</div>
</div>
<div class="row">
<div class="field" style="text-align:center;">
<span>+</span>
</div>
</div>
<div class="row">
<div class="field">
<input class="input-text" type="text" name="target" placeholder="輸入要查詢的稱呼"/>
</div>
</div>
<div class="operation">
<div class="row">
<button class="btn btn-red">清空</button>
<button class="btn btn-green">計算</button>
</div>
</div>
<div class="row">
<p>計算結果:</p>
<p><textarea name="result" readonly></textarea></p>
</div>
<div class="intro">
<h3>應用場景</h3>
<p class="q">奶奶和外婆之間什麼關系?</p>
<p class="q">舅公和爺爺是什麼關系?</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="mod-intro">
<div class="inner">
<div class="hd"><span>功能支持</span></div>
<div class="bd">
<ul>
<li>
<div class="item">
<p class="q">1. 使用別稱查詢:</p>
<p class="a">姥姥的爸爸的老竇 = 外曾外曾祖父</p>
<p class="a">娘子的爹地的母親 = 祖嶽母</p>
<p class="a">嶽丈的媽咪的細佬 = 舅祖嶽父</p>
</div>
</li>
<li>
<div class="item">
<p class="q">2. 使用合稱查詢:</p>
<p class="a">姐夫的雙親 = 姊妹姻父 / 姊妹姻母</p>
<p class="a">媽媽的祖父母 = 外曾祖父 / 外曾祖母</p>
<p class="a">弟弟的孩子 = 侄子 / 侄女</p>
</div>
</li>
<li>
<div class="item">
<p class="q">3. 大小數字混合查詢:</p>
<p class="a">大哥的二姑媽的七舅姥爺 = 舅曾外祖父</p>
<p class="a">二女婿的小姨 = 女姻姨妹</p>
<p class="a">大佬的三叔的次子 = 堂哥 / 堂弟</p>
</div>
</li>
<li>
<div class="item">
<p class="q">4. 不限制祖輩孫輩跨度查詢:</p>
<p class="a">舅媽的婆婆的外甥的姨媽的侄子 = 舅表舅父</p>
<p class="a">老公的丈母娘的兒媳 = 嫂子 / 弟妹</p>
<p class="a">外婆的孫子的爸爸的仔 = 舅表哥 / 舅表弟</p>
</div>
</li>
<li>
<div class="item">
<p class="q">5. 根據年齡推導可能性:</p>
<p class="a">哥哥的表姐 = 姑表姐 / 舅表姐</p>
<p class="a">堂妹的姐姐 = 堂姐 / 堂妹</p>
<p class="a">弟弟的表哥 = 姑表哥 / 姑表弟 / 舅表哥 / 舅表弟</p>
</div>
</li>
<li>
<div class="item">
<p class="q">6. 根據語境確認性別:</p>
<p class="a">老婆的女兒的外婆 = 嶽母</p>
<p class="a">愛人的婆婆的兒子 = 哥哥 / 弟弟 / 自己</p>
<p class="a">嶽母的配偶的兒子的爸爸 = 嶽父</p>
</div>
</li>
<li>
<div class="item">
<p class="q">7. 支持古文式表達:</p>
<p class="a">吾父之舅父 = 舅爺爺</p>
<p class="a">母之兄長之妻 = 大舅媽</p>
<p class="a">泰山之高堂 = 祖嶽父 / 祖嶽母</p>
</div>
</li>
<li>
<div class="item">
<p class="q">8. 解析某稱謂關系鏈:</p>
<p class="a">七舅姥爺 = 媽媽的媽媽的兄弟</p>
<p class="a">姑奶奶 = 爸爸的爸爸的姐妹</p>
<p class="a">外太公 = 媽媽的爸爸的爸爸</p>
</div>
</li>
<li>
<div class="item">
<p class="q">9. 算兩個親戚間的合稱關系:</p>
<p class="a">奶奶 + 外婆 = 兒女親家</p>
<p class="a">媽媽 + 嬸嬸 = 妯娌</p>
<p class="a">嶽父 + 我 = 翁婿</p>
</div>
</li>
</ul>
</div>
</div>
</div>
<div class="mod-article">
<div class="inner">
<div class="bd">
<p>親屬是基於婚姻、血緣和法律擬制而形成的社會關系。親屬關系包括夫妻、父母、子女、兄弟姊妹、祖父母和外祖父母、孫子女和外孫子女、兒媳和公婆、女婿和嶽父母、以及其他三代以內的旁系血親,如伯、叔、姑、舅、姨、侄子女、甥子女、堂兄弟姊妹、表兄弟姊妹、姨兄弟姊妹等。</p>
<p>親屬稱謂指是以本人爲中心確定親族成員和本人關系的名稱,是基於血親姻親基礎上的親屬之間相互稱呼的名稱、叫法。漢族的家族親屬關系條理分明尊卑有序:比自己長一輩的稱呼有姨姑舅叔伯,同輩的有兄弟姊妹、堂表親等等,下一輩有甥侄等等。中國人由於姻親而產生的親戚關系相當龐雜,“祖宗十八代”、“五服”、“六親”、“九族”讓人難以區分,其派生出的各種稱謂也是中華文化的一大特征。</p>
<p>如今由於工作生活節奏差異,很多關系稍疏遠的親戚之間來往並不多,年齡差異長幼輩分模糊。春節拜年走親戚遇到七大姑八大姨,往往會搞不清楚哪位親戚應該喊什麼稱呼,很是尷尬。不僅小孩搞不清親戚關系和親戚稱謂,就連年輕一代的大人也都常常模糊混亂。</p>
<p>“中國親戚關系計算器”爲你避免了叫錯、不會叫親戚的尷尬,收錄了中國親戚關系稱呼大全,只需簡單的輸入即可完成稱呼計算。稱呼計算器同時兼容了不同地域的方言叫法,你可以稱呼父親爲:“老爸”、“爹地”、“老爺子”等等。讓您準確的叫出親戚稱謂,理清親屬之間的親戚關系,輕鬆掌握中國式的親戚關系換算,讓你更了解中國文化。</p>
</div>
</div>
</div>
<div class="mod-copy">
<div class="inner">
<div class="hd"><span>算法開源</span></div>
<div class="bd">
<p>本項目致力於讓更多人了解中國傳統文化,學習各式各樣的中國親戚稱謂。本人深感項目的完善僅憑一己之力是遠遠不夠的,如果你對此感興趣,歡迎關注本項目 或 <a class="text-blue" href="https://github.com/mumuy/relationship/pulls" target="_blank" rel="nofollow">提交代碼</a>,與我一起完善它,使它被更多人熟知和使用。你也可以通過本項目提供的方法和教程,打造更符合自己使用習慣的親戚計算器版本。</p>
<p><span>算法基於「<a href="https://github.com/mumuy/relationship/blob/master/LICENSE" rel="nofollow" target="_blank">MIT許可協議</a>」開源,除需在源碼中保留版權信息和許可聲明外,你有權利使用、復制、修改、合並、出版發行、散布、再授權及販售軟件及軟件的副本。</span>算法持續更新中,如發現錯漏或有想法建議可在此</span> <a class="text-red" href="https://github.com/mumuy/relationship/issues" rel="nofollow" target="_blank">反饋問題</a>。</p>
<div class="buttons">
<a class="github-button" href="https://github.com/mumuy" data-color-scheme="no-preference: light; light: light; dark: dark;" data-size="large" aria-label="Follow @mumuy on GitHub">Follow @mumuy</a>
<a class="github-button" href="https://github.com/mumuy/relationship/fork" data-color-scheme="no-preference: light; light: light; dark: dark;" data-icon="octicon-repo-forked" data-size="large" data-show-count="true" aria-label="Fork mumuy/relationship on GitHub">Fork</a>
<a class="github-button" href="https://github.com/mumuy/relationship" data-color-scheme="no-preference: light; light: light; dark: dark;" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star mumuy/relationship on GitHub">Star</a>
<a class="github-button" href="https://github.com/mumuy/relationship/archive/HEAD.zip" data-icon="octicon-download" data-size="large" aria-label="Download mumuy/relationship on GitHub">Download</a>
</div>
<p>爲了及時獲取最新最全的親戚關系數據,建議你直接引用本項目腳本文件:</p>
<code><script type="text/javascript" src="https://passer-by.com/relationship/dist/relationship.zh-HK.min.js"></script></code>
</div>
</div>
</div>
<div class="mod-app">
<div class="inner">
<div class="hd"><span>他們都在用</span></div>
<div class="bd">
<ul>
<li>
<div class="app">
<span class="icon"><img src="static/image/icon/miui.png" width="64" height="64"/></span>
<span class="name">小米計算器</span>
</div>
</li>
<li>
<div class="app">
<span class="icon"><img src="static/image/icon/quanneng.png" width="64" height="64"/></span>
<span class="name">全能計算器</span>
</div>
</li>
<li>
<div class="app">
<span class="icon"><img src="static/image/icon/yuwendaren.png" width="64" height="64"/></span>
<span class="name">有道語文達人</span>
</div>
</li>
<li>
<div class="app">
<span class="icon"><img src="static/image/icon/qinqi.png" width="64" height="64"/></span>
<span class="name">親戚計算器</span>
</div>
</li>
</ul>
</div>
</div>
</div>
<div class="mod-foot">
<div class="inner">
<div class="bd">
<div class="box">
<p><img src="static/image/qrcode.jpg" width="150" alt="親戚關系微信小程序"/></p>
<p>微信掃一掃,使用小程序</p>
</div>
<p>Copyright © <a href="http://passer-by.com">passer-by.com</a></p>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="dist/relationship.zh-HK.min.js"></script>
<script type="text/javascript" src="dist/relationship-mode.zh-HK.min.js"></script>
<script type="text/javascript">
// 獲取數量
document.getElementById('count').innerText = relationship.dataCount;
// 自定義模式
for(var key in relationshipMode){
relationship.setMode(key,relationshipMode[key]['data']);
}
// 標籤頁
(function(){
var $module = document.querySelector('.mod-panel');
var $items = $module.querySelectorAll('li');
var $panels = $module.querySelectorAll('.c-panel');
for(var i=0;i<$items.length;i++){
(function(i){
$items[i].addEventListener('click',function(){
for(var j=0;j<$panels.length;j++){
$items[j].className = i==j?'active':'';
$panels[j].style.display = i==j?'block':'none';
}
});
})(i);
}
})();
// 關系找稱呼
(function(){
var $module = document.querySelector('.mod-panel');
var $panel = $module.querySelector('.c-panel:nth-child(1)');
var $radio = $panel.querySelectorAll('input[type="radio"]');
var $mode = $panel.querySelectorAll('input[name="mode"]');
var $sex = $panel.querySelectorAll('input[name="sex"]');
var $reverse = $panel.querySelectorAll('input[name="reverse"]');
var $small_btns = $panel.querySelectorAll('.btn-small');
var $input = $panel.querySelector('textarea[name="input"]');
var $result = $panel.querySelector('textarea[name="result"]');
var toggleSex = function(sex){
if(sex){ //男女判斷
$small_btns[2].disabled=true;
$small_btns[3].disabled=false;
}else{
$small_btns[2].disabled=false;
$small_btns[3].disabled=true;
}
}
var count = function(){
var value = $input.value.trim();
if(value){
var sex = $sex[0].checked?1:0;
var mode = 'default';
if($mode[1].checked){
mode = $mode[1].value;
}else if($mode[2].checked){
mode = $mode[2].value;
}
var reverse = !$reverse[0].checked;
var result = relationship({text:value,sex:sex,reverse:reverse,mode:mode});
$result.value = '';
if(result.length){
$result.value = result.join('\n');
}else{
$result.value = '貌似他/她跟你不是很熟哦!';
}
}else{
$result.value = '';
}
};
var bindChange = function(){
var value = $input.value.trim();
if(value){
var input_result = relationship({text:value.split('的')[0],sex:-1,type:'chain'});
var output_result = relationship({text:value,sex:-1,type:'chain'});
if(input_result.length){
var isFamale = input_result.every(function(value){
return value.split('的').shift()=='老公';
});
var isMale = input_result.every(function(value){
return value.split('的').shift()=='老婆';
});
if(isFamale){
$sex[1].checked = true;
}else if(isMale){
$sex[0].checked = true;
}
}
if(output_result.length){
var name = output_result[0].split('的').pop();
if(!name){
toggleSex($sex[0].checked);
}else{
toggleSex('爸爸,老公,兒子,哥哥,弟弟,兄弟'.indexOf(name)>-1);
}
}
}else{
$result.value = '';
}
};
for(var i=0;i<$small_btns.length;i++){
$small_btns[i].onclick = function(){
var value = $input.value.trim();
var name = this.getAttribute('data-value');
if(value){
$input.value= value+'的'+name;
}else{
$input.value= name;
}
toggleSex('爸爸,老公,兒子,哥哥,弟弟,兄弟'.indexOf(name)>-1);
}
}
for(var i=0;i<$radio.length;i++){
$radio[i].onchange=function(){
toggleSex($sex[0].checked);
if($result.value){
count();
}
}
}
var hander = null;
$input.addEventListener('paste',function(){
hander&&clearTimeout(bindChange,250);
hander = setTimeout(bindChange,250);
});
$input.addEventListener('input',function(){
hander&&clearTimeout(bindChange,250);
hander = setTimeout(bindChange,250);
});
$panel.querySelector('.btn-orange').addEventListener('click',function(){
var value = $input.value.trim();
var index = value.lastIndexOf('的');
index = Math.max(0,index);
var search = value.substr(0,index);
$input.value = search;
$result.value = '';
var name = search.split('的').pop();
if(!name){
toggleSex($sex[0].checked);
}else{
toggleSex('爸爸,老公,兒子,哥哥,弟弟'.indexOf(name)>-1);
}
});
$panel.querySelector('.btn-red').addEventListener('click',function(){
$result.value = $input.value = '';
toggleSex($sex[0].checked);
});
$panel.querySelector('.btn-green').addEventListener('click',count);
toggleSex($sex[0].checked);
})();
// 稱呼找關系
(function(){
var $module = document.querySelector('.mod-panel');
var $panel = $module.querySelector('.c-panel:nth-child(2)');
var $radio = $panel.querySelectorAll('input[type="radio"]');
var $input = $panel.querySelector('input[name="input"]');
var $result = $panel.querySelector('textarea[name="result"]');
var count = function(){
var value = $input.value.trim();
if(value){
var result = relationship({text:value,type:'chain'});
if(result.length){
$result.value = result.join('\n');
}else{
$result.value = '貌似他/她跟你不是很熟哦!';
}
}else{
$result.value = '';
}
};
$panel.querySelector('.btn-red').onclick = function(){
$result.value = $input.value = '';
};
$panel.querySelector('.btn-green').onclick = count;
})();
// 兩者間稱呼
(function(){
var $module = document.querySelector('.mod-panel');
var $panel = $module.querySelector('.c-panel:nth-child(3)');
var $radio = $panel.querySelectorAll('input[type="radio"]');
var $reverse = $panel.querySelectorAll('input[name="reverse2"]');
var $optimal = $panel.querySelectorAll('input[name="optimal"]');
var $person = $panel.querySelector('input[name="person"]');
var $target = $panel.querySelector('input[name="target"]');
var $result = $panel.querySelector('textarea[name="result"]');
var count = function(){
var person = $person.value.trim();
var target = $target.value.trim();
if(person){
if($reverse[0].checked){
var temp = target;
target = person;
person = temp;
}
var result = relationship({text:person,target:target,optimal:$optimal[0].checked});
if(result.length){
$result.value = result.join('\n');
}else{
$result.value = '他們貌似不是很熟哦!';
}
}else{
$result.value = '';
}
};
for(var i=0;i<$radio.length;i++){
$radio[i].onchange=function(){
if($result.value){
count();
}
}
}
$panel.querySelector('.btn-red').onclick = function(){
$result.value = $person.value = $target.value = '';
};
$panel.querySelector('.btn-green').onclick = count;
})();
// 兩者的稱呼
(function(){
var $module = document.querySelector('.mod-panel');
var $panel = $module.querySelector('.c-panel:nth-child(4)');
var $radio = $panel.querySelectorAll('input[type="radio"]');
var $optimal = $panel.querySelectorAll('input[name="optimal"]');
var $person = $panel.querySelector('input[name="person"]');
var $target = $panel.querySelector('input[name="target"]');
var $result = $panel.querySelector('textarea[name="result"]');
var count = function(){
var person = $person.value.trim();
var target = $target.value.trim();
if(person){
var result = relationship({text:person,target:target,type:'pair',optimal:$optimal[0].checked});
if(result.length){
$result.value = result.join('\n');
}else{
$result.value = '未找到合稱!';
}
}else{
$result.value = '';
}
};
for(var i=0;i<$radio.length;i++){
$radio[i].onchange=function(){
if($result.value){
count();
}
}
}
$panel.querySelector('.btn-red').onclick = function(){
$result.value = $person.value = $target.value = '';
};
$panel.querySelector('.btn-green').onclick = count;
})();
</script>
<script async defer src="https://cdn.bootcdn.net/ajax/libs/github-buttons/2.21.1/buttons.min.js"></script>
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?b86879c9cc57dd112fe1f7dd75206b82";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<script>
(function(){
var bp = document.createElement('script');
var curProtocol = window.location.protocol.split(':')[0];
if (curProtocol === 'https') {
bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
}
else {
bp.src = 'http://push.zhanzhang.baidu.com/push.js';
}
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(bp, s);
})();
</script>
</body>
</html>