Пилим фичу с плеером твича встроенным в сайт
Some checks failed
Gitea Actions / Build and deploy (push) Has been cancelled

This commit is contained in:
Dhaverd 2024-04-09 19:57:23 +08:00
parent be63dccac2
commit fdbb8e9f79
3 changed files with 27 additions and 3 deletions

View File

@ -1,11 +1,17 @@
<template>
<v-sheet class="mt-5 mb-5 rounded-lg w-75">
<p class="text-h3 ma-5">Расписание стримов</p>
<v-skeleton-loader v-if="fetching" type="text" />
<p v-else class="ma-5 text-h4"> {{ parseDate(dates[0].current_date) }} - {{ parseDate(dates[1].current_date) }}</p>
<ScheduleTable/>
<p class="text-h3 ma-5">Ссылочки</p>
<Links/>
<iframe
src="https://player.twitch.tv/?channel=dhaverd&parent=localhost:8000/&muted=true"
frameborder="0"
allowfullscreen="true"
scrolling="no"
height="378"
width="620"
/>
</v-sheet>
</template>
@ -19,7 +25,8 @@ export default {
components: {Links, ScheduleTable},
data: () => ({
dates: [],
fetching: true
fetching: true,
twitchStreamIsOnline: false
}),
methods: {
parseDate(date){
@ -33,10 +40,25 @@ export default {
this.dates = response.data;
this.fetching = false;
});
},
async checkTwitchStreamOnline(){
await axios
.get('https://api.twitch.tv/helix/search/channels?query=Dhaverd', {
headers: {
'Authorization': 'Bearer 2gbdx6oar67tqtcmt49t3wpcgycthx',
'Client-Id': 'wbmytr93xzw8zbg0p1izqyzzc5mbiz'
}
})
.then(response => {
for (let item in response.data){
console.log(item);
}
});
}
},
mounted() {
this.getDates();
this.checkTwitchStreamOnline();
}
}
</script>

View File

@ -20,6 +20,7 @@
<template>
<div class="w-100 d-flex justify-center">
<p class="text-h3 ma-5">Ссылочки</p>
<v-list class="w-66">
<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" -->

View File

@ -26,6 +26,7 @@
<template>
<div class="w-100 d-flex justify-center">
<p class="text-h3 ma-5">Расписание стримов</p>
<v-skeleton-loader v-if="fetching" type="table"/>
<v-table v-else class="text-h5 w-66">
<tbody>