<template>
    <v-sheet class="bg-gradient justify-center d-flex" style="height: 100%">
        <v-sheet :elevation="4" class="mt-5 mb-5 align-center justify-center h-auto w-75 rounded-lg main-sheet-bg">
            <div class="d-flex flex-row align-center">
                <p class="text-h4 w-75 ma-2 pa-2 justify-start">Белезов Павел</p>
                <div v-if="windowWidth >= 1000" class="d-flex justify-end">
                    <v-btn v-for="item in linksData" :key="item" color="#21abf6" variant="text" class="ma-2 pa-2 justify-end" :href="item.link">{{ item.name }}</v-btn>
                </div>
                <div v-else class="d-flex justify-end w-25 pr-3">
                    <v-menu location="bottom" color="#424242">
                        <template class="justify-end" v-slot:activator="{ props }">
                            <v-btn color="#424242" icon="mdi-dots-vertical" v-bind="props"></v-btn>
                        </template>
                        <v-list>
                            <v-list-item v-for="item in linksData" :key="item" :href="item.link">
                                <v-list-item-title>
                                    {{ item.name }}
                                </v-list-item-title>
                            </v-list-item>
                        </v-list>
                    </v-menu>
                </div>
            </div>
            <div class="d-flex justify-end align-center">
                <v-table class="main-sheet-bg pl-5 w-66" style="text-align: center">
                    <tbody>
                    <tr>
                        <td><v-icon :icon="`mdi-account`"></v-icon>Возраст</td>
                        <td>{{ personalData.age }}</td>
                    </tr>
                    <tr>
                        <td><v-icon :icon="`mdi-city`"></v-icon>Город</td>
                        <td>{{ personalData.location }}</td>
                    </tr>
                    <tr>
                        <td><v-icon :icon="`mdi-at`"></v-icon>E-mail</td>
                        <td>{{ personalData.email }}</td>
                    </tr>
                    <tr>
                        <td><v-icon :icon="`mdi-phone`"></v-icon>Телефон</td>
                        <td>{{ personalData.phoneNumber }}</td>
                    </tr>
                    </tbody>
                </v-table>
                <div class="w-33">
                    <v-img class="image-gradient" src="./resume.png"></v-img>
                </div>
            </div>

            <!--
            <div class="d-flex align-center float-right w-100">
                <v-list class="main-sheet-bg w-66" style="align-content: flex-end">
                    <v-list-item>
                        <template v-slot:prepend>
                            <v-icon :icon="`mdi-account`"></v-icon>
                        </template>
                        <v-list-item-title v-text="personalData.age"></v-list-item-title>
                    </v-list-item>
                    <v-list-item>
                        <template v-slot:prepend>
                            <v-icon :icon="`mdi-city`"></v-icon>
                        </template>
                        <v-list-item-title v-text="personalData.location"></v-list-item-title>
                    </v-list-item>
                    <v-list-item>
                        <template v-slot:prepend>
                            <v-icon :icon="`mdi-at`"></v-icon>
                        </template>
                        <v-list-item-title v-text="personalData.email"></v-list-item-title>
                    </v-list-item>
                    <v-list-item>
                        <template v-slot:prepend>
                            <v-icon :icon="`mdi-phone`"></v-icon>
                        </template>
                        <v-list-item-title v-text="personalData.phoneNumber"></v-list-item-title>
                    </v-list-item>
                </v-list>
                <v-img class="image-gradient w-33" src="./resume.png" height="500"></v-img>
            </div>-->
        </v-sheet>
    </v-sheet>
</template>

<script>
export default {
    name: "Resume",
    data: () => ({
        linksData: [
            {name: "Github", link: "https://github.com/Dhaverd"},
            {name: "HeadHunter", link: "https://irkutsk.hh.ru/resume/d8c67e1dff0843f1900039ed1f7839666b4559"},
            {name: "Habr", link: "https://career.habr.com/dhaverd"},
            {name: "Replit", link: "https://replit.com/@DHAVERD"},
            {name: "Резюме docx", link: "/download/resume.docx"}
        ],
        personalData: {
            age: '25 лет',
            location: 'г. Иркутск',
            email: 'belezov.pavel@mail.ru',
            phoneNumber: '+7-914-919-21-17'
        },
        windowHeight: window.innerHeight,
        windowWidth: window.innerWidth
    }),
    methods: {
        created() {
            window.addEventListener("resize", this.myEventHandler);
        },
        mounted() {
            window.addEventListener("resize", this.myEventHandler);
        },
        destroyed() {
            window.removeEventListener("resize", this.myEventHandler);
        },
        methods: {
            myEventHandler(e) {
                this.windowHeight = window.innerHeight;
                this.windowWidth = window.innerWidth;
            }
        }
    }
}
</script>


<style scoped>

.bg-gradient {
    background: linear-gradient(-45deg, #f103b0, #f0a068, #4fdbfeff);
    background-size: 200% 200%;
    animation: gradient 15s ease infinite;
    height: 100vh;
}

@keyframes gradient {
    0% {
        background-position: 0 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0 50%;
    }
}

.main-sheet-bg {
    background-color: #424242;
    color: #E0E0E0;
    text-decoration-color: #E0E0E0;
}

.image-gradient {
    mask-image: linear-gradient( to bottom, rgba(0, 0, 0, 1) 70%, rgba(0, 0, 0, 0) 100%);
}

</style>
