<tizen:application id="RiIuG1b0CV.SensorBall" package="RiIuG1b0CV" required_version="2.2"/>
<content src="index.html"/>
<icon src="icon.png"/>
- <name>SensorBall</name>
+ <name>Sensor ball</name>
<tizen:privilege name="http://tizen.org/privilege/application.launch"/>
<tizen:setting screen-orientation="portrait" context-menu="disable" background-support="disable" encryption="disable" install-location="auto"/>
</widget>
}
.background1 {
- background-image: url('../images/background1.png');
+ background-image: url('../images/background1.jpg');
}
.background2 {
- background-image: url('../images/background2.png');
+ background-image: url('../images/background2.jpg');
}
.background3 {
- background-image: url('../images/background3.png');
+ background-image: url('../images/background3.jpg');
+ background-color: #000;
overflow: hidden;
}
#main {
width: 100%;
height: 100%;
-}
\ No newline at end of file
+}
+
+.ui-tabbar-margin-back {
+ margin-right:0 !important;
+}
var h = screen.availHeight;
viewport_meta.setAttribute('content', 'width=' + w + ', height=' + h + ',user-scalable=no');
</script>
-<title>SensorBall</title>
+<title>Sensor ball</title>
<script src="/usr/share/tizen-web-ui-fw/latest/js/jquery.min.js"></script>
<script
src="/usr/share/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
<script type="text/javascript" src="./js/main.js"></script>
</head>
<body>
- <div data-role="page" id="mainPage" data-add-back-btn="true">
+ <div data-role="page" id="mainPage">
<div data-role="header" data-position="fixed">
- <h1>Sensor Ball</h1>
+ <h1>Sensor ball</h1>
</div>
<div data-role="content" class="background background1"
data-scroll="none">
repulse: 0.6,
cdd: -0.3,
+ timeout: null,
current: 'ball',
event: null,
animationInterval: 40,
}
// animation - go to next step;
- setTimeout(this.fun.bind(this), this.animationInterval);
+ if (this.timeout !== null) {
+ clearTimeout(this.timeout);
+ }
+ this.timeout = setTimeout(this.fun.bind(this), this.animationInterval);
},
/**
app.fun();
- document.addEventListener('tizenhwkey', function(e) {
- if (e.keyName == "back") {
+ $(window).on('tizenhwkey', function (e) {
+ if (e.originalEvent.keyName === "back") {
tizen.application.getCurrentApplication().exit();
}
});
- $('.ui-btn-back').bind('touchstart', function (event) {
- tizen.application.getCurrentApplication().exit();
- });
-
$('#btnBall').bind('tap', function (event) {
$('#sun').remove();
app.startBall();
$('#mainPage').on('pageshow', function () {
app.startBall();
+ });
- // fix for hidden back batton
- if ($('a.ui-btn-back').is(':hidden')) {
- $('#footerControls').removeClass('ui-tabbar-margin-back');
+ document.addEventListener('webkitvisibilitychange', function (event) {
+ if (document.webkitVisibilityState === 'visible') {
+ app.fun();
}
});