<template>
    <div :class="type == 'left' ? 'headline_left_bj' : 'headline_right_bj'">
        <div class="desk_box_head"
            :style="{ marginRight: type == 'right' ? '50px' : '0px', marginLeft: type == 'left' ? '50px' : '0px' }">
            <span class="text_desk_head" v-if="type == 'right'" style="padding-right: 15px;">{{ value }}</span>
            <div class="cube-box48">
                <div class="cube48">
                    <div></div>
                    <div></div>
                    <div></div>
                    <div></div>
                    <div></div>
                    <div></div>
                </div>
            </div>
            <span class="text_desk_head" v-if="type == 'left'" style="padding-left: 15px;">{{ value }}</span>
        </div>
        <div class="main_quadrangle_left" v-if="type == 'left'">
            <div class="itemshape_left" v-for="item in 3"></div>
        </div>
        <div class="main_quadrangle" v-if="type == 'right'">
            <div class="itemshape" v-for="item in 3"></div>
        </div>
    </div>
</template>

<script setup>
const props = defineProps({
    /* 标题 */
    value: {
        type: String,
    },
    type: {
        type: String,
        default: 'left' //左left 右right
    },
});
</script>

<style lang='scss' scoped>
.main_quadrangle {
    position: absolute;
    bottom: 5px;
    left: 10px;
    display: flex;
    align-items: center;
}

.itemshape {
    width: 6px;
    height: 6px;
    margin-left: 4px;
    background-color: rgb(54, 106, 160);
    transform: skewX(-45deg);
}

.main_quadrangle_left {
    position: absolute;
    bottom: 5px;
    right: 10px;
    display: flex;
    align-items: center;
}

.itemshape_left {
    width: 6px;
    height: 6px;
    margin-left: 4px;
    background-color: rgb(54, 106, 160);
    transform: skewX(45deg);
}

.headline_left_bj {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 40px;
    color: #fff;
    clip-path: polygon(0 0, 40px 100%, calc(100% - 0px) 100%, 100% 0);
    background-image: linear-gradient(183deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 50%, rgba(16, 74, 141, 1) 80%, rgba(152, 190, 210, 1) 100%);

    &::before {
        content: '';
        position: absolute;
        height: 2px;
        width: 100%;
        bottom: 0;
        z-index: -1;
        background: linear-gradient(181deg, rgba(255, 255, 255, 0) 0%, rgba(54, 128, 182, 0.5) 20%, rgb(54, 128, 182) 60%, rgb(248, 251, 252) 100%)
    }
}

.headline_right_bj {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    height: 40px;
    color: #fff;
    clip-path: polygon(0 0, 0px 100%, calc(100% - 40px) 100%, 100% 0);
    background-image: linear-gradient(177deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 50%, rgba(16, 74, 141, 1) 80%, rgba(152, 190, 210, 1) 100%);

    &::before {
        content: '';
        position: absolute;
        height: 2px;
        width: 100%;
        bottom: 0;
        z-index: -1;
        background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(54, 128, 182, 0.5) 20%, rgb(54, 128, 182) 60%, rgb(248, 251, 252) 100%)
    }
}

.text_desk_head {
    user-select: none;
    font-size: 18px;
    font-weight: bold;
    background-image: -webkit-linear-gradient(bottom, rgb(120, 173, 221), rgb(229, 232, 236));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.desk_box_head {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.cube-box48 {
    transform-style: preserve-3d;
    animation: cube48-eff 3s linear infinite;
}

.cube48 {
    width: 16px;
    height: 16px;
    transform-style: preserve-3d;
    transform: rotateX(35deg) rotateY(0deg) rotateZ(45deg);
}

.cube48>div {
    height: 100%;
    position: absolute;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.cube48 div:nth-of-type(1) {
    background-color: rgba(40, 68, 177, 0.4);
    transform: translateZ(-8px) rotateY(180deg);
}

.cube48 div:nth-of-type(2) {
    background-color: rgba(40, 94, 177, 0.4);
    transform: rotateY(-270deg) translateX(50%);
    transform-origin: top right;
}

.cube48 div:nth-of-type(3) {
    background-color: rgba(40, 56, 177, 0.4);
    transform: rotateY(270deg) translateX(-50%);
    transform-origin: center left;
}

.cube48 div:nth-of-type(4) {
    background-color: rgba(36, 88, 187, 0.4);
    transform: rotateX(90deg) translateY(-50%);
    transform-origin: top center;
}

.cube48 div:nth-of-type(5) {
    background-color: rgba(36, 116, 187, 0.4);
    transform: rotateX(-90deg) translateY(50%);
    transform-origin: bottom center;
}

.cube48 div:nth-of-type(6) {
    background-color: rgba(55, 175, 202, 0.4);
    transform: translateZ(8px);
}

@keyframes cube48-eff {
    100% {
        transform: rotateY(360deg);
    }
}
</style>