корень

This commit is contained in:
2021-06-25 17:53:27 +03:00
parent 0eca32f3c1
commit 43fa2e1f93
3 changed files with 6 additions and 2 deletions

View File

@@ -48,7 +48,7 @@ function обновитьИзображение(путь, имя, свойств
эл.id = `изображения-${имя}`;
эл.style.position = "absolute";
эл.style.display = "block";
document.body.appendChild(эл);
document.getElementById("корень").appendChild(эл);
мир.изображения.элементы[имя] = эл;
// Свойства по умолчанию.
эл.style.left = `${ум.x}px`;

View File

@@ -105,7 +105,7 @@ function обновитьЭлемент(имя, свойство, значени
элемент.style.position = "absolute";
элемент.style.display = "block";
элемент.style.transformOrigin = "center";
document.body.appendChild(элемент);
document.getElementById("корень").appendChild(элемент);
мир.объекты.элементы[имя] = элемент;
// Свойства по умолчанию.
элемент.style.width = `${ум.ширина}px`;

View File

@@ -14,10 +14,14 @@
body {
height: 100vh;
width: 100vw;
}
#корень {
position: relative;
}
</style>
</head>
<body>
<div id="корень"></div>
<script src="00100.мир.js"></script>
<script src="00110.заголовок.js"></script>
<script src="00120.физика.js"></script>