<template>
    <button :disabled="disabled" :type="type" :class="`link-button ${theme}`">
        <div class="overlay"></div>
        <div v-if="prepend_icon != ''" class="pre-label">
            <v-icon>WMi-{{ prepend_icon }}</v-icon>
        </div>
        <div class="name">
            <div class="Fa"> {{ title_fa }} </div>
        </div>

    </button>
</template>
<script>
export default {
    props: {
        theme: {default: 'theme-black'},
        prepend_icon: {default: ''},
        title_fa: {default: 'عنوان دکمه'},
        disabled: {default: false},
        type: {default: 'button'},
    },
}
</script>
<style lang="scss" scoped>
    .link-button {
        position: relative;
        display: flex;
        justify-content: right;
        padding: 5px 35px 5px 35px;
        min-width: 200px;
        align-items: center;
        cursor: pointer;
        margin-bottom: 10px;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-transition: all 1000ms;
        transition: all 1000ms;
        color: #383838;
        text-align: right;
        border-radius: 5px;
    }

    .link-button .pre-label .v-icon {
        font-size: 22px;
        transition: color 0.3s;
    }
    .link-button .name {
        transition: color 0.3s;
    }
    .link-button .name .Fa {
        font-size: 14px;
    }

    .link-button:before {
        content: "";
        position: absolute;
        z-index: -1;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--color-black);
        -webkit-transform: scaleX(0);
        transform: scaleX(0);
        -webkit-transform-origin: 100% 50%;
        transform-origin: 100% 50%;
        -webkit-transition-property: transform;
        transition-property: transform;
        -webkit-transition: 300ms cubic-bezier(1, 0, 0, 1);
        transition: 300ms cubic-bezier(1, 0, 0, 1);
        border-radius: 5px;
    }


    /*----------------------------------------------------*/
    /*                      Colors                        */
    /*----------------------------------------------------*/
    @import "resources/js/Global/scss/_vars.scss";
    @each $color,
    $value in $colors {
        .link-button.theme-#{$color} .name, .link-button.theme-#{$color} .pre-label .v-icon {
            color: $value;
        }
    }
    @each $color,
    $value in $colors {
        .link-button.theme-#{$color}:before {
            background-color: $value;
        }
    }


    /*----------------------------------------------------*/
    /*                      Hover State                   */
    /*----------------------------------------------------*/
    .link-button:hover {
        -webkit-box-shadow: 0 10px 30px 0px rgba(255, 255, 255, 0.2) !important;
    }
    .link-button:hover:before {
        -webkit-transform: scaleX(1);
        transform: scaleX(1);
    }
    .link-button:hover .name {
        color: var(--color-white);
    }
    .link-button:hover .left-icon .v-icon, .link-button:hover .pre-label .v-icon {
        color: var(--color-white);
    }

    .link-button.flat {
        -webkit-box-shadow: none;
        box-shadow: none;
    }


</style>
