This commit is contained in:
ebolam
2022-10-18 11:55:30 -04:00
6 changed files with 22 additions and 15 deletions

View File

@@ -5187,11 +5187,11 @@ let load_substitutions;
/* -- Tooltips -- */
function initalizeTooltips() {
const tooltip = $e("span", document.body, {id: "tooltip-text", "style.display": "none"});
let tooltipActive = false;
let tooltipTarget = null;
function alterTooltipState(enabled, specialClass=null) {
tooltipActive = enabled;
tooltip.style.display = enabled ? "block" : "none";
function alterTooltipState(target, specialClass=null) {
tooltipTarget = target;
tooltip.style.display = target ? "block" : "none";
tooltip.className = specialClass || "";
}
@@ -5206,11 +5206,11 @@ function initalizeTooltips() {
// Kinda lame
if (this.classList.contains("context-token")) specialClass = "tooltip-context-token";
alterTooltipState(true, specialClass);
alterTooltipState(el, specialClass);
});
el.addEventListener("mouseleave", function(event) {
alterTooltipState(false);
alterTooltipState(null);
});
}
@@ -5218,7 +5218,7 @@ function initalizeTooltips() {
const yOffset = 15;
document.addEventListener("mousemove", function(event) {
if (!tooltipActive) return;
if (!tooltipTarget) return;
let [x, y] = [event.x, event.y];
@@ -5255,6 +5255,9 @@ function initalizeTooltips() {
registerElement(record.target);
continue;
}
// If we remove the tooltip target, stop showing the tooltip. Maybe a little ineffecient.
if (!document.body.contains(tooltipTarget)) alterTooltipState(null);
for (const node of record.addedNodes) {
if (node.nodeType !== 1) continue;

View File

@@ -1,7 +1,7 @@
/*
Name: Darkness
Author: LightSaveUs
Version: 0.4
Version: 0.4.1
Description: A theme inspired by the AI Dungeon interface.
*/
@@ -108,7 +108,7 @@
/*World Info*/
--wi_card_border_color: #333333;
--wi_card_border_color_to_ai: #333333;
--wi_card_border_color_to_ai: #1e6d6aa1;
--wi_card_bg_color: #242424;
--wi_card_text_color: #e0e0e0;

View File

@@ -1,7 +1,7 @@
/*
Name: Monochrome
Author: LightSaveUs
Version: 0.7
Version: 0.7.1
Description: A theme inspired by the NovelAI interface.
*/
@@ -108,7 +108,7 @@
/*World Info*/
--wi_card_border_color: #334552;
--wi_card_border_color_to_ai: #334552;
--wi_card_border_color_to_ai: #eedcb880;
--wi_card_bg_color: #223040;
--wi_card_text_color: #e0e0e0;

View File

@@ -1,7 +1,7 @@
/*
Name: Nostalgia
Author: LightSaveUs
Version: 0.3
Version: 0.3.1
Description: A theme inspired by the old KoboldAI interface.
*/
@@ -108,7 +108,7 @@
/*World Info*/
--wi_card_border_color: #1e1e1e;
--wi_card_border_color_to_ai: #1e1e1e00;
--wi_card_border_color_to_ai: #3bf72380;
--wi_card_bg_color: #1e1e1e;
--wi_card_text_color: #ffffff;

View File

@@ -1,7 +1,7 @@
/*
Name: Unicorn
Author: LightSaveUs
Version: 0.4
Version: 0.4.1
Description: A theme inspired by the DreamilyAI interface.
*/
@@ -113,7 +113,7 @@
/*World Info*/
--wi_card_border_color: #acacac;
--wi_card_border_color_to_ai: #acacac;
--wi_card_border_color_to_ai: #e2677180;
--wi_card_bg_color: #ebebeb;
--wi_card_text_color: #5c5c5c;

View File

@@ -3,3 +3,7 @@
color: inherit;
font-weight: inherit;
}
.world_info_card.used_in_game {
border: 2px outset var(--wi_card_border_color);
}