2020-11-17 10:45:35 +05:30
|
|
|
<template>
|
|
|
|
<h1 class="uk-text-bold uk-text-center">Trending</h1>
|
|
|
|
|
|
|
|
<hr />
|
|
|
|
|
2020-11-22 10:05:16 +05:30
|
|
|
<div class="uk-grid-xl" uk-grid="parallax: 0">
|
2020-11-17 10:45:35 +05:30
|
|
|
<div
|
2020-11-18 19:10:04 +05:30
|
|
|
style="background: #0b0e0f"
|
|
|
|
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 10:45:35 +05:30
|
|
|
v-bind:key="video.url"
|
|
|
|
v-for="video in videos"
|
|
|
|
>
|
2020-11-22 10:05:16 +05:30
|
|
|
<div class="uk-text-secondary" style="background: #0b0e0f">
|
2021-04-07 17:15:40 +05:30
|
|
|
<router-link class="uk-text-emphasis" v-bind:to="video.url || '/'">
|
2021-05-10 23:44:28 +05:30
|
|
|
<img
|
|
|
|
height="118"
|
|
|
|
width="210"
|
|
|
|
style="width: 100%"
|
|
|
|
v-bind:src="video.thumbnail"
|
|
|
|
alt="thumbnail"
|
|
|
|
loading="lazy"
|
|
|
|
/>
|
2020-11-22 10:05:16 +05:30
|
|
|
<p>{{ video.title }}</p>
|
2020-11-17 10:45:35 +05:30
|
|
|
</router-link>
|
2021-04-07 17:15:40 +05:30
|
|
|
<router-link class="uk-link-muted" v-bind:to="video.uploaderUrl || '/'">
|
2020-11-17 10:45:35 +05:30
|
|
|
<p>{{ video.uploaderName }}</p>
|
|
|
|
</router-link>
|
2021-02-24 15:05:41 +05:30
|
|
|
<b class="uk-text-small uk-align-left">
|
2020-11-22 10:05:16 +05:30
|
|
|
<font-awesome-icon icon="eye"></font-awesome-icon>
|
|
|
|
{{ video.views }} views
|
2021-02-24 15:05:41 +05:30
|
|
|
<br />
|
|
|
|
{{ video.uploadedDate }}
|
|
|
|
</b>
|
|
|
|
<b class="uk-text-small uk-align-right">
|
|
|
|
{{ timeFormat(video.duration) }}
|
2020-11-22 10:05:16 +05:30
|
|
|
</b>
|
2020-11-17 10:45:35 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import Constants from "@/Constants.js";
|
|
|
|
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
2021-04-07 17:15:40 +05:30
|
|
|
videos: [],
|
2020-11-17 10:45:35 +05:30
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
document.title = "Trending - Piped";
|
|
|
|
|
|
|
|
this.fetchTrending().then(videos => (this.videos = videos));
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
async fetchTrending() {
|
2021-02-24 15:05:41 +05:30
|
|
|
return await this.fetchJson(Constants.BASE_URL + "/trending");
|
2021-04-07 17:15:40 +05:30
|
|
|
},
|
|
|
|
},
|
2020-11-17 10:45:35 +05:30
|
|
|
};
|
|
|
|
</script>
|