diff --git a/src/AppMobile.svelte b/src/AppMobile.svelte
index 7d4ebe8..d507691 100644
--- a/src/AppMobile.svelte
+++ b/src/AppMobile.svelte
@@ -1,17 +1,8 @@
@@ -64,7 +97,9 @@
label={widget.attrs.title}
show_label={true}
on:release={onRelease}
- on:change
+ on:change={updateSliderForMobile}
+ on:pointerdown={onPointerDown}
+ on:pointermove={onPointerMove}
/>
{/if}
@@ -77,9 +112,32 @@
// Prevent swiping on the slider track from accidentally changing the value
&.mobile :global(input[type="range"]) {
pointer-events: none;
+ -webkit-appearance: none;
+ appearance: none;
+ cursor: default;
+ height: 0.6rem;
+ padding: initial;
+ border: initial;
+ margin: 0.8rem 0;
+ width: 100%;
+
+ background: linear-gradient(to right, var(--color-blue-600), var(--color-blue-600)), #D7D7D7;
+ background-size: var(--background-size, 0%) 100%;
+ background-repeat: no-repeat;
+ border-radius: 1rem;
+ border: 1px solid var(--neutral-400);
&::-webkit-slider-thumb {
+ -webkit-appearance: none;
+ appearance: none;
pointer-events: all;
+ width: 1.75rem;
+ height: 1.75rem;
+ border-radius: 50%;
+ background: var(--color-blue-600);
+ cursor: pointer;
+ border: 2px solid var(--neutral-100);
+ box-shadow: 0px 0px 0px 1px var(--neutral-400);
}
}
}
diff --git a/src/main-mobile.ts b/src/main-mobile.ts
index 4ba38cd..c62b15d 100644
--- a/src/main-mobile.ts
+++ b/src/main-mobile.ts
@@ -2,12 +2,23 @@ import AppMobile from './AppMobile.svelte';
import Framework7 from 'framework7/lite-bundle';
import Framework7Svelte from 'framework7-svelte';
import { f7 } from 'framework7-svelte';
-
+import ComfyApp from '$lib/components/ComfyApp';
+import uiState from '$lib/stores/uiState';
+import { LiteGraph } from '@litegraph-ts/core';
Framework7.use(Framework7Svelte);
+LiteGraph.dialog_close_on_mouse_leave = false;
+LiteGraph.search_hide_on_mouse_leave = false;
+LiteGraph.pointerevents_method = "pointer";
+
+const comfyApp = new ComfyApp();
+
+uiState.update(s => { s.app = comfyApp; return s; })
+
const app = new AppMobile({
- target: document.getElementById('app'),
+ target: document.getElementById('app'),
+ props: { app: comfyApp }
})
export default app;
diff --git a/src/mobile/GenToolbar.svelte b/src/mobile/GenToolbar.svelte
index 18d5113..4adfeeb 100644
--- a/src/mobile/GenToolbar.svelte
+++ b/src/mobile/GenToolbar.svelte
@@ -7,14 +7,13 @@
import { Link, Toolbar } from "framework7-svelte"
import ProgressBar from "$lib/components/ProgressBar.svelte";
+ import Indicator from "./Indicator.svelte";
+ import interfaceState from "$lib/stores/interfaceState";
export let subworkflowID: number = -1;
- let app: ComfyApp = undefined;
+ export let app: ComfyApp = undefined;
let fileInput: HTMLInputElement = undefined;
- $: if (!app)
- app = $uiState.app
-
function queuePrompt() {
app.queuePrompt(0, 1);
notify("Prompt was queued", "Queued");
@@ -56,6 +55,9 @@
Load
+{#if $interfaceState.showIndicator}
+
+{/if}
diff --git a/src/mobile/routes/graph.svelte b/src/mobile/routes/graph.svelte
index b1c0fd0..170c018 100644
--- a/src/mobile/routes/graph.svelte
+++ b/src/mobile/routes/graph.svelte
@@ -6,13 +6,10 @@
import { onMount } from 'svelte';
import uiState from "$lib/stores/uiState"
- let app: ComfyApp | null = null;
+ export let app: ComfyApp | null = null;
let lCanvas: ComfyGraphCanvas | null = null;
let canvasEl: HTMLCanvasElement | null = null;
- $: if (!app)
- app = $uiState.app
-
function resizeCanvas() {
canvasEl.width = canvasEl.parentElement.offsetWidth;
canvasEl.height = canvasEl.parentElement.offsetHeight;
@@ -21,13 +18,10 @@
lCanvas.draw(true, true);
}
- $: if (app != null && canvasEl != null) {
+ $: if (app != null && app.lGraph && canvasEl != null) {
if (!lCanvas) {
lCanvas = new ComfyGraphCanvas(app, canvasEl);
lCanvas.allow_interaction = false;
- LiteGraph.dialog_close_on_mouse_leave = false;
- LiteGraph.search_hide_on_mouse_leave = false;
- LiteGraph.pointerevents_method = "pointer";
app.lGraph.eventBus.on("afterExecute", () => lCanvas.draw(true))
}
resizeCanvas();
@@ -47,5 +41,10 @@
width: 100%;
height: 100%;
background-color: #333;
+
+ > canvas {
+ // Don't try to scroll the page when scrolling on canvas
+ touch-action: none;
+ }
}
diff --git a/src/mobile/routes/home.svelte b/src/mobile/routes/home.svelte
index 8ef2f6e..ed1f5fd 100644
--- a/src/mobile/routes/home.svelte
+++ b/src/mobile/routes/home.svelte
@@ -14,22 +14,7 @@
import queueState from "$lib/stores/queueState";
import { Page, Navbar, Link, BlockTitle, Block, List, ListItem } from "framework7-svelte"
- let app: ComfyApp | null = null;
-
- onMount(async () => {
- if (app)
- return
-
- app = $uiState.app = new ComfyApp();
-
- app.api.addEventListener("status", (ev: CustomEvent) => {
- queueState.statusUpdated(ev.detail as ComfyAPIStatus);
- });
-
- await app.setup();
- (window as any).app = app;
-
- });
+ export let app: ComfyApp | null = null;
@@ -52,8 +37,4 @@
-
-
-
-
diff --git a/src/mobile/routes/list-subworkflows.svelte b/src/mobile/routes/list-subworkflows.svelte
index c9a4fea..1e2138a 100644
--- a/src/mobile/routes/list-subworkflows.svelte
+++ b/src/mobile/routes/list-subworkflows.svelte
@@ -1,19 +1,8 @@
diff --git a/src/mobile/routes/subworkflow.svelte b/src/mobile/routes/subworkflow.svelte
index d026695..c910e3f 100644
--- a/src/mobile/routes/subworkflow.svelte
+++ b/src/mobile/routes/subworkflow.svelte
@@ -3,8 +3,10 @@
import { Page, Navbar, Link, BlockTitle, Block, List, ListItem, Toolbar } from "framework7-svelte"
import WidgetContainer from "$lib/components/WidgetContainer.svelte";
+ import type ComfyApp from "$lib/components/ComfyApp";
export let subworkflowID: number = -1;
+ export let app: ComfyApp