quick
Version:
QuickJS is a declarative language engine to run inside a browser. The node module contains the offline compiler.
61 lines (46 loc) • 1.53 kB
HTML
<html>
<head>
<title> QuickJS </title>
<script type="text/javascript" src="../../quick.js"></script>
<script type="text/javascript">
// global config
var config = {};
config.normalBackgroundColor = "#3C7DC1";
config.hightlightBackgroundColor = "#36A7DF";
config.downBackgroundColor = "#006B9F";
config.normalTextColor = "white";
config.highlightTextColor = "white";
</script>
<script type="text/jml">
InputItem {
width: window.innerWidth
height: window.innerHeight
Item {
id: foo
backgroundColor: config.normalBackgroundColor
overflow: "hidden"
width: this.childrenWidth + 10
height: this.childrenHeight + 10
Item {
left: 10
top: 100
backgroundColor: config.hightlightBackgroundColor;
width: 800;
}
Item {
id: bar;
left: 200
top: 40
backgroundColor: config.normalTextColor
}
}
onmousemove: ^{
this.foo.bar.left = this.mouseAbsX - this.foo.bar.width/2
this.foo.bar.top = this.mouseAbsY - this.foo.bar.height/2
}^
}
</script>
</head>
<body onload="Quick.run();">
</body>
</html>