Skip to content

Instantly share code, notes, and snippets.

@paoloboschini
Last active December 14, 2015 18:28
Show Gist options
  • Save paoloboschini/5129328 to your computer and use it in GitHub Desktop.
Save paoloboschini/5129328 to your computer and use it in GitHub Desktop.
Web MoSync Live
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=320, user-scalable=no">
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Wormhole Template App</title>
<link rel="stylesheet" href="http://people.dsv.su.se/~pabo9696/live/style.css" type="text/css" media="screen" title="no title" charset="utf-8">
</head>
<body>
<div id="screen">
<div class="pane" id="heading">Customized Wormhole Technology</div>
<div class="pane" id="info">
<div class="infoItem">Platform: <span id="platform">&nbsp;</span></div>
<div class="infoItem">Version: <span id="version">&nbsp;</span></div>
<div class="infoItem">UUID: <span id="uuid">&nbsp;</span></div>
<div class="infoItem">Name: <span id="name">&nbsp;</span></div>
<div class="infoItem">Width: <span id="width">&nbsp;</span></div>
<div class="infoItem">Height: <span id="height">&nbsp;</span></div>
</div>
<div class="pane button" onclick="vibrate()">Vibrate</div>
<div class="pane button" onclick="beep()">Beep</div>
<div class="pane button" onclick="changeColor()">Change Color</div>
</div>
<script type="text/javascript">
document.getElementById("platform").innerHTML = device.platform;
document.getElementById("version").innerHTML = device.version;
document.getElementById("uuid").innerHTML = device.uuid;
document.getElementById("name").innerHTML = device.name;
document.getElementById("width").innerHTML = screen.width;
document.getElementById("height").innerHTML = 'ZXSWEEWSascreen.height';
function vibrate() {
navigator.notification.vibrate(2000);
}
function changeColor() {
var color = "#" +
(Math.random() * 0xFFFFFF + 0x1000000)
.toString(16).substr(1,6);
document.documentElement.style.backgroundColor = color;
document.body.style.backgroundColor = color;
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment