feat(ui): add smooth collapse animation for subscriptions list
Replace display toggle with CSS transitions for subscriptions list collapse
This commit is contained in:
10
js/script.js
10
js/script.js
@@ -778,12 +778,12 @@ function bindEvents() { // Bind events to the DOM elements
|
||||
const subscriptionsList = document.querySelector('.subscriptions-list');
|
||||
const chevron = subscriptionTitle.querySelector('i');
|
||||
|
||||
if (subscriptionsList.style.display === 'none') {
|
||||
subscriptionsList.style.display = 'block';
|
||||
chevron.style.transform = 'rotate(0deg)';
|
||||
} else {
|
||||
subscriptionsList.style.display = 'none';
|
||||
subscriptionsList.classList.toggle('collapsed');
|
||||
|
||||
if (subscriptionsList.classList.contains('collapsed')) {
|
||||
chevron.style.transform = 'rotate(-90deg)';
|
||||
} else {
|
||||
chevron.style.transform = 'rotate(0deg)';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user