Join us

Career

At EXPC, we are dedicated to building a talented team that drives our success. We value diversity and look for individuals who are innovative, proactive, and eager to take on challenges. Join us to shape the future of logistics and enhance your career journey in a thriving environment.

Collaboration Opportunities

At EXPC, we seek strategic alliances that enhance our service offerings and expand our capabilities. If you are interested in exploring how we can work together, please reach out. Together, we can tackle the complexities of logistics and create impactful solutions.

Learn More

Explore our website to dive deeper into EXPC's mission, values, and the range of services we offer. You will find valuable insights into our projects and learn how we can help you achieve your logistics goals. Don't hesitate to contact us for any questions or custom solutions
document.addEventListener("DOMContentLoaded", function () {
    const sections = document.querySelectorAll("#section-0, #section-1, #section-2, #section-3");
    let sectionPositions = [];

    // Cập nhật vị trí từng section (nếu chiều cao section thay đổi)
    function updateSectionPositions() {
        sectionPositions = Array.from(sections).map((section) => {
            const sectionHeight = section.offsetHeight; // Lấy chiều cao thực tế của section
            const isSection0 = section.id === "section-0"; // Kiểm tra riêng section-0
            const isSpecialSection = ["section-2"].includes(section.id);
            const isRegularSection = ["section-1", "section-3"].includes(section.id);
            let offsetAdjustment = 0; // Giá trị mặc định

            if (isSection0) {
                // Không căn giữa, giữ vị trí mặc định
                return section.offsetTop;
            } else if (isSpecialSection) {
                offsetAdjustment = -30; // Điều chỉnh offset cho các section đặc biệt
            } else if (isRegularSection) {
                offsetAdjustment = -30; // Điều chỉnh offset cho các section thông thường
            }

            // Tính toán vị trí offset căn giữa
            const offset = section.offsetTop - (window.innerHeight - sectionHeight) / 2 + offsetAdjustment;
            return offset;
        });
    }

    // Gọi hàm cập nhật khi DOMContentLoaded
    updateSectionPositions();

    let isScrolling = false; // Trạng thái đang cuộn
    const scrollDuration = 500; // Thời gian cuộn (ms)

    // Hàm cuộn đến vị trí mục tiêu
    function scrollToSection(targetIndex) {
        if (targetIndex < 0 || targetIndex >= sectionPositions.length) return; // Kiểm tra giới hạn index

        window.scrollTo({
            top: sectionPositions[targetIndex],
            behavior: "smooth",
        });

        // Đợi cuộn hoàn tất trước khi cho phép cuộn tiếp
        setTimeout(() => {
            isScrolling = false;
        }, scrollDuration);
    }

    // Lắng nghe sự kiện cuộn chuột
    window.addEventListener("wheel", function (event) {
        if (isScrolling) return; // Nếu đang cuộn, bỏ qua sự kiện mới

        isScrolling = true;
        const currentScroll = window.scrollY + window.innerHeight / 2; // Tính vị trí hiện tại dựa vào trung tâm màn hình
        const direction = event.deltaY > 0 ? 1 : -1; // Kiểm tra hướng cuộn (xuống hoặc lên)

        // Tìm section hiện tại
        let currentIndex = sectionPositions.findIndex((pos, i) => {
            const nextPos = sectionPositions[i + 1] || Infinity;
            return currentScroll >= pos && currentScroll < nextPos;
        });

        if (currentIndex === -1) currentIndex = 0; // Phòng trường hợp không tìm thấy index

        // Tính index mục tiêu
        let targetIndex;
        if (direction === 1) {
            // Cuộn xuống: Tìm section tiếp theo
            targetIndex = currentIndex + 1 < sectionPositions.length ? currentIndex + 1 : currentIndex;
        } else if (direction === -1) {
            // Cuộn lên: Tìm section trước đó
            targetIndex = currentIndex - 1 >= 0 ? currentIndex - 1 : currentIndex;
        }

        // Cuộn đến section mục tiêu
        scrollToSection(targetIndex);
    });

    // Cập nhật lại vị trí section khi thay đổi kích thước cửa sổ
    window.addEventListener("resize", updateSectionPositions);

    // Khi load trang, cuộn đến section gần nhất
    const currentScroll = window.scrollY + window.innerHeight / 2;
    const closestIndex = sectionPositions.findIndex((pos, i) => {
        const nextPos = sectionPositions[i + 1] || Infinity;
        return currentScroll >= pos && currentScroll < nextPos;
    });

    if (closestIndex !== -1) {
        scrollToSection(closestIndex);
    }
});