Skip to content

Commit 7e1ffc5

Browse files
authored
Merge pull request #956 from cheeaun/main
Update from main
2 parents 8f048af + 7f947a0 commit 7e1ffc5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+14086
-12985
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ These are self-hosted by other wonderful folks.
273273
- [phanpy.tilde.zone](https://phanpy.tilde.zone) by [@ben@tilde.zone](https://tilde.zone/@ben)
274274
- [phanpy.vmst.io](https://phanpy.vmst.io/) by [@vmstan@vmst.io](https://vmst.io/@vmstan)
275275
- [social.qrk.one](https://social.qrk.one) by [@kev@fosstodon.org](https://fosstodon.org/@kev)
276+
- [phanpy.linuxusers.in](https://phanpy.linuxusers.in) by [@dharmik@linuxusers.in](https://linuxusers.in/dharmik)
276277

277278
> Note: Add yours by creating a pull request.
278279
@@ -324,12 +325,14 @@ Costs involved in running and developing this web app:
324325
- <img src="https://crowdin-static.downloads.crowdin.com/avatar/16529521/medium/ae6add93a901b0fefa2d9b1077920d73.png" alt="" width="16" height="16" /> llun (Thai)
325326
- <img src="https://crowdin-static.downloads.crowdin.com/avatar/16291756/medium/c008af10bc117fa9c9dcb70f2b291ee6.jpg" alt="" width="16" height="16" /> lucasofchirst (Occitan, Portuguese, Portuguese, Brazilian)
326327
- <img src="https://crowdin-static.downloads.crowdin.com/avatar/16640089/medium/4b7d8d275d7a7bff564adde51e09b473_default.png" alt="" width="16" height="16" /> LukeHong (Chinese Traditional)
328+
- <img src="https://crowdin-static.downloads.crowdin.com/avatar/12822971/medium/4ecbe6d1248536084902925beb0b63e4.png" alt="" width="16" height="16" /> Mannivu (Italian)
327329
- <img src="https://crowdin-static.downloads.crowdin.com/avatar/16537713/medium/825f0bf1a14fc545a76891a52839d86e_default.png" alt="" width="16" height="16" /> marcin.kozinski (Polish)
328330
- <img src="https://crowdin-static.downloads.crowdin.com/avatar/13521465/medium/76cb9aa6b753ce900a70478bff7fcea0.png" alt="" width="16" height="16" /> mkljczkk (Polish)
329331
- <img src="https://crowdin-static.downloads.crowdin.com/avatar/12882812/medium/77744d8db46e9a3e09030e1a02b7a572.jpeg" alt="" width="16" height="16" /> mojosoeun (Korean)
330332
- <img src="https://crowdin-static.downloads.crowdin.com/avatar/13613969/medium/c7834ddc0ada84a79671697a944bb274.png" alt="" width="16" height="16" /> moreal (Korean)
331333
- <img src="https://crowdin-static.downloads.crowdin.com/avatar/14158861/medium/ba1ff31dc5743b067ea6685f735229a5_default.png" alt="" width="16" height="16" /> MrWillCom (Chinese Simplified)
332334
- <img src="https://crowdin-static.downloads.crowdin.com/avatar/15652333/medium/7f36f289f9e2fe41d89ad534a1047f0e.png" alt="" width="16" height="16" /> nclm (French)
335+
- <img src="https://crowdin-static.downloads.crowdin.com/avatar/15000639/medium/ebbf0bb7d5027a1903d11b7f5f34f65b.jpeg" alt="" width="16" height="16" /> nycterent (Lithuanian)
333336
- <img src="https://crowdin-static.downloads.crowdin.com/avatar/16539461/medium/2f41b9f0b802c1d200a6ab62167a7229_default.png" alt="" width="16" height="16" /> pazpi (Italian)
334337
- <img src="https://crowdin-static.downloads.crowdin.com/avatar/13954917/medium/56a2cba267eb1b5d122bf62ddc0dd732_default.png" alt="" width="16" height="16" /> PPNplus (Thai)
335338
- <img src="https://crowdin-static.downloads.crowdin.com/avatar/15106977/medium/54bf93b19af8bbfdee579ea51685bafa.jpeg" alt="" width="16" height="16" /> punkrockgirl (Basque)

package-lock.json

Lines changed: 6 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
"postcss": "~8.4.49",
6767
"postcss-dark-theme-class": "~1.3.0",
6868
"postcss-preset-env": "~10.1.1",
69+
"prettier": "3.4.1",
6970
"sonda": "~0.6.1",
7071
"twitter-text": "~3.1.0",
7172
"vite": "~5.4.11",

src/app.jsx

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import SearchCommand from './components/search-command';
2727
import Shortcuts from './components/shortcuts';
2828
import NotFound from './pages/404';
2929
import AccountStatuses from './pages/account-statuses';
30+
import AnnualReport from './pages/annual-report';
3031
import Bookmarks from './pages/bookmarks';
3132
import Catchup from './pages/catchup';
3233
import Favourites from './pages/favourites';
@@ -98,39 +99,42 @@ window.__STATES_STATS__ = () => {
9899
// Experimental "garbage collection" for states
99100
// Every 15 minutes
100101
// Only posts for now
101-
setInterval(() => {
102-
if (!window.__IDLE__) return;
103-
const { statuses, unfurledLinks, notifications } = states;
104-
let keysCount = 0;
105-
const { instance } = api();
106-
for (const key in statuses) {
107-
if (!window.__IDLE__) break;
108-
try {
109-
const $post = document.querySelector(
110-
`[data-state-post-id~="${key}"], [data-state-post-ids~="${key}"]`,
111-
);
112-
const postInNotifications = notifications.some(
113-
(n) => key === statusKey(n.status?.id, instance),
114-
);
115-
if (!$post && !postInNotifications) {
116-
delete states.statuses[key];
117-
delete states.statusQuotes[key];
118-
for (const link in unfurledLinks) {
119-
const unfurled = unfurledLinks[link];
120-
const sKey = statusKey(unfurled.id, unfurled.instance);
121-
if (sKey === key) {
122-
delete states.unfurledLinks[link];
123-
break;
102+
setInterval(
103+
() => {
104+
if (!window.__IDLE__) return;
105+
const { statuses, unfurledLinks, notifications } = states;
106+
let keysCount = 0;
107+
const { instance } = api();
108+
for (const key in statuses) {
109+
if (!window.__IDLE__) break;
110+
try {
111+
const $post = document.querySelector(
112+
`[data-state-post-id~="${key}"], [data-state-post-ids~="${key}"]`,
113+
);
114+
const postInNotifications = notifications.some(
115+
(n) => key === statusKey(n.status?.id, instance),
116+
);
117+
if (!$post && !postInNotifications) {
118+
delete states.statuses[key];
119+
delete states.statusQuotes[key];
120+
for (const link in unfurledLinks) {
121+
const unfurled = unfurledLinks[link];
122+
const sKey = statusKey(unfurled.id, unfurled.instance);
123+
if (sKey === key) {
124+
delete states.unfurledLinks[link];
125+
break;
126+
}
124127
}
128+
keysCount++;
125129
}
126-
keysCount++;
127-
}
128-
} catch (e) {}
129-
}
130-
if (keysCount) {
131-
console.info(`GC: Removed ${keysCount} keys`);
132-
}
133-
}, 15 * 60 * 1000);
130+
} catch (e) {}
131+
}
132+
if (keysCount) {
133+
console.info(`GC: Removed ${keysCount} keys`);
134+
}
135+
},
136+
15 * 60 * 1000,
137+
);
134138

135139
// Preload icons
136140
// There's probably a better way to do this
@@ -546,6 +550,7 @@ function SecondaryRoutes({ isLoggedIn }) {
546550
<Route path="/fh" element={<FollowedHashtags />} />
547551
<Route path="/ft" element={<Filters />} />
548552
<Route path="/catchup" element={<Catchup />} />
553+
<Route path="/annual_report/:year" element={<AnnualReport />} />
549554
</>
550555
)}
551556
<Route path="/:instance?/t/:hashtag" element={<Hashtag />} />

src/components/ICONS.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,4 +174,5 @@ export const ICONS = {
174174
'heart-break': () => import('@iconify-icons/mingcute/heart-crack-line'),
175175
'user-x': () => import('@iconify-icons/mingcute/user-x-line'),
176176
minimize: () => import('@iconify-icons/mingcute/arrows-down-line'),
177+
celebrate: () => import('@iconify-icons/mingcute/celebrate-line'),
177178
};

src/components/compose.css

Lines changed: 130 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@
2020
justify-content: space-between;
2121
gap: 8px;
2222
align-items: center;
23-
padding: 16px;
23+
padding: 8px;
2424
position: sticky;
2525
top: 0;
2626
z-index: 100;
2727
white-space: nowrap;
28+
29+
@media (min-width: 480px) {
30+
padding: 16px;
31+
}
2832
}
2933
#compose-container .compose-top .account-block {
3034
text-align: start;
@@ -110,17 +114,21 @@
110114
}
111115

112116
#compose-container form {
113-
--form-padding-inline: 8px;
114-
--form-padding-block: 0;
117+
--form-spacing-inline: 4px;
118+
--form-spacing-block: 0;
115119
/* border-radius: 16px; */
116-
padding: var(--form-padding-block) var(--form-padding-inline);
120+
padding: var(--form-spacing-block) var(--form-spacing-inline);
117121
background-color: var(--bg-blur-color);
118122
/* background-image: linear-gradient(var(--bg-color) 85%, transparent); */
119123
position: relative;
120124
z-index: 2;
121125
--drop-shadow: 0 3px 6px -3px var(--drop-shadow-color);
122126
box-shadow: var(--drop-shadow);
123127

128+
@media (min-width: 480px) {
129+
--form-spacing-inline: 8px;
130+
}
131+
124132
@media (min-width: 40em) {
125133
border-radius: 16px;
126134
}
@@ -153,8 +161,8 @@
153161
display: flex;
154162
justify-content: space-between;
155163
align-items: center;
156-
padding: 8px 0;
157-
gap: 8px;
164+
padding: var(--form-spacing-inline) 0;
165+
gap: var(--form-spacing-inline);
158166
}
159167
#compose-container .toolbar.wrap {
160168
flex-wrap: wrap;
@@ -181,6 +189,11 @@
181189
white-space: nowrap;
182190
border: 2px solid transparent;
183191
vertical-align: middle;
192+
193+
&.active {
194+
filter: brightness(0.8);
195+
background-color: var(--bg-color);
196+
}
184197
}
185198
#compose-container .toolbar-button > * {
186199
vertical-align: middle;
@@ -246,6 +259,39 @@
246259
text-overflow: ellipsis;
247260
overflow: hidden;
248261
max-width: 100%;
262+
min-width: 4ch;
263+
}
264+
265+
#compose-container .compose-footer {
266+
.add-toolbar-button-group {
267+
display: flex;
268+
overflow: auto;
269+
}
270+
.add-sub-toolbar-button-group {
271+
flex-grow: 1;
272+
display: flex;
273+
overflow: auto;
274+
transition: 0.5s ease-in-out;
275+
transition-property: opacity, width;
276+
scrollbar-width: none;
277+
padding-inline-end: 16px;
278+
mask-image: linear-gradient(
279+
var(--to-backward),
280+
transparent 0,
281+
black 16px,
282+
black 100%
283+
);
284+
285+
&::-webkit-scrollbar {
286+
display: none;
287+
}
288+
289+
&[hidden] {
290+
opacity: 0;
291+
pointer-events: none;
292+
width: 0;
293+
}
294+
}
249295
}
250296

