mirror of
https://github.com/vladmandic/automatic
synced 2026-09-02 02:50:47 +02:00
add builtin gradio themes
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 101 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 97 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 89 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 215 KiB |
+2
-2
@@ -310,11 +310,11 @@ function create_theme_element() {
|
||||
|
||||
function preview_theme() {
|
||||
const name = gradioApp().getElementById('setting_gradio_theme').querySelectorAll('span')[1].innerText; // ugly but we want current value without the need to set apply
|
||||
if (name === 'black-orange' || name === 'gradio/default') {
|
||||
if (name === 'black-orange' || name.startsWith('gradio/')) {
|
||||
el = document.getElementById('theme-preview') || create_theme_element();
|
||||
el.style.display = el.style.display === 'block' ? 'none' : 'block';
|
||||
if (name === 'black-orange') el.src = '/file=javascript/black-orange.jpg';
|
||||
else el.src = '/file=javascript/gradio-default.jpg';
|
||||
else el.src = `/file=javascript/${name.replace('/', '-')}.jpg`;
|
||||
} else {
|
||||
fetch('/file=javascript/themes.json')
|
||||
.then((r) => r.json())
|
||||
|
||||
Reference in New Issue
Block a user