Skip to content

Commit ab9d235

Browse files
committed
on toggle video button hover, use black background
1 parent 7865227 commit ab9d235

File tree

2 files changed

+3
-24
lines changed

2 files changed

+3
-24
lines changed

src/content-script/update-description.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ chrome.runtime.onMessage.addListener((request) => {
1111

1212
const details = document.querySelectorAll('div.mt-3.flex.space-x-4')[0];
1313
let oldBtn = document.getElementById('openSolutionsBtn');
14-
i(oldBtn) {
14+
if (oldBtn) {
1515
oldBtn.remove();
1616
}
1717

src/content-script/update-solutions.ts

Lines changed: 2 additions & 23 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: '160px'
34+
width: '180px'
3535
});
3636
channelElement.classList.add('channel'); // add this line
3737
channelElement.textContent = channelName;
@@ -49,18 +49,7 @@ function createControlsContainer(channelName) {
4949
padding: '5px 10px'
5050
};
5151
const toggleButton = createButton('🔼', 'toggle-video', toggleButtonStyles);
52-
53-
const selectStyles = {
54-
marginLeft: '20px',
55-
border: '1px solid white',
56-
borderRadius: '5px',
57-
padding: '5px 10px',
58-
height: '35px',
59-
width: '150px'
60-
};
61-
6252
controlsContainer.append(prevButton, channelElement, nextButton, toggleButton);
63-
6453
return { controlsContainer, prevButton, nextButton, toggleButton };
6554
}
6655

@@ -94,17 +83,8 @@ function createVideoContainer(videoUrl, channelName) {
9483
return { container, iframe, prevButton, nextButton, toggleButton };
9584
}
9685

97-
interface LeetCodeProblem {
98-
title: string;
99-
videos: {
100-
embedded_url: string;
101-
channel: string;
102-
}[];
103-
}
104-
10586
/**
10687
* Injects the embedded YouTube solution into the solutions tab of the LeetCode problem.
107-
* @param {string} title - The problem title.
10888
*/
10989
function addVideo(title: string) {
11090
const SOLUTIONS_TAB_INDEX = 1;
@@ -153,14 +133,13 @@ function addVideo(title: string) {
153133

154134
if (iframe) {
155135
// pause the video
156-
iframe.contentWindow?.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
157136
}
158137
}
159138
});
160139

161140
// on hover, change background color of toggleButton
162141
toggleButton?.addEventListener('mouseover', () => {
163-
toggleButton.style.backgroundColor = '#fff';
142+
toggleButton.style.backgroundColor = '#222';
164143
toggleButton.style.color = '#000';
165144
});
166145

0 commit comments

Comments
 (0)