
This CL flips the switch to make Sky use Dart. TBR=eseidel@chromium.org BUG=454613 Review URL: https://codereview.chromium.org/922893002
32 lines
600 B
Plaintext
32 lines
600 B
Plaintext
#!mojo mojo:sky_viewer
|
|
<sky>
|
|
<style>
|
|
square {
|
|
margin: 50px;
|
|
height: 100px;
|
|
width: 100px;
|
|
background-color: green;
|
|
}
|
|
</style>
|
|
<square />
|
|
<script>
|
|
import "dart:sky";
|
|
|
|
void main() {
|
|
Element square = document.querySelector('square');
|
|
double timeBase = null;
|
|
|
|
void animate(double time) {
|
|
if (timeBase == null)
|
|
timeBase = time;
|
|
double delta = time - timeBase;
|
|
int rotation = (delta / 10).floor();
|
|
square.style.setProperty("transform", 'rotate(${rotation}deg)');
|
|
window.requestAnimationFrame(animate);
|
|
}
|
|
|
|
window.requestAnimationFrame(animate);
|
|
}
|
|
</script>
|
|
</sky>
|