/
index.html
987 lines (600 loc) · 31.3 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
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
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme="auto">
<head>
<meta charset="UTF-8">
<link rel="apple-touch-icon" sizes="76x76" href="https://aigisss.com/media/icons/favicon.png">
<link rel="icon" href="https://aigisss.com/media/icons/favicon.png">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="theme-color" content="#2f4154">
<meta name="description" content="真正的伟大,即在于以脆弱的凡人之躯而具有神性的不可战胜。">
<meta name="author" content="Hai">
<meta name="keywords" content="爱即是诗,blog">
<title>AIGISSS</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css" />
<!-- 主题依赖的图标库,不要自行修改 -->
<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_ba1fz6golrf.css">
<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_kmeydafke9r.css">
<link rel="stylesheet" href="/blog/css/main.css" />
<!-- 自定义样式保持在最底部 -->
<link rel="stylesheet" href="/blog/styles/style.css">
<script id="fluid-configs">
var Fluid = window.Fluid || {};
var CONFIG = {"hostname":"www.aigisss.com","root":"/blog/","version":"1.8.11","typing":{"enable":true,"typeSpeed":70,"cursorChar":"✦","loop":false},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"right","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":200}},"copy_btn":true,"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":true,"baidu":"e57601b965796b6bd88329a0ca1e8b5e","google":147234769,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":"diTi74ah5rpPDNa6bjS0VjqN-gzGzoHsz","app_key":"nHbjOKICQKYQtsVVJjeHYl0O","server_url":"https://diti74ah.lc-cn-n1-shared.com"}},"search_path":"/blog/local-search.xml"};
</script>
<script src="/blog/js/utils.js" ></script>
<script src="/blog/js/color-schema.js" ></script>
<meta name="generator" content="Hexo 5.4.0"></head>
<body><!-- hexo injector body_begin start --><div id="web_bg"></div><!-- hexo injector body_begin end -->
<header style="height: 100vh;">
<nav id="navbar" class="navbar fixed-top navbar-expand-lg navbar-dark scrolling-navbar">
<div class="container">
<a class="navbar-brand"
href="/blog/"> <strong>AIGISSS</strong> </a>
<button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<div class="animated-icon"><span></span><span></span><span></span></div>
</button>
<!-- Collapsible content -->
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto text-center">
<li class="nav-item">
<a class="nav-link" target="_blank" rel="noopener external nofollow noreferrer" href="http://aigisss.com">
<i class="iconfont icon-google-fill"></i>
首页
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/blog/">
<i class="iconfont icon-home-fill"></i>
博客
</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" target="_self" role="button"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="iconfont icon-books"></i>
文章
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="/blog/archives/">
<i class="iconfont icon-archive-fill"></i>
归档
</a>
<a class="dropdown-item" href="/blog/categories/">
<i class="iconfont icon-category-fill"></i>
分类
</a>
<a class="dropdown-item" href="/blog/tags/">
<i class="iconfont icon-tags-fill"></i>
标签
</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="/blog/photos/">
<i class="iconfont icon-image"></i>
相册
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/blog/about/">
<i class="iconfont icon-user-fill"></i>
关于
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/blog/links/">
<i class="iconfont icon-link-fill"></i>
友链
</a>
</li>
<li class="nav-item" id="search-btn">
<a class="nav-link" target="_self" data-toggle="modal" data-target="#modalSearch"> <i
class="iconfont icon-search"></i> </a>
</li>
<li class="nav-item" id="color-toggle-btn">
<a class="nav-link" target="_self"> <i
class="iconfont icon-dark" id="color-toggle-icon"></i> </a>
</li>
</ul>
</div>
</div>
</nav>
<div class="banner" id="banner" parallax=true
style="background: url('https://static.zcool.cn/passport4.0/images/login-tommyp.jpg') no-repeat center center;
background-size: cover;">
<div class="full-bg-img">
<div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
<div class="page-header text-center fade-in-up">
<span class="h2" id="subtitle" title="爱即是诗的博客">
</span>
</div>
<div class="scroll-down-bar">
<i class="iconfont icon-arrowdown"></i>
</div>
</div>
</div>
</div>
</header>
<main>
<div class="container nopadding-x-md">
<div class="py-5" id="board"
style=margin-top:0>
<div class="container">
<div class="row">
<div class="col-12 col-md-10 m-auto">
<div class="row mx-auto index-card">
<div class="col-12 col-md-4 m-auto index-img">
<a href="/blog/posts/ba2c7364.html" target="_self">
<img src="/blog/posts/ba2c7364/prototype.png" srcset="/blog/img/loading.gif" lazyload alt="JavaScript整理之从原型到原型链">
</a>
</div>
<article class="col-12 col-md-8 mx-auto index-info">
<h1 class="index-header">
<a href="/blog/posts/ba2c7364.html" target="_self">
JavaScript整理之从原型到原型链
</a>
</h1>
<p class="index-excerpt">
<a href="/blog/posts/ba2c7364.html" target="_self">
前言先直接上一个原型链图以便讲解:
图中Parent是构造函数,p1是通过Parent实例化出来的一个对象。
想要弄清楚原型和原型链,这几个属性必须要搞清楚,__proto__、prototype、 constructor。JavaScript中一切皆对象,函数也是对象。函数中有个特殊的函数——构造函数,任何函数都可以作为构造函数,但是并不能将任意函数叫做构造函数,只有当一个函数通过new关键字
</a>
</p>
<div class="index-btm post-metas">
<div class="post-meta mr-3">
<i class="iconfont icon-date"></i>
<time datetime="2021-09-05 11:07" pubdate>
2021-09-05
</time>
</div>
<div class="post-meta">
<i class="iconfont icon-tags"></i>
<a href="/blog/tags/JavaScript/">JavaScript</a>
</div>
</div>
</article>
</div>
<div class="row mx-auto index-card">
<div class="col-12 col-md-4 m-auto index-img">
<a href="/blog/posts/90da98cf.html" target="_self">
<img src="/blog/posts/90da98cf/rollup-1626491194567.jpg" srcset="/blog/img/loading.gif" lazyload alt="使用Rollup创作一个可以随处使用的JavaScript库">
</a>
</div>
<article class="col-12 col-md-8 mx-auto index-info">
<h1 class="index-header">
<a href="/blog/posts/90da98cf.html" target="_self">
使用Rollup创作一个可以随处使用的JavaScript库
</a>
</h1>
<p class="index-excerpt">
<a href="/blog/posts/90da98cf.html" target="_self">
前言在本文中,我们的目标是创建和发布一个无需更改代码即可在客户端和服务器端应用程序中使用的库。
我们需要满足以下用例:
该库是用 ES6+ 编写的,使用 import 和 export 关键字
该库可以与 <script>标签一起使用
该库可用于使用现代打包器的 Web 应用程序。
该库可用于Node应用程序。
从技术上讲,这意味着库需要在以下上下文中工作:
使用<scrip
</a>
</p>
<div class="index-btm post-metas">
<div class="post-meta mr-3">
<i class="iconfont icon-date"></i>
<time datetime="2021-07-17 10:59" pubdate>
2021-07-17
</time>
</div>
<div class="post-meta">
<i class="iconfont icon-tags"></i>
<a href="/blog/tags/rollup/">rollup</a>
</div>
</div>
</article>
</div>
<div class="row mx-auto index-card">
<div class="col-12 col-md-4 m-auto index-img">
<a href="/blog/posts/b6b80389.html" target="_self">
<img src="/blog/posts/b6b80389/node-sass.png" srcset="/blog/img/loading.gif" lazyload alt="安装node-sass的几个方法">
</a>
</div>
<article class="col-12 col-md-8 mx-auto index-info">
<h1 class="index-header">
<a href="/blog/posts/b6b80389.html" target="_self">
安装node-sass的几个方法
</a>
</h1>
<p class="index-excerpt">
<a href="/blog/posts/b6b80389.html" target="_self">
安装 node-sass 的时候总是会各种不成功,安装 node-sass 时在 node scripts/install 阶段会从 github.com 上下载一个 .node 文件,大部分安装不成功的原因都源自这里,因为 GitHub Releases 里的文件都托管在 s3.amazonaws.com 上面,而这个网址在国内总是网络不稳定,所以我们需要通过第三方服务器下载这个文件。https
</a>
</p>
<div class="index-btm post-metas">
<div class="post-meta mr-3">
<i class="iconfont icon-date"></i>
<time datetime="2021-07-05 09:12" pubdate>
2021-07-05
</time>
</div>
<div class="post-meta">
<i class="iconfont icon-tags"></i>
<a href="/blog/tags/node-sass/">node-sass</a>
</div>
</div>
</article>
</div>
<div class="row mx-auto index-card">
<div class="col-12 col-md-4 m-auto index-img">
<a href="/blog/posts/8479a1a4.html" target="_self">
<img src="/blog/posts/8479a1a4/supervisor.jpg" srcset="/blog/img/loading.gif" lazyload alt="supervisor的使用记录">
</a>
</div>
<article class="col-12 col-md-8 mx-auto index-info">
<h1 class="index-header">
<a href="/blog/posts/8479a1a4.html" target="_self">
supervisor的使用记录
</a>
</h1>
<p class="index-excerpt">
<a href="/blog/posts/8479a1a4.html" target="_self">
前言为啥使用supervisor,因为最近给我的API服务增加了一个定时任务,需要后台一直运行一条命令行,当关掉这个命令行时任务就不会跑了,各种搜索,定位到supervisor能解决这个问题。于是了解了一下,发现Supervisor还能解决Django项目不能自动启动的问题。Supervisor是用Python开发的一套通用的进程管理程序,能将一个普通的命令行进程变为后台daemon,并监控进程状
</a>
</p>
<div class="index-btm post-metas">
<div class="post-meta mr-3">
<i class="iconfont icon-date"></i>
<time datetime="2021-06-12 16:08" pubdate>
2021-06-12
</time>
</div>
<div class="post-meta">
<i class="iconfont icon-tags"></i>
<a href="/blog/tags/supervisor/">supervisor</a>
</div>
</div>
</article>
</div>
<div class="row mx-auto index-card">
<div class="col-12 col-md-4 m-auto index-img">
<a href="/blog/posts/1563abd8.html" target="_self">
<img src="/blog/posts/1563abd8/fluid.png" srcset="/blog/img/loading.gif" lazyload alt="基于hexo的fluid主题的魔改汇总">
</a>
</div>
<article class="col-12 col-md-8 mx-auto index-info">
<h1 class="index-header">
<a href="/blog/posts/1563abd8.html" target="_self">
基于hexo的fluid主题的魔改汇总
</a>
</h1>
<p class="index-excerpt">
<a href="/blog/posts/1563abd8.html" target="_self">
前言所谓魔改,就是与主题不同,一旦主题已经被采用或者被实现,则会被划掉,而且魔改初心是使用无侵入式的方式修改——即不修改源码,而是使用注入器的方式。这样的话主题升级比较容易!
背景固定效果如背景所示,这种效果贯穿着整个博客。具体做法如下:使用注入器(如果没有injector.js文件,则在scripts文件夹下新建injector.js),在injector.js中写下这些代码。
12345678
</a>
</p>
<div class="index-btm post-metas">
<div class="post-meta mr-3">
<i class="iconfont icon-date"></i>
<time datetime="2021-04-24 22:16" pubdate>
2021-04-24
</time>
</div>
<div class="post-meta">
<i class="iconfont icon-tags"></i>
<a href="/blog/tags/hexo/">hexo</a>
<a href="/blog/tags/fluid/">fluid</a>
</div>
</div>
</article>
</div>
<div class="row mx-auto index-card">
<div class="col-12 col-md-4 m-auto index-img">
<a href="/blog/posts/91dc324b.html" target="_self">
<img src="/blog/posts/91dc324b/image-20210418160637890.png" srcset="/blog/img/loading.gif" lazyload alt="在任意hexo主题博客中添加github日历">
</a>
</div>
<article class="col-12 col-md-8 mx-auto index-info">
<h1 class="index-header">
<a href="/blog/posts/91dc324b.html" target="_self">
在任意hexo主题博客中添加github日历
</a>
</h1>
<p class="index-excerpt">
<a href="/blog/posts/91dc324b.html" target="_self">
前言:在博客中添加github的commit的日历,在我博客中的使用的效果如下图:
与其说在任意hexo主题博客中添加github日历,倒不如说是hexo-githubcalendar的使用。
安装hexo-githubcalendar123npm i hexo-githubcalendar --save# 或者cnpm i hexo-githubcalendar --save
注意,一定要加 -
</a>
</p>
<div class="index-btm post-metas">
<div class="post-meta mr-3">
<i class="iconfont icon-date"></i>
<time datetime="2021-04-18 15:56" pubdate>
2021-04-18
</time>
</div>
<div class="post-meta">
<i class="iconfont icon-tags"></i>
<a href="/blog/tags/hexo/">hexo</a>
</div>
</div>
</article>
</div>
<div class="row mx-auto index-card">
<div class="col-12 col-md-4 m-auto index-img">
<a href="/blog/posts/7d474f9c.html" target="_self">
<img src="/blog/posts/7d474f9c/f92417a5da79920f0f2e21bb135a4952.jpg" srcset="/blog/img/loading.gif" lazyload alt="一起学可视化">
</a>
</div>
<article class="col-12 col-md-8 mx-auto index-info">
<h1 class="index-header">
<a href="/blog/posts/7d474f9c.html" target="_self">
一起学可视化
</a>
</h1>
<p class="index-excerpt">
<a href="/blog/posts/7d474f9c.html" target="_self">
什么是可视化可视化用一句话来说,本质上就是将数据信息组织起来后,以图形的方式呈现出来。在 Web 上,图形通常是通过浏览器绘制的。现代浏览器是一个复杂的系统,其中负责绘制图形的部分是渲染引擎。渲染引擎绘制图形的方式,我总结了一下,大体上有 4 种。
HTML+CSS这种方式通常用来呈现普通的 Web 网页。
SVGSVG 和传统的 HTML+CSS 的绘图方式差别不大。只不过,HTML 元素在绘制
</a>
</p>
<div class="index-btm post-metas">
<div class="post-meta mr-3">
<i class="iconfont icon-date"></i>
<time datetime="2021-04-13 09:50" pubdate>
2021-04-13
</time>
</div>
<div class="post-meta">
<i class="iconfont icon-tags"></i>
<a href="/blog/tags/%E5%8F%AF%E8%A7%86%E5%8C%96/">可视化</a>
</div>
</div>
</article>
</div>
<div class="row mx-auto index-card">
<div class="col-12 col-md-4 m-auto index-img">
<a href="/blog/posts/c2d307e0.html" target="_self">
<img src="/blog/posts/c2d307e0/ef778476a893c816039d660885b86122.jpg" srcset="/blog/img/loading.gif" lazyload alt="重学前端总结">
</a>
</div>
<article class="col-12 col-md-8 mx-auto index-info">
<h1 class="index-header">
<a href="/blog/posts/c2d307e0.html" target="_self">
重学前端总结
</a>
</h1>
<p class="index-excerpt">
<a href="/blog/posts/c2d307e0.html" target="_self">
JavaScript关于类型,有哪些你不知道的细节?JavaScript 语言的每一个值都属于某一种数据类型。JavaScript 语言规定了 7 种语言类型。语言类型广泛用于变量、函数参数、表达式、函数返回值等场合。根据最新的语言标准,这 7 种语言类型是:
Undefined、Null、Boolean、String、Number、Symbol。(ES2020新增了Bigint)
Object
</a>
</p>
<div class="index-btm post-metas">
<div class="post-meta mr-3">
<i class="iconfont icon-date"></i>
<time datetime="2021-02-27 11:42" pubdate>
2021-02-27
</time>
</div>
<div class="post-meta">
<i class="iconfont icon-tags"></i>
<a href="/blog/tags/Javascript/">Javascript</a>
</div>
</div>
</article>
</div>
<div class="row mx-auto index-card">
<div class="col-12 col-md-4 m-auto index-img">
<a href="/blog/posts/798ba833.html" target="_self">
<img src="/blog/posts/798ba833/images.jpg" srcset="/blog/img/loading.gif" lazyload alt="hexo的fluid主题添加瀑布流懒加载相册功能">
</a>
</div>
<article class="col-12 col-md-8 mx-auto index-info">
<h1 class="index-header">
<a href="/blog/posts/798ba833.html" target="_self">
hexo的fluid主题添加瀑布流懒加载相册功能
</a>
</h1>
<p class="index-excerpt">
<a href="/blog/posts/798ba833.html" target="_self">
相册演示地址:https://www.aigisss.com/blog/photos/ ,当前演示环境基于hexo===5.2.0 , fluid===1.8.7,很大程度上参考了醉里挑灯赏猫的Hexo NexT 博客增加瀑布流相册页面这篇博客!在此感谢班班提供的帮助!!
创建相册页面新建相册页 hexo new page photos,编辑 /source/photos/index.md,输入
</a>
</p>
<div class="index-btm post-metas">
<div class="post-meta mr-3">
<i class="iconfont icon-date"></i>
<time datetime="2021-01-10 16:57" pubdate>
2021-01-10
</time>
</div>
<div class="post-meta">
<i class="iconfont icon-tags"></i>
<a href="/blog/tags/hexo/">hexo</a>
<a href="/blog/tags/fluid/">fluid</a>
</div>
</div>
</article>
</div>
<div class="row mx-auto index-card">
<div class="col-12 col-md-4 m-auto index-img">
<a href="/blog/posts/d673e1b7.html" target="_self">
<img src="/blog/posts/d673e1b7/123.jpg" srcset="/blog/img/loading.gif" lazyload alt="23种经典的设计模式">
</a>
</div>
<article class="col-12 col-md-8 mx-auto index-info">
<h1 class="index-header">
<a href="/blog/posts/d673e1b7.html" target="_self">
23种经典的设计模式
</a>
</h1>
<p class="index-excerpt">
<a href="/blog/posts/d673e1b7.html" target="_self">
前言23 种经典设计模式共分为 3 种类型,分别是创建型、结构型和行为型
创建型设计模式创建型设计模式包括:单例模式、工厂模式、建造者模式、原型模式。它主要解决对象的创建问题,封装复杂的创建过程,解耦对象的创建代码和使用代码。
单例模式单例模式用来创建全局唯一的对象。一个类只允许创建一个对象(或者叫实例),那这个类就是一个单例类,这种设计模式就叫作单例模式。单例有几种经典的实现方式,它们分别是:
</a>
</p>
<div class="index-btm post-metas">
<div class="post-meta mr-3">
<i class="iconfont icon-date"></i>
<time datetime="2020-12-31 13:21" pubdate>
2020-12-31
</time>
</div>
<div class="post-meta">
<i class="iconfont icon-tags"></i>
<a href="/blog/tags/%E6%80%BB%E7%BB%93/">总结</a>
</div>
</div>
</article>
</div>
<nav aria-label="navigation">
<span class="pagination" id="pagination">
<span class="page-number current">1</span><a class="page-number" href="/blog/page/2/#board">2</a><a class="page-number" href="/blog/page/3/#board">3</a><span class="space">…</span><a class="page-number" href="/blog/page/8/#board">8</a><a class="extend next" rel="next" href="/blog/page/2/#board"><i class="iconfont icon-arrowright"></i></a>
</span>
</nav>
</div>
</div>
</div>
</div>
</div>
<a id="scroll-top-button" href="#" role="button">
<i class="iconfont icon-arrowup" aria-hidden="true"></i>
</a>
<div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
<div class="modal-content">
<div class="modal-header text-center">
<h4 class="modal-title w-100 font-weight-bold">搜索</h4>
<button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body mx-3">
<div class="md-form mb-5">
<input type="text" id="local-search-input" class="form-control validate">
<label data-error="x" data-success="v"
for="local-search-input">关键词</label>
</div>
<div class="list-group" id="local-search-result"></div>
</div>
</div>
</div>
</div>
</main>
<footer class="text-center mt-5 py-3">
<div class="footer-content">
<a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a>
</div>
<div class="statistics">
<!-- LeanCloud 统计PV -->
<span id="leancloud-site-pv-container" style="display: none">
总访问量
<span id="leancloud-site-pv"></span>
次
</span>
<!-- LeanCloud 统计UV -->
<span id="leancloud-site-uv-container" style="display: none">
总访客数
<span id="leancloud-site-uv"></span>
人
</span>
</div>
<!-- 备案信息 -->
<div class="beian">
<span>
<a href="http://beian.miit.gov.cn/" target="_blank" rel="nofollow noopener">
赣ICP备18013338-1号
</a>
</span>
</div>
</footer>
<!-- SCRIPTS -->
<script src="https://cdn.jsdelivr.net/npm/nprogress@0.2.0/nprogress.min.js" ></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nprogress@0.2.0/nprogress.min.css" />
<script>
NProgress.configure({"showSpinner":false,"trickleSpeed":200})
NProgress.start()
window.addEventListener('load', function() {
NProgress.done();
})
</script>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js" ></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.min.js" ></script>
<script src="/blog/js/events.js" ></script>
<script src="/blog/js/plugins.js" ></script>
<!-- Plugins -->
<script src="/blog/js/img-lazyload.js" ></script>
<script defer src="https://cdn.jsdelivr.net/npm/clipboard@2.0.8/dist/clipboard.min.js" ></script>
<script src="/blog/js/local-search.js" ></script>
<script defer src="/blog/js/leancloud.js" ></script>
<script src="https://cdn.jsdelivr.net/npm/typed.js@2.0.12/lib/typed.min.js" ></script>
<script>
(function (window, document) {
var typing = Fluid.plugins.typing;
var title = document.getElementById('subtitle').title;
typing(title)
})(window, document);
</script>
<!-- Baidu Analytics -->
<script defer>
var _hmt = _hmt || [];
(function () {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?e57601b965796b6bd88329a0ca1e8b5e";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<!-- Google Analytics -->
<script defer>
window.ga = window.ga || function () { (ga.q = ga.q || []).push(arguments) };
ga.l = +new Date;
ga('create', '147234769', 'auto');
ga('send', 'pageview');
</script>
<script async src='https://www.google-analytics.com/analytics.js'></script>
<script src="/blog/js/custom.js"></script>
<script src="/blog/js/test.js"></script>
<!-- 主题的启动项 保持在最底部 -->
<script src="/blog/js/boot.js" ></script>
<!-- hexo injector body_end start --><link defer rel="stylesheet" href="/blog/styles/customize.css" />
<script src="/blog/js/backgroundize.js"></script>
<link defer rel="stylesheet" href="/blog/styles/backgroundize.css" />
<script src="/blog/js/banner.js"></script>
<script src="/blog/js/snow.js"></script>
<link defer rel="stylesheet" href="/blog/styles/banner.css" />
<script data-pjax src="https://cdn.jsdelivr.net/gh/Zfour/hexo-github-calendar@1.21/hexo_githubcalendar.js"></script>
<script data-pjax>
function GithubCalendarConfig(){
var git_githubapiurl ="https://python-github-calendar-api.vercel.app/api?cenergy";
var git_color =['#ebedf0', '#fdcdec', '#fc9bd9', '#fa6ac5', '#f838b2', '#f5089f', '#c4067e', '#92055e', '#540336', '#48022f', '#30021f'];
var git_user ="cenergy";
var parent_div_git = document.getElementById('recent-posts');
var git_div_html = '<div class="recent-post-item" style="width:100%;height:auto;padding:10px;"><div id="github_loading" style="width:10%;height:100%;margin:0 auto;display: block"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50" xml:space="preserve"><path fill="#d0d0d0" d="M25.251,6.461c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615V6.461z" transform="rotate(275.098 25 25)"><animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite"></animateTransform></path></svg></div><div id="github_container"></div></div>';
if(parent_div_git && location.pathname =='/blog/about/'){
console.log('已挂载github calendar')
// parent_div_git.innerHTML=git_div_html+parent_div_git.innerHTML // 无报错,但不影响使用(支持pjax跳转)
parent_div_git.insertAdjacentHTML("afterbegin",git_div_html) // 有报错,但不影响使用(支持pjax跳转)
};
GithubCalendar(git_githubapiurl,git_color,git_user)
}
if(document.getElementById('recent-posts')){
GithubCalendarConfig()
}
</script>
<style>#github_container{min-height:280px}@media screen and (max-width:650px) {#github_container{background-image:;min-height:0px}}</style>
<style></style><!-- hexo injector body_end end --></body>
</html>