The site does not adjust position elements depending on the window size

I wrote a code in Javascript that takes data on accounts from a json file and arranges them on the site according to x, y coordinates, but the problem is that when the size of the browser window or on the phone changes, the offices remain in the same place and do not change position depending on on the size of the window. What to do?

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Кабинетs</title>

    <script src="https://code.highcharts.com/highcharts.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script src="https://apis.google.com/js/api.js"></script>

    <script src="../../scripts/options.js"></script>

    <link rel="stylesheet" href="....style.css">
    <link rel="stylesheet" href="style.css">
    <link type="image/x-icon" href="https://oksei.ru/public/img/logo.png" rel="icon">
    <link href="https://unpkg.com/[email protected]/css/boxicons.min.css" rel="stylesheet"/>
</head>
<body>
    <div class="mainTitle">
        <a href="../../index.html"><img src="https://oksei.ru/public/img/logo.png" style="height:60px; width: auto; margin-left: 10px; padding: 10px;"></a>
        <h1 style="align-self: left; margin-left: 10px; padding: 5px;">ГАПОУ "ОКЭИ" Кабинеты</h1>
    </div>

    <div class="gridBox">
        <div class="gridComponent">
            <div id="map"></div>
            <div class="floor-menu">
                <button class="floor-btn" data-floor="1">Этаж 1</button>
                <button class="floor-btn" data-floor="2">Этаж 2</button>
                <button class="floor-btn" data-floor="3">Этаж 3</button>
                <button class="floor-btn" data-floor="4">Этаж 4</button>
                <!-- Добавьте кнопки для других этажей по аналогии -->
            </div>
            
    <div class="tooltip" id="tooltip"></div> <!-- Элемент для отображения подсказки -->
    <script src="cabscript.js"></script>
        <!--<div class="left-col">
            <div class="gridComponent">
                
            </div>
            <div class="gridComponent">
                
            </div>

        </div>
        <div class="right-col gridComponent">
        </div>-->
    </div>
</body>

CSS:

.gridBox {
    padding-top: 10px;
    display: flex;
    flex-direction: row;  
    height: 85vh;     
}

.gridComponent {
    height: 100%;
}

.gridComponent:hover {
    transform: none;
}

.left-col .gridComponent {
    height: 50%;
}

.left-col {
    display: flex;
    flex-direction: column;
    width: 33.3%;
    justify-content: space-between;
}

.right-col {
    width: 66.6%;
    padding-bottom: 0px;
}

.room {
    max-width: 60px; /* Изменяем ширину комнаты на 8% от ширины экрана при ширине экрана до 768px */
    max-height: 60px; /* Также изменяем высоту комнаты */
    border: 2px solid black;
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    border-radius: 5px;
    color: black;
    cursor: pointer; /* Добавляем указатель при наведении */
}


@media screen and (max-width: 2000px) {
    .room {
        width: 5%; 
        height: 7%;
    }
    .stream-room {
        width: 10%;
        height: 14%;
    }
}
@media screen and (max-width: 990px) {
    .room {
        width: 6%; 
        height: 8%;
    }
    .stream-room {
        width: 12%;
        height: 16%;
    }
}

@media screen and (max-width: 768px) {
    .room {
        width: 8%; 
        height: 10%; 
    }
    .stream-room {
        width: 16%;
        height: 20%;
    }
}
.computer-room {
    border-color: blue;
}
.stream-room {
    max-width: 100px;
    max-height: 140px;
}

.tooltip {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px;
    display: none; 
}

.floor-menu {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
    position: relative;
}

/* Определяем стили для всех кнопок */
.floor-btn {
    background-color: #33333300;
    color: rgba(255, 255, 255, 0.233);
    font-size: x-large;
    border: none;
    padding: 10px 20px;
    margin: 0 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border-radius: 6px; /* добавляем округление углов */
}

/* Определяем стили для кнопок при наведении */
.floor-btn:hover {
    background-color: #555;
}


/* Определяем дополнительные стили для активной кнопки */
.floor-btn.active {
    background-color: rgba(65, 76, 233, 0.548); /* изменяем цвет активной кнопки */
    font-size: xx-large; /* изменяем размер шрифта при активации */
    color: white; /* изменяем цвет текста */
}

JavaScript:

 let classrooms_ = void 0;

async function LoadCabinetsData()
{
    const dataShit = await fetch("./myAss.json");
    const fuck = await dataShit.json();
    return fuck["floor"];
}

async function drawCabinets(floor) {

    if(classrooms_ === undefined)
    {
        console.log("Loading Classroms");
        classrooms_ = await LoadCabinetsData();
    }

    let classrooms = classrooms_[floor-1];

    var map = document.getElementById('map');
    var tooltip = document.getElementById('tooltip');

    console.log(classrooms)

    if(classrooms !== undefined)
    {
        classrooms.forEach(function(classroom) {
            var room = document.createElement('div');
            room.className = 'room';
            room.style.left = classroom.location[0] + 'px';
            room.style.top = classroom.location[1] + 'px';
            room.style.backgroundColor = getColor(classroom.students, classroom.capacity);
            room.innerText = classroom.cabinet;
            if (classroom.type === 'Компьютерный') {
                room.classList.add('computer-room');
            }
            if (classroom.type === 'Поточный') {
                room.classList.add('stream-room');
            }
            room.addEventListener('mouseover', function() {
                tooltip.innerHTML = `Кабинет №${classroom.cabinet}<br>Тип: ${classroom.type}<br>Вместимость: ${classroom.capacity}<br>Сейчас в кабинете: ${classroom.students} студентов<br>Группы: ${classroom.groups.join(', ')}`;
                tooltip.style.left = (classroom.location[0] + 40) + 'px';
                tooltip.style.top = (classroom.location[1] - 20) + 'px';
                tooltip.style.display = 'block';
            });
            room.addEventListener('mouseout', function() {
                tooltip.style.display = 'none';
            });
            map.appendChild(room);
        });
    }
    function getColor(students, capacity) {
        var percentage = (students / capacity) * 100;
        if (percentage < 25) {
            return 'green';
        } else if (percentage < 50) {
            return 'lightgreen';
        } else if (percentage < 75) {
            return 'yellow';
        } else if (percentage < 90) {
            return 'orange';
        } else {
            return 'red';
        }
    }

}

drawCabinets(1);

document.addEventListener('DOMContentLoaded', function() {
    var buttons = document.querySelectorAll('.floor-btn');
    buttons.forEach(function(button) {
        button.addEventListener('click', function(event) {
            var floorNumber = parseInt(this.getAttribute('data-floor'));
            //console.log(floorNumber)
            changeFloor(floorNumber);
        });
    });
    changeFloor(1);
});

function changeFloor(floorNumber) {
    var buttons = document.querySelectorAll('.floor-btn');
    buttons.forEach(function(btn) {
        btn.classList.remove('active'); // Убираем класс active у всех кнопок
    });
    var button = document.querySelector('.floor-btn[data-floor="' + floorNumber + '"]');
    button.classList.add('active'); // Добавляем класс active к нажатой кнопке

    while (map.firstChild) {
        map.removeChild(map.lastChild);
    }
    drawCabinets(floorNumber);
}

I tried with
window.addEventListener("resize", function() { console.log("Resize Event") }); dynamically arrange offices, but the event is simply ignored

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật