add page visibility event

for issue  <https://github.com/phoboslab/Ejecta/issues/233>

simulation  "Page Visibility Event" in js.
I think this's a easy way to  impletment the Page Visibility feature.

By the way , I removed some trailing whitespaces.