0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-26 13:13:03 +00:00
VueTube/NUXT/pages/search.vue
Front 418682e2f6 Front's Bug Fixes pt.1
- Refactor homepage/"recommended" videos
- Fix SOME theme header issues
2022-03-19 15:31:43 -04:00

54 lines
1.3 KiB
Vue

<template>
<div class="py-1">
<center v-if="videos.length == 0">
<v-skeleton-loader type="card-avatar, article, actions" />
<v-skeleton-loader type="card-avatar, article, actions" />
</center>
<v-list-item v-for="(video, index) in videos" :key="index">
<v-card class="entry" :to="`/watch?v=${video.id}`">
<v-card-text>
<div style="position: relative;">
<v-img :src="video.thumbnails[video.thumbnails.length - 1].url" />
<div v-text="video.runtime" class="videoRuntimeFloat" style="color: #fff;" />
</div>
<div v-text="video.title" style="margin-top: 0.5em;" />
<div v-text="`${video.views} • ${video.uploaded}`" />
</v-card-text>
</v-card>
</v-list-item>
</div>
</template>
<style scoped>
.entry {
margin-top: 1em;
width: 100%; /* Prevent Loading Weirdness */
}
.videoRuntimeFloat {
position: absolute;
bottom: 10px;
right: 10px;
background: rgba(0, 0, 0, 0.5);
border-radius: 5px;
padding: 0 3px 0 3px;
}
</style>
<script>
export default {
data() {
return {
videos: []
}
},
mounted() {
const searchQuestion = this.$route.query.q
const vm = this;
this.$youtube.search(searchQuestion, (data) => {
vm.videos = data;
})
}
}
</script>