This repository has been archived by the owner on Nov 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
196 lines (184 loc) · 8.45 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
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="assets/css/style.css">
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/>
<script>
/* ______ __ __ ___ .__ __. _______ _______
/ || | | | / \ | \ | | / _____|| ____|
| ,----'| |__| | / ^ \ | \| | | | __ | |__
| | | __ | / /_\ \ | . ` | | | |_ | | __|
| `----.| | | | / _____ \ | |\ | | |__| | | |____
\______||__| |__| /__/ \__\ |__| \__| \______| |_______|
______ .__ __. __ ____ ____
/ __ \ | \ | | | | \ \ / /
| | | | | \| | | | \ \/ /
| | | | | . ` | | | \_ _/
| `--' | | |\ | | `----. | |
\______/ |__| \__| |_______| |__|
__ __ _______ .______ _______
| | | | | ____|| _ \ | ____|
| |__| | | |__ | |_) | | |__
| __ | | __| | / | __|
| | | | | |____ | |\ \---.| |____
|__| |__| |_______|| _| `.____||_______|
╔════════════════════════════════════════════════════════════════════════════════════╗
/*║*/ /*║*/
/*║*/ /*Site Header*/ /*║*/
/*║*/ var header="Loading Files.."; /*║*/
/*║*/ /*║*/
/*║*/ /*Rules*/ /*║*/
/*║*/ var rules=[ /*║*/
/*║*/ "Bugusing u. Hacking sind verboten", /*║*/
/*║*/ "Beleidigungen sind untersagt", /*║*/
/*║*/ "Kein Random-Killen", /*║*/
/*║*/ "Kein Ghosten", /*║*/
/*║*/ "Spammen ist untersagt"]; /*║*/
/*║*/ /*║*/
/*║*/ var backgroundimagescount=14; /*║*/
/*║*/ /*║*/
/*║*/ /*Footer*/ /*║*/
/*║*/ var footer="Teammitglieder dürfen Bans aussprechen"; /*║*/
/*║*/ /*║*/
/*╚════════════════════════════════════════════════════════════════════════════════════╝
/* _______.___________. ______ .______
/ | | / __ \ | _ \
| (----`---| |----`| | | | | |_) |
\ \ | | | | | | | ___/
.----) | | | | `--' | | |
|_______/ |__| \______/ | _|
.__ __. ______ ____ __ ____
| \ | | / __ \ \ \ / \ / /
| \| | | | | | \ \/ \/ /
| . ` | | | | | \ /
| |\ | | `--' | \ /\ /
|__| \__| \______/ \__/ \__/
______ __ __ ___ .__ __. _______ __ .__ __. _______
/ || | | | / \ | \ | | / _____|| | | \ | | / _____|
| ,----'| |__| | / ^ \ | \| | | | __ | | | \| | | | __
| | | __ | / /_\ \ | . ` | | | |_ | | | | . ` | | | |_ |
| `----.| | | | / _____ \ | |\ | | |__| | | | | |\ | | |__| |
\______||__| |__| /__/ \__\ |__| \__| \______| |__| |__| \__| \______|
*/
this.progress=0.0;
this.filesNeeded=0;
this.filesTotal=1;
function initializeGMod(){
updateBG();
updateRules();
updateHeaderFooter();
updateProgress();
}
function updateHeaderFooter(){
document.getElementById("footer").innerHTML=footer;
document.getElementById("header").innerHTML=header;
}
function updateRules(){
var ruleSec=document.getElementById("rule-list");
for(i=0;i<rules.length;i++){
var rule=rules[i];
var node=document.createElement("li");
var textnode=document.createTextNode(rule);
node.appendChild(textnode);
ruleSec.appendChild(node)
}
}
function updateBG(){
document.body.style.backgroundImage="url(assets/img/bgs/bg-"+getRandomPercentageInteger(backgroundimagescount)+".jpg)";
}
function getRandomPercentageInteger(max){
var percentage=(100/max)/100;
var random=(Math.floor(Math.random()*100))/100;
var perc=0;
var result=1;
for(i=1;i<max+1;i++){
perc+=percentage;
if(random<perc&&random>perc-percentage){
result=i;
break;
}
}
return result;
}
function GameDetails(servername, serverurl, mapname, maxplayers, steamid, gamemode){
setServerInfo(servername, mapname, maxplayers, gamemode);
}
function SetFilesTotal(numFiles){
this.filesTotal=Math.max(0, numFiles);
}
function SetStatusChanged(status){
onStatusChange(status);
}
function SetFilesNeeded(numFiles){
this.filesNeeded=Math.max(0, numFiles);
}
function DownloadingFile(fileName){
this.filesNeeded=Math.max(0, this.filesNeeded-1);
updateProgress();
var status='Downloading '+filePath+'...';
onStatusChanged(status);
}
function onStatusChange(status){
if(status==='Sending client info...'){
this.filesNeeded=0;
document.getElementById("status").innerHTML="";
updateProgress();
}else{
document.getElementById("status").innerHTML=status;
}
}
function setServerInfo(serverName, mapName, maxPlayers, gamemode){
document.getElementById("mappreview").src='http://image.www.gametracker.com/images/maps/160x120/garrysmod/' + mapName + '.jpg';
document.getElementById("mapname").innerHTML=mapName;
document.getElementById("servername").innerHTML=serverName;
document.getElementById("slots").innerHTML=maxPlayers + " Spieler Slots";
document.getElementById("gamemode").innerHTML=gamemode;
}
function updateProgress(){
var filesRemaining=Math.max(0, this.filesTotal-this.filesNeeded), progress=(this.filesTotal>0)?(filesRemaining/this.filesTotal):1;
this.progress=Math.round(progress*100);
document.getElementById("loadingbar").style.width=this.progress+'%';
}
</script>
</head>
<body onload="initializeGMod();">
<center>
<div class="loading-body">
<h1 id="header" class="header">{%SERVERNAME%}</h1>
<h4 style="color: white; margin-top: 5px; font-family: sans-serif;" id="servername">{%SERVERMOTD%}</h4>
<div class="rules">
<div class="row">
<div class="col s6">
<h3 class="rules-header">Server Info</h3>
<div class="rules-divider"></div>
<div class="row">
<div class="col s6">
<img src="assets/img/servericon.png" style="width: 100%; height: 100%;" id="mappreview">
</div>
<div class="col s6 info">
<br>
<a class="mapname" id="mapname">{%MAPNAME%}</a><br>
<a class="mapname" id="slots">{%SLOTS%}</a><br><br>
<a class="mapname" id="gamemode">{%MAPNAME%}</a>
</div>
</div>
</div>
<div class="col s6">
<h3 class="rules-header">Regeln</h3>
<div class="rules-divider"></div>
<ul id="rule-list" class="rules-list"></ul>
</div>
</div>
<div class="col text-footer">
<div class="rules-divider"></div>
<h4 id="footer" class="rules-header"></h4>
</div>
</div>
<div class="progress">
<div class="progress-bar" id="loadingbar" style="width: 100%;"></div>
</div>
<div class="progress-text" id="status">Downloading ...</div>
</div>
</center>
</body>
</html>