UNPKG

bungee

Version:

Bungee is a declarative language engine to run inside a browser. The node module contains the offline compiler.

63 lines (47 loc) 1.59 kB
<html> <head> <title> Bungee.js </title> <link rel="stylesheet" href="normalize.css"> <script type="text/javascript" src="../../bungee.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/jump"> 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="Bungee.jump();"> </body> </html>