mirror of
https://github.com/He4eT/tabswitcher.git
synced 2026-05-05 01:17:23 +00:00
pages/search: indicator for discarded tabs
This commit is contained in:
parent
bd95d1c114
commit
bcf56cf841
4 changed files with 25 additions and 1 deletions
|
|
@ -20,6 +20,10 @@ html, body {
|
|||
--gray-dark-60: #2b2a33;
|
||||
--gray-dark-80: #1c1b22;
|
||||
--gray-dark-90: #15141a;
|
||||
|
||||
--green-20: #b3ffe3;
|
||||
--green-40: #54ffbd;
|
||||
--green-60: #2ac3a2;
|
||||
}
|
||||
|
||||
body {
|
||||
|
|
|
|||
|
|
@ -8,10 +8,14 @@ const tabView = (result) => {
|
|||
const [label, title, url] =
|
||||
result.map((field) => fuzzysort.highlight(field))
|
||||
|
||||
const tooltip = (tab.discarded ? `[discarded] ` : '')
|
||||
+ `${tab.title}\n${tab.url}`
|
||||
|
||||
return `
|
||||
<button class='tab' data-id='${tab.id}'>
|
||||
<button class='tab' data-id='${tab.id}' title='${tooltip}'>
|
||||
<span class='label'>${label ?? tab.label}</span>
|
||||
<img class='favicon' src='${tab.favIconUrl ?? defaultFavicon}'/>
|
||||
<div class='indicator ${tab.discarded ? 'discarded' : 'active'}'></div>
|
||||
<span class='title'>${title ?? tab.title}</span>
|
||||
<span class='url'>${url ?? tab.url}</span>
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ export const init = ({
|
|||
})
|
||||
|
||||
const pickFields = (tab) => [
|
||||
'discarded',
|
||||
'favIconUrl',
|
||||
'id',
|
||||
'label',
|
||||
|
|
|
|||
|
|
@ -65,6 +65,21 @@ main {
|
|||
height: calc(2 * var(--step));
|
||||
}
|
||||
|
||||
.tab > .indicator {
|
||||
flex-shrink: 0;
|
||||
border-radius: 50%;
|
||||
width: calc(1 * var(--step));
|
||||
height: calc(1 * var(--step));
|
||||
}
|
||||
|
||||
.tab > .indicator.active {
|
||||
background-color: var(--green-60);
|
||||
}
|
||||
|
||||
.tab > .indicator.discarded {
|
||||
background-color: var(--gray-light-50);
|
||||
}
|
||||
|
||||
.tab > .label {
|
||||
font-family: monospace;
|
||||
color: var(--gray-dark-10);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue