2020-11-17 05:15:35 +00:00
|
|
|
<template>
|
|
|
|
<h1 class="uk-text-bold uk-text-center">Trending</h1>
|
|
|
|
|
|
|
|
<hr />
|
|
|
|
|
2020-11-22 04:35:16 +00:00
|
|
|
<div class="uk-grid-xl" uk-grid="parallax: 0">
|
2020-11-17 05:15:35 +00:00
|
|
|
<div
|
2021-06-28 19:45:03 +00:00
|
|
|
:style="[{ background: backgroundColor }]"
|
2020-11-18 13:40:04 +00:00
|
|
|
class="uk-width-1-2 uk-width-1-3@s uk-width-1-4@m uk-width-1-5@l uk-width-1-6@xl"
|
2020-11-17 05:15:35 +00:00
|
|
|
v-bind:key="video.url"
|
|
|
|
v-for="video in videos"
|
|
|
|
>
|
2021-06-16 19:14:46 +00:00
|
|
|
<VideoItem :video="video" height="118" width="210" />
|
2020-11-17 05:15:35 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2021-06-16 19:14:46 +00:00
|
|
|
import VideoItem from "@/components/VideoItem.vue";
|
2020-11-17 05:15:35 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
2021-04-07 11:45:40 +00:00
|
|
|
videos: [],
|
2020-11-17 05:15:35 +00:00
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted() {
|
2021-07-05 13:18:54 +00:00
|
|
|
let region = this.getPreferenceString("region", "US");
|
2021-07-04 17:53:36 +00:00
|
|
|
|
|
|
|
this.fetchTrending(region).then(videos => (this.videos = videos));
|
2020-11-17 05:15:35 +00:00
|
|
|
},
|
2021-07-21 10:59:53 +00:00
|
|
|
activated() {
|
|
|
|
document.title = "Trending - Piped";
|
|
|
|
},
|
2020-11-17 05:15:35 +00:00
|
|
|
methods: {
|
2021-07-04 17:53:36 +00:00
|
|
|
async fetchTrending(region) {
|
2021-07-04 18:26:02 +00:00
|
|
|
return await this.fetchJson(this.apiUrl() + "/trending", {
|
2021-07-04 17:53:36 +00:00
|
|
|
region: region || "US",
|
|
|
|
});
|
2021-04-07 11:45:40 +00:00
|
|
|
},
|
|
|
|
},
|
2021-06-16 19:14:46 +00:00
|
|
|
components: {
|
|
|
|
VideoItem,
|
|
|
|
},
|
2020-11-17 05:15:35 +00:00
|
|
|
};
|
|
|
|
</script>
|