Skip to content

Commit 34cbfc9

Browse files
committed
add animation to hide/show solution video button
1 parent ab9d235 commit 34cbfc9

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/content-script/update-solutions.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function createControlsContainer(channelName) {
3131
const channelElement = createStyledElement('div', {
3232
fontSize: '15px',
3333
textAlign: 'center',
34-
width: '180px'
34+
width: '200px'
3535
});
3636
channelElement.classList.add('channel'); // add this line
3737
channelElement.textContent = channelName;
@@ -127,13 +127,12 @@ function addVideo(title: string) {
127127
const videoContainer = document.querySelector('div.video-container');
128128
if (videoContainer) {
129129
videoContainer.style.paddingBottom = videoContainer.style.paddingBottom === '0%' ? `${VIDEO_ASPECT_RATIO}% ` : '0%';
130-
toggleButton.textContent = videoContainer.style.paddingBottom === '0%' ? ' 🔽 ' : '🔼';
131-
132-
const iframe = container.querySelector('iframe.youtube-video');
133-
134-
if (iframe) {
135-
// pause the video
130+
if (videoContainer.style.paddingBottom === '0%') {
131+
toggleButton.style.transform = 'rotate(180deg)';
132+
} else {
133+
toggleButton.style.transform = 'rotate(0deg)';
136134
}
135+
toggleButton.style.transition = 'transform 0.3s linear';
137136
}
138137
});
139138

0 commit comments

Comments
 (0)