     adjustWebviewHeight "#{window.innerHeight - poiControlHeight}px"
     factor = null
     return
+  # Set zoom factor
   webview.executeJavaScript """
     window.scrollTo(0, 0);
     if (document.querySelector('#game_frame') != null) {

      document.querySelector('html').style.zoom = #{factor};
    }
  """
  # Adjust webview height
  if window.layout == 'horizontal'
    adjustWebviewHeight "#{Math.min(Math.floor(480 * factor), window.innerHeight - poiControlHeight)}px"
    $('kan-game #webview-wrapper')?.style?.width = "#{Math.floor(800 * factor)}px"

$('#layout-css').setAttribute 'href', "./assets/css/layout.#{window.layout}.css"
factor = null
poiControlHeight = 30 # Magic number
gameLeftBound = -38.5 # The .5 removes white bound when factor != 1. It works but I dont know why lol
gameTopBound = -16
dropdownStyleAppended = false
dropdownStyle = document.createElement 'style'

