mirror of
https://github.com/danbulant/dribbblish-dynamic-theme
synced 2026-07-05 19:21:12 +00:00
refactor stuff and change notification styles
This commit is contained in:
parent
decfe17aa2
commit
56b109cc01
13 changed files with 115 additions and 103 deletions
|
|
@ -6,4 +6,5 @@ Fixed:
|
||||||
|
|
||||||
Improved:
|
Improved:
|
||||||
- Add `embedWidgetGenerator` modals to custom modal styles. (Things like the [spicetify-marketplace](https://github.com/CharlieS1103/spicetify-marketplace) options)
|
- Add `embedWidgetGenerator` modals to custom modal styles. (Things like the [spicetify-marketplace](https://github.com/CharlieS1103/spicetify-marketplace) options)
|
||||||
- Changed custom app tab styles to fit in with the theme
|
- Changed custom app tab styles to fit in with the theme
|
||||||
|
- Changed notification styles to fit in with other elements of the theme
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
import ConfigMenu from "./ConfigMenu";
|
import ConfigMenu from "./ConfigMenu";
|
||||||
import Info from "./Info";
|
import Info from "./Info";
|
||||||
import Loader from "./Loader";
|
import Loader from "./Loader";
|
||||||
import { icons } from "./Icons";
|
import Overlay from "./Overlay";
|
||||||
|
import Icon, { icons } from "./Icons";
|
||||||
|
|
||||||
export default class Dribbblish {
|
export default class Dribbblish {
|
||||||
/**
|
/**
|
||||||
|
|
@ -23,7 +24,10 @@ export default class Dribbblish {
|
||||||
/** @type {Loader} */
|
/** @type {Loader} */
|
||||||
loader;
|
loader;
|
||||||
|
|
||||||
/** @type {Icons} */
|
/** @type {Overlay} */
|
||||||
|
overlay;
|
||||||
|
|
||||||
|
/** @type {Icon} */
|
||||||
icons;
|
icons;
|
||||||
|
|
||||||
/** @type {Object.<string, listener[]>} */
|
/** @type {Object.<string, listener[]>} */
|
||||||
|
|
@ -36,6 +40,7 @@ export default class Dribbblish {
|
||||||
this.config = new ConfigMenu();
|
this.config = new ConfigMenu();
|
||||||
this.info = new Info();
|
this.info = new Info();
|
||||||
this.loader = new Loader();
|
this.loader = new Loader();
|
||||||
|
this.overlay = new Overlay();
|
||||||
this.icons = icons;
|
this.icons = icons;
|
||||||
|
|
||||||
let tries = 0;
|
let tries = 0;
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,18 @@
|
||||||
import { icons } from "./Icons";
|
import Overlay from "./Overlay";
|
||||||
|
|
||||||
export default class Loader {
|
export default class Loader {
|
||||||
/** @type {HTMLDivElement} */
|
/** @type {Overlay} */
|
||||||
#container;
|
#overlay;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.#container = document.createElement("div");
|
this.#overlay = new Overlay();
|
||||||
this.#container.id = "dribbblish-loader";
|
|
||||||
this.#container.innerHTML = /* html */ `
|
|
||||||
<div>
|
|
||||||
${icons.get("loading", { size: 64 })}
|
|
||||||
<span></span>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
|
|
||||||
document.body.appendChild(this.#container);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
show(text) {
|
show(text) {
|
||||||
this.#container.querySelector("span").innerText = text ?? "Loading...";
|
this.#overlay.show({ icon: "loading", text });
|
||||||
this.#container.setAttribute("active", "");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hide() {
|
hide() {
|
||||||
this.#container.removeAttribute("active");
|
this.#overlay.hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
68
src/js/Overlay.js
Normal file
68
src/js/Overlay.js
Normal file
|
|
@ -0,0 +1,68 @@
|
||||||
|
import { defaults } from "./Util";
|
||||||
|
import { icons } from "./Icons";
|
||||||
|
|
||||||
|
export default class Overlay {
|
||||||
|
/**
|
||||||
|
* @typedef {Object} DribbblishOverlayOptions
|
||||||
|
* @property {String} icon
|
||||||
|
* @property {String} text
|
||||||
|
* @property {DribbblishOverlayColor} color
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {Object} DribbblishOverlayColor
|
||||||
|
* @property {String} [icon]
|
||||||
|
* @property {String} [text]
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @type {HTMLDivElement} */
|
||||||
|
#container;
|
||||||
|
|
||||||
|
/** @type {HTMLElement} */
|
||||||
|
#iconElem;
|
||||||
|
|
||||||
|
/** @type {HTMLSpanElement} */
|
||||||
|
#textElem;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
this.#container = document.createElement("div");
|
||||||
|
this.#container.id = "dribbblish-overlay";
|
||||||
|
this.#container.innerHTML = /* html */ `
|
||||||
|
<div>
|
||||||
|
<i></i>
|
||||||
|
<span>Loading...</span>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
this.#iconElem = this.#container.querySelector("i");
|
||||||
|
this.#textElem = this.#container.querySelector("span");
|
||||||
|
|
||||||
|
document.body.appendChild(this.#container);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {DribbblishOverlayOptions} options
|
||||||
|
*/
|
||||||
|
show(options) {
|
||||||
|
const defaultOptions = {
|
||||||
|
icon: "",
|
||||||
|
text: "",
|
||||||
|
color: {
|
||||||
|
icon: "var(--spice-text)",
|
||||||
|
text: "var(--spice-subtext)"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
options = defaults(options, defaultOptions);
|
||||||
|
if (options.icon != "" && !options.icon.startsWith("<svg")) options.icon = icons.get(options.icon, { size: 64 });
|
||||||
|
this.#iconElem.innerHTML = options.icon;
|
||||||
|
this.#iconElem.style.setProperty("--color", options.color.icon);
|
||||||
|
this.#textElem.innerHTML = options.text;
|
||||||
|
this.#textElem.style.setProperty("--color", options.color.text);
|
||||||
|
this.#container.setAttribute("active", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
hide() {
|
||||||
|
this.#container.removeAttribute("active");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -23,16 +23,13 @@
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
position: relative;
|
position: relative;
|
||||||
width: clamp(500px, 50%, 650px);
|
width: clamp(500px, 50%, 650px);
|
||||||
background-color: spiceColor("main", 0.95);
|
|
||||||
backdrop-filter: blur(3px);
|
|
||||||
padding: 20px 15px;
|
padding: 20px 15px;
|
||||||
border-radius: var(--main-corner-radius);
|
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@include spiceShadow();
|
@include spiceGlass();
|
||||||
|
|
||||||
> h2 {
|
> h2 {
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,6 @@
|
||||||
.connect-device-list-container {
|
.connect-device-list-container {
|
||||||
$border-color: spiceColor("subtext", 0.1, 0.1);
|
|
||||||
|
|
||||||
border: 1px solid $border-color;
|
|
||||||
border-radius: var(--main-corner-radius);
|
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
background-color: spiceColor("main", 0.75, -0.1) !important;
|
@include spiceGlass(lightOffset(0.8, -0.1));
|
||||||
backdrop-filter: blur(10px);
|
|
||||||
border-radius: var(--main-corner-radius);
|
|
||||||
@include spiceShadow();
|
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
display: none;
|
display: none;
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,7 @@
|
||||||
.main-contextMenu-menu {
|
.main-contextMenu-menu {
|
||||||
$border-color: spiceColor("subtext", 0.1, 0.1);
|
|
||||||
|
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
background-color: transparent !important;
|
background-color: transparent !important;
|
||||||
border: 1px solid $border-color;
|
|
||||||
border-radius: var(--main-corner-radius);
|
border-radius: var(--main-corner-radius);
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
|
|
||||||
|
|
@ -13,10 +10,7 @@
|
||||||
content: "";
|
content: "";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
inset: 0px;
|
inset: 0px;
|
||||||
background-color: spiceColor("main", 0.75, -0.1) !important;
|
@include spiceGlass(lightOffset(0.8, -0.1));
|
||||||
backdrop-filter: blur(10px);
|
|
||||||
border-radius: var(--main-corner-radius);
|
|
||||||
@include spiceShadow();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-contextMenu-menuItem {
|
.main-contextMenu-menuItem {
|
||||||
|
|
@ -34,7 +28,7 @@
|
||||||
&::after {
|
&::after {
|
||||||
left: 8px;
|
left: 8px;
|
||||||
right: 8px;
|
right: 8px;
|
||||||
border-color: $border-color;
|
border-color: spiceColor("subtext", 0.1, 0.1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
1
src/styles/Lyrics.scss
Normal file
1
src/styles/Lyrics.scss
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
// TODO: improve default lyrics styles when the classes are mapped `see: https://github.com/JulienMaille/dribbblish-dynamic-theme/issues/144`
|
||||||
|
|
@ -5,15 +5,12 @@
|
||||||
.GenericModal {
|
.GenericModal {
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
position: relative;
|
position: relative;
|
||||||
background-color: spiceColor("main", 0.95);
|
|
||||||
backdrop-filter: blur(3px);
|
|
||||||
padding: 24px 16px;
|
padding: 24px 16px;
|
||||||
border-radius: var(--main-corner-radius);
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@include spiceShadow();
|
@include spiceGlass();
|
||||||
|
|
||||||
// Popups (`Spicetify.PopupModal.display()`)
|
// Popups (`Spicetify.PopupModal.display()`)
|
||||||
generic-modal & {
|
generic-modal & {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#dribbblish-loader {
|
#dribbblish-overlay {
|
||||||
z-index: 999999;
|
z-index: 999999;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
inset: 0px;
|
inset: 0px;
|
||||||
|
|
@ -31,8 +31,12 @@
|
||||||
gap: 16px;
|
gap: 16px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
svg {
|
& > * {
|
||||||
color: spiceColor("text");
|
color: var(--color);
|
||||||
|
|
||||||
|
&:empty {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,50 +0,0 @@
|
||||||
.GenericModal__overlay {
|
|
||||||
backdrop-filter: blur(3px) brightness(60%);
|
|
||||||
background-color: transparent;
|
|
||||||
|
|
||||||
.GenericModal {
|
|
||||||
z-index: 1;
|
|
||||||
position: relative;
|
|
||||||
width: clamp(500px, 50%, 650px);
|
|
||||||
background-color: spiceColor("main", 0.95);
|
|
||||||
backdrop-filter: blur(3px);
|
|
||||||
padding: 24px 16px;
|
|
||||||
border-radius: var(--main-corner-radius);
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
@include spiceShadow();
|
|
||||||
|
|
||||||
.main-trackCreditsModal-container {
|
|
||||||
display: flex;
|
|
||||||
gap: 16px;
|
|
||||||
background-color: transparent;
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
.main-trackCreditsModal-header {
|
|
||||||
display: flex;
|
|
||||||
gap: 16px;
|
|
||||||
padding: 0px;
|
|
||||||
width: 100%;
|
|
||||||
border: none;
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
text-align: center;
|
|
||||||
width: 100%;
|
|
||||||
@include spiceFont("glue", 2em, "Bold");
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
|
||||||
position: absolute;
|
|
||||||
top: 16px;
|
|
||||||
right: 16px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.main-trackCreditsModal-mainSection {
|
|
||||||
padding: 0px 26px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -11,3 +11,11 @@
|
||||||
@mixin spiceShadow() {
|
@mixin spiceShadow() {
|
||||||
box-shadow: 0px 0px 8px spiceColor("subtext", 0.1, 0.1);
|
box-shadow: 0px 0px 8px spiceColor("subtext", 0.1, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@mixin spiceGlass($opacity: 0.95) {
|
||||||
|
background-color: spiceColor("main", $opacity);
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
border: 1px solid spiceColor("subtext", 0.1, 0.1);
|
||||||
|
border-radius: var(--main-corner-radius);
|
||||||
|
@include spiceShadow();
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,11 @@
|
||||||
@import "NoAds";
|
@import "NoAds";
|
||||||
@import "Markdown";
|
@import "Markdown";
|
||||||
@import "Info";
|
@import "Info";
|
||||||
@import "Loader";
|
|
||||||
@import "Modals";
|
@import "Modals";
|
||||||
@import "ConnectDeviceList";
|
@import "ConnectDeviceList";
|
||||||
|
@import "Lyrics";
|
||||||
@import "Icons";
|
@import "Icons";
|
||||||
|
@import "Overlay";
|
||||||
@import "CustomAppTabBar";
|
@import "CustomAppTabBar";
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
|
|
@ -595,13 +596,8 @@ html.sidebar-hide-text .GlueDropTarget span {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
border: 1px solid spiceColor("subtext", 0.1, 0.1);
|
|
||||||
border-radius: var(--main-corner-radius);
|
|
||||||
color: spiceColor("subtext");
|
color: spiceColor("subtext");
|
||||||
background-color: spiceColor("main", 0.75, -0.1) !important;
|
@include spiceGlass();
|
||||||
backdrop-filter: blur(10px);
|
|
||||||
border-radius: var(--main-corner-radius);
|
|
||||||
@include spiceShadow();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.minimal-player .player-controls__buttons {
|
.minimal-player .player-controls__buttons {
|
||||||
|
|
@ -1288,6 +1284,14 @@ html.right-expanded-cover.buddyfeed-visible .main-coverSlotExpanded-container {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Notifications
|
||||||
|
.main-notificationBubbleContainer-NotificationBubbleContainer {
|
||||||
|
.main-notificationBubble-NotificationBubble {
|
||||||
|
color: spiceColor("subtext");
|
||||||
|
@include spiceGlass();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ! WORKAROUNDS / TEMP FIXES
|
// ! WORKAROUNDS / TEMP FIXES
|
||||||
// Spotify UI breaks after advertisements #63
|
// Spotify UI breaks after advertisements #63
|
||||||
canvas[width="250"][height="250"] {
|
canvas[width="250"][height="250"] {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue