style(miieditor): fix mii alignment

This commit is contained in:
Ash Monty 2022-08-14 21:46:06 +02:00
parent b98c26049f
commit 91d6241093
No known key found for this signature in database
GPG Key ID: 740B7C88251D49B6
2 changed files with 3 additions and 11 deletions

View File

@ -63,16 +63,16 @@ svg.logotype {
position: relative;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
overflow: hidden;
}
canvas#miiCanvas {
margin: auto;
width: auto;
height: auto;
transform-origin: top center;
transform-origin: center;
transition: transform 200ms, filter 200ms;
}

View File

@ -6,19 +6,12 @@ window.addEventListener('beforeunload', function (e) {
e.returnValue = '';
});
let currentTab = '';
// this makes it so the canvas fits in the target element
function setCanvasScale() {
let targetX;
let targetY;
if (currentTab === 'size'||
currentTab === 'miiscTab' ||
currentTab === 'gender' ||
currentTab === 'favoriteColor' ||
currentTab === 'saveTab' ||
window.innerWidth <= 1080) {
if (window.innerWidth <= 1080) {
const canvasWrapper = document.querySelector('.canvas-wrapper');
targetX = canvasWrapper.offsetWidth;
@ -385,7 +378,6 @@ function openTab(e, tabType) {
document.querySelector(`#${selectedID} .subtabbtn`)?.click();
}
currentTab = selectedID;
setCanvasScale();
// We hide all subpages