[FORK] moved js and css to external files; divide dimensions by device-pixel-ratio for hidpi screens