Fixed: Moved viewport resizing code to JS file