-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplay.html
89 lines (89 loc) · 5 KB
/
play.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
<!DOCTYPE html>
<html>
<head>
<title>Parking Master 2.0</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<div id="load-cover" style="transition:opacity .2s;position:absolute;left:0;top:0;bottom:0;right:0;background:#f5f5f5;margin:0;padding:0;z-index:100000;">
<div class="loading-container" id="load">
<i class="fa fa-coffee"></i>
<p style="text-align:center;margin-top:0.25em;">Loading... <span id="load-percent">0</span>%</p>
<style>
.progress {
position: relative;
width: 145px;
background-color: #f5f5f5;
height: 20px;
left: 50%;
margin-left: -72.5px;
}
.progress_bar {
width: 0%;
height: 20px;
background-color: #fff;
}
.fa-coffee {
position: relative;
color: #fff;
font-size: 150px !important;
width: 150px;
left: 50%;
margin-left: -75px;
margin-top: 12%;
}
.fa-coffee + p {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
color: #fff;
font-weight: bold;
font-size: 20px;
}
</style>
<div class="progress">
<div class="progress_bar"></div>
</div>
<script>!function(){let e=0;if(0==e){e=1;let t=1,r=setInterval((function(){t>=100?(clearInterval(r),e=0,setTimeout(()=>(document.querySelector("#load-cover").style.opacity="0",setTimeout(()=>document.querySelector("#load-cover").remove(),200)),0)):(t+=1,document.querySelector("#load-percent").textContent=t.toFixed(0),document.querySelector(".progress_bar").style.width=t+"%")}),0)}}();</script>
<noscript><div style="position:absolute;left:0;top:0;right:0;bottom:0;margin:0;background:#f9f9f9;padding:0;"><span style="z-index:1;color:#222;font-weight:bold;font-size:2vw;text-align:center;font-family:Arial">JavaScript is disabled</span></div></noscript>
</div>
</div>
<iframe style="position:absolute;height:100%;width:100%;padding:0;margin:0;top:0;left:0;bottom:0;right:0;border:none;" class="main"></iframe>
<div class="current-pts" style="cursor:crosshair;user-select:none!important;position:absolute;left:90.5%;top:70%;font-family:Arial,Helvetica,sans-serif;z-index:9999;font-size:2.30vw;color:#a1a1a1!important;font-weight:bold;white-space:nowrap;">PTS: 0</div>
<div class="current-lvl" style="cursor:crosshair;user-select:none!important;position:absolute;left:90.5%;top:75%;font-family:Arial,Helvetica,sans-serif;z-index:9999;font-size:2.15vw;color:#a1a1a1!important;font-weight:bold;">Level 1</div>
<script>
function isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}
function load(url, frame) {
document.querySelector(frame).src = String(url);
document.querySelector(frame).focus();
return document.querySelector(frame);
}
const lvl = localStorage["current_lvl"] || "";
const proof = lvl.replace(/lvl(.)/i, ":");
if (proof === ":") {
levelFrame = load("levels/" + lvl + ".html", ".main");
levelFrame.onload = function() {
currentLevel = levelFrame.contentWindow.location.href;
const useButtons = function() {
levelFrame.contentWindow.document.querySelector(".controls").querySelector(".steering").remove();
levelFrame.contentWindow.document.querySelector(".controls").innerHTML += `
<br>
<div class="button-steering">
<button id="left" onmousedown="mouseLeftDown()" onmouseup="mouseLeftUp()" onmouseout="mouseLeftUp()" ontouchstart="mouseLeftDown()" ontouchend="mouseLeftUp()" ontouchcancel="mouseLeftUp()">←</button>
<button id="right" onmousedown="mouseRightDown()" onmouseup="mouseRightUp()" onmouseout="mouseRightUp()" ontouchstart="mouseRightDown()" ontouchend="mouseRightUp()" ontouchcancel="mouseRightUp()">→</button>
</div>
`;
}
levelText = ((!currentLevel.includes("bonus") ? "Level" : "Bonus") + " " + ((currentLevel.split("/").pop().split(".")[0].split("").map(Number).join("").split("NaN").join("") - 0) + 1));
document.querySelector(".current-lvl").textContent = levelText;
currentPoints = parseFloat(localStorage["current_pts"], 0) || 0;
pointsText = ("PTS: " + currentPoints);
document.querySelector(".current-pts").textContent = pointsText;
if (isTouchDevice()) {
useButtons();
}
}
}
</script>
<script src="https://cdn.jsdelivr.net/gh/notiflix/Notiflix/dist/notiflix-aio-3.2.7.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/Parking-Master/Parking-Master-Tipper@main/tipper.js" defer></script>
</body>
</html>