-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublish.html
More file actions
184 lines (177 loc) · 5.44 KB
/
publish.html
File metadata and controls
184 lines (177 loc) · 5.44 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
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<title>发布页</title>
<meta name="description" content="发布页">
<style>
* {
box-sizing: border-box;
margin: 0;
}
html,
body {
height: 100%;
width: 100%;
}
.information{height: 100%;}
.container {
margin: auto;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";
line-height: 1.4;
justify-content: center;
display: flex;
align-items: center;
background-color: #f9f9f9;
height: 100%;
}
.card {
background: #fff;
background-size: contain;
border-radius: 10px;
box-shadow: 0 10px 30px -5px rgba(60, 60, 60, 0.2);
text-align: center;
padding: 30px 60px;
}
.card img {
background-color: #dddfe6;
height: 120px;
width: 120px;
border-radius: 50%;
margin: auto auto 15px;
display: block;
}
.card h1 {
font-size: 22px;
margin: 10px auto 0;
letter-spacing: 1px;
}
.card h2 {
margin: auto;
color: #b1b6c6;
font-weight: 300;
font-size: 14px;
}
.card h3 {
margin: auto;
color: #525252;
font-weight: 300;
font-size: 18px;
}
.card .button {
display: block;
text-decoration: none;
background: #3b70fc;
color: #f9f9f9;
padding: 12px;
border: none;
border-radius: 25px;
margin-top: 30px;
font-size: 16px;
font-weight: 700;
min-width: 200px;
transition: 0.2s;
}
.card .button span {
font-size: 20px;
line-height: 1;
vertical-align: top;
}
.card .button:hover {
background: #1856fb;
}
.scare {
z-index: 1;
height: 100%;
}
video#video {
height: 100%;
width: 100%;
object-fit: cover;
}
video#video::-webkit-media-controls-enclosure {
display:none !important;
}
</style>
</head>
<body>
<div id="information" class="information">
<div class="container">
<div class="card">
<img src="img/publish.png" alt="发布页">
<h1>发布页</h1>
<h2>加入收藏,不走失回家的方向~</h2>
<h3 id="publish_URL">https://xkk1.github.io/</h3>
<a id="go" class="button" href="#">点击访问</a>
</div>
</div>
</div>
<div class="scare">
<!--<video id="video" class="video" src="https://res.lingx.org/nggyu.mp4" loop=""></video>-->
<video id="video" class="video" src="https://vdse.bdstatic.com/192d9a98d782d9c74c96f09db9378d93.mp4" loop="loop"></video>
</div>
<script type="text/javascript">
const video = document.getElementById("video");
video.hidden = true;
const information = document.getElementById("information");
const goButton = document.getElementById("go");
let hasClicked;
window.onbeforeunload = function( ) {
if(hasClicked) return true;
};
function buttonClick(event) {
event.preventDefault();
if(!hasClicked) hasClicked = true;
information.hidden = true;
video.hidden = false;
video.play();
videoClick();
}
function videoClick(event) {
if(event) event.preventDefault();
// if not fullscreen
const { documentElement } = document;
if(documentElement.requestFullscreen) documentElement.requestFullscreen();
else if(documentElement.mozRequestFullScreen) documentElement.mozRequestFullScreen();
else if(documentElement.webkitRequestFullscreen) documentElement.webkitRequestFullscreen();
else if(documentElement.msRequestFullscreen) documentElement.msRequestFullscreen();
}
goButton.addEventListener("click", buttonClick);
video.addEventListener("click", videoClick);
// 以下JS函数用于获取url参数(https://www.runoob.com/w3cnote/js-get-url-param.html)
function getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
if (pair[0] == variable) {
return pair[1];
}
}
return(false);
}
/*
使用实例
url 实例:
http://www.runoob.com/index.php?id=1&image=awesome.jpg
调用 getQueryVariable("id") 返回 1。
调用 getQueryVariable("image") 返回 "awesome.jpg"。
*/
const publish_URL = document.getElementById("publish_URL");
// 更改显示的 URL U
var new_publish_URL = getQueryVariable("U");
if (new_publish_URL != false) {
publish_URL.textContent = decodeURIComponent(new_publish_URL);
}
// 更改跳转的页面 G
var go_URL = getQueryVariable("G");
if (go_URL != false) {
goButton.removeEventListener("click", buttonClick);
goButton.addEventListener("click" , function () {
window.location.href = decodeURIComponent(go_URL);
});
}
</script>
</body>
</html>