diff --git a/CHANGELOG.md b/CHANGELOG.md index aa25452..4a32e6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,4 +12,5 @@ Improved: - Settings that have been changed from default will now show a line next to them. Inspired by the [Visual Studio Code settings UI](https://d33wubrfki0l68.cloudfront.net/d1f1ea4def506997ced23d3d912154794e530e1c/063d2/assets/img/blog/2020-09-17-vscode-settings/settings-ui.png) - Checkbox / Switch input styles are now more in line with other input styles - Available updates are now shown as a clickable button next to your user icon instead of having to open the user menu +- The "offline" icon is now handled by dribbblish and fits in with the other info icons - Hovering over the release date in the album info now shows the full date \ No newline at end of file diff --git a/src/js/main.js b/src/js/main.js index 8c5f80a..34e8c9e 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -9,6 +9,7 @@ import Info from "./Info"; import svgArrowDown from "svg/arrow-down"; import svgCode from "svg/code"; +import svgWifiSlash from "svg/wifi-slash"; const DribbblishShared = { config: new ConfigMenu(), @@ -760,4 +761,18 @@ waitForElement([".main-topBar-container"], ([topBarContainer]) => { checkForUpdate(); }); +// Show "Offline info" +window.addEventListener("offline", () => + DribbblishShared.info.set("offline", { + tooltip: "Offline", + icon: svgWifiSlash, + order: 999, + color: { + fg: "#ffffff", + bg: "#ff2323" + } + }) +); +window.addEventListener("online", () => DribbblishShared.info.remove("offline")); + $("html").css("--warning_message", " "); diff --git a/src/styles/main.scss b/src/styles/main.scss index 9de965e..f03e24e 100644 --- a/src/styles/main.scss +++ b/src/styles/main.scss @@ -1227,6 +1227,11 @@ html.right-expanded-cover.buddyfeed-visible .main-coverSlotExpanded-container { height: 100%; } +// Hide default Sporify "Offline" notice +.main-noConnection { + display: none; +} + // ! WORKAROUNDS / TEMP FIXES // Spotify UI breaks after advertisements #63 canvas[width="250"][height="250"] { diff --git a/src/svg/wifi-slash.svg b/src/svg/wifi-slash.svg new file mode 100644 index 0000000..3fb33e2 --- /dev/null +++ b/src/svg/wifi-slash.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file