viewport javascript adaptation