-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
170 lines (169 loc) · 6.31 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
<!DOCTYPE html>
<!-- (c) Wilson Berkow -->
<html>
<head>
<title>The Master and Margarita</title>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<style>
html, body {
margin: 0;
padding: 0;
user-select: none;
cursor: default;
font-family: arial;
background: black;
width: 576px;
}
#container {
position: fixed;
top: 0;
left: 0;
}
canvas {
position: absolute;
}
@font-face {
font-family: BlessedDay;
src: url(./BLESD___.otf)
}
@font-face {
font-family: PressStart2P;
src: url(./PressStart2P.ttf);
}
#storycontainer {
width: 576px;/*336px;*/
height: 1024px;/*904px;*/
padding-left: 40px;
padding-right: 40px;
padding-bottom: 77px;
padding-top: 77px;
}
#story {
background-color: #EDB773;
color: #7D603D;
padding: 15px;
border-radius: 15px;
font-size: 24px;
width: 476px;
height: 850px;
}
#story > ttl {
display: block;
font-family: arial;
font-weight: bold;
font-size: 1.5em;
}
#story > bdy {
display: block;
padding: 5px;
font-size: 1.2em;
}
#story > bdy > item {
display: block;
background-color: tan;
margin: 5px;
padding: 10px;
border-radius: 15px;
}
#story > bdy > item > ttl {
display: block;
font-size: 1.2em;
font-weight: bold;
}
#story > bdy > item > description {
display: block;
}
btn {
border-radius: 15px;
background-color: #ffc27b;
color: #bd905b;
box-shadow: 2px 2px 0 0 #bd905b;
font-weight: bold;
padding: 0.1em;
}
btn:active {
background-color: none;
box-shadow: none;
}
.playBtn {
padding: 6px;
font-style: 1.5em;
font-weight: bold;
}
playBtnCont {
display: block;
text-align: center;
}
</style>
</head>
<body>
<div id="container">
<canvas id="game" width="576" height="1024"></canvas>
<canvas id="overlay0" width="576" height="1024"></canvas>
<div id="storycontainer">
<div id="story" style="display: none; position: fixed;">
<!-- This will not fill the page, but will be pulled up over the main menu -->
<ttl>Behind The Minigames <btn id="closeStory"> ✖ </btn></ttl>
<bdy>
<item>
<ttl>Match the Heads</ttl>
<description>
Woland's retinue has fun tearing people's heads
off, so you'll have have to be quick putting
them back on!
</description>
<playBtnCont><btn class="playBtn" target="headsGame">Help & Play</btn></playBtnCont>
</item>
<hr color="white" />
<item>
<ttl>Shoot Woland</ttl>
<description>
Woland's thinks that machines and apparatus
are trivial, and humans are just as helpless with
them as without them.
<br style="height: 15px;" />
But you have a shotgun.
</description>
<playBtnCont><btn class="playBtn" target="shotgunGame">Help & Play</btn></playBtnCont>
</item>
<hr color="white" />
<item>
<ttl>Defend the Streetcar</ttl>
<description>
Behemoth is known to try to get his way into
streetcars, keep him out while bringing in all
the wonderful Muscovites!
</description>
<playBtnCont><btn class="playBtn" target="streetcarGame">Help & Play</btn></playBtnCont>
</item>
</bdy>
</div>
</div>
</div>
<script src="jquery-2.1.4.min.js"></script>
<script src="hammer.min.js"></script>
<script>
(function () {
var $story = jQuery('#story');
var isOffsetted = false;
jQuery('btn').on('touchstart mousedown', function (event) {
var $btn = jQuery(event.target);
var offset = $btn.offset();
$btn.offset({left: offset.left + 2, top: offset.top + 2});
isOffsetted = true;
}).on('touchend mouseup', function (event) {
if (isOffsetted) {
var $btn = jQuery(event.target);
var offset = $btn.offset();
$btn.offset({left: offset.left - 2, top: offset.top - 2});
isOffsetted = false;
}
});
jQuery("btn#closeStory").on('tap click', function () {
$story.css('display', 'none');
});
}());
</script>
<script src="bulgakov.js"></script>
</body>
</html>