Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(828)

Side by Side Diff: sky/examples/spinning-square.sky

Issue 748853004: Add a basic example of a spinning square (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <sky>
2 <style>
3 square {
4 margin: 50px;
5 height: 100px;
6 width: 100px;
7 background-color: green;
8 }
9 </style>
10 <square></square>
11 <script>
12 var square = document.querySelector('square');
13 var timeBase = 0;
14
15 function animate(time) {
16 if (!timeBase)
17 timeBase = time;
18 var delta = time - timeBase;
19 var rotation = Math.floor(delta / 10);
20 square.style.transform = 'rotate(' + rotation + 'deg)';
21 requestAnimationFrame(animate);
22 }
23
24 requestAnimationFrame(animate);
25 </script>
26 </sky>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698