-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fully migrated to svelte for settings page
- Loading branch information
Showing
15 changed files
with
298 additions
and
684 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<script> | ||
export let text; | ||
export let title; | ||
function showTooltip(e) { | ||
const tooltip = e.target.nextElementSibling; | ||
tooltip.style.display = "block"; | ||
// Check if tooltip is going off the top of the screen | ||
const rect = tooltip.getBoundingClientRect(); | ||
if (rect.top < 0) { | ||
tooltip.classList.add("below"); | ||
} else { | ||
tooltip.classList.remove("below"); | ||
} | ||
} | ||
function hideTooltip(e) { | ||
const tooltip = e.target.nextElementSibling; | ||
tooltip.style.display = "none"; | ||
tooltip.classList.remove("below"); | ||
} | ||
</script> | ||
|
||
<div class="tooltip-container"> | ||
<slot name="slotTitle"></slot> | ||
|
||
{#if title} | ||
{title} | ||
{/if} | ||
|
||
<span | ||
class="help-icon" | ||
role="button" | ||
tabindex="0" | ||
on:mouseenter={showTooltip} | ||
on:mouseleave={hideTooltip} | ||
on:keydown={(e) => e.key === "Enter" && showTooltip(e)}>❓</span | ||
> | ||
<span class="tooltip below">{text}</span> | ||
</div> | ||
|
||
<style> | ||
.tooltip-container { | ||
position: relative; | ||
} | ||
.help-icon { | ||
cursor: help; | ||
margin-left: 5px; | ||
position: relative; /* Make help icon the positioning context for the tooltip */ | ||
} | ||
.tooltip { | ||
display: none; | ||
position: absolute; | ||
background-color: black; | ||
color: white; | ||
padding: 10px; /* Add padding for better readability */ | ||
border-radius: 5px; | ||
bottom: 125%; /* Position the tooltip above the help icon */ | ||
left: 50%; | ||
transform: translateX(-50%); | ||
white-space: normal; /* Allow text to wrap */ | ||
z-index: 10; | ||
min-width: 50vw; /* Allow the tooltip to expand based on its content */ | ||
max-width: 90vw; /* Maximum width to prevent it from being too wide */ | ||
text-align: center; /* Center align text inside the tooltip */ | ||
pointer-events: none; /* Prevent the tooltip from interfering with hover */ | ||
} | ||
.tooltip.below { | ||
bottom: auto; | ||
top: 125%; /* Position the tooltip below the help icon */ | ||
} | ||
.help-icon:hover + .tooltip { | ||
display: block; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
fieldset { | ||
border: 1px solid #8250df; | ||
border-radius: 5px; | ||
padding: 10px; | ||
margin-bottom: 20px; | ||
} | ||
|
||
legend { | ||
font-weight: bold; | ||
color: #8250df; | ||
padding: 0 5px; | ||
} | ||
|
||
button.settings-button { | ||
background-color: rgba(130 80 223 / 75%); | ||
color: floralwhite; | ||
padding: 5px; | ||
cursor: pointer; | ||
font-weight: bold; | ||
width: fit-content; | ||
} | ||
|
||
.input-container input { | ||
width: 100%; | ||
max-width: 100%; | ||
padding: 5px; | ||
margin-top: 5px; | ||
} | ||
|
||
.input-container input[type="checkbox"] { | ||
width: fit-content; | ||
margin-bottom: 5px; | ||
} | ||
|
||
.input-container input[type="text"], | ||
input[type="password"], | ||
select { | ||
width: 100%; | ||
padding: 5px 0 5px 5px; | ||
margin-top: 5px; | ||
max-width: 96%; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.