Move changes to card component

This commit is contained in:
pkrasicki 2023-11-25 12:00:06 +00:00
parent 96b2410bcc
commit 7da85e49bd
No known key found for this signature in database
GPG Key ID: C1B616F69A0A23EB
48 changed files with 73 additions and 204 deletions

View File

@ -1,7 +0,0 @@
.ft-card {
background-color: var(--card-bg-color);
margin: 8px;
padding-block: 3px 16px;
padding-inline: 16px;
box-shadow: 0 1px 2px rgba(0,0,0,.1);
}

View File

@ -1,5 +1,16 @@
import { defineComponent } from 'vue' import { defineComponent } from 'vue'
export default defineComponent({ export default defineComponent({
name: 'FtCard' name: 'FtCard',
props: {
big: {
type: Boolean,
default: false
}
},
computed: {
useFullWidthLayout: function () {
return this.$store.getters.getUseFullWidthLayout
}
}
}) })

View File

@ -0,0 +1,17 @@
.ft-card {
background-color: var(--card-bg-color);
margin: 8px;
padding-block: 3px 16px;
padding-inline: 16px;
box-shadow: 0 1px 2px rgba(0,0,0,.1);
&.big:not(.fullWidth) {
inline-size: 85%;
}
@media only screen and (max-width: 680px) {
&.big:not(.fullWidth) {
inline-size: 90%;
}
}
}

View File

@ -1,6 +1,7 @@
<template> <template>
<div <div
class="ft-card" class="ft-card"
:class="{ fullWidth: useFullWidthLayout, big }"
@focusout="$emit('focusout')" @focusout="$emit('focusout')"
> >
<slot /> <slot />
@ -8,4 +9,4 @@
</template> </template>
<script src="./ft-card.js" /> <script src="./ft-card.js" />
<style scoped src="./ft-card.css" /> <style scoped src="./ft-card.scss" lang="scss" />

View File

@ -67,9 +67,6 @@ export default defineComponent({
}, },
locale: function () { locale: function () {
return this.$i18n.locale.replace('_', '-') return this.$i18n.locale.replace('_', '-')
},
useFullWidthLayout: function () {
return this.$store.getters.getUseFullWidthLayout
} }
}, },
watch: { watch: {

View File

@ -1,8 +1,4 @@
.card { .card {
margin-block: 0 15px; margin-block: 0 15px;
margin-inline: auto; margin-inline: auto;
&:not(.fullWidth) {
inline-size: 85%;
}
} }

View File

@ -1,6 +1,9 @@
<template> <template>
<div> <div>
<ft-card class="card" :class="{ fullWidth: useFullWidthLayout }"> <ft-card
big
class="card"
>
<h2> <h2>
{{ $t("Profile.Subscription List") }} {{ $t("Profile.Subscription List") }}
</h2> </h2>

View File

@ -65,9 +65,6 @@ export default defineComponent({
this.$t('Yes'), this.$t('Yes'),
this.$t('No') this.$t('No')
] ]
},
useFullWidthLayout: function () {
return this.$store.getters.getUseFullWidthLayout
} }
}, },
watch: { watch: {

View File

@ -1,10 +1,6 @@
.card { .card {
margin-block: 0 15px; margin-block: 0 15px;
margin-inline: auto; margin-inline: auto;
&:not(.fullWidth) {
inline-size: 85%;
}
} }
.message { .message {
@ -43,9 +39,3 @@
user-select: none; user-select: none;
-webkit-user-select: none; -webkit-user-select: none;
} }
@media only screen and (max-width: 680px) {
.card:not(.fullWidth) {
inline-size: 90%;
}
}

View File

@ -1,6 +1,9 @@
<template> <template>
<div> <div>
<ft-card class="card" :class="{ fullWidth: useFullWidthLayout }"> <ft-card
big
class="card"
>
<h2>{{ $t("Profile.Edit Profile") }}</h2> <h2>{{ $t("Profile.Edit Profile") }}</h2>
<ft-flex-box> <ft-flex-box>
<ft-input <ft-input

View File

@ -49,9 +49,6 @@ export default defineComponent({
}, },
locale: function () { locale: function () {
return this.$i18n.locale.replace('_', '-') return this.$i18n.locale.replace('_', '-')
},
useFullWidthLayout: function () {
return this.$store.getters.getUseFullWidthLayout
} }
}, },
watch: { watch: {

View File

@ -1,10 +1,6 @@
.card { .card {
margin-block: 0 30px; margin-block: 0 30px;
margin-inline: auto; margin-inline: auto;
&:not(.fullWidth) {
inline-size: 85%;
}
} }
.selected { .selected {

View File

@ -1,6 +1,9 @@
<template> <template>
<div> <div>
<ft-card class="card" :class="{ fullWidth: useFullWidthLayout }"> <ft-card
big
class="card"
>
<h2> <h2>
{{ $t("Profile.Other Channels") }} {{ $t("Profile.Other Channels") }}
</h2> </h2>

View File

@ -12,9 +12,6 @@ export default defineComponent({
computed: { computed: {
settingsPassword: function () { settingsPassword: function () {
return this.$store.getters.getSettingsPassword return this.$store.getters.getSettingsPassword
},
useFullWidthLayout: function () {
return this.$store.getters.getUseFullWidthLayout
} }
}, },
mounted: function () { mounted: function () {

View File

@ -1,10 +1,6 @@
.card { .card {
margin: auto; margin: auto;
box-sizing: border-box; box-sizing: border-box;
&:not(.fullWidth) {
inline-size: 85%;
}
} }
.passwordInput { .passwordInput {

View File

@ -1,7 +1,6 @@
<template> <template>
<ft-card <ft-card
class="card" class="card"
:class="{ fullWidth: useFullWidthLayout }"
> >
<h3>{{ $t("Settings.Password Dialog.Enter Password To Unlock") }}</h3> <h3>{{ $t("Settings.Password Dialog.Enter Password To Unlock") }}</h3>

View File

@ -83,10 +83,5 @@ export default defineComponent({
} }
] ]
} }
},
computed: {
useFullWidthLayout: function () {
return this.$store.getters.getUseFullWidthLayout
}
} }
}) })

