forked from ucbg/stickman-climb-2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloading__.js
114 lines (102 loc) · 8.74 KB
/
loading__.js
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
pc.script.createLoadingScreen(function (app) {
var showSplash = function () {
// splash wrapper
var wrapper = document.createElement('div');
wrapper.id = 'application-splash-wrapper';
document.body.appendChild(wrapper);
// splash
var splash = document.createElement('div');
splash.id = 'application-splash';
wrapper.appendChild(splash);
splash.style.display = 'none';
var logo = document.createElement('img');
logo.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAArCAYAAACXblYnAAAPrklEQVR4nO1dCZAWxRX+/mVlRZcb5daoHCZGUFKgEA0eFa0YlXglMWqMqGgMEVHjhShBTESJJvFCREPUGDUqKKDiDd5gBLGCAsohl8IiC+qy7NWp1q/Lrk5f81/Lkvmqpv6je9709HS/fv2uyQghAGAUgHPxNbbBjWYASgF8wHP+7ambK37DNrUBUANA8NgZQAZANX+XANgVwKcARgB4pYBtSpFih4JkANcA+H2WNzUIwBsF6JC/Avhtluf2BbAwz+1JkWKHhFw9T8rhxu4tQKf80DP53wWwL4A+lBDettQZXIA2pUixQ0KJz9lCTsYZADrlqXOOBvCIp/wtAIsBvAfgDgD9AfzZqNM8HaopUsRB7ufrcuyrHwNYB2A+gKcAVHCPnok4t4F6hV4ATgTQIVD/TABbAKwC8CSAFQBGAjiGNBTNXCHpXQZgDfUMXQA8SqZjg9xCDQSwnnWfAXBjZBsGADiS7Zf3/wmApQBeBjA3ksae1MnU8gD7XzL4LwAsAjANwOcBOvtz+1UJ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6GNuKhUww0pmMYTq3Fl5JIJukoKU5vE8gRYqmgHIucip9+m0JUtiB2ns9c1YZA4jUvlwYbuw3M82X/uYmlVBnBoOjOhvXGGukmSun1LCaC7UM/DkqxABcHClpnsDGQjHfCZji/wej6fdyFDMID3ekVHOlHpNZffdk8s7jGGVZodGo4otlhpBZXGC8dTqjzc2hlABquQ0fQQZSwZVeYR6VkvsxQ1EPmgO9cDGAUM747QXRb0BJkSIBbmS48BSmtxvpeKX7Ckco8HomK23OFHXvGMlLX2F242ncWhygreYZer2qrNmfMUz8EUoC4/gKdTOR6TBaA2bzHZQHWTJR/w9c4cDDjDxn2yM2k8ulHoIpUmQJ115+EqWDq/hpJjCo556jU4Hs8zVUiFQbIlaG1/2QYlM6+VOkyAEuCSAGJRQ5utJsclGOD+JL7p0ep0nE9dLJFClS5Am5MAATfajN7McVPCZZh3qLyotUboTe+poiRYp8AcB/AZXWFoaxmIRqAAAAAElFTkSuQmCC';
splash.appendChild(logo);
logo.onload = function () {
splash.style.display = 'block';
};
var container = document.createElement('div');
container.id = 'progress-bar-container';
splash.appendChild(container);
var bar = document.createElement('div');
bar.id = 'progress-bar';
container.appendChild(bar);
};
var hideSplash = function () {
var splash = document.getElementById('application-splash-wrapper');
splash.parentElement.removeChild(splash);
};
var setProgress = function (value) {
var bar = document.getElementById('progress-bar');
if(bar) {
value = Math.min(1, Math.max(0, value));
bar.style.width = value * 100 + '%';
}
};
var createCss = function () {
var css = [
'body {',
' background: rgb(15,15,15);',
' background: linear-gradient(0deg, rgba(15,15,15,1) 0%, rgba(35,46,48,1) 100%);',
'}',
'',
'#application-splash-wrapper {',
' position: absolute;',
' top: 0;',
' left: 0;',
' height: 100%;',
' width: 100%;',
' background: rgb(15,15,15);',
' background: linear-gradient(0deg, rgba(15,15,15,1) 0%, rgba(35,46,48,1) 100%);',
'}',
'',
'#application-splash {',
' position: absolute;',
' top: calc(50% - 40px);',
' width: 264px;',
' left: calc(50% - 132px);',
'}',
'',
'#application-splash img {',
' width: 100%;',
'}',
'',
'#progress-bar-container {',
' margin: 40px auto 0 auto;',
' height: 30px;',
' width: 100%;',
' border-radius:15px;',
' background-color: #414141;',
'}',
'',
'#progress-bar {',
' width: 0%;',
' height: 100%;',
' border-radius:15px;',
' background-color: #aeaeae;',
'}',
'',
'@media (max-width: 480px) {',
' #application-splash {',
' width: 170px;',
' left: calc(50% - 85px);',
' }',
'}'
].join('\n');
var style = document.createElement('style');
style.type = 'text/css';
if (style.styleSheet) {
style.styleSheet.cssText = css;
} else {
style.appendChild(document.createTextNode(css));
}
document.head.appendChild(style);
};
createCss();
showSplash();
app.on('preload:end', function () {
app.off('preload:progress');
});
app.on('preload:progress', setProgress);
app.on('start', hideSplash);
});