rand = new Random().&nextInt
circles = []

demo = group {
    rectangle(fill: Color.BLACK, width: 800, height: 600)
    50.times {
        circles << circle(centerX: rand(800), centerY: rand(600), radius: 150, stroke: Color.WHITE,
                          strokeWidth: bind('hover', converter: {val -> val ? 4 : 0})) {
            fill rgb(rand(255), rand(255), rand(255), 0.2)
            effect boxBlur(width: 10, height: 10, iterations: 3)
            onMouseClicked { e ->
                timeline {
                    at(3.s) { change e.source.radiusProperty() to 0 }
                }.play()
            }
        }
    }
}

parallelTransition(cycleCount: 'indefinite', autoReverse: true) {
    circles.each { circle ->
        translateTransition(40.s, node: circle, toX: rand(800), toY: rand(600))
    }
}.play()

demo
