Update Timeline component

pull/4563/head
Daniel Supernault 3 years ago
parent 3b885709b8
commit 8efb4047b1
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7

@ -1,348 +1,382 @@
<template> <template>
<div class="card-header border-0" style="border-top-left-radius: 15px;border-top-right-radius: 15px;"> <div>
<div class="media align-items-center"> <div v-if="isReblog" class="card-header bg-light border-0" style="border-top-left-radius: 15px;border-top-right-radius: 15px;">
<a :href="status.account.url" @click.prevent="goToProfile()" style="margin-right: 10px;"> <div class="media align-items-center" style="height:10px;">
<img :src="getStatusAvatar()" style="border-radius:15px;" width="44" height="44" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=0';"> <a :href="reblogAccount.url" class="mx-2" @click.prevent="goToProfileById(reblogAccount.id)">
</a> <img :src="reblogAccount.avatar" style="border-radius:10px;" width="24" height="24" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=0';">
</a>
<div class="media-body"> <div style="font-size:12px;font-weight:bold">
<p class="font-weight-bold username"> <i class="far fa-retweet text-warning mr-1"></i> Reblogged by <a :href="reblogAccount.url" class="text-dark" @click.prevent="goToProfileById(reblogAccount.id)">&commat;{{ reblogAccount.acct }}</a>
<a :href="status.account.url" class="text-dark" :id="'apop_'+status.id" @click.prevent="goToProfile"> </div>
{{ status.account.acct }} </div>
</a> </div>
<b-popover :target="'apop_'+status.id" triggers="hover" placement="bottom" custom-class="shadow border-0 rounded-px"> <div class="card-header border-0" style="border-top-left-radius: 15px;border-top-right-radius: 15px;">
<profile-hover-card <div class="media align-items-center">
:profile="status.account" <a :href="status.account.url" @click.prevent="goToProfile()" style="margin-right: 10px;">
v-on:follow="follow" <img :src="getStatusAvatar()" style="border-radius:15px;" width="44" height="44" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=0';">
v-on:unfollow="unfollow" /> </a>
</b-popover>
</p> <div class="media-body">
<p class="text-lighter mb-0" style="font-size: 13px;"> <p class="font-weight-bold username">
<span v-if="status.account.is_admin" class="d-none d-md-inline-block"> <a :href="status.account.url" class="text-dark" :id="'apop_'+status.id" @click.prevent="goToProfile">
<span class="badge badge-light text-danger user-select-none" title="Admin account">ADMIN</span> {{ status.account.acct }}
<span class="mx-1 text-lighter">·</span> </a>
</span> <b-popover :target="'apop_'+status.id" triggers="hover" placement="bottom" custom-class="shadow border-0 rounded-px">
<a class="timestamp text-lighter" :href="status.url" @click.prevent="goToPost()" :title="status.created_at"> <profile-hover-card
{{ timeago(status.created_at) }} :profile="status.account"
</a> v-on:follow="follow"
v-on:unfollow="unfollow" />
<span v-if="config.ab.pue && status.hasOwnProperty('edited_at') && status.edited_at"> </b-popover>
<span class="mx-1 text-lighter">·</span> </p>
<a class="text-lighter" href="#" @click.prevent="openEditModal">Edited</a> <p class="text-lighter mb-0" style="font-size: 13px;">
</span> <span v-if="status.account.is_admin" class="d-none d-md-inline-block">
<span class="badge badge-light text-danger user-select-none" title="Admin account">ADMIN</span>
<span class="mx-1 text-lighter">·</span> <span class="mx-1 text-lighter">·</span>
<span class="visibility text-lighter" :title="scopeTitle(status.visibility)"><i :class="scopeIcon(status.visibility)"></i></span> </span>
<a class="timestamp text-lighter" :href="status.url" @click.prevent="goToPost()" :title="status.created_at">
<span v-if="status.place && status.place.hasOwnProperty('name')" class="d-none d-md-inline-block"> {{ timeago(status.created_at) }}
<span class="mx-1 text-lighter">·</span> </a>
<span class="location text-lighter"><i class="far fa-map-marker-alt"></i> {{ status.place.name }}, {{ status.place.country }}</span>
</span> <span v-if="config.ab.pue && status.hasOwnProperty('edited_at') && status.edited_at">
</p> <span class="mx-1 text-lighter">·</span>
</div> <a class="text-lighter" href="#" @click.prevent="openEditModal">Edited</a>
</span>
<button v-if="!useDropdownMenu" class="btn btn-link text-lighter" @click="openMenu">
<i class="far fa-ellipsis-v fa-lg"></i> <span class="mx-1 text-lighter">·</span>
</button> <span class="visibility text-lighter" :title="scopeTitle(status.visibility)"><i :class="scopeIcon(status.visibility)"></i></span>
<b-dropdown <span v-if="status.place && status.place.hasOwnProperty('name')" class="d-none d-md-inline-block">
v-else <span class="mx-1 text-lighter">·</span>
no-caret <span class="location text-lighter"><i class="far fa-map-marker-alt"></i> {{ status.place.name }}, {{ status.place.country }}</span>
right </span>
variant="link" </p>
toggle-class="text-lighter" </div>
html="<i class='far fa-ellipsis-v fa-lg px-3'></i>"
> <button v-if="!useDropdownMenu" class="btn btn-link text-lighter" @click="openMenu">
<b-dropdown-item> <i class="far fa-ellipsis-v fa-lg"></i>
<p class="mb-0 font-weight-bold">{{ $t('menu.viewPost') }}</p> </button>
</b-dropdown-item>
<b-dropdown-item> <b-dropdown
<p class="mb-0 font-weight-bold">{{ $t('common.copyLink') }}</p> v-else
</b-dropdown-item> no-caret
<b-dropdown-item v-if="status.local"> right
<p class="mb-0 font-weight-bold">{{ $t('menu.embed') }}</p> variant="link"
</b-dropdown-item> toggle-class="text-lighter"
<b-dropdown-divider v-if="!owner"></b-dropdown-divider> html="<i class='far fa-ellipsis-v fa-lg px-3'></i>"
<b-dropdown-item v-if="!owner"> >
<p class="mb-0 font-weight-bold">{{ $t('menu.report') }}</p> <b-dropdown-item>
<p class="small text-muted mb-0">Report content that violate our rules</p> <p class="mb-0 font-weight-bold">{{ $t('menu.viewPost') }}</p>
</b-dropdown-item> </b-dropdown-item>
<b-dropdown-item v-if="!owner && status.hasOwnProperty('relationship')"> <b-dropdown-item>
<p class="mb-0 font-weight-bold">{{ status.relationship.muting ? 'Unmute' : 'Mute' }}</p> <p class="mb-0 font-weight-bold">{{ $t('common.copyLink') }}</p>
<p class="small text-muted mb-0">Hide posts from this account in your feeds</p> </b-dropdown-item>
</b-dropdown-item> <b-dropdown-item v-if="status.local">
<b-dropdown-item v-if="!owner && status.hasOwnProperty('relationship')"> <p class="mb-0 font-weight-bold">{{ $t('menu.embed') }}</p>
<p class="mb-0 font-weight-bold text-danger">{{ status.relationship.blocking ? 'Unblock' : 'Block' }}</p> </b-dropdown-item>
<p class="small text-muted mb-0">Restrict all content from this account</p> <b-dropdown-divider v-if="!owner"></b-dropdown-divider>
</b-dropdown-item> <b-dropdown-item v-if="!owner">
<b-dropdown-divider v-if="owner || admin"></b-dropdown-divider> <p class="mb-0 font-weight-bold">{{ $t('menu.report') }}</p>
<b-dropdown-item v-if="owner || admin"> <p class="small text-muted mb-0">Report content that violate our rules</p>
<p class="mb-0 font-weight-bold text-danger"> </b-dropdown-item>
{{ $t('common.delete') }} <b-dropdown-item v-if="!owner && status.hasOwnProperty('relationship')">
</p> <p class="mb-0 font-weight-bold">{{ status.relationship.muting ? 'Unmute' : 'Mute' }}</p>
</b-dropdown-item> <p class="small text-muted mb-0">Hide posts from this account in your feeds</p>
</b-dropdown> </b-dropdown-item>
</div> <b-dropdown-item v-if="!owner && status.hasOwnProperty('relationship')">
<p class="mb-0 font-weight-bold text-danger">{{ status.relationship.blocking ? 'Unblock' : 'Block' }}</p>
<edit-history-modal ref="editModal" :status="status" /> <p class="small text-muted mb-0">Restrict all content from this account</p>
</div> </b-dropdown-item>
<b-dropdown-divider v-if="owner || admin"></b-dropdown-divider>
<b-dropdown-item v-if="owner || admin">
<p class="mb-0 font-weight-bold text-danger">
{{ $t('common.delete') }}
</p>
</b-dropdown-item>
</b-dropdown>
</div>
<edit-history-modal ref="editModal" :status="status" />
</div>
</div>
</template> </template>
<script type="text/javascript"> <script type="text/javascript">
import ProfileHoverCard from './../profile/ProfileHoverCard.vue'; import ProfileHoverCard from './../profile/ProfileHoverCard.vue';
import EditHistoryModal from './EditHistoryModal.vue'; import EditHistoryModal from './EditHistoryModal.vue';
export default { export default {
props: { props: {
status: { status: {
type: Object type: Object
}, },
profile: { profile: {
type: Object type: Object
}, },
useDropdownMenu: { useDropdownMenu: {
type: Boolean, type: Boolean,
default: false default: false
} },
},
isReblog: {
components: { type: Boolean,
"profile-hover-card": ProfileHoverCard, default: false
"edit-history-modal": EditHistoryModal },
},
reblogAccount: {
data() { type: Object
return { }
config: window.App.config, },
menuLoading: true,
owner: false, components: {
admin: false, "profile-hover-card": ProfileHoverCard,
license: false "edit-history-modal": EditHistoryModal
} },
},
data() {
methods: { return {
timeago(ts) { config: window.App.config,
let short = App.util.format.timeAgo(ts); menuLoading: true,
if( owner: false,
short.endsWith('s') || admin: false,
short.endsWith('m') || license: false
short.endsWith('h') }
) { },
return short;
} methods: {
const intl = new Intl.DateTimeFormat(undefined, { timeago(ts) {
year: 'numeric', let short = App.util.format.timeAgo(ts);
month: 'short', if(
day: 'numeric', short.endsWith('s') ||
hour: 'numeric', short.endsWith('m') ||
minute: 'numeric' short.endsWith('h')
}); ) {
return intl.format(new Date(ts)); return short;
}, }
const intl = new Intl.DateTimeFormat(undefined, {
openMenu() { year: 'numeric',
this.$emit('menu'); month: 'short',
}, day: 'numeric',
hour: 'numeric',
scopeIcon(scope) { minute: 'numeric'
switch(scope) { });
case 'public': return intl.format(new Date(ts));
return 'far fa-globe'; },
break;
openMenu() {
case 'unlisted': this.$emit('menu');
return 'far fa-lock-open'; },
break;
scopeIcon(scope) {
case 'private': switch(scope) {
return 'far fa-lock'; case 'public':
break; return 'far fa-globe';
break;
default:
return 'far fa-globe'; case 'unlisted':
break; return 'far fa-lock-open';
} break;
},
case 'private':
scopeTitle(scope) { return 'far fa-lock';
switch(scope) { break;
case 'public':
return 'Visible to everyone'; default:
break; return 'far fa-globe';
break;
case 'unlisted': }
return 'Hidden from public feeds'; },
break;
scopeTitle(scope) {
case 'private': switch(scope) {
return 'Only visible to followers'; case 'public':
break; return 'Visible to everyone';
break;
default:
return ''; case 'unlisted':
break; return 'Hidden from public feeds';
} break;
},
case 'private':
goToPost() { return 'Only visible to followers';
if(location.pathname.split('/').pop() == this.status.id) { break;
location.href = this.status.local ? this.status.url + '?fs=1' : this.status.url;
return; default:
} return '';
break;
this.$router.push({ }
name: 'post', },
path: `/i/web/post/${this.status.id}`,
params: { goToPost() {
id: this.status.id, if(location.pathname.split('/').pop() == this.status.id) {
cachedStatus: this.status, location.href = this.status.local ? this.status.url + '?fs=1' : this.status.url;
cachedProfile: this.profile return;
} }
})
}, this.$router.push({
name: 'post',
goToProfile() { path: `/i/web/post/${this.status.id}`,
this.$nextTick(() => { params: {
this.$router.push({ id: this.status.id,
name: 'profile', cachedStatus: this.status,
path: `/i/web/profile/${this.status.account.id}`, cachedProfile: this.profile
params: { }
id: this.status.account.id, })
cachedProfile: this.status.account, },
cachedUser: this.profile
} goToProfileById(id) {
}); this.$nextTick(() => {
}); this.$router.push({
}, name: 'profile',
path: `/i/web/profile/${id}`,
toggleContentWarning() { params: {
this.key++; id: id,
this.sensitive = true; cachedUser: this.profile
this.status.sensitive = !this.status.sensitive; }
}, });
});
like() { },
event.currentTarget.blur();
if(this.status.favourited) { goToProfile() {
this.$emit('unlike'); this.$nextTick(() => {
} else { this.$router.push({
this.$emit('like'); name: 'profile',
} path: `/i/web/profile/${this.status.account.id}`,
}, params: {
id: this.status.account.id,
toggleMenu(bvEvent) { cachedProfile: this.status.account,
setTimeout(() => { cachedUser: this.profile
this.menuLoading = false; }
}, 500); });
}, });
},
closeMenu(bvEvent) {
setTimeout(() => { toggleContentWarning() {
bvEvent.target.parentNode.firstElementChild.blur(); this.key++;
}, 100); this.sensitive = true;
}, this.status.sensitive = !this.status.sensitive;
},
showLikes() {
event.currentTarget.blur(); like() {
this.$emit('likes-modal'); event.currentTarget.blur();
}, if(this.status.favourited) {
this.$emit('unlike');
showShares() { } else {
event.currentTarget.blur(); this.$emit('like');
this.$emit('shares-modal'); }
}, },
showComments() { toggleMenu(bvEvent) {
event.currentTarget.blur(); setTimeout(() => {
this.showCommentDrawer = !this.showCommentDrawer; this.menuLoading = false;
}, }, 500);
},
copyLink() {
event.currentTarget.blur(); closeMenu(bvEvent) {
App.util.clipboard(this.status.url); setTimeout(() => {
}, bvEvent.target.parentNode.firstElementChild.blur();
}, 100);
shareToOther() { },
if (navigator.canShare) {
navigator.share({ showLikes() {
url: this.status.url event.currentTarget.blur();
}) this.$emit('likes-modal');
.then(() => console.log('Share was successful.')) },
.catch((error) => console.log('Sharing failed', error));
} else { showShares() {
swal('Not supported', 'Your current device does not support native sharing.', 'error'); event.currentTarget.blur();
} this.$emit('shares-modal');
}, },
counterChange(type) { showComments() {
this.$emit('counter-change', type); event.currentTarget.blur();
}, this.showCommentDrawer = !this.showCommentDrawer;
},
showCommentLikes(post) {
this.$emit('comment-likes-modal', post); copyLink() {
}, event.currentTarget.blur();
App.util.clipboard(this.status.url);
shareStatus() { },
this.$emit('share');
}, shareToOther() {
if (navigator.canShare) {
unshareStatus() { navigator.share({
this.$emit('unshare'); url: this.status.url
}, })
.then(() => console.log('Share was successful.'))
handleReport(post) { .catch((error) => console.log('Sharing failed', error));
this.$emit('handle-report', post); } else {
}, swal('Not supported', 'Your current device does not support native sharing.', 'error');
}
follow() { },
this.$emit('follow');
}, counterChange(type) {
this.$emit('counter-change', type);
unfollow() { },
this.$emit('unfollow');
}, showCommentLikes(post) {
this.$emit('comment-likes-modal', post);
handleReblog() { },
this.isReblogging = true;
if(this.status.reblogged) { shareStatus() {
this.$emit('unshare'); this.$emit('share');
} else { },
this.$emit('share');
} unshareStatus() {
this.$emit('unshare');
setTimeout(() => { },
this.isReblogging = false;
}, 5000); handleReport(post) {
}, this.$emit('handle-report', post);
},
handleBookmark() {
event.currentTarget.blur(); follow() {
this.isBookmarking = true; this.$emit('follow');
this.$emit('bookmark'); },
setTimeout(() => { unfollow() {
this.isBookmarking = false; this.$emit('unfollow');
}, 5000); },
},
handleReblog() {
getStatusAvatar() { this.isReblogging = true;
if(window._sharedData.user.id == this.status.account.id) { if(this.status.reblogged) {
return window._sharedData.user.avatar; this.$emit('unshare');
} } else {
this.$emit('share');
return this.status.account.avatar; }
},
setTimeout(() => {
openModTools() { this.isReblogging = false;
this.$emit('mod-tools'); }, 5000);
}, },
openEditModal() { handleBookmark() {
this.$refs.editModal.open(); event.currentTarget.blur();
} this.isBookmarking = true;
} this.$emit('bookmark');
}
setTimeout(() => {
this.isBookmarking = false;
}, 5000);
},
getStatusAvatar() {
if(window._sharedData.user.id == this.status.account.id) {
return window._sharedData.user.avatar;
}
return this.status.account.avatar;
},
openModTools() {
this.$emit('mod-tools');
},
openEditModal() {
this.$refs.editModal.open();
}
}
}
</script> </script>

