Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/tabs.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,6 +17,7 @@ async function createTab(url) {
).agent;
let tab = document.createElement('div');
let span = document.createElement('span');
let mute = document.createElement('span')
// Some parts taken from MystPi/Ninetails on Github. Thank you so much!!!
let randomHash = generateHashkey();
tab.classList.add('tab');
Expand All@@ -25,7 +26,15 @@ async function createTab(url) {
switchTabs(randomHash);
};
span.innerText = 'New Tab';
mute.classList.add("material-symbols-rounded")
mute.innerText = 'volume_off'
mute.classList.add('hidden')
mute.classList.add('indicator')
let view = document.createElement('webview');
tab.onauxclick = () => {
view.setAudioMuted(!view.audioMuted)
tab.children[2].classList.toggle("hidden")
}
view.id = 'view-' + randomHash;
view.classList.add('view');
view.allowpopups = 'allowpopups';
Expand All@@ -41,6 +50,7 @@ async function createTab(url) {
document.getElementById('tabs-bar').appendChild(tab);
tab.appendChild(image);
tab.appendChild(span);
tab.appendChild(mute)
addListeners(view, randomHash);
document.getElementById('webviews').appendChild(view);
switchTabs(randomHash);
Expand Down
15 changes: 12 additions & 3 deletions styles.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -27,9 +27,6 @@ body {

.tab {
transition: all;
display: flex;
justify-content: center;
align-items: center;
flex-grow: 1;
max-width: 32rem;
padding: 0.25rem 0.5rem;
Expand All@@ -40,6 +37,18 @@ body {
border-radius: 0.5rem;
cursor: pointer;
white-space: nowrap;
padding: 4pt;
}

.tab span {
font-size: 12pt;
}

.tab .indicator {
position: relative;
float: right;
font-weight: bold;
font-size: 1.3em;
}

.active-tab {
Expand Down