cellular-automata/web/main.dart

24 lines
538 B
Dart
Raw Normal View History

2018-07-05 15:59:11 +00:00
import 'dart:html' as html;
import 'package:rules_of_living/App.dart';
2018-07-07 13:46:40 +00:00
import 'package:angular/angular.dart';
import 'package:rules_of_living/app_component.template.dart' as ng;
2018-07-05 15:59:11 +00:00
html.CanvasElement el;
App engine;
void main() {
2018-07-07 13:46:40 +00:00
runApp(ng.AppComponentNgFactory);
2018-07-05 15:59:11 +00:00
el = new html.CanvasElement(width: 500, height: 500);
html.querySelector('#output').append(el);
engine = new App(el);
html.window.animationFrame.then(animFrame);
}
void animFrame(num now) {
engine.process(now);
html.window.animationFrame.then(animFrame);
}