Add rotation effect to "Show More Chats" button and toggle visibility of hidden chats

This commit is contained in:
Cohee
2025-05-12 21:59:26 +03:00
parent e2c44161ed
commit ed388553cc
2 changed files with 7 additions and 2 deletions

View File

@@ -186,6 +186,10 @@ body.big-avatars .welcomeRecent .recentChatList .recentChat .chatMessageContaine
align-self: center;
}
.welcomeRecent .recentChatList .showMoreChats.rotate {
transform: rotate(180deg);
}
@media screen and (max-width: 1000px) {
.welcomePanel .welcomeShortcuts a span {
display: none;

View File

@@ -107,10 +107,11 @@ async function sendWelcomePanel() {
const hiddenChats = fragment.querySelectorAll('.recentChat.hidden');
fragment.querySelectorAll('button.showMoreChats').forEach((button) => {
button.addEventListener('click', () => {
const rotate = button.classList.contains('rotate');
hiddenChats.forEach((chatItem) => {
chatItem.classList.remove('hidden');
chatItem.classList.toggle('hidden', rotate);
});
button.remove();
button.classList.toggle('rotate', !rotate);
});
});
fragment.querySelectorAll('button.openTemporaryChat').forEach((button) => {