Also rewrite ft-list-channel

This commit is contained in:
Cadence Ember 2020-06-24 04:08:24 +12:00
parent 6882630b22
commit 8bdc3640ba
No known key found for this signature in database
GPG Key ID: 128B99B1B74A6412
8 changed files with 67 additions and 137 deletions

View File

@ -7,6 +7,7 @@
> >
<ft-list-channel <ft-list-channel
v-if="result.type === 'channel'" v-if="result.type === 'channel'"
appearance="result"
:data="result" :data="result"
:key="index" :key="index"
/> />

View File

@ -1,93 +0,0 @@
.channelThumbnail {
position: relative;
cursor: pointer;
}
.channelThumbnail img {
width: 140px;
height: 140px;
border-radius: 200px 200px 200px 200px;
-webkit-border-radius: 200px 200px 200px 200px;
}
.channelName {
font-weight: bold;
color: var(--title-color);
cursor: pointer;
margin-bottom: 0px;
}
.subscriberCount {
cursor: pointer;
font-size: 13px;
color: var(--secondary-text-color);
}
.videoCount {
cursor: pointer;
font-size: 13px;
color: var(--secondary-text-color);
}
.grid {
width: 240px;
height: 250px;
padding: 2px;
overflow: hidden;
}
.grid .channelThumbnail {
width: 100%;
height: 140px;
margin-bottom: 5px;
}
.grid .channelThumbnail img {
position: relative;
left: 50px;
}
.grid .channelName {
width: 240px;
}
.list {
height: 140px;
width: 100%;
margin-left: 5px;
margin-top: 15px;
border-bottom: 1px solid var(--secondary-text-color);
}
.list .channelThumbnail {
float: left;
width: 240px;
}
.list .channelThumbnail img {
position: relative;
width: 120px;
height: 120px;
left: 60px;
}
.list .channelName {
margin-left: 250px;
width: 275px;
}
.list .subscriberCount {
margin-left: 10px;
}
.list .videoCount {
margin-left: 1px;
}
.list .description {
margin-left: 250px;
font-size: 13px;
color: var(--secondary-text-color);
height: 35px;
overflow: hidden;
}

View File

@ -6,6 +6,10 @@ export default Vue.extend({
data: { data: {
type: Object, type: Object,
required: true required: true
},
appearance: {
type: String,
required: true
} }
}, },
data: function () { data: function () {
@ -32,10 +36,6 @@ export default Vue.extend({
} }
}, },
methods: { methods: {
goToChannel: function () {
this.$router.push({ path: `/channel/${this.id}` })
},
parseLocalData: function () { parseLocalData: function () {
this.thumbnail = this.data.avatar this.thumbnail = this.data.avatar
this.channelName = this.data.name this.channelName = this.data.name

View File

@ -0,0 +1 @@
@use "../../sass-partials/_ft-list-item"

View File

@ -1,32 +1,41 @@
<template> <template>
<div <div
class="ft-list-channel" class="ft-list-channel ft-list-item"
:class="{ list: listType === 'list', grid: listType === 'grid' }" :class="{
list: listType === 'list',
grid: listType === 'grid',
[appearance]: true
}"
> >
<div class="channelThumbnail"> <div class="channelThumbnail">
<router-link
:to="`/channel/${id}`"
>
<img <img
:src="thumbnail" :src="thumbnail"
@click="goToChannel(id)" class="channelImage"
> >
</router-link>
</div> </div>
<p <div class="info">
class="channelName" <router-link
@click="goToChannel(id)" class="title"
:to="`/channel/${id}`"
> >
{{ channelName }} {{ channelName }}
</p> </router-link>
<div class="infoLine">
<span <span
class="subscriberCount" class="subscriberCount"
@click="goToChannel(id)"
> >
{{ subscriberCount }} subscribers {{ subscriberCount }} subscribers
</span> </span>
<span <span
class="videoCount" class="videoCount"
@click="goToChannel(id)"
> >
- {{ videoCount }} videos - {{ videoCount }} videos
</span> </span>
</div>
<p <p
v-if="listType !== 'grid'" v-if="listType !== 'grid'"
class="description" class="description"
@ -34,7 +43,8 @@
{{ description }} {{ description }}
</p> </p>
</div> </div>
</div>
</template> </template>
<script src="./ft-list-channel.js" /> <script src="./ft-list-channel.js" />
<style scoped src="./ft-list-channel.css" /> <style scoped lang="sass" src="./ft-list-channel.sass" />

View File

@ -1,6 +1,6 @@
<template> <template>
<div <div
class="ft-list-video" class="ft-list-video ft-list-item"
:appearance="appearance" :appearance="appearance"
:class="{ list: listType === 'list', grid: listType === 'grid' }" :class="{ list: listType === 'list', grid: listType === 'grid' }"
> >
@ -22,7 +22,7 @@
</div> </div>
</div> </div>
</router-link> </router-link>
<div class="videoInfo"> <div class="info">
<router-link <router-link
class="title" class="title"
:to="`/playlist/${playlistId}`" :to="`/playlist/${playlistId}`"

View File

@ -1,6 +1,6 @@
<template> <template>
<div <div
class="ft-list-video" class="ft-list-video ft-list-item"
:class="{ :class="{
list: (listType === 'list' || forceListType === 'list') && forceListType !== 'grid', list: (listType === 'list' || forceListType === 'list') && forceListType !== 'grid',
grid: (listType === 'grid' || forceListType === 'list') && forceListType !== 'list', grid: (listType === 'grid' || forceListType === 'list') && forceListType !== 'list',
@ -49,7 +49,7 @@
:style="{width: progressPercentage + '%'}" :style="{width: progressPercentage + '%'}"
/> />
</div> </div>
<div class="videoInfo"> <div class="info">
<ft-icon-button <ft-icon-button
class="optionsButton" class="optionsButton"
title="More Options" title="More Options"

View File

@ -20,7 +20,7 @@ $thumbnail-overlay-opacity: 0.85
.watchPlaylistItem#{&}, .recommendation#{&} .watchPlaylistItem#{&}, .recommendation#{&}
@content @content
.ft-list-video .ft-list-item
.videoThumbnail .videoThumbnail
display: flex display: flex
position: relative position: relative
@ -88,7 +88,15 @@ $thumbnail-overlay-opacity: 0.85
align-items: center align-items: center
color: var(--primary-text-color) color: var(--primary-text-color)
.videoInfo .channelThumbnail
display: flex
justify-content: center
.channelImage
height: 130px
border-radius: 50%
.info
flex: 1 flex: 1
position: relative position: relative
@ -121,10 +129,14 @@ $thumbnail-overlay-opacity: 0.85
display: flex display: flex
align-items: flex-start align-items: flex-start
.videoThumbnail .videoThumbnail, .channelThumbnail
margin-right: 20px margin-right: 20px
.channelThumbnail
width: 231px
@include is-sidebar-item @include is-sidebar-item
.videoThumbnail
margin-right: 10px margin-right: 10px
&.grid &.grid
@ -133,7 +145,7 @@ $thumbnail-overlay-opacity: 0.85
min-height: 230px min-height: 230px
padding-bottom: 20px padding-bottom: 20px
.videoThumbnail .videoThumbnail, .channelThumbnail
margin-bottom: 12px margin-bottom: 12px
.thumbnailImage .thumbnailImage
@ -146,6 +158,5 @@ $thumbnail-overlay-opacity: 0.85
margin-top: 8px margin-top: 8px
font-size: 13px font-size: 13px
.videoWatched, .live .videoWatched, .live
text-transform: uppercase text-transform: uppercase