251297
#compose-container text-expander {
@@ -516,6 +562,37 @@
516562
color: var(--red-color);
517563
}
518564

565+
.compose-menu-add-media {
566+
position: relative;
567+
568+
.compose-menu-add-media-field {
569+
position: absolute;
570+
inset: 0;
571+
opacity: 0;
572+
cursor: inherit;
573+
}
574+
}
575+
576+
.icon-gif {
577+
display: inline-block !important;
578+
min-width: 16px;
579+
height: 16px;
580+
font-size: 10px !important;
581+
letter-spacing: -0.5px;
582+
font-size-adjust: none;
583+
overflow: hidden;
584+
white-space: nowrap;
585+
text-align: center;
586+
line-height: 16px;
587+
font-weight: bold;
588+
text-rendering: optimizeSpeed;
589+
590+
&:after {
591+
display: block;
592+
content: 'GIF';
593+
}
594+
}
595+
519596
@media (display-mode: standalone) {
520597
/* No popping in standalone mode */
521598
#compose-container .pop-button {
@@ -525,8 +602,10 @@
525602

526603
#compose-container button[type='submit'] {
527604
border-radius: 8px;
605+
528606
@media (min-width: 480px) {
529607
padding-inline: 24px;
608+
font-size: 125%;
530609
}
531610
}
532611