View File

@ -1,14 +1,6 @@
.card { .card {
margin-block: 0 60px; margin-block: 0 60px;
margin-inline: auto; margin-inline: auto;
&:not(.fullWidth) {
inline-size: 85%;
@media only screen and (max-width: 680px) {
inline-size: 90%;
}
}
} }
.brand { .brand {

View File

@ -1,6 +1,9 @@
<template> <template>
<div> <div>
<ft-card class="card" :class="{ fullWidth: useFullWidthLayout }"> <ft-card
big
class="card"
>
<h1> <h1>
{{ $t("About.About") }} {{ $t("About.About") }}
</h1> </h1>

View File

@ -3,10 +3,6 @@
margin-block: 0 20px; margin-block: 0 20px;
margin-inline: auto; margin-inline: auto;
box-sizing: border-box; box-sizing: border-box;
&:not(.fullWidth) {
inline-size: 85%;
}
} }
.channelDetails { .channelDetails {

View File

@ -8,7 +8,9 @@
/> />
<ft-card <ft-card
v-else-if="(isFamilyFriendly || !showFamilyFriendlyOnly)" v-else-if="(isFamilyFriendly || !showFamilyFriendlyOnly)"
class="card channelDetails" :class="{ fullWidth: useFullWidthLayout }" big
class="card channelDetails"
:class="{ fullWidth: useFullWidthLayout }"
> >
<div <div
class="channelBannerContainer" class="channelBannerContainer"
@ -216,7 +218,8 @@
</ft-card> </ft-card>
<ft-card <ft-card
v-if="!isLoading && !errorMessage && (isFamilyFriendly || !showFamilyFriendlyOnly)" v-if="!isLoading && !errorMessage && (isFamilyFriendly || !showFamilyFriendlyOnly)"
class="card" :class="{ fullWidth: useFullWidthLayout }" big
class="card"
> >
<channel-about <channel-about
v-if="currentTab === 'about'" v-if="currentTab === 'about'"
@ -409,7 +412,8 @@
</ft-card> </ft-card>
<ft-card <ft-card
v-if="errorMessage" v-if="errorMessage"
class="card" :class="{ fullWidth: useFullWidthLayout }" big
class="card"
> >
<p> <p>
{{ errorMessage }} {{ errorMessage }}

View File

@ -38,10 +38,6 @@ export default defineComponent({
showFetchMoreButton() { showFetchMoreButton() {
return !isNullOrEmpty(this.hashtagContinuationData) || this.apiUsed === 'invidious' return !isNullOrEmpty(this.hashtagContinuationData) || this.apiUsed === 'invidious'
},
useFullWidthLayout: function () {
return this.$store.getters.getUseFullWidthLayout
} }
}, },
watch: { watch: {

View File

@ -16,14 +16,4 @@
.card { .card {
margin-block: 0 20px; margin-block: 0 20px;
margin-inline: auto; margin-inline: auto;
&:not(.fullWidth) {
inline-size: 85%;
}
}
@media only screen and (max-width: 680px) {
.card:not(.fullWidth) {
inline-size: 90%;
}
} }

View File

@ -6,8 +6,8 @@
/> />
<ft-card <ft-card
v-else v-else
big
class="card" class="card"
:class="{ fullWidth: useFullWidthLayout }"
> >
<h2>{{ hashtag }}</h2> <h2>{{ hashtag }}</h2>
<ft-element-list <ft-element-list

View File

@ -38,10 +38,6 @@ export default defineComponent({
} else { } else {
return this.historyCacheSorted.slice(0, this.dataLimit) return this.historyCacheSorted.slice(0, this.dataLimit)
} }
},
useFullWidthLayout: function () {
return this.$store.getters.getUseFullWidthLayout
} }
}, },
watch: { watch: {

View File

@ -1,18 +1,8 @@
.card { .card {
margin-block: 0 60px; margin-block: 0 60px;
margin-inline: auto; margin-inline: auto;
&:not(.fullWidth) {
inline-size: 85%;
}
} }
.message { .message {
color: var(--tertiary-text-color); color: var(--tertiary-text-color);
} }
@media only screen and (max-width: 680px) {
.card:not(.fullWidth) {
inline-size: 90%;
}
}

View File

@ -6,8 +6,8 @@
/> />
<ft-card <ft-card
v-show="!isLoading" v-show="!isLoading"
big
class="card" class="card"
:class="{ fullWidth: useFullWidthLayout }"
> >
<h2>{{ $t("History.History") }}</h2> <h2>{{ $t("History.History") }}</h2>
<ft-input <ft-input

View File

@ -24,10 +24,6 @@ export default defineComponent({
computed: { computed: {
popularCache: function () { popularCache: function () {
return this.$store.getters.getPopularCache return this.$store.getters.getPopularCache
},
useFullWidthLayout: function () {
return this.$store.getters.getUseFullWidthLayout
} }
}, },
mounted: function () { mounted: function () {

View File

@ -1,10 +1,6 @@
.card { .card {
margin-block: 0 60px; margin-block: 0 60px;
margin-inline: auto; margin-inline: auto;
&:not(.fullWidth) {
inline-size: 85%;
}
} }
.floatingTopButton { .floatingTopButton {
@ -17,10 +13,4 @@
.floatingTopButton { .floatingTopButton {
position: absolute position: absolute
} }
} }
@media only screen and (max-width: 680px) {
.card:not(.fullWidth) {
inline-size: 90%;
}
}

View File

@ -6,8 +6,8 @@
/> />
<ft-card <ft-card
v-else v-else
big
class="card" class="card"
:class="{ fullWidth: useFullWidthLayout }"
> >
<h2>{{ $t("Most Popular") }}</h2> <h2>{{ $t("Most Popular") }}</h2>
<ft-element-list <ft-element-list

View File

@ -15,10 +15,6 @@ export default defineComponent({
computed: { computed: {
profileList: function () { profileList: function () {
return this.$store.getters.getProfileList return this.$store.getters.getProfileList
},
useFullWidthLayout: function () {
return this.$store.getters.getUseFullWidthLayout
} }
}, },
methods: { methods: {

View File

@ -1,10 +1,6 @@
.card { .card {
margin-block: 0 60px; margin-block: 0 60px;
margin-inline: auto; margin-inline: auto;
&:not(.fullWidth) {
inline-size: 85%;
}
} }
.message { .message {
@ -15,10 +11,4 @@
max-inline-size: 1000px; max-inline-size: 1000px;
margin-block: 0 10px; margin-block: 0 10px;
margin-inline: auto; margin-inline: auto;
} }
@media only screen and (max-width: 680px) {
.card:not(.fullWidth) {
inline-size: 90%;
}
}

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<ft-card class="card" :class="{ fullWidth: useFullWidthLayout }"> <ft-card big class="card">
<h2>{{ $t("Profile.Profile Manager") }}</h2> <h2>{{ $t("Profile.Profile Manager") }}</h2>
<ft-flex-box <ft-flex-box
class="profileList" class="profileList"

View File

@ -40,10 +40,6 @@ export default defineComponent({
showFamilyFriendlyOnly: function() { showFamilyFriendlyOnly: function() {
return this.$store.getters.getShowFamilyFriendlyOnly return this.$store.getters.getShowFamilyFriendlyOnly
},
useFullWidthLayout: function () {
return this.$store.getters.getUseFullWidthLayout
} }
}, },
watch: { watch: {

View File

@ -16,14 +16,4 @@
.card { .card {
margin-block: 0 60px; margin-block: 0 60px;
margin-inline: auto; margin-inline: auto;
}
&:not(.fullWidth) {
inline-size: 85%;
}
}
@media only screen and (max-width: 680px) {
.card:not(.fullWidth) {
inline-size: 90%;
}
}

View File

@ -8,8 +8,8 @@
/> />
<ft-card <ft-card
v-else v-else
big
class="card" class="card"
:class="{ fullWidth: useFullWidthLayout }"
> >
<h2>{{ $t("Search Filters.Search Results") }}</h2> <h2>{{ $t("Search Filters.Search Results") }}</h2>
<ft-element-list <ft-element-list

View File

@ -64,10 +64,6 @@ export default defineComponent({
currentInvidiousInstance: function () { currentInvidiousInstance: function () {
return this.$store.getters.getCurrentInvidiousInstance return this.$store.getters.getCurrentInvidiousInstance
},
useFullWidthLayout: function () {
return this.$store.getters.getUseFullWidthLayout
} }
}, },
watch: { watch: {

View File

@ -1,10 +1,6 @@
.card { .card {
margin-block: 0 60px; margin-block: 0 60px;
margin-inline: auto; margin-inline: auto;
&:not(.fullWidth) {
inline-size: 85%;
}
} }
.message { .message {
@ -70,10 +66,6 @@
} }
@media only screen and (max-width: 680px) { @media only screen and (max-width: 680px) {
.card:not(.fullWidth) {
inline-size: 90%;
}
.channels { .channels {
gap: 1.5rem; gap: 1.5rem;
} }

View File

@ -1,6 +1,9 @@
<template> <template>
<div> <div>
<ft-card class="card" :class="{ fullWidth: useFullWidthLayout }"> <ft-card
big
class="card"
>
<h2>{{ $t('Channels.Title') }}</h2> <h2>{{ $t('Channels.Title') }}</h2>
<ft-input <ft-input
v-show="subscribedChannels.length > 0" v-show="subscribedChannels.length > 0"

View File

@ -68,10 +68,6 @@ export default defineComponent({
} }
return tabs return tabs
},
useFullWidthLayout: function () {
return this.$store.getters.getUseFullWidthLayout
} }
}, },
watch: { watch: {

View File

@ -1,10 +1,6 @@
.card { .card {
margin-block: 0 60px; margin-block: 0 60px;
margin-inline: auto; margin-inline: auto;
&:not(.fullWidth) {
inline-size: 85%;
}
} }
.message { .message {
@ -37,9 +33,3 @@
.tab:hover { .tab:hover {
font-weight: bold; font-weight: bold;
} }
@media only screen and (max-width: 680px) {
.card:not(.fullWidth) {
inline-size: 90%;
}
}

View File

@ -1,6 +1,9 @@
<template> <template>
<div> <div>
<ft-card class="card" :class="{ fullWidth: useFullWidthLayout }"> <ft-card
big
class="card"
>
<h2>{{ $t("Subscriptions.Subscriptions") }}</h2> <h2>{{ $t("Subscriptions.Subscriptions") }}</h2>
<ft-flex-box <ft-flex-box
class="subscriptionTabs" class="subscriptionTabs"

View File

@ -39,9 +39,6 @@ export default defineComponent({
}, },
trendingCache () { trendingCache () {
return this.$store.getters.getTrendingCache return this.$store.getters.getTrendingCache
},
useFullWidthLayout: function () {
return this.$store.getters.getUseFullWidthLayout
} }
}, },
mounted: function () { mounted: function () {

View File

@ -1,10 +1,6 @@
.card { .card {
margin-block: 0 60px; margin-block: 0 60px;
margin-inline: auto; margin-inline: auto;
&:not(.fullWidth) {
inline-size: 85%;
}
} }
.floatingTopButton { .floatingTopButton {
@ -47,9 +43,3 @@
position: absolute position: absolute
} }
} }
@media only screen and (max-width: 680px) {
.card:not(.fullWidth) {
inline-size: 90%;
}
}

View File

@ -6,8 +6,8 @@
/> />
<ft-card <ft-card
v-else v-else
big
class="card" class="card"
:class="{ fullWidth: useFullWidthLayout }"
> >
<h2>{{ $t("Trending.Trending") }}</h2> <h2>{{ $t("Trending.Trending") }}</h2>
<ft-flex-box <ft-flex-box

View File

@ -41,10 +41,6 @@ export default defineComponent({
} else { } else {
return data.slice(0, this.dataLimit) return data.slice(0, this.dataLimit)
} }
},
useFullWidthLayout: function () {
return this.$store.getters.getUseFullWidthLayout
} }
}, },
watch: { watch: {

View File

@ -1,18 +1,8 @@
.card { .card {
margin-block: 0 60px; margin-block: 0 60px;
margin-inline: auto; margin-inline: auto;
&:not(.fullWidth) {
inline-size: 85%;
}
} }
.message { .message {
color: var(--tertiary-text-color); color: var(--tertiary-text-color);
} }
@media only screen and (max-width: 680px) {
.card:not(.fullWidth) {
inline-size: 90%;
}
}

View File

@ -6,8 +6,8 @@
/> />
<ft-card <ft-card
v-show="!isLoading" v-show="!isLoading"
big
class="card" class="card"
:class="{ fullWidth: useFullWidthLayout }"
> >
<h2> <h2>
{{ $t("User Playlists.Your Playlists") }} {{ $t("User Playlists.Your Playlists") }}