"use strict";

var siteWidth = 600;


window.onresize = function(event) {
    scale();
};

function scale() {
    var x = screen.width;
    if (x > (screen.height-30)) x = screen.height - 30;
    var scale = x / siteWidth;
    if (scale > 1) scale = 1;
    document.querySelector('meta[name="viewport"]').setAttribute('content', 'width='+siteWidth+', initial-scale='+scale+', minimum-scale='+scale+', maximum-scale='+scale+'');
}

scale();