@@ -820,8 +899,8 @@
820899
.compose-field-container {
821900
display: grid !important;
822901

823-
@media (width < 30em) {
824-
margin-inline: calc(-1 * var(--form-padding-inline));
902+
@media (width < 480px) {
903+
margin-inline: calc(-1 * var(--form-spacing-inline));
825904
width: 100vw !important;
826905
max-width: 100vw;
827906

@@ -929,15 +1008,55 @@
9291008
}
9301009
}
9311010

1011+
@keyframes jump-scare {
1012+
from {
1013+
opacity: 0.5;
1014+
transform: scale(0.25) translateX(80px);
1015+
}
1016+
to {
1017+
opacity: 1;
1018+
transform: scale(1) translateX(0);
1019+
}
1020+
}
1021+
@keyframes jump-scare-rtl {
1022+
from {
1023+
opacity: 0.5;
1024+
transform: scale(0.25) translateX(-80px);
1025+
}
1026+
to {
1027+
opacity: 1;
1028+
transform: scale(1) translateX(0);
1029+
}
1030+
}
1031+
1032+
.add-button {
1033+
transform-origin: var(--forward) center;
1034+
background-color: var(--bg-blur-color) !important;
1035+
animation: jump-scare 0.2s ease-in-out both;
1036+
:dir(rtl) & {
1037+
animation-name: jump-scare-rtl;
1038+
}
1039+
1040+
.icon {
1041+
transition: transform 0.3s ease-in-out;
1042+
}
1043+
&.active {
1044+
.icon {
1045+
transform: rotate(135deg);
1046+
}
1047+
}
1048+
}
1049+
9321050
.gif-picker-button {
933-
span {
1051+
/* span {
9341052
font-weight: bold;
9351053
font-size: 11.5px;
9361054
display: block;
937-
}
1055+
line-height: 1;
1056+
} */
9381057

9391058
&:is(:hover, :focus) {
940-
span {
1059+
.icon {
9411060
animation: gif-shake 0.3s 3;
9421061
}
9431062
}

0 commit comments

Comments
 (0)