import QtQuick 2.15

Rectangle {
    id: root
    color: "#050505"

    Image {
        id: backgroundImage
        source: "saikyo_boot_background.png"
        anchors.fill: parent
        fillMode: Image.PreserveAspectCrop
        opacity: 0.8
    }

    Rectangle {
        anchors.fill: parent
        color: "#000000"
        opacity: 0.4
    }

    Image {
        id: saikyoLogo
        source: "saikyo_logo_white.png"
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.top: parent.top
        anchors.topMargin: root.height * 0.15
        width: root.width * 0.25
        height: root.height * 0.15
        fillMode: Image.PreserveAspectFit
        smooth: true
    }

    Text {
        id: titleText
        text: "SAIKYO OS"
        color: "#00ff66"
        font.pixelSize: 48
        font.bold: true
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.top: saikyoLogo.bottom
        anchors.topMargin: 20
    }

    Rectangle {
        id: progressBarBg
        width: root.width * 0.4
        height: 8
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.bottom: parent.bottom
        anchors.bottomMargin: 100
        color: "#333333"
        radius: 4

        Rectangle {
            id: progressBar
            height: parent.height
            color: "#00ff66"
            radius: 4

            SequentialAnimation on width {
                running: true
                loops: Animation.Infinite

                PropertyAnimation {
                    from: 0
                    to: progressBarBg.width
                    duration: 2000
                    easing.type: Easing.InOutQuad
                }
                PropertyAnimation {
                    from: progressBarBg.width
                    to: 0
                    duration: 2000
                    easing.type: Easing.InOutQuad
                }
            }
        }
    }

    Text {
        id: loadingText
        text: "Загрузка..."
        color: "#ffffff"
        font.pixelSize: 18
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.bottom: progressBarBg.top
        anchors.bottomMargin: 20
        opacity: 0.8
    }
}
