adventskalender/shared/js/position.js aktualisiert
This commit is contained in:
@@ -47,6 +47,7 @@ function positionAllDoors() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Openfields
|
// Openfields
|
||||||
|
// Openfields
|
||||||
document.querySelectorAll('.openfield').forEach(field => {
|
document.querySelectorAll('.openfield').forEach(field => {
|
||||||
const day = field.dataset.day;
|
const day = field.dataset.day;
|
||||||
const topPct = parseFloat(field.dataset.top) || 0;
|
const topPct = parseFloat(field.dataset.top) || 0;
|
||||||
@@ -54,9 +55,7 @@ function positionAllDoors() {
|
|||||||
const widthPct = parseFloat(field.dataset.width) || 10;
|
const widthPct = parseFloat(field.dataset.width) || 10;
|
||||||
|
|
||||||
const w = imgRect.width * (widthPct / 100);
|
const w = imgRect.width * (widthPct / 100);
|
||||||
const h = (document.querySelector(`.fluegel[data-day="${day}"]`))
|
const h = w; // Immer quadratisch – egal ob Tür oder Flügeltür
|
||||||
? w * 2 // Doppelt so hoch bei Flügeltür
|
|
||||||
: w; // Quadratisch bei normaler Tür
|
|
||||||
|
|
||||||
field.style.position = 'absolute';
|
field.style.position = 'absolute';
|
||||||
field.style.width = w + 'px';
|
field.style.width = w + 'px';
|
||||||
|
|||||||
Reference in New Issue
Block a user