<template>
<RendererVideoVue />
<div id="content-wrapper">
<RouterView />
</div>
</template>
<script setup lang="ts">
import { watch, onMounted, onUnmounted, computed } from "vue";
const w = window.innerWidth;
const h = window.innerHeight;
const initAspectRatio = Number((w / h).toFixed(2))
const resize = () => {
const w = window.innerWidth;
const h = window.innerHeight;
var controlsWrapper = document.getElementById('content-wrapper') as any
const aspectRatio = Number((w/h).toFixed(2))
if(aspectRatio>initAspectRatio){
controlsWrapper.style.width = Math.round(initAspectRatio*h) + 'px'
controlsWrapper.style.height = h + 'px'
}else{
controlsWrapper.style.width = w + 'px'
controlsWrapper.style.height = Math.round(w/initAspectRatio) + 'px'
}
}
onMounted(() => {
window.addEventListener("resize", function () {
resize()
}, false);
})
onUnmounted(() => {
window.removeEventListener('resize', resize);
});
</script>
<style scoped lang="less">
#content-wrapper {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
margin: auto;
}
</style>