<template>
    <div class="bottom-controls" :class="{ hidden: isHidden }" :style="{ bottom }">
        <FloorSwitch />
        <LeftButtons />
        <RightButtons />
    </div>
</template>
<script setup>
import { computed } from 'vue'
import { useStore } from 'vuex'
import { ref } from 'vue'
import FloorSwitch from './FloorSwitch'
import LeftButtons from './LeftButtons'
import RightButtons from './RightButtons'
const store = useStore()
const isHidden = ref(false)
const bottom = computed(() => {
    return store.getters.controlsBottom
})
</script>
<style lang="scss" scoped>
.bottom-controls {
    width: 100%;
    position: absolute;
    left: 0;
    right: var(--editor-toolbox-width);
    bottom: 20px;
    height: 34px;
    display: flex;
    justify-content: space-between;
    transition: bottom 0.3s ease;
    z-index: 100;
}

:deep(.buttons) {
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 34px;
    border-radius: 17px;
    background-color: rgba(0, 0, 0, 0.3);
    > div {
        position: relative;
        margin-left: 20px;
        margin-right: 20px;
        cursor: pointer;
        &.active {
            color: var(--editor-main-color);
        }
        > i {
            font-size: 18px;
        }
        span {
            cursor: pointer;
            display: none;
            position: absolute;
            top: -20px;
            right: -15px;
            width: 24px;
            height: 24px;
            background-color: rgba(0, 0, 0, 0.5);
            border-radius: 50%;
            align-items: center;
            justify-content: center;
            color: var(--editor-main-color);
            transition: all 0.1s;

            &:hover {
                transform: scale(1.2);
            }
            &.disable {
                i {
                    opacity: 0.5;
                }
            }
        }
    }
}
</style>
