diff --git a/flask/static/js/window.js b/flask/static/js/window.js new file mode 100644 index 0000000..d4e9e82 --- /dev/null +++ b/flask/static/js/window.js @@ -0,0 +1,20 @@ +function scaleDashboard() { + const dashboard = document.querySelector('.dashboard'); + const layoutSidenavContent = document.querySelector('#layoutSidenav_content'); + + const scaleX = layoutSidenavContent.offsetWidth / 1330; + const scaleY = layoutSidenavContent.offsetHeight / 1045; + const scale = Math.min(scaleX, scaleY); + + if (layoutSidenavContent.offsetWidth < 1680) { + dashboard.style.transform = `scale(${scale})`; + } + else { + dashboard.style.transform = `scale(${scaleX*0.99}, ${scaleY})`; + } + + dashboard.style.transformOrigin = '0 0px'; +} + +window.addEventListener('resize', scaleDashboard); +scaleDashboard(); \ No newline at end of file diff --git a/flask/templates/index.html b/flask/templates/index.html index edcd47f..a38bc09 100644 --- a/flask/templates/index.html +++ b/flask/templates/index.html @@ -2,6 +2,7 @@ + @@ -161,5 +162,6 @@ + \ No newline at end of file