This repository has been archived by the owner on Apr 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
iframe.html
164 lines (144 loc) · 4.11 KB
/
iframe.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
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<!-- server -->
<script>
var viewRank = function(){
$.ajax({
dataType: 'jsonp',
jsonp: 'callback',
url: 'http://jjpt.ga:3001/view',
success: function(data) {
var text = '<table id=rank-table cellspacing=15>';
text += '<tr>';
text += '<td> rank </td><td> name </td><td> level </td><td> time </td>';
text += '</tr>';
for(var i in data){
if(i>19) continue;
var levelName = {
1:'Debut',
2:'Regular',
3:'Pro',
4:'Master',
5:'Master+'
}[data[i].level];
text += '<tr>';
text += '<td>' +(i*1+1)+ '</td><td>' + data[i].player +'</td><td>'+ levelName +'</td><td>'+ data[i].time/1000 + 's </td>';
text += '</tr>';
}
text += '</table>';
$('#rank-container').html(text);
}
});
};
</script>
<style>
body{
margin: 0px;
padding: 0px;
overflow: hidden;
}
.container{
width: 800px;
margin: 0px;
padding: 0px;
}
#button-container{
position: absolute;
width: 400px;
height: 50px;
top: 270px;
left: 70px;
text-align: center;
}
.button{
margin: 10px;
color: #bbb;
font-size: 20;
transition: 0.3s;
}
.button-disable{
margin: 10px;
color: #777;
font-size: 20;
cursor: pointer;
}
.button:hover {
color:#fff;
cursor: pointer;
font-size: 24;
}
#rank-table{
margin: 20px;
}
</style>
</head>
<body>
<div class="container">
<!--<canvas id="canvas" width=1066 height=600></canvas>-->
<canvas id="canvas" width=888 height=500></canvas>
<div id="button-container">
<div class="button">Debut</div>
<div class="button-disable">Regular</div>
<div class="button-disable">Pro</div>
<div class="button-disable">Master</div>
<div class="button-disable">Master+</div>
</div>
<br>
<br>
<p>목표 : 별 5개 먹기<br>조작 : 방향키</p>
<span style="color:red">랭킹 등록은 Pro난이도부터 가능합니다.</span>
<div id="rank-container">
</div>
</div>
<!--div id="bgm">
<iframe width="300" height="25" src="http://www.youtube.com/embed/vE8Df0k-mD4?autoplay=1&playlist=vE8Df0k-mD4&loop=1&showinfo=0&fs=0&rel=0" frameborder="0" allowfullscreen></iframe>
</div-->
</body>
<!-- game -->
<script src="resource.js"></script>
<script src="lib/engine.js"></script>
<script src="monster/weed.js"></script>
<script src="monster/bat.js"></script>
<script src="monster/mouse.js"></script>
<script src="monster/beetle.js"></script>
<script src="monster/piece.js"></script>
<script src="map/map.js"></script>
<script src="game.js"></script>
<script>
clearStage = localStorage.getItem('clearStage') || 1;
viewRank();
for(var i=0; i<clearStage; i++){
if($('.button-disable')[0])
$('.button-disable')[0].className = 'button';
};
var intro = new Sprite(function(my){
my.width = canvas.width;
my.height = canvas.width/1.4;
my.y = -50;
my.collision = false;
my.tag = 'background';
my.renderer(function(){
ctx.font = "30px Arial";
ctx.fillText("Loading...",10,50);
ctx.drawImage(resource.bg1, my.x, my.y, my.width, my.height);
ctx.drawImage(resource.intro, (canvas.width-666)/2, 0, 666, 500);
});
my.draw(0, 0);
});
$('.button').click(function(){
var level = {
'Debut': 1,
'Regular': 2,
'Pro': 3,
'Master': 4,
'Master+' : 5
}[$(this).text()];
$('#button-container').hide();
intro.dead();
gameStart(level);
//$('#bgm').html('<iframe width="300" height="25" src="http://www.youtube.com/embed/zBgy4lrOdt4?autoplay=1&playlist=zBgy4lrOdt4&loop=1&showinfo=0&fs=0&rel=0" frameborder="0" allowfullscreen></iframe>');
});
</script>
</html>