aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclarkzjw <[email protected]>2022-12-09 17:16:51 -0800
committerclarkzjw <[email protected]>2022-12-09 17:16:51 -0800
commit605513219ae93dff0e0876e8f90f3cf1bf748cf9 (patch)
tree06cb90ff7fd01558159ee556cca36380370181bf /deprecated/2022/js
parent4eb313986873dbc036e9dddbba79ffd4ee578aaf (diff)
downloadjinwei.me-605513219ae93dff0e0876e8f90f3cf1bf748cf9.tar.gz
deprecated: add 2022 github gist versiondeprecated
Diffstat (limited to 'deprecated/2022/js')
-rw-r--r--deprecated/2022/js/blackout.js76
1 files changed, 76 insertions, 0 deletions
diff --git a/deprecated/2022/js/blackout.js b/deprecated/2022/js/blackout.js
new file mode 100644
index 0000000..e0ce075
--- /dev/null
+++ b/deprecated/2022/js/blackout.js
@@ -0,0 +1,76 @@
1//套上CSS樣式
2(function() {
3var blackout_css = document.createElement("style");
4var blackout_css_content = document.createTextNode(
5 "#blackout * { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;}" +
6 "#blackout { background-color: #3C261C; background-image: url(https://cdn.clarkzjw.cn/v_compressed.jpg); background-position: center; background-repeat: no-repeat; background-size: cover; font-size: 16px; height: 100%; left: 0; margin: 0; overflow: hidden; position: fixed; text-align: left; top: 0; -webkit-transition: top 0.8s; transition: top 0.8s; width: 100%; z-index: 99999; }" +
7 "#blackout.out { top: -150%; }" +
8 "#blackout section { background: rgba(0, 0, 0, 0.2); border-radius: 1em; color: white; line-height: 1.5em; margin: 5% auto 3%; max-height: 70%; max-width: 750px; overflow-y: auto; padding: 3%; text-shadow: 1px 3px 3px black; width: 75%; }" +
9 "#blackout p { color: white; line-height: 1.5em; text-shadow: 1px 3px 3px black; }" +
10 "#blackout h1 { border-bottom: 1px solid #CCC; color: white; font-family: sans-serif; font-size: 1.5em; font-weight: bold; line-height: 1.5em; margin: 0 0 1em 0.25em; padding: 0 0 0.25em; }" +
11 "#blackout a { color: #CCC; text-decoration: underline; } #blackout a:hover { background: transparent; color: #EEEEEE; text-decoration: underline; }" +
12 "#blackout .anno { color: #BBB; font-size: 0.9em; margin-bottom: 1.5em; padding: 0 2em; text-shadow: 1px 1px 1px black;}" +
13 "#blackout footer { display: block; height: 20%; text-align: center; } " +
14 "#blackout .blackout-btn { background-color: black; border-radius: 8px; box-shadow: 0 0 15px white; color: white; display: inline-block; line-height: 1.5em; padding: 0.5em 1em; text-decoration: none; }" +
15 "#blackout .blackout-btn:hover { background-color: #333; color: white; text-decoration: none; }"
16);
17blackout_css.appendChild(blackout_css_content);
18
19//騰寫抗議內容
20 var header = document.createElement("header");
21 var title = document.createElement("h1");
22 title.appendChild(document.createTextNode("本網頁基於國家法律而封鎖"));
23 header.appendChild(title);
24
25 var section = document.createElement("section");
26 section.appendChild(header);
27
28 var br = document.createElement("br");
29
30 var content1 = document.createElement("p");
31 content1.appendChild(document.createTextNode("為何看到這個畫面?"));
32
33 var content3 = document.createElement("p");
34 content3.appendChild(document.createTextNode("你知道嗎,政府正打算立法,取得逕自封鎖境外侵權網站的權利。未來本站如果出現利益團體認定的侵權內容,經由政府機關對 ISP 下令,就可以封鎖本站,讓你再也連不上。"));
35 var content31 = document.createElement("p");
36 content31.appendChild(document.createTextNode("如果我們同意提供政府這種權力,以後他們還能以各種理由,任意阻擋他們覺得「不適當」的網站。未來許多網站可能被迫自我審查,在你發言的同時,先看看有沒有「敏感詞」。"));
37
38 var error451a = document.createElement("a");
39 error451a.setAttribute("href", "https://cdn.clarkzjw.cn/451.PNG");
40 error451a.setAttribute("target", "_blank");
41 error451a.appendChild(document.createTextNode("ERROR 451 錯誤頁面"));
42
43 var content4 = document.createElement("p");
44 content4.appendChild(document.createTextNode("我們不希望這種事情在任何地方發生,請您與我們一同反對政府將手伸進網路!如果你我不積極爭取,有一天,你將會看到如此 "));
45 content4.appendChild(error451a);
46 content4.appendChild(document.createTextNode(",真正阻擋了你的瀏覽。"));
47
48 section.appendChild(content1);
49 section.appendChild(content3);
50 section.appendChild(content31);
51 section.appendChild(content4);
52
53 var footer = document.createElement("footer");
54 var footer_content_close = document.createElement("a");
55 footer_content_close.setAttribute("href", "javascript:void(0)");
56 footer_content_close.setAttribute("class", "blackout-btn");
57 footer_content_close.setAttribute("onclick", "document.getElementById('blackout').className = document.getElementById('blackout').className+' out';");
58 footer_content_close.appendChild(document.createTextNode("繼續瀏覽網頁"));
59 footer.appendChild(footer_content_close);
60
61//建立抗議內容到#blackout區塊
62function showBlackout()
63{
64 var element = document.createElement("div");
65 element.id = 'blackout';
66 element.appendChild(blackout_css);
67 element.appendChild(section);
68 element.appendChild(footer);
69 document.body.appendChild(element);
70}
71
72if (window.addEventListener)
73 window.addEventListener('load', function(){ showBlackout() }, false);
74else if (window.attachEvent)
75 window.attachEvent('on' + 'load', function(){ showBlackout() });
76})();
Powered by cgit v1.2.3 (git 2.41.0)