@ -8,6 +8,30 @@
</div> </div>
<div v-else> <div v-else>
<transition name="fade">
<div v-if="showReblogBanner && getScope() === 'home'" class="card bg-g-amin card-body shadow-sm mb-3" style="border-radius: 15px;">
<div class="d-flex justify-content-around align-items-center">
<div class="flex-grow-1 ft-std">
<h2 class="font-weight-bold text-white mb-0">Introducing Reblogs in feeds</h2>
<hr />
<p class="lead text-white mb-0">
See reblogs from accounts you follow in your home feed!
</p>
<p class="text-white small mb-1" style="opacity:0.6">
You can disable reblogs in feeds on the Timeline Settings page.
</p>
<hr />
<div class="d-flex">
<button class="btn btn-light rounded-pill font-weight-bold btn-block mr-2" @click.prevent="enableReblogs()">
<template v-if="!enablingReblogs">Show reblogs in home feed</template>
<b-spinner small v-else />
</button>
<button class="btn btn-outline-light rounded-pill font-weight-bold px-5" @click.prevent="hideReblogs()">Hide</button>
</div>
</div>
</div>
</div>
</transition>
<status <status
v-for="(status, index) in feed" v-for="(status, index) in feed"
:key="'pf_feed:' + status.id + ':idx:' + index + ':fui:' + forceUpdateIdx" :key="'pf_feed:' + status.id + ':idx:' + index + ':fui:' + forceUpdateIdx"
@ -140,6 +164,7 @@
data() { data() {
return { return {
settings: [],
isLoaded: false, isLoaded: false,
feed: [], feed: [],
ids: [], ids: [],
@ -159,7 +184,9 @@
reportedStatusId: 0, reportedStatusId: 0,
showSharesModal: false, showSharesModal: false,
sharesModalPost: {}, sharesModalPost: {},
forceUpdateIdx: 0 forceUpdateIdx: 0,
showReblogBanner: false,
enablingReblogs: false
} }
}, },
@ -174,7 +201,7 @@
return; return;
}; };
} }
this.fetchTimeline(); this.fetchSettings();
}, },
methods: { methods: {
@ -194,13 +221,48 @@
} }
}, },
fetchSettings() {
axios.get('/api/pixelfed/v1/web/settings')
.then(res => {
this.settings = res.data;
if(!res.data) {
this.showReblogBanner = true;
} else {
if(res.data.hasOwnProperty('hide_reblog_banner')) {
} else if(res.data.hasOwnProperty('enable_reblogs')) {
if(!res.data.enable_reblogs) {
this.showReblogBanner = true;
}
} else {
this.showReblogBanner = true;
}
}
})
.finally(() => {
this.fetchTimeline();
})
},
fetchTimeline(scrollToTop = false) { fetchTimeline(scrollToTop = false) {
let url = `/api/pixelfed/v1/timelines/${this.getScope()}`; let url, params;
axios.get(url, { if(this.getScope() === 'home' && this.settings && this.settings.hasOwnProperty('enable_reblogs') && this.settings.enable_reblogs) {
params: { url = `/api/v1/timelines/home`;
params = {
'_pe': 1,
max_id: this.max_id,
limit: 6,
include_reblogs: true,
}
} else {
url = `/api/pixelfed/v1/timelines/${this.getScope()}`;
params = {
max_id: this.max_id, max_id: this.max_id,
limit: 6 limit: 6,
} }
}
axios.get(url, {
params: params
}).then(res => { }).then(res => {
let ids = res.data.map(p => { let ids = res.data.map(p => {
if(p && p.hasOwnProperty('relationship')) { if(p && p.hasOwnProperty('relationship')) {
@ -242,12 +304,24 @@
this.isFetchingMore = true; this.isFetchingMore = true;
let url = `/api/pixelfed/v1/timelines/${this.getScope()}`; let url, params;
axios.get(url, { if(this.getScope() === 'home' && this.settings && this.settings.hasOwnProperty('enable_reblogs') && this.settings.enable_reblogs) {
params: { url = `/api/v1/timelines/home`;
params = {
'_pe': 1,
max_id: this.max_id,
limit: 6,
include_reblogs: true,
}
} else {
url = `/api/pixelfed/v1/timelines/${this.getScope()}`;
params = {
max_id: this.max_id, max_id: this.max_id,
limit: 6 limit: 6,
} }
}
axios.get(url, {
params: params
}).then(res => { }).then(res => {
if(!res.data.length) { if(!res.data.length) {
this.endFeedReached = true; this.endFeedReached = true;
@ -568,7 +642,31 @@
this.$nextTick(() => { this.$nextTick(() => {
this.forceUpdateIdx++; this.forceUpdateIdx++;
}); });
} },
enableReblogs() {
this.enablingReblogs = true;
axios.post('/api/pixelfed/v1/web/settings', {
field: 'enable_reblogs',
value: true
})
.then(res => {
setTimeout(() => {
window.location.reload();
}, 1000);
})
},
hideReblogs() {
this.showReblogBanner = false;
axios.post('/api/pixelfed/v1/web/settings', {
field: 'hide_reblog_banner',
value: true
})
.then(res => {
})
},
}, },
watch: { watch: {

@ -1,166 +1,172 @@
@import "lib/ibmplexsans"; @import "lib/ibmplexsans";
:root { :root {
--light: #fff; --light: #fff;
--dark: #000; --dark: #000;
--body-bg: rgba(243,244,246,1); --body-bg: rgba(243,244,246,1);
--body-color: #212529; --body-color: #212529;
--nav-bg: #fff; --nav-bg: #fff;
--bg-light: #f8f9fa; --bg-light: #f8f9fa;
--primary: #3B82F6; --primary: #3B82F6;
--light-gray: #f8f9fa; --light-gray: #f8f9fa;
--text-lighter: #94a3b8; --text-lighter: #94a3b8;
--card-bg: #fff; --card-bg: #fff;
--light-hover-bg: #f9fafb; --light-hover-bg: #f9fafb;
--btn-light-border: #fff; --btn-light-border: #fff;
--input-border: #e2e8f0; --input-border: #e2e8f0;
--comment-bg: #eff2f5; --comment-bg: #eff2f5;
--border-color: #dee2e6; --border-color: #dee2e6;
--card-header-accent: #f9fafb; --card-header-accent: #f9fafb;
--dropdown-item-hover-bg: #e9ecef; --dropdown-item-hover-bg: #e9ecef;
--dropdown-item-hover-color: #16181b; --dropdown-item-hover-color: #16181b;
--dropdown-item-color: #64748b; --dropdown-item-color: #64748b;
--dropdown-item-active-color: #334155; --dropdown-item-active-color: #334155;
} }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
:root { :root {
--light: #000; --light: #000;
--dark: #fff; --dark: #fff;
--body-bg: #000; --body-bg: #000;
--body-color: #9ca3af; --body-color: #9ca3af;
--nav-bg: #000; --nav-bg: #000;
--bg-light: #212124; --bg-light: #212124;
--light-gray: #212124; --light-gray: #212124;
--text-lighter: #818181; --text-lighter: #818181;
--card-bg: #161618; --card-bg: #161618;
--light-hover-bg: #212124; --light-hover-bg: #212124;
--btn-light-border: #161618; --btn-light-border: #161618;
--input-border: #161618; --input-border: #161618;
--comment-bg: #212124; --comment-bg: #212124;
--border-color: #212124; --border-color: #212124;
--card-header-accent: #212124; --card-header-accent: #212124;
--dropdown-item-hover-bg: #000; --dropdown-item-hover-bg: #000;
--dropdown-item-hover-color: #818181; --dropdown-item-hover-color: #818181;
--dropdown-item-color: #64748b; --dropdown-item-color: #64748b;
--dropdown-item-active-color: #fff; --dropdown-item-active-color: #fff;
} }
} }
.force-light-mode { .force-light-mode {
--light: #fff; --light: #fff;
--dark: #000; --dark: #000;
--body-bg: rgba(243,244,246,1); --body-bg: rgba(243,244,246,1);
--body-color: #212529; --body-color: #212529;
--nav-bg: #fff; --nav-bg: #fff;
--bg-light: #f8f9fa; --bg-light: #f8f9fa;
--primary: #3B82F6; --primary: #3B82F6;
--light-gray: #f8f9fa; --light-gray: #f8f9fa;
--text-lighter: #94a3b8; --text-lighter: #94a3b8;
--card-bg: #fff; --card-bg: #fff;
--light-hover-bg: #f9fafb; --light-hover-bg: #f9fafb;
--btn-light-border: #fff; --btn-light-border: #fff;
--input-border: #e2e8f0; --input-border: #e2e8f0;
--comment-bg: #eff2f5; --comment-bg: #eff2f5;
--border-color: #dee2e6; --border-color: #dee2e6;
--card-header-accent: #f9fafb; --card-header-accent: #f9fafb;
--dropdown-item-hover-bg: #e9ecef; --dropdown-item-hover-bg: #e9ecef;
--dropdown-item-hover-color: #16181b; --dropdown-item-hover-color: #16181b;
--dropdown-item-color: #64748b; --dropdown-item-color: #64748b;
--dropdown-item-active-color: #334155; --dropdown-item-active-color: #334155;
} }
.force-dark-mode { .force-dark-mode {
--light: #000; --light: #000;
--dark: #fff; --dark: #fff;
--body-bg: #000; --body-bg: #000;
--body-color: #9ca3af; --body-color: #9ca3af;
--nav-bg: #000; --nav-bg: #000;
--bg-light: #212124; --bg-light: #212124;
--light-gray: #212124; --light-gray: #212124;
--text-lighter: #818181; --text-lighter: #818181;
--card-bg: #161618; --card-bg: #161618;
--light-hover-bg: #212124; --light-hover-bg: #212124;
--btn-light-border: #161618; --btn-light-border: #161618;
--input-border: #161618; --input-border: #161618;
--comment-bg: #212124; --comment-bg: #212124;
--border-color: #212124; --border-color: #212124;
--card-header-accent: #212124; --card-header-accent: #212124;
--dropdown-item-hover-bg: #000; --dropdown-item-hover-bg: #000;
--dropdown-item-hover-color: #818181; --dropdown-item-hover-color: #818181;
--dropdown-item-color: #64748b; --dropdown-item-color: #64748b;
--dropdown-item-active-color: #b3b3b3; --dropdown-item-active-color: #b3b3b3;
} }
body { body {
background: var(--body-bg); background: var(--body-bg);
font-family: 'IBM Plex Sans', sans-serif; font-family: 'IBM Plex Sans', sans-serif;
color: var(--body-color); color: var(--body-color);
} }
.web-wrapper { .web-wrapper {
margin-bottom: 10rem; margin-bottom: 10rem;
} }
.container-fluid { .container-fluid {
max-width: 1440px !important; max-width: 1440px !important;
} }
.jumbotron { .jumbotron {
border-radius: 18px; border-radius: 18px;
} }
.rounded-px { .rounded-px {
border-radius: 18px; border-radius: 18px;
} }
.doc-body { .doc-body {
p:last-child { p:last-child {
margin-bottom: 0; margin-bottom: 0;
} }
} }
.navbar-laravel { .navbar-laravel {
background-color: var(--nav-bg); background-color: var(--nav-bg);
} }
.sticky-top { .sticky-top {
z-index: 2; z-index: 2;
} }
.navbar-light .navbar-brand { .navbar-light .navbar-brand {
color: var(--dark); color: var(--dark);
&:hover { &:hover {
color: var(--dark); color: var(--dark);
} }
} }
.primary { .primary {
color: var(--primary); color: var(--primary);
}
.bg-g-amin {
background: #8E2DE2;
background: -webkit-linear-gradient(to right, #4A00E0, #8E2DE2);
background: linear-gradient(to left, #4A00E0, #8E2DE2);
} }
.text-lighter { .text-lighter {
color: var(--text-lighter) !important; color: var(--text-lighter) !important;
} }
.text-dark { .text-dark {
color: var(--body-color) !important; color: var(--body-color) !important;
&:hover { &:hover {
color: var(--dark) !important; color: var(--dark) !important;
} }
} }
@ -169,16 +175,16 @@ a.text-dark:hover {
} }
.badge-primary { .badge-primary {
background-color: var(--primary); background-color: var(--primary);
} }
.btn-primary { .btn-primary {
background-color: var(--primary); background-color: var(--primary);
color: #fff !important; color: #fff !important;
} }
.btn-outline-light { .btn-outline-light {
border-color: var(--light-gray); border-color: var(--light-gray);
} }
.border { .border {
@ -187,51 +193,51 @@ a.text-dark:hover {
.bg-white, .bg-white,
.bg-light { .bg-light {
background-color: var(--bg-light) !important; background-color: var(--bg-light) !important;
border-color: var(--bg-light) !important; border-color: var(--bg-light) !important;
} }
.btn-light { .btn-light {
background-color: var(--light-gray); background-color: var(--light-gray);
border-color: var(--btn-light-border); border-color: var(--btn-light-border);
color: var(--body-color); color: var(--body-color);
&:hover { &:hover {
color: var(--body-color); color: var(--body-color);
background-color: var(--card-bg); background-color: var(--card-bg);
border-color: var(--btn-light-border); border-color: var(--btn-light-border);
} }
} }
.autocomplete-input { .autocomplete-input {
border: 1px solid var(--light-gray) !important; border: 1px solid var(--light-gray) !important;
color: var(--body-color); color: var(--body-color);
} }
.autocomplete-result-list { .autocomplete-result-list {
background: var(--light) !important; background: var(--light) !important;
z-index: 2 !important; z-index: 2 !important;
} }
.dropdown-menu, .dropdown-menu,
span.twitter-typeahead .tt-menu, span.twitter-typeahead .tt-menu,
.form-control { .form-control {
border: 1px solid var(--border-color) !important; border: 1px solid var(--border-color) !important;
color: var(--body-color); color: var(--body-color);
background-color: var(--card-bg); background-color: var(--card-bg);
} }
.tribute-container li, .tribute-container li,
.dropdown-item, .dropdown-item,
span.twitter-typeahead .tt-suggestion { span.twitter-typeahead .tt-suggestion {
color: var(--body-color); color: var(--body-color);
} }
.dropdown-item:hover, .dropdown-item:hover,
span.twitter-typeahead .tt-suggestion:hover, span.twitter-typeahead .tt-suggestion:hover,
.dropdown-item:focus, .dropdown-item:focus,
span.twitter-typeahead .tt-suggestion:focus { span.twitter-typeahead .tt-suggestion:focus {
color: var(--dropdown-item-hover-color); color: var(--dropdown-item-hover-color);
background-color: var(--dropdown-item-hover-bg); background-color: var(--dropdown-item-hover-bg);
text-decoration: none; text-decoration: none;
} }
@ -245,7 +251,7 @@ span.twitter-typeahead .tt-suggestion:focus {
.card-header, .card-header,
.card-footer, .card-footer,
.ph-item { .ph-item {
background-color: var(--card-bg); background-color: var(--card-bg);
} }
.badge-light, .badge-light,
@ -253,143 +259,147 @@ span.twitter-typeahead .tt-suggestion:focus {
.ph-avatar, .ph-avatar,
.ph-picture, .ph-picture,
.ph-row div { .ph-row div {
background-color: var(--light-gray); background-color: var(--light-gray);
} }
.card-header, .card-header,
.border-top, .border-top,
.border-bottom { .border-bottom {
border-color: var(--border-color) !important; border-color: var(--border-color) !important;
} }
.modal-header, .modal-header,
.modal-footer { .modal-footer {
border-color: var(--border-color); border-color: var(--border-color);
} }
.compose-action:hover { .compose-action:hover {
background-color: var(--light-gray) !important; background-color: var(--light-gray) !important;
} }
.dropdown-divider { .dropdown-divider {
border-color: var(--dropdown-item-hover-bg); border-color: var(--dropdown-item-hover-bg);
} }
.metro-nav { .metro-nav {
&.flex-column { &.flex-column {
background-color: var(--card-bg); background-color: var(--card-bg);
.nav-item { .nav-item {
.nav-link:hover { .nav-link:hover {
background-color: var(--light-hover-bg); background-color: var(--light-hover-bg);
} }
} }
} }
} }
.child-reply-form { .child-reply-form {
.form-control { .form-control {
border-color: var(--input-border); border-color: var(--input-border);
color: var(--body-color); color: var(--body-color);
} }
} }
.ui-menu { .ui-menu {
.btn-group { .btn-group {
.btn:first-child { .btn:first-child {
border-top-left-radius: 50rem; border-top-left-radius: 50rem;
border-bottom-left-radius: 50rem; border-bottom-left-radius: 50rem;
} }
.btn:last-child { .btn:last-child {
border-top-right-radius: 50rem; border-top-right-radius: 50rem;
border-bottom-right-radius: 50rem; border-bottom-right-radius: 50rem;
} }
.btn-primary { .btn-primary {
font-weight: bold; font-weight: bold;
} }
} }
.b-custom-control-lg { .b-custom-control-lg {
padding-bottom: 8px; padding-bottom: 8px;
} }
} }
.content-label { .content-label {
&-wrapper { &-wrapper {
div:not(.content-label) { div:not(.content-label) {
height: 100%; height: 100%;
} }
} }
&-text { &-text {
width: 80%; width: 80%;
@media (min-width: 768px) { @media (min-width: 768px) {
width: 50%; width: 50%;
} }
} }
} }
.compose-modal-component { .compose-modal-component {
.form-control:focus { .form-control:focus {
color: var(--body-color); color: var(--body-color);
} }
} }
.modal-body { .modal-body {
.nav-tabs .nav-link.active, .nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link { .nav-tabs .nav-item.show .nav-link {
background-color: transparent; background-color: transparent;
border-color: var(--border-color); border-color: var(--border-color);
} }
.nav-tabs .nav-link:hover, .nav-tabs .nav-link:hover,
.nav-tabs .nav-link:focus { .nav-tabs .nav-link:focus {
border-color: var(--border-color); border-color: var(--border-color);
} }
.form-control:focus { .form-control:focus {
color: var(--body-color); color: var(--body-color);
} }
} }
.tribute-container { .tribute-container {
border: 0; border: 0;
ul {
margin-top: 0;
border-color: var(--border-color);
}
li { ul {
padding: 0.5rem 1rem; margin-top: 0;
border-top: 0; border-color: var(--border-color);
border-left: 0; }
border-right: 0;
font-size: 13px;
&:not(:last-child) { li {
border-bottom: 1px solid var(--border-color); padding: 0.5rem 1rem;
} border-top: 0;
border-left: 0;
border-right: 0;
font-size: 13px;
&:not(:last-child) {
border-bottom: 1px solid var(--border-color);
}
&.highlight,
&:hover {
color: var(--body-color);
font-weight: bold;
background: rgba(44, 120, 191, 0.25);
}
}
}
&.highlight, .ft-std {
&:hover { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
color: var(--body-color);
font-weight: bold;
background: rgba(44, 120, 191, 0.25);
}
}
} }
.timeline-status-component { .timeline-status-component {
.username { .username {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
margin-bottom: -3px; margin-bottom: -3px;
word-break: break-word; word-break: break-word;
@media (min-width: 768px) { @media (min-width: 768px) {
font-size: 17px; font-size: 17px;
} }
} }
} }

Loading…
Cancel
Save