2024-01-31 07:05:03 +03:00
|
|
|
<template>
|
2024-03-01 11:39:35 +03:00
|
|
|
<v-sheet class="mt-5 mb-5 rounded-lg w-75">
|
2024-03-07 07:35:07 +03:00
|
|
|
<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>
|
2024-03-01 11:39:35 +03:00
|
|
|
<ScheduleTable/>
|
|
|
|
<Links/>
|
2024-04-09 14:57:23 +03:00
|
|
|
<iframe
|
|
|
|
src="https://player.twitch.tv/?channel=dhaverd&parent=localhost:8000/&muted=true"
|
|
|
|
frameborder="0"
|
|
|
|
allowfullscreen="true"
|
|
|
|
scrolling="no"
|
|
|
|
height="378"
|
|
|
|
width="620"
|
|
|
|
/>
|
2024-01-31 07:05:03 +03:00
|
|
|
</v-sheet>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import axios from "axios";
|
2024-02-27 17:11:25 +03:00
|
|
|
import ScheduleTable from "./Schedule/ScheduleTable.vue";
|
|
|
|
import Links from "./Schedule/Links.vue";
|
2024-01-31 07:05:03 +03:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: "Schedule",
|
2024-02-27 17:11:25 +03:00
|
|
|
components: {Links, ScheduleTable},
|
2024-01-31 07:05:03 +03:00
|
|
|
data: () => ({
|
2024-03-07 07:35:07 +03:00
|
|
|
dates: [],
|
2024-04-09 14:57:23 +03:00
|
|
|
fetching: true,
|
|
|
|
twitchStreamIsOnline: false
|
2024-01-31 07:05:03 +03:00
|
|
|
}),
|
|
|
|
methods: {
|
|
|
|
parseDate(date){
|
|
|
|
let dateArr = date.split("-");
|
|
|
|
return dateArr[2] + "." + dateArr[1];
|
2024-03-07 07:35:07 +03:00
|
|
|
},
|
|
|
|
async getDates(){
|
|
|
|
await axios
|
|
|
|
.get('/api/v1/dates')
|
|
|
|
.then(response => {
|
|
|
|
this.dates = response.data;
|
|
|
|
this.fetching = false;
|
|
|
|
});
|
2024-04-09 14:57:23 +03:00
|
|
|
},
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
});
|
2024-01-31 07:05:03 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {
|
2024-03-07 07:35:07 +03:00
|
|
|
this.getDates();
|
2024-04-09 14:57:23 +03:00
|
|
|
this.checkTwitchStreamOnline();
|
2024-01-31 07:05:03 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
|
|
@keyframes gradient {
|
|
|
|
0% {
|
|
|
|
background-position: 0 50%;
|
|
|
|
}
|
|
|
|
50% {
|
|
|
|
background-position: 100% 50%;
|
|
|
|
}
|
|
|
|
100% {
|
|
|
|
background-position: 0 50%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|