System Settings
-
+
diff --git a/ui/media/css/auto-save.css b/ui/media/css/auto-save.css
index 58cc7d85..58710039 100644
--- a/ui/media/css/auto-save.css
+++ b/ui/media/css/auto-save.css
@@ -26,23 +26,55 @@
float: left;
}
-.form-table small {
+
+.parameters-table {
+ display: flex;
+ flex-direction: column;
+ gap: 1px;
+}
+
+.parameters-table > div {
+ background: var(--background-color2);
+ display: flex;
+}
+
+.parameters-table > div > div {
+ padding: 10px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.parameters-table small {
color: rgb(153, 153, 153);
}
-#system-settings .form-table td {
- height: 24px;
+.parameters-table > div > div:nth-child(1) {
+ font-size: 20px;
+ width: 45px;
}
-#system-settings .form-table td:last-child div {
- display: flex;
- align-items: center;
-}
-#system-settings .form-table td:last-child div > :not([type="checkbox"]):first-child {
- margin-left: 3px;
-}
-
-#system-settings .form-table td:last-child div small {
- padding-left: 5px;
+.parameters-table > div > div:nth-child(2) {
+ flex: 1;
+ flex-direction: column;
text-align: left;
+ justify-content: center;
+ align-items: start;
+ gap: 4px;
+}
+
+.parameters-table > div > div:nth-child(3) {
+ text-align: right;
+}
+
+.parameters-table > div:first-child {
+ border-radius: 12px 12px 0px 0px;
+}
+
+.parameters-table > div:last-child {
+ border-radius: 0px 0px 12px 12px;
+}
+
+.parameters-table .fa-fire {
+ color: #F7630C;
}
\ No newline at end of file
diff --git a/ui/media/css/main.css b/ui/media/css/main.css
index 06e1ed4f..9766ae1f 100644
--- a/ui/media/css/main.css
+++ b/ui/media/css/main.css
@@ -216,7 +216,6 @@ code {
display: none !important;
}
#editor-modifiers {
- max-width: 600px;
overflow-y: auto;
overflow-x: hidden;
}
@@ -495,6 +494,10 @@ img {
border-radius: 6px 0px;
}
+#editor-settings {
+ min-width: 500px;
+}
+
#editor-settings-entries {
display: flex;
flex-direction: column;
@@ -584,6 +587,57 @@ input::file-selector-button {
height: 19px;
}
+
+.input-toggle {
+ display: inline-block;
+ position: relative;
+ vertical-align: middle;
+ width: calc(var(--input-height) * 2);
+ user-select: none;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ margin-right: 4px;
+}
+.input-toggle > input {
+ position: absolute;
+ opacity: 0;
+ pointer-events: none;
+}
+.input-toggle > label {
+ display: block;
+ overflow: hidden;
+ cursor: pointer;
+ height: var(--input-height);
+ padding: 0;
+ line-height: var(--input-height);
+ border: var(--input-border-size) solid var(--input-border-color);
+ border-radius: var(--input-height);
+ background: var(--input-background-color);
+ transition: background 0.2s ease-in;
+}
+.input-toggle > label:before {
+ content: "";
+ display: block;
+ width: calc(var(--input-height) - ((var(--input-border-size) + var(--input-switch-padding)) * 2));
+ margin: 0px;
+ background: var(--input-text-color);
+ position: absolute;
+ top: calc(var(--input-border-size) + var(--input-switch-padding));
+ bottom: calc(var(--input-border-size) + var(--input-switch-padding));
+ right: calc(var(--input-border-size) + var(--input-switch-padding) + var(--input-height));
+ border-radius: calc(var(--input-height) - ((var(--input-border-size) + var(--input-switch-padding)) * 2));
+ transition: all 0.2s ease-in 0s;
+ opacity: 0.8;
+}
+.input-toggle > input:checked + label {
+ background: var(--accent-color);
+}
+.input-toggle > input:checked + label:before {
+ right: calc(var(--input-border-size) + var(--input-switch-padding));
+ opacity: 1;
+}
+
/* MOBILE SUPPORT */
@media screen and (max-width: 700px) {
#top-nav {
@@ -625,6 +679,9 @@ input::file-selector-button {
#editor {
padding: 16px 8px;
}
+ #editor-settings {
+ min-width: 0px;
+ }
.tab-content-inner {
margin: 0px;
}
@@ -648,14 +705,8 @@ input::file-selector-button {
padding: 0px !important;
margin: 24px !important;
}
- .simple-tooltip.right {
- right: initial;
- left: 0px;
- top: 50%;
- transform: translate(calc(-100% + 15%), -50%);
- }
- :hover > .simple-tooltip.right {
- transform: translate(100%, -50%);
+ .simple-tooltip {
+ display: none;
}
}
diff --git a/ui/media/css/themes.css b/ui/media/css/themes.css
index 0f889ec9..e87df2c6 100644
--- a/ui/media/css/themes.css
+++ b/ui/media/css/themes.css
@@ -24,6 +24,18 @@
--accent-color: hsl(var(--accent-hue), 100%, var(--accent-lightness));
--accent-color-hover: hsl(var(--accent-hue), 100%, var(--accent-lightness-hover));
--primary-button-border: none;
+ --input-switch-padding: 1px;
+ --input-height: 24px;
+}
+
+.theme-default-modified {
+ --button-text-color: black;
+
+ --input-switch-padding: 2px;
+ --input-text-color: #ccc;
+ --input-border-size: 0px;
+ --input-background-color: #16191c;
+ --input-border-color: var(--input-background-color);
}
.theme-light {
diff --git a/ui/media/js/auto-save.js b/ui/media/js/auto-save.js
index 8b97f461..29e5298a 100644
--- a/ui/media/js/auto-save.js
+++ b/ui/media/js/auto-save.js
@@ -213,6 +213,7 @@ function fillSaveSettingsConfigTable() {
})
})
})
+ prettifyInputs(saveSettingsConfigTable)
}
// configureSettingsSaveBtn
@@ -224,7 +225,7 @@ var autoSaveSettings = document.getElementById("auto_save_settings")
var configSettingsButton = document.createElement("button")
configSettingsButton.textContent = "Configure"
configSettingsButton.style.margin = "0px 5px"
-autoSaveSettings.insertAdjacentElement("afterend", configSettingsButton)
+autoSaveSettings.insertAdjacentElement("beforebegin", configSettingsButton)
autoSaveSettings.addEventListener("change", () => {
configSettingsButton.style.display = autoSaveSettings.checked ? "block" : "none"
})
diff --git a/ui/media/js/main.js b/ui/media/js/main.js
index afb0925d..467da253 100644
--- a/ui/media/js/main.js
+++ b/ui/media/js/main.js
@@ -1323,3 +1323,4 @@ window.addEventListener("beforeunload", function(e) {
});
createCollapsibles()
+prettifyInputs(document);
\ No newline at end of file
diff --git a/ui/media/js/parameters.js b/ui/media/js/parameters.js
index 1aa87bf8..394e9703 100644
--- a/ui/media/js/parameters.js
+++ b/ui/media/js/parameters.js
@@ -28,18 +28,21 @@ var PARAMETERS = [
type: ParameterType.select,
label: "Theme",
default: "theme-default",
+ note: "customize the look and feel of the ui",
options: [ // Note: options expanded dynamically
{
value: "theme-default",
label: "Default"
}
- ]
+ ],
+ icon: "fa-palette"
},
{
id: "save_to_disk",
type: ParameterType.checkbox,
label: "Auto-Save Images",
note: "automatically saves images to the specified location",
+ icon: "fa-download",
default: false,
},
{
@@ -55,6 +58,7 @@ var PARAMETERS = [
type: ParameterType.checkbox,
label: "Enable Sound",
note: "plays a sound on task completion",
+ icon: "fa-volume-low",
default: true,
},
{
@@ -62,20 +66,23 @@ var PARAMETERS = [
type: ParameterType.checkbox,
label: "Open browser on startup",
note: "starts the default browser on startup",
+ icon: "fa-window-restore",
default: true,
},
{
id: "turbo",
type: ParameterType.checkbox,
label: "Turbo Mode",
- default: true,
note: "generates images faster, but uses an additional 1 GB of GPU memory",
+ icon: "fa-forward",
+ default: true,
},
{
id: "use_cpu",
type: ParameterType.checkbox,
label: "Use CPU (not GPU)",
note: "warning: this will be *very* slow",
+ icon: "fa-microchip",
default: false,
},
{
@@ -96,6 +103,7 @@ var PARAMETERS = [
type: ParameterType.checkbox,
label: "Use Full Precision",
note: "for GPU-only. warning: this will consume more VRAM",
+ icon: "fa-crosshairs",
default: false,
},
{
@@ -103,13 +111,15 @@ var PARAMETERS = [
type: ParameterType.checkbox,
label: "Auto-Save Settings",
note: "restores settings on browser load",
+ icon: "fa-gear",
default: true,
},
{
id: "use_beta_channel",
type: ParameterType.checkbox,
- label: "🔥Beta channel",
+ label: "Beta channel",
note: "Get the latest features immediately (but could be less stable). Please restart the program after changing this.",
+ icon: "fa-fire",
default: false,
},
];
@@ -140,16 +150,18 @@ function getParameterElement(parameter) {
}
}
-let parametersTable = document.querySelector("#system-settings table")
+let parametersTable = document.querySelector("#system-settings .parameters-table")
/* fill in the system settings popup table */
function initParameters() {
PARAMETERS.forEach(parameter => {
var element = getParameterElement(parameter)
var note = parameter.note ? `
${parameter.note}` : "";
- var newrow = document.createElement('tr')
+ var icon = parameter.icon ? `
` : "";
+ var newrow = document.createElement('div')
newrow.innerHTML = `
-
|
-
| `
+
${icon}
+
${note}
+
${element}
`
parametersTable.appendChild(newrow)
parameter.settingsEntry = newrow
})
@@ -224,6 +236,7 @@ function getCurrentRenderDeviceSelection() {
useCPUField.addEventListener('click', function() {
let gpuSettingEntry = getParameterSettingsEntry('use_gpus')
let autoPickGPUSettingEntry = getParameterSettingsEntry('auto_pick_gpus')
+ console.log("hello", this.checked);
if (this.checked) {
gpuSettingEntry.style.display = 'none'
autoPickGPUSettingEntry.style.display = 'none'
diff --git a/ui/media/js/utils.js b/ui/media/js/utils.js
index 3172579f..6fc3c402 100644
--- a/ui/media/js/utils.js
+++ b/ui/media/js/utils.js
@@ -358,3 +358,19 @@ function preventNonNumericalInput(e) {
e.preventDefault();
}
}
+
+/* inserts custom html to allow prettifying of inputs */
+function prettifyInputs(root_element) {
+ root_element.querySelectorAll(`input[type="checkbox"]`).forEach(element => {
+ var parent = element.parentNode;
+ if (!parent.classList.contains("input-toggle")) {
+ var wrapper = document.createElement("div");
+ wrapper.classList.add("input-toggle");
+ parent.replaceChild(wrapper, element);
+ wrapper.appendChild(element);
+ var label = document.createElement("label");
+ label.htmlFor = element.id;
+ wrapper.appendChild(label);
+ }
+ })
+}