Skip to content

Commit

Permalink
Other Audible tabs list implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianE00 committed Aug 9, 2024
1 parent 0d449e7 commit 56217d7
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions home.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ <h1 class="text-white text-center text-xl ">Not in Production Yet.</hi>
</div>
-->

<div class="text-white text-center " id="tabList">
<div class="text-green-500 text-center " id="tabList">

<p>test 1</p>
<p class="text-center text-pink-300 ">Other Audio</p>
<!--<p>test 2</p>-->

</div>
Expand Down
15 changes: 15 additions & 0 deletions src/css/output.css
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,11 @@ video {
color: rgb(31 41 55 / var(--tw-text-opacity));
}

.text-green-500 {
--tw-text-opacity: 1;
color: rgb(34 197 94 / var(--tw-text-opacity));
}

.text-indigo-400 {
--tw-text-opacity: 1;
color: rgb(129 140 248 / var(--tw-text-opacity));
Expand All @@ -883,11 +888,21 @@ video {
color: rgb(251 207 232 / var(--tw-text-opacity));
}

.text-pink-300 {
--tw-text-opacity: 1;
color: rgb(249 168 212 / var(--tw-text-opacity));
}

.text-pink-500 {
--tw-text-opacity: 1;
color: rgb(236 72 153 / var(--tw-text-opacity));
}

.text-red-500 {
--tw-text-opacity: 1;
color: rgb(239 68 68 / var(--tw-text-opacity));
}

.text-red-600 {
--tw-text-opacity: 1;
color: rgb(220 38 38 / var(--tw-text-opacity));
Expand Down
9 changes: 8 additions & 1 deletion src/js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,18 @@ document.addEventListener('DOMContentLoaded', async () => {

function updateTabMuteStatus(muted) {
if (muted === "true"){
tabMuteIcon.className = 'fa-solid fa-volume-xmark';
tabMuteIcon.className = 'fa-solid fa-volume-xmark ';
tabMuted.style.color = "green";

// NOTE: Get this working in the future
//tabMuted.classList.contains('text-red-500') ? tabMuted.classList.remove('text-red-500') : null;
//tabMuted.classList.add('text-green-500');
}
else {
tabMuteIcon.className = 'fa-solid fa-volume-high';
// NOTE: Get this working in the future
//tabMuted.classList.contains('text-green-500') ? tabMuted.classList.remove('text-green-500') : null;
//tabMuted.classList.add('text-red-500');
tabMuted.style.color = "red";
}
}
Expand Down
23 changes: 22 additions & 1 deletion src/js/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ chrome.runtime.onMessage.addListener(async (msg, sender, sendResponse) => {
let title = arr[0];
let audible = arr[1];
muted = arr[2];
let allTabs = await getAllTabTitles();
let allTabs = await getAllTabTitlesWithAudio();
/*for(let t of allTabs){
console.log("__Tab--:", t);
}
Expand Down Expand Up @@ -201,6 +201,27 @@ async function getAllTabTitlesAndSounds() {
}


/**
*
*
*/
async function getAllTabTitlesWithAudio() {
let queryOptions = {}; // * Get tabs across all chrome windows
let tabs = await chrome.tabs.query(queryOptions);
let titles = [];
// Get all tab titles that are currently audible
for (const tab of tabs) {
if (tab) {
if (tab.audible) {
console.log(` Titleee: ${tab.title}`);
titles.push(tab.title);
}
}

}
return titles
}

/**
*
*
Expand Down
3 changes: 3 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ module.exports = {
"./src/**/*.js",
"./*.html"
],
options : {
safelist: ['text-green-500', 'text-red-500'],
},
theme: {
extend: {},
},
Expand Down

0 comments on commit 56217d7

Please sign in to comment.