Skip to content

Commit

Permalink
Adds better styles and animation for clicking URL in the popup
Browse files Browse the repository at this point in the history
to indicate that it has been copied to clipboard.
  • Loading branch information
Amunak committed Sep 3, 2024
1 parent ee7baa1 commit 802a0d6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "__MSG_extensionName__",
"version": "1.0.1",
"version": "1.1.0",
"description": "__MSG_extensionDescription__",
"author": "Amunak",
"homepage_url": "https://github.com/Amunak/thunderbird-list-unsubscribe-addon",
Expand Down
9 changes: 9 additions & 0 deletions popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,18 @@ body, html {
}

code {
display: inline-block;
font-size: .875em;
color: #d63384;
word-wrap: break-word;

transition: all 0.1s ease;
cursor: pointer;
}

code.hl {
color: #ffffff;
background-color: #d63384;
}

.popup-page {
Expand Down
4 changes: 4 additions & 0 deletions popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ async function handleActiveTabs(tabs) {
linkEl.innerText = unsubLink
linkEl.addEventListener('click', () => {
navigator.clipboard.writeText(linkEl.innerText)
linkEl.classList.add('hl')
setTimeout(() => {
linkEl.classList.remove('hl')
}, 100)
})

linkContainerEl.innerText = browser.i18n.getMessage('unsubLink')
Expand Down

0 comments on commit 802a0d6

Please sign in to comment.