perkeep/server/perkeepd/ui/spinner_test.html

46 lines
1.3 KiB
HTML

<!--
Copyright 2013 The Perkeep Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="spinner.css">
<script src="closure/goog/base.js"></script>
<script src="deps.js"></script>
<script>
goog.require('cam.Spinner');
</script>
</head>
<body>
<script>
var spinner = new cam.Spinner(goog.dom.getDomHelper());
spinner.render(document.body);
document.onclick = function() {
spinner.isRunning() ? spinner.stop() : spinner.start();
};
// These two are to easily see how off-center the rotation is at worst.
spinner.getElement().onmouseover = function() {
cam.style.setRotation(spinner.getElement().firstChild, 180);
};
spinner.getElement().onmouseout = function() {
cam.style.setRotation(spinner.getElement().firstChild, 0);
};
</script>
</body>
</html>