2024-02-27 17:11:25 +03:00
|
|
|
<script>
|
|
|
|
import axios from "axios";
|
2024-03-01 11:39:35 +03:00
|
|
|
|
2024-02-27 17:11:25 +03:00
|
|
|
export default {
|
|
|
|
name: "Links",
|
|
|
|
data: () => ({
|
2024-03-07 07:35:07 +03:00
|
|
|
links: [],
|
2024-04-10 06:53:43 +03:00
|
|
|
fetching: true,
|
|
|
|
windowHeight: document.documentElement.clientHeight,
|
|
|
|
windowWidth: document.documentElement.clientWidth,
|
|
|
|
isWide: window.innerWidth >= 460
|
2024-02-27 17:11:25 +03:00
|
|
|
}),
|
|
|
|
mounted() {
|
|
|
|
axios
|
|
|
|
.get('/api/v1/links')
|
2024-03-01 11:39:35 +03:00
|
|
|
.then(response => {
|
|
|
|
this.links = response.data;
|
2024-03-07 07:35:07 +03:00
|
|
|
this.fetching = false;
|
2024-03-01 11:39:35 +03:00
|
|
|
});
|
2024-04-10 06:53:43 +03:00
|
|
|
this.myEventHandler();
|
|
|
|
window.addEventListener("resize", this.myEventHandler, { passive: true });
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
window.addEventListener("resize", this.myEventHandler);
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
myEventHandler(e) {
|
|
|
|
this.windowHeight = document.documentElement.clientHeight;
|
|
|
|
this.windowWidth = document.documentElement.clientWidth;
|
|
|
|
this.isWide = this.windowWidth >= 460;
|
|
|
|
}
|
2024-02-27 17:11:25 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div class="w-100 d-flex justify-center">
|
2024-04-10 06:53:43 +03:00
|
|
|
<v-list :class="isWide ? 'w-66' : 'w-100'">
|
2024-03-07 07:35:07 +03:00
|
|
|
<v-skeleton-loader v-if="fetching" type="list-item"/>
|
|
|
|
<v-list-item v-else class="ma-5 bg-gradient-noh" elevation="6" v-for="link in links" :href="link.link"> <!-- style="background-color: #E57373; color: #FFFFFF" -->
|
2024-02-27 17:11:25 +03:00
|
|
|
<template v-slot:prepend>
|
|
|
|
<v-avatar :image="link.image" rounded="0"></v-avatar>
|
|
|
|
</template>
|
|
|
|
<v-list-item-title>{{ link.link_name }}</v-list-item-title>
|
|
|
|
</v-list-item>
|
|
|
|
</v-list>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.bg-gradient-noh {
|
|
|
|
background: linear-gradient(-45deg, #f103b0, #f0a068, #4fdbfeff);
|
|
|
|
background-size: 200% 200%;
|
|
|
|
animation: gradient 15s ease infinite;
|
|
|
|
}
|
|
|
|
</style>
|