UNPKG

bungee

Version:

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

84 lines (66 loc) 2.14 kB
<html> <head> <title> Bungee.js </title> <link rel="stylesheet" href="normalize.css"> <script type="text/javascript" src="../../bungee.js"></script> <script type="text/jump"> Item { backgroundColor: "purple" onload: this.anim.start(); left: window.innerWidth/2 - this.width/2 top: window.innerHeight/2 - this.height/2 Animation { id: anim target: this.parent duration: 7000 loops: "infinite" Step { percentage: 0 left: 0 top: 0 opacity: 1 } Step { percentage: 25 left: window.innerWidth - this.parent.parent.width top: 100 opacity: 0.5 } Step { percentage: 50 top: window.innerHeight - this.parent.parent.height left: window.innerWidth - this.parent.parent.width opacity: 1 } Step { percentage: 75 top: window.innerHeight - this.parent.parent.height - 300 left: 200 opacity: 0.5 } Step { percentage: 100 left: 0 top: 0 opacity: 1 } } } InputItem { backgroundColor: "#3C7DC1" hoverEnabled: true width: 200 left: 0 top: window.innerHeight/2 - this.height/2 opacity: 1-(this.left/window.innerWidth) Behavior { left: "2s" opacity: "4s" } onactivated: this.left = this.left !== 0 ? 0 : (window.innerWidth - this.width) } </script> </head> <body onload="Bungee.jump();" style="margin: 0"> </body> </html>