Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
|
vivaldi [2021/01/11 20:47] behemoth |
vivaldi [2021/01/11 21:12] (Version actuelle) behemoth [Modifications] |
||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| ====== Vivaldi ====== | ====== Vivaldi ====== | ||
| ===== Modifications ===== | ===== Modifications ===== | ||
| + | [[https:// | ||
| + | |||
| ==== jdHooks ==== | ==== jdHooks ==== | ||
| [[https:// | [[https:// | ||
| Ligne 8: | Ligne 10: | ||
| </ | </ | ||
| ==== Cacher automatiquement la barre d' | ==== Cacher automatiquement la barre d' | ||
| - | [[https:// | + | [[https:// |
| Le script original provoque un petit problème d' | Le script original provoque un petit problème d' | ||
| Dans les paramètres, | Dans les paramètres, | ||
| Ligne 31: | Ligne 33: | ||
| # | # | ||
| </ | </ | ||
| + | ==== Activer les différents panneaux au survol de la souris ==== | ||
| + | [[https:// | ||
| + | <code javascript> | ||
| + | // https:// | ||
| + | function panelMouseOver(autoHide, | ||
| + | var buttons = document.getElementById(' | ||
| + | var show_token = null; | ||
| + | var activeButton = null; | ||
| + | |||
| + | /* Stop timer if mouse exits screen */ | ||
| + | document.addEventListener(" | ||
| + | clearTimeout(show_token); | ||
| + | }); | ||
| + | |||
| + | /* Do auto-hide if applicable */ | ||
| + | if (autoHide) { | ||
| + | var content = document.getElementById(" | ||
| + | if (!document.getElementById(" | ||
| + | clearTimeout(show_token); | ||
| + | setTimeout(function () { | ||
| + | activeButton = activeButton ? activeButton : getActiveButton(); | ||
| + | if (activeButton && (activeButton.getAttribute(' | ||
| + | activeButton.click(); | ||
| + | activeButton = null; | ||
| + | } | ||
| + | }, delay_hide); | ||
| + | } | ||
| + | }; | ||
| + | } | ||
| + | |||
| + | |||
| + | function activeButtonIndex() { | ||
| + | for (let i = 0; i < buttons.length - 2; i++) { | ||
| + | if (buttons[i].getAttribute(' | ||
| + | return i; | ||
| + | } | ||
| + | } | ||
| + | return -1; | ||
| + | } | ||
| + | |||
| + | function getActiveButton() { | ||
| + | if(buttons[activeButtonIndex()]) { | ||
| + | return buttons[activeButtonIndex()]; | ||
| + | } | ||
| + | return null; | ||
| + | } | ||
| + | |||
| + | function setActive(index, | ||
| + | clearTimeout(show_token); | ||
| + | var delay = 0; | ||
| + | if (doDelay) { | ||
| + | delay = (activeButtonIndex() < 0) ? delay_show : delay_change; | ||
| + | } | ||
| + | show_token = setTimeout(function () { | ||
| + | var newButton = buttons[index]; | ||
| + | if (!newButton.getAttribute(' | ||
| + | activeButton = newButton; | ||
| + | activeButton.click(); | ||
| + | panel = index; | ||
| + | } | ||
| + | }, delay); | ||
| + | } | ||
| + | |||
| + | function setListeners() { | ||
| + | for (let index = 0; index < buttons.length - 2; index++) { | ||
| + | buttons[index].onmouseover = function () { | ||
| + | setActive(index, | ||
| + | }; | ||
| + | buttons[index].onmouseout = function () { | ||
| + | clearTimeout(show_token); | ||
| + | }; | ||
| + | buttons[index].ondragover = function () { | ||
| + | setActive(index, | ||
| + | }; | ||
| + | } | ||
| + | } | ||
| + | |||
| + | setListeners(); | ||
| + | } | ||
| + | |||
| + | function addObserver() { | ||
| + | const switchPanel = document.getElementById(' | ||
| + | const config = { | ||
| + | childList: true, | ||
| + | subtree: true | ||
| + | }; | ||
| + | const callback = function (mutationList, | ||
| + | for (let mutation of mutationList) { | ||
| + | if (mutation.type === ' | ||
| + | panelMouseOver(true, | ||
| + | } | ||
| + | } | ||
| + | }; | ||
| + | const observer = new MutationObserver(callback); | ||
| + | observer.observe(switchPanel, | ||
| + | }; | ||
| + | |||
| + | setTimeout(function wait() { | ||
| + | const browser = document.getElementById(' | ||
| + | if (browser) { | ||
| + | panelMouseOver(true, | ||
| + | addObserver(); | ||
| + | } else { | ||
| + | setTimeout(wait, | ||
| + | } | ||
| + | }, 300); | ||
| + | </ | ||
| + | ==== Faire clignoter le lien actif ==== | ||
| + | [[https:// | ||
| + | <code css> | ||
| + | a:active {animation: flk .15s steps(2) 0s infinite;} | ||
| + | @keyframes flk {50% {filter: invert(1); | ||
| + | </ | ||
| + | |||