commit
5f594a7062
|
@ -4,6 +4,7 @@
|
||||||
<title>Paradise Café</title>
|
<title>Paradise Café</title>
|
||||||
<!--[if IE]><script type="text/javascript" src="excanvas.js"></script><![endif]-->
|
<!--[if IE]><script type="text/javascript" src="excanvas.js"></script><![endif]-->
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
|
||||||
<link href="paradise.css" media="screen" rel="stylesheet" type="text/css">
|
<link href="paradise.css" media="screen" rel="stylesheet" type="text/css">
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
@ -18,6 +19,14 @@
|
||||||
<li>b - oral</li>
|
<li>b - oral</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="infoTouchDiv" class="center">
|
||||||
|
Acções:
|
||||||
|
<ul id="touch-elems">
|
||||||
|
<li id="67">anal</li>
|
||||||
|
<li id="70">vaginal</li>
|
||||||
|
<li id="66">oral</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
<script type="text/javascript" src="paradise.js"></script>
|
<script type="text/javascript" src="paradise.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
prepareCanvas(document.getElementById("canvasDiv"), 512, 272);
|
prepareCanvas(document.getElementById("canvasDiv"), 512, 272);
|
||||||
|
|
17
paradise.css
17
paradise.css
|
@ -1,6 +1,7 @@
|
||||||
body {
|
body {
|
||||||
background-color: #0000C8;
|
background-color: #0000C8;
|
||||||
color: #FFF;
|
color: #FFF;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
p.center {
|
p.center {
|
||||||
|
@ -19,3 +20,19 @@ div.center {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*MOBILE STUFF*/
|
||||||
|
#touch-elems li {
|
||||||
|
|
||||||
|
width: 100%;
|
||||||
|
height: 32px;
|
||||||
|
line-height: 32px;
|
||||||
|
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (max-width:512px) {
|
||||||
|
div.main {
|
||||||
|
zoom: 0.7;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
41
paradise.js
41
paradise.js
|
@ -15,10 +15,16 @@ function reset() {
|
||||||
room();
|
room();
|
||||||
}
|
}
|
||||||
|
|
||||||
function doKeyDown(e)
|
|
||||||
{
|
/**
|
||||||
if (selected == 0) {
|
* @author cc
|
||||||
switch(e.keyCode) {
|
* Unified func for keydown and touch events
|
||||||
|
*/
|
||||||
|
function doAction(actionID) {
|
||||||
|
|
||||||
|
if(selected === 0) {
|
||||||
|
|
||||||
|
switch(actionID) {
|
||||||
case 70:
|
case 70:
|
||||||
selected = 1;
|
selected = 1;
|
||||||
context.drawImage(images["balloon_vaginal"], 0, 0);
|
context.drawImage(images["balloon_vaginal"], 0, 0);
|
||||||
|
@ -54,7 +60,32 @@ function prepareCanvas(canvasDiv, canvasWidth, canvasHeight)
|
||||||
// Note: The above code is a workaround for IE 8and lower. Otherwise we could have used:
|
// Note: The above code is a workaround for IE 8and lower. Otherwise we could have used:
|
||||||
// context = document.getElementById('canvas').getContext("2d");
|
// context = document.getElementById('canvas').getContext("2d");
|
||||||
|
|
||||||
window.addEventListener('keydown', doKeyDown, true);
|
|
||||||
|
/**
|
||||||
|
* @author: cc
|
||||||
|
* Do device validation, fix layout and assign their events
|
||||||
|
*/
|
||||||
|
|
||||||
|
//Check device
|
||||||
|
if( navigator.userAgent.match(/Android/i) ||
|
||||||
|
navigator.userAgent.match(/iPhone|iPad|iPod/i) ||
|
||||||
|
navigator.userAgent.match(/IEMobile/i) ) { //is mobile
|
||||||
|
|
||||||
|
document.getElementById("infoDiv").style.display = "none";
|
||||||
|
var elems = document.getElementById("touch-elems").getElementsByTagName("li");
|
||||||
|
for(var i = 0; i < elems.length; i++) {
|
||||||
|
elems[i].addEventListener("click", function(e) {
|
||||||
|
|
||||||
|
doAction( parseInt(e.target.id) );
|
||||||
|
}, true);
|
||||||
|
}
|
||||||
|
} else { //is desktop
|
||||||
|
|
||||||
|
document.getElementById("infoTouchDiv").style.display = "none";
|
||||||
|
window.addEventListener('keydown', function(e) {
|
||||||
|
doAction(e.keyCode);
|
||||||
|
}, true);
|
||||||
|
}
|
||||||
|
|
||||||
var myImages = [
|
var myImages = [
|
||||||
"room", "whore", "hero", "balloon_choose",
|
"room", "whore", "hero", "balloon_choose",
|
||||||
|
|
Loading…
Reference in New Issue