-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
1225 lines (796 loc) · 34.4 KB
/
index.html
File metadata and controls
1225 lines (796 loc) · 34.4 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
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
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="zh-tw">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="generator" content="Hugo 0.53 with theme Tranquilpeak 0.4.3-BETA">
<title>sleepycookie's blog</title>
<meta name="author" content="kwei">
<meta name="keywords" content=", Hugo, coding, js, engineer, sleepycookie">
<link rel="icon" href="https://sleepyman212.github.io/favicon.png">
<link rel="alternate" type="application/rss+xml" title="RSS" href="https://sleepyman212.github.io/index.xml">
<meta name="description" content="sleepycokie 的 blog 分享一些程式解題的心得和隨筆心得">
<meta property="og:description" content="sleepycokie 的 blog 分享一些程式解題的心得和隨筆心得">
<meta property="og:type" content="blog">
<meta property="og:title" content="sleepycookie's blog">
<meta property="og:url" content="/">
<meta property="og:site_name" content="sleepycookie's blog">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="sleepycookie's blog">
<meta name="twitter:description" content="sleepycokie 的 blog 分享一些程式解題的心得和隨筆心得">
<meta property="og:image" content="https://sleepyman212.github.io/images/cat.jpg">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.4/jquery.fancybox.min.css" integrity="sha256-vuXZ9LGmmwtjqFX1F+EKin1ThZMub58gKULUyf0qECk=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.4/helpers/jquery.fancybox-thumbs.min.css" integrity="sha256-SEa4XYAHihTcEP1f5gARTB2K26Uk8PsndQYHQC1f4jU=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://sleepyman212.github.io/css/style-jsjn0006wyhpyzivf6yceb31gvpjatbcs3qzjvlumobfnugccvobqwxnnaj8.min.css" />
<script type="application/javascript">
var doNotTrack = false;
if (!doNotTrack) {
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-119870337-1', 'auto');
ga('send', 'pageview');
}
</script>
<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
</head>
<body>
<div id="blog">
<header id="header" data-behavior="1">
<i id="btn-open-sidebar" class="fa fa-lg fa-bars"></i>
<div class="header-title">
<a class="header-title-link" href="https://sleepyman212.github.io/">sleepycookie's blog</a>
</div>
<a class="header-right-picture "
href="https://sleepyman212.github.io/#about">
<img class="header-picture" src="https://sleepyman212.github.io/images/cat.jpg" alt="作者的圖片" />
</a>
</header>
<nav id="sidebar" data-behavior="1">
<div class="sidebar-container">
<div class="sidebar-profile">
<a href="https://sleepyman212.github.io/#about">
<img class="sidebar-profile-picture" src="https://sleepyman212.github.io/images/cat.jpg" alt="作者的圖片" />
</a>
<h4 class="sidebar-profile-name">kwei</h4>
<h5 class="sidebar-profile-bio">挑戰每天的自己,比昨天更前進一點</h5>
</div>
<ul class="sidebar-buttons">
<li class="sidebar-button">
<a class="sidebar-button-link " href="https://sleepyman212.github.io/">
<i class="sidebar-button-icon fa fa-lg fa-home"></i>
<span class="sidebar-button-desc">首頁</span>
</a>
</li>
<li class="sidebar-button">
<a class="sidebar-button-link " href="https://sleepyman212.github.io/post/">
<i class="sidebar-button-icon fa fa-lg fa-archive"></i>
<span class="sidebar-button-desc">所有文章</span>
</a>
</li>
<li class="sidebar-button">
<a class="sidebar-button-link " href="https://sleepyman212.github.io/tags/">
<i class="sidebar-button-icon fa fa-lg fa-tags"></i>
<span class="sidebar-button-desc">標籤</span>
</a>
</li>
<li class="sidebar-button">
<a class="sidebar-button-link " href="https://sleepyman212.github.io/#about">
<i class="sidebar-button-icon fa fa-lg fa-question"></i>
<span class="sidebar-button-desc">關於</span>
</a>
</li>
<li class="sidebar-button">
<a class="sidebar-button-link " href="https://sleepyman212.github.io/categories/">
<i class="sidebar-button-icon fa fa-lg fa-bookmark"></i>
<span class="sidebar-button-desc">分類</span>
</a>
</li>
</ul>
<ul class="sidebar-buttons">
<li class="sidebar-button">
<a class="sidebar-button-link " href="https://github.com/SleepyMan212" target="_blank" rel="noopener">
<i class="sidebar-button-icon fa fa-lg fa-github"></i>
<span class="sidebar-button-desc">GitHub</span>
</a>
</li>
</ul>
<ul class="sidebar-buttons">
<li class="sidebar-button">
<a class="sidebar-button-link " href="https://sleepyman212.github.io/index.xml">
<i class="sidebar-button-icon fa fa-lg fa-rss"></i>
<span class="sidebar-button-desc">Atom</span>
</a>
</li>
</ul>
</div>
</nav>
<div id="main" data-behavior="1"
class="
hasCoverMetaIn
">
<section class="postShorten-group main-content-wrap">
<article class="postShorten postShorten--thumbnailimg-bottom" itemscope itemType="http://schema.org/BlogPosting">
<div class="postShorten-wrap">
<div class="postShorten-header">
<h1 class="postShorten-title" itemprop="headline">
<a class="link-unstyled" href="https://sleepyman212.github.io/post/alphavsopacity/">
AlphaVSOpacity
</a>
</h1>
<div class="postShorten-meta post-meta">
<time itemprop="datePublished" datetime="2019-09-05T01:26:04+08:00">
九月 5, 2019
</time>
<span>分類</span>
<a class="category-link" href="https://sleepyman212.github.io/categories/%e5%89%8d%e7%ab%af">前端</a>
</div>
</div>
<div class="postShorten-excerpt" itemprop="articleBody">
<h1 id="opacity-跟-background-差別">opacity 跟 background 差別</h1>
<ul>
<li>opacity 子元素都會受影響,也會變成透明</li>
<li>background-color 子元素就不會影響</li>
</ul>
<h2 id="example">example</h2>
<h3 id="opacity">opacity</h3>
<p><style>
.bg1{
width: 700px;
height: 500px;
background-position:center;
color:black;
font-size:8rem;
opacity:.6;
}
.bg1-txt{
width:100%;
height:100%;
display:flex;
justify-content:center;
align-items:center;
}
</style>
<div class='bg1' style="background: url('/images/alphaBG.png');">
<div class='bg1-txt'>
Test
</div>
</div></p>
<pre><code class="language-htmlmixed="><style>
.bg{
background: url("/images/alphaBG.png");
width: 800px;
height:600px;
background-position:center;
color:black;
font-size:8rem;
opacity:.6;
}
.bg-txt{
width:100%;
height:100%;
display:flex;
justify-content:center;
align-items:center;
}
</style>
<div class='bg'>
<div class='bg-txt'>
Test
</div>
</div>
</code></pre>
<blockquote>
<p>上面的範例連文字都會有透明</p>
</blockquote>
<h3 id="backgroud">backgroud</h3>
<p><style>
.bg{
width: 700px;
height:500px;
background-position:center;
color:black;
font-size:8rem;
}
.bg-txt{
width:100%;
height:100%;
background: rgba(255,255,255,.3);
display:flex;
justify-content:center;
align-items:center;
}
</style>
<div class='bg' style="background: url('/images/alphaBG.png');">
<div class='bg-txt'>
Test
</div>
</div></p>
<pre><code class="language-htmlmixed="><style>
.bg{
background: url("/images/alphaBG.png");
width: 800px;
height:600px;
background-position:center;
color:black;
font-size:8rem;
}
.bg-txt{
width:100%;
height:100%;
background: rgba(255,255,255,.3);
display:flex;
justify-content:center;
align-items:center;
}
</style>
<div class='bg'>
<div class='bg-txt'>
Test
</div>
</div>
</code></pre>
<blockquote>
<p>文字不會透明了,只有背竟有透明一點</p>
</blockquote>
<h2 id="參考資料">參考資料</h2>
<p><a href="https://www.youtube.com/watch?v=yxAGnwgzM4E">CSS Opacity VS Alpha | Opacity 跟 Alpha的差異 | 調整透明度</a>
<a href="https://kknews.cc/zh-tw/tech/va6zgml.html">CSS實現背景圖片透明,文字不透明效果</a></p>
<p>
<a href="https://sleepyman212.github.io/post/alphavsopacity/" class="postShorten-excerpt_link link">繼續閱讀</a>
</p>
</div>
</div>
</article>
<article class="postShorten postShorten--thumbnailimg-bottom" itemscope itemType="http://schema.org/BlogPosting">
<div class="postShorten-wrap">
<div class="postShorten-header">
<h1 class="postShorten-title" itemprop="headline">
<a class="link-unstyled" href="https://sleepyman212.github.io/post/fetch_post/">
Fetch POST 傳遞資料
</a>
</h1>
<div class="postShorten-meta post-meta">
<time itemprop="datePublished" datetime="2019-07-28T22:45:06+08:00">
七月 28, 2019
</time>
<span>分類</span>
<a class="category-link" href="https://sleepyman212.github.io/categories/%e5%89%8d%e7%ab%af">前端</a>
</div>
</div>
<div class="postShorten-excerpt" itemprop="articleBody">
<p>最近剛好在使用 fetch 代替 ajax ,剛好遇到了一些小問題,所以寫下來提醒一下自己</p>
<p>fetch 是一個新的 API 可以讓我們可以去做 AJAX ,而且用起來更直觀</p>
<p>當要使用 fetch 來做 POST 我們可以用以下的寫法:</p>
<pre><code class="language-javascript">fetch(URL,{
method:'POST',
method: 'cors' // 用來作為 跨域請求用的
})
</code></pre>
<p>這樣就可以使用 fetch 發出 POST 的請求,當我們要附上資料時,可以用 FormData 這一個 class 來帶上我們的資料</p>
<p><code>const fd = new FormData([可以直接指定 dom 元素是 form 的])</code></p>
<pre><code class="language-javascript">const fd = FormData();
fd.append('key',value);
</code></pre>
<p>可以用以上兩種方法來給 FormData 資料</p>
<p>最後只需要把 FormData 帶入 fetch 中的欄位,就可以成功帶上資料了</p>
<pre><code class="language-javascript">fetch(URL,{
method:'POST',
method: 'cors', // 用來作為 跨域請求用的
body: fd
})
</code></pre>
<blockquote>
<p>這邊不需要去指定 Content-Type ,因為 fetch 會幫我們帶上適當的屬性</p>
</blockquote>
<p>
<a href="https://sleepyman212.github.io/post/fetch_post/" class="postShorten-excerpt_link link">繼續閱讀</a>
</p>
</div>
</div>
</article>
<article class="postShorten postShorten--thumbnailimg-bottom" itemscope itemType="http://schema.org/BlogPosting">
<div class="postShorten-wrap">
<div class="postShorten-header">
<h1 class="postShorten-title" itemprop="headline">
<a class="link-unstyled" href="https://sleepyman212.github.io/post/moodle_build/">
建立 moodle 工作環境
</a>
</h1>
<div class="postShorten-meta post-meta">
<time itemprop="datePublished" datetime="2019-04-21T02:38:03+08:00">
四月 21, 2019
</time>
<span>分類</span>
<a class="category-link" href="https://sleepyman212.github.io/categories/moddle">moddle</a>
</div>
</div>
<div class="postShorten-excerpt" itemprop="articleBody">
環境要求 os ubuntu 18.04.1 apache mysql php moodle 3.x 安裝教學 用來建立 server 用的 apache 更新套件 sudo apt update 安裝apache sudo apt install apache2 讓 apache 可以通過防火牆之前,先看一下 sudo ufw app list 現在讓 apache 可以通
<p>
<a href="https://sleepyman212.github.io/post/moodle_build/" class="postShorten-excerpt_link link">繼續閱讀</a>
</p>
</div>
</div>
</article>
<article class="postShorten postShorten--thumbnailimg-bottom" itemscope itemType="http://schema.org/BlogPosting">
<div class="postShorten-wrap">
<div class="postShorten-header">
<h1 class="postShorten-title" itemprop="headline">
<a class="link-unstyled" href="https://sleepyman212.github.io/post/cas_build/">
建立 CAS server
</a>
</h1>
<div class="postShorten-meta post-meta">
<time itemprop="datePublished" datetime="2019-04-21T02:33:02+08:00">
四月 21, 2019
</time>
<span>分類</span>
<a class="category-link" href="https://sleepyman212.github.io/categories/cas">cas</a>
</div>
</div>
<div class="postShorten-excerpt" itemprop="articleBody">
環境要求 jdk-11 apache-maven-3.5.2 apache-tomcat-9.0.17 install openjdk sudo add-apt-repository ppa:openjdk-r/ppa sudo apt update sudo apt install openjdk-11-jdk java -version #看一下版本跟有無安裝成功 install tomcat Create Tomcat User sudo groupadd tomcat #創建一個 tomcat 群組 sudo useradd -s /bin/false -g tomcat -d /opt/tomcat tomcat #創建一個較 tomcat 的使用者
<p>
<a href="https://sleepyman212.github.io/post/cas_build/" class="postShorten-excerpt_link link">繼續閱讀</a>
</p>
</div>
</div>
</article>
<article class="postShorten postShorten--thumbnailimg-bottom" itemscope itemType="http://schema.org/BlogPosting">
<div class="postShorten-wrap">
<div class="postShorten-header">
<h1 class="postShorten-title" itemprop="headline">
<a class="link-unstyled" href="https://sleepyman212.github.io/post/php_session/">
PHP session 換頁找不到了
</a>
</h1>
<div class="postShorten-meta post-meta">
<time itemprop="datePublished" datetime="2019-03-11T02:33:27+08:00">
三月 11, 2019
</time>
<span>分類</span>
<a class="category-link" href="https://sleepyman212.github.io/categories/backend">backEnd</a>
</div>
</div>
<div class="postShorten-excerpt" itemprop="articleBody">
<p>最近重新架 PHP 的環境,在使用 session 的時候發現了問題,當我在這個網頁設定了 session 後,
當我跳轉到另一個網頁後,發現 session 不見了!!!!</p>
<p>我確認了一下我有沒有開啟 session(<code>session_start()</code>) , 也確認了我是在同一個網域底下,結果是我在其中一個關鍵的 php 檔案沒有開啟…</p>
<p>於是我上網找了一下有沒有可以避免的方法,發現是 <code>session.auto_start</code> ,它可以自動幫我們開啟 session ,這樣就不會有時忘了開了,可以在 <code>php_info()</code> 中找找看,如下圖,如果確認沒有開後,可以到 php.ini 裡去改掉他</p>
<p><code>session.auto_start=1</code> 這樣應該就可以了</p>
<p><img src="https://i.imgur.com/oNpf7vl.png" alt="" /></p>
<p>
<a href="https://sleepyman212.github.io/post/php_session/" class="postShorten-excerpt_link link">繼續閱讀</a>
</p>
</div>
</div>
</article>
<article class="postShorten postShorten--thumbnailimg-bottom" itemscope itemType="http://schema.org/BlogPosting">
<div class="postShorten-wrap">
<div class="postShorten-header">
<h1 class="postShorten-title" itemprop="headline">
<a class="link-unstyled" href="https://sleepyman212.github.io/post/box_model/">
Box Model
</a>
</h1>
<div class="postShorten-meta post-meta">
<time itemprop="datePublished" datetime="2019-01-07T04:38:38+08:00">
一月 7, 2019
</time>
<span>分類</span>
<a class="category-link" href="https://sleepyman212.github.io/categories/%e5%89%8d%e7%ab%af">前端</a>
</div>
</div>
<div class="postShorten-excerpt" itemprop="articleBody">
在 HTML 裡的每個元素都有一個 box-model,而 box-model 是用來表達一個元件的呈現方式,在 CSS 裡可以用 box-sizing 這個屬性去設定,以下是他可以設定的值 content-box –> 預設的模
<p>
<a href="https://sleepyman212.github.io/post/box_model/" class="postShorten-excerpt_link link">繼續閱讀</a>
</p>
</div>
</div>
</article>
<article class="postShorten postShorten--thumbnailimg-bottom" itemscope itemType="http://schema.org/BlogPosting">
<div class="postShorten-wrap">
<div class="postShorten-header">
<h1 class="postShorten-title" itemprop="headline">
<a class="link-unstyled" href="https://sleepyman212.github.io/post/accessibility1/">
無障礙網頁規範
</a>
</h1>
<div class="postShorten-meta post-meta">
<time itemprop="datePublished" datetime="2018-12-15T20:32:24+08:00">
十二月 15, 2018
</time>
<span>分類</span>
<a class="category-link" href="https://sleepyman212.github.io/categories/accessibility">accessibility</a>
</div>
</div>
<div class="postShorten-excerpt" itemprop="articleBody">
以下是網站無障礙規範 2.0 的內容 我把 AA 級的規範盡量拿出來,如果要達到 AAA 級,仍需到網站無障礙規範 2.0參考 1. (替代文字)為任何非文字的內容提供相等
<p>
<a href="https://sleepyman212.github.io/post/accessibility1/" class="postShorten-excerpt_link link">繼續閱讀</a>
</p>
</div>
</div>
</article>
<div class="pagination-bar">
<ul class="pagination">
<li class="pagination-next">
<a class="btn btn--default btn--small" href="https://sleepyman212.github.io/page/2/">
<span>下一頁</span>
<i class="fa fa-angle-right text-base icon-ml"></i>
</a>
</li>
<li class="pagination-number">第 1 頁 共 3 頁</li>
</ul>
</div>
</section>
<footer id="footer" class="main-content-wrap">
<span class="copyrights">
© 2019 <a href="https://github.com/SleepyMan212">SleepyMan212</a>. All Rights Reserved
</span>
<span id="busuanzi_container_site_uv">
本站訪客人數:<span id="busuanzi_value_site_uv"></span>次
</span>
<span id="busuanzi_container_site_pv">
本站瀏覽量<span id="busuanzi_value_site_pv"></span>次
</span>
</footer>
</div>
</div>
<div id="about">
<div id="about-card">
<div id="about-btn-close">
<i class="fa fa-remove"></i>
</div>
<img id="about-card-picture" src="https://sleepyman212.github.io/images/cat.jpg" alt="作者的圖片" />
<h4 id="about-card-name">kwei</h4>
<div id="about-card-bio">挑戰每天的自己,比昨天更前進一點</div>
<div id="about-card-job">
<i class="fa fa-briefcase"></i>
<br/>
CCU_Student
</div>
<div id="about-card-location">
<i class="fa fa-map-marker"></i>
<br/>
Taiwan
</div>
</div>
</div>
<div id="algolia-search-modal" class="modal-container">
<div class="modal">
<div class="modal-header">
<span class="close-button"><i class="fa fa-close"></i></span>
<a href="https://algolia.com" target="_blank" rel="noopener" class="searchby-algolia text-color-light link-unstyled">
<span class="searchby-algolia-text text-color-light text-small">by</span>
<img class="searchby-algolia-logo" src="https://www.algolia.com/static_assets/images/press/downloads/algolia-light.svg">
</a>
<i class="search-icon fa fa-search"></i>
<form id="algolia-search-form">
<input type="text" id="algolia-search-input" name="search"
class="form-control input--large search-input" placeholder="搜尋" />
</form>
</div>
<div class="modal-body">
<div class="no-result text-color-light text-center">沒有找到文章</div>
<div class="results">
<div class="media">
<div class="media-body">
<a class="link-unstyled" href="https://sleepyman212.github.io/post/alphavsopacity/">
<h3 class="media-heading">AlphaVSOpacity</h3>
</a>
<span class="media-meta">
<span class="media-date text-small">
Sep 9, 2019
</span>
</span>
<div class="media-content hide-xs font-merryweather"><h1 id="opacity-跟-background-差別">opacity 跟 background 差別</h1>
<ul>
<li>opacity 子元素都會受影響,也會變成透明</li>
<li>background-color 子元素就不會影響</li>
</ul>
<h2 id="example">example</h2>
<h3 id="opacity">opacity</h3>
<p><style>
.bg1{
width: 700px;
height: 500px;
background-position:center;
color:black;
font-size:8rem;
opacity:.6;
}
.bg1-txt{
width:100%;
height:100%;
display:flex;
justify-content:center;
align-items:center;
}
</style>
<div class='bg1' style="background: url('/images/alphaBG.png');">
<div class='bg1-txt'>
Test
</div>
</div></p>
<pre><code class="language-htmlmixed="><style>
.bg{
background: url("/images/alphaBG.png");
width: 800px;
height:600px;
background-position:center;
color:black;
font-size:8rem;
opacity:.6;
}
.bg-txt{
width:100%;
height:100%;
display:flex;
justify-content:center;
align-items:center;
}
</style>
<div class='bg'>
<div class='bg-txt'>
Test
</div>
</div>
</code></pre>
<blockquote>
<p>上面的範例連文字都會有透明</p>
</blockquote>
<h3 id="backgroud">backgroud</h3>
<p><style>
.bg{
width: 700px;
height:500px;
background-position:center;
color:black;
font-size:8rem;
}
.bg-txt{
width:100%;
height:100%;
background: rgba(255,255,255,.3);
display:flex;
justify-content:center;
align-items:center;
}
</style>
<div class='bg' style="background: url('/images/alphaBG.png');">
<div class='bg-txt'>
Test
</div>
</div></p>
<pre><code class="language-htmlmixed="><style>
.bg{
background: url("/images/alphaBG.png");
width: 800px;
height:600px;
background-position:center;
color:black;
font-size:8rem;
}
.bg-txt{
width:100%;
height:100%;
background: rgba(255,255,255,.3);
display:flex;
justify-content:center;
align-items:center;
}
</style>
<div class='bg'>
<div class='bg-txt'>
Test
</div>
</div>
</code></pre>
<blockquote>
<p>文字不會透明了,只有背竟有透明一點</p>
</blockquote>
<h2 id="參考資料">參考資料</h2>
<p><a href="https://www.youtube.com/watch?v=yxAGnwgzM4E">CSS Opacity VS Alpha | Opacity 跟 Alpha的差異 | 調整透明度</a>
<a href="https://kknews.cc/zh-tw/tech/va6zgml.html">CSS實現背景圖片透明,文字不透明效果</a></p></div>
</div>
<div style="clear:both;"></div>
<hr>
</div>
<div class="media">
<div class="media-body">
<a class="link-unstyled" href="https://sleepyman212.github.io/post/fetch_post/">
<h3 class="media-heading">Fetch POST 傳遞資料</h3>
</a>
<span class="media-meta">
<span class="media-date text-small">
Jul 7, 2019
</span>
</span>
<div class="media-content hide-xs font-merryweather"><p>最近剛好在使用 fetch 代替 ajax ,剛好遇到了一些小問題,所以寫下來提醒一下自己</p>
<p>fetch 是一個新的 API 可以讓我們可以去做 AJAX ,而且用起來更直觀</p>
<p>當要使用 fetch 來做 POST 我們可以用以下的寫法:</p>
<pre><code class="language-javascript">fetch(URL,{
method:'POST',