aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/smartdraw
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-03-05 14:54:18 -0500
committerbobzel <zzzman@gmail.com>2025-03-05 14:54:18 -0500
commitdb3bdb19ff7bc1c69c544797c05a6db3b72b1464 (patch)
treefe01be9276ffcbaf9e27bb17e8f1fe7a25b22505 /src/client/views/smartdraw
parent9688e3bb1e67336fe57e11b186936830d5483b06 (diff)
added:hover mode for images to make primary image fade in instead of alternate.
Diffstat (limited to 'src/client/views/smartdraw')
-rw-r--r--src/client/views/smartdraw/DrawingFillHandler.tsx4
-rw-r--r--src/client/views/smartdraw/SmartDrawHandler.tsx8
2 files changed, 10 insertions, 2 deletions
diff --git a/src/client/views/smartdraw/DrawingFillHandler.tsx b/src/client/views/smartdraw/DrawingFillHandler.tsx
index 0a30b14b8..c672bc718 100644
--- a/src/client/views/smartdraw/DrawingFillHandler.tsx
+++ b/src/client/views/smartdraw/DrawingFillHandler.tsx
@@ -1,6 +1,7 @@
import { imageUrlToBase64 } from '../../../ClientUtils';
import { Doc, StrListCast } from '../../../fields/Doc';
import { DocData } from '../../../fields/DocSymbols';
+import { List } from '../../../fields/List';
import { DocCast, ImageCast } from '../../../fields/Types';
import { ImageField } from '../../../fields/URLField';
import { Upload } from '../../../server/SharedMediaTypes';
@@ -53,7 +54,10 @@ export class DrawingFillHandler {
undefined,
Docs.Create.ImageDocument(info.accessPaths.agnostic.client, {
ai: 'firefly',
+ tags: new List<string>(['@ai']),
title: newPrompt,
+ _data_usePath: 'alternate:hover',
+ data_alternates: new List<Doc>([drawing]),
ai_firefly_prompt: newPrompt,
_width: 500,
data_nativeWidth: info.nativeWidth,
diff --git a/src/client/views/smartdraw/SmartDrawHandler.tsx b/src/client/views/smartdraw/SmartDrawHandler.tsx
index ca308015d..1cceabed3 100644
--- a/src/client/views/smartdraw/SmartDrawHandler.tsx
+++ b/src/client/views/smartdraw/SmartDrawHandler.tsx
@@ -28,6 +28,7 @@ import { FireflyDimensionsMap, FireflyImageData, FireflyImageDimensions } from '
import './SmartDrawHandler.scss';
import { Upload } from '../../../server/SharedMediaTypes';
import { PointData } from '../../../pen-gestures/GestureTypes';
+import { List } from '../../../fields/List';
export interface DrawingOptions {
text?: string;
@@ -293,15 +294,17 @@ export class SmartDrawHandler extends ObservableReactComponent<object> {
return undefined;
}
const newseed = img.accessPaths.agnostic.client.match(/\/(\d+)upload/)?.[1];
- const imgDoc: Doc = Docs.Create.ImageDocument(img.accessPaths.agnostic.client, {
+ return Docs.Create.ImageDocument(img.accessPaths.agnostic.client, {
title: input,
nativeWidth: dims.width,
nativeHeight: dims.height,
+ tags: new List<string>(['@ai']),
+ _width: Math.min(400, dims.width),
+ _height: (Math.min(400, dims.width) * dims.height) / dims.width,
ai: 'firefly',
ai_firefly_seed: +(newseed ?? 0),
ai_firefly_prompt: input,
});
- return imgDoc;
})
.catch(e => {
alert('create image failed: ' + e.toString());
@@ -568,6 +571,7 @@ export class SmartDrawHandler extends ObservableReactComponent<object> {
color={SettingsManager.userColor}
/>
<input
+ style={{ color: SettingsManager.userColor, background: SettingsManager.userBackgroundColor }}
aria-label="Smart Draw Input"
className="smartdraw-input"
type="text"