mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-09 01:26:24 +01:00
Catching up with fixes and enhancements
This commit is contained in:
parent
315ce98511
commit
6f3f83a620
2 changed files with 62 additions and 9 deletions
|
@ -179,6 +179,10 @@
|
||||||
color: var(--text-insignificant-color);
|
color: var(--text-insignificant-color);
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
transform: scale(0.95);
|
||||||
|
}
|
||||||
|
|
||||||
select {
|
select {
|
||||||
/* appearance: none;
|
/* appearance: none;
|
||||||
background-color: var(--bg-faded-color);
|
background-color: var(--bg-faded-color);
|
||||||
|
@ -456,6 +460,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-line {
|
.post-line {
|
||||||
|
font-size: 0.95em;
|
||||||
border-radius: inherit;
|
border-radius: inherit;
|
||||||
animation: appear-smooth 0.3s ease-in-out both;
|
animation: appear-smooth 0.3s ease-in-out both;
|
||||||
--pad: 16px;
|
--pad: 16px;
|
||||||
|
@ -603,7 +608,6 @@
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
line-height: 1.3;
|
line-height: 1.3;
|
||||||
opacity: 0.9;
|
opacity: 0.9;
|
||||||
font-size: 0.9em;
|
|
||||||
text-wrap: balance;
|
text-wrap: balance;
|
||||||
|
|
||||||
&:empty {
|
&:empty {
|
||||||
|
@ -653,7 +657,8 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
br:after {
|
br:after,
|
||||||
|
:not(br, span, a) + :is(p, div, blockquote, ul, ol, pre):before {
|
||||||
font-size: 0.75em;
|
font-size: 0.75em;
|
||||||
content: ' ↵ ';
|
content: ' ↵ ';
|
||||||
opacity: 0.35;
|
opacity: 0.35;
|
||||||
|
@ -823,21 +828,24 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-stats {
|
.post-stats {
|
||||||
opacity: 0;
|
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
gap: 2px;
|
gap: 2px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
transform: translateX(4px);
|
|
||||||
/* transition: all 0.25s ease-out; */
|
|
||||||
|
|
||||||
&:empty {
|
&:empty {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@media (hover: hover) {
|
||||||
|
.post-stats {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateX(4px);
|
||||||
|
}
|
||||||
.post-line:hover .post-stats {
|
.post-line:hover .post-stats {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
transform: translateX(0);
|
transform: translateX(0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
+ footer {
|
+ footer {
|
||||||
min-height: 15vh;
|
min-height: 15vh;
|
||||||
|
|
|
@ -261,6 +261,7 @@ function Catchup() {
|
||||||
|
|
||||||
const thePost = post.reblog || post;
|
const thePost = post.reblog || post;
|
||||||
if (
|
if (
|
||||||
|
post.__FILTER !== 'filtered' &&
|
||||||
thePost.card?.url &&
|
thePost.card?.url &&
|
||||||
thePost.card?.image &&
|
thePost.card?.image &&
|
||||||
thePost.card?.type === 'link'
|
thePost.card?.type === 'link'
|
||||||
|
@ -467,6 +468,51 @@ function Catchup() {
|
||||||
return (Date.now() - lastCatchupEndAt) / 1000 / 60 / 60;
|
return (Date.now() - lastCatchupEndAt) / 1000 / 60 / 60;
|
||||||
}, [lastCatchupEndAt, range]);
|
}, [lastCatchupEndAt, range]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const filterCategoryText = {
|
||||||
|
Filtered: 'filtered posts',
|
||||||
|
Groups: 'group posts',
|
||||||
|
Boosts: 'boosts',
|
||||||
|
Replies: 'replies',
|
||||||
|
'Followed tags': 'followed-tag posts',
|
||||||
|
Original: 'original posts',
|
||||||
|
};
|
||||||
|
const authorUsername =
|
||||||
|
selectedAuthor && authors[selectedAuthor]
|
||||||
|
? authors[selectedAuthor].username
|
||||||
|
: '';
|
||||||
|
const sortOrderIndex = sortOrder === 'asc' ? 0 : 1;
|
||||||
|
const sortByText = {
|
||||||
|
// asc, desc
|
||||||
|
createdAt: ['oldest', 'latest'],
|
||||||
|
repliesCount: ['fewest replies', 'most replies'],
|
||||||
|
favouritesCount: ['fewest likes', 'most likes'],
|
||||||
|
reblogsCount: ['fewest boosts', 'most boosts'],
|
||||||
|
};
|
||||||
|
const groupByText = {
|
||||||
|
account: 'authors',
|
||||||
|
};
|
||||||
|
let toast = showToast(
|
||||||
|
`Showing ${filterCategoryText[selectedFilterCategory] || 'all posts'}${
|
||||||
|
authorUsername ? ` by @${authorUsername}` : ''
|
||||||
|
}, ${sortByText[sortBy][sortOrderIndex]} first${
|
||||||
|
!!groupBy
|
||||||
|
? `, grouped by ${groupBy === 'account' ? groupByText[groupBy] : ''}`
|
||||||
|
: ''
|
||||||
|
}`,
|
||||||
|
);
|
||||||
|
return () => {
|
||||||
|
toast?.hideToast?.();
|
||||||
|
};
|
||||||
|
}, [
|
||||||
|
selectedFilterCategory,
|
||||||
|
selectedAuthor,
|
||||||
|
sortBy,
|
||||||
|
sortOrder,
|
||||||
|
groupBy,
|
||||||
|
authors,
|
||||||
|
]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
ref={scrollableRef}
|
ref={scrollableRef}
|
||||||
|
@ -934,7 +980,6 @@ function Catchup() {
|
||||||
repliesCount: 'Replies',
|
repliesCount: 'Replies',
|
||||||
favouritesCount: 'Likes',
|
favouritesCount: 'Likes',
|
||||||
reblogsCount: 'Boosts',
|
reblogsCount: 'Boosts',
|
||||||
// account: 'Authors',
|
|
||||||
}[key]
|
}[key]
|
||||||
}
|
}
|
||||||
</label>
|
</label>
|
||||||
|
|
Loading…
Reference in a new issue