jbilcke-hf HF staff commited on
Commit
7a3bdc2
Β·
1 Parent(s): 8a0a4e8
src/app/main.tsx CHANGED
@@ -270,15 +270,14 @@ export default function Main() {
270
  </div>
271
 
272
  <div className={[
273
- "flex flex-col w-full pt-4 space-y-3 px-2 text-gray-50 dark:text-gray-50",
274
  getGame(gameRef.current).className // apply the game theme
275
  ].join(" ")}>
276
- <p className="text-xl">A stable diffusion exploration game. Click on an item to explore a new scene!</p>
277
  <div className="flex flex-row">
278
  <div className="text-xl mr-2">
279
  {rendered.segments.length
280
- ? <span>πŸ”Ž Clickable items:</span>
281
- : <span>βŒ› Loading clickable items..</span>
282
  }
283
  </div>
284
  {clickables.map((clickable, i) =>
 
270
  </div>
271
 
272
  <div className={[
273
+ "flex flex-col w-full pt-4 space-y-2 px-2 text-gray-50 dark:text-gray-50",
274
  getGame(gameRef.current).className // apply the game theme
275
  ].join(" ")}>
 
276
  <div className="flex flex-row">
277
  <div className="text-xl mr-2">
278
  {rendered.segments.length
279
+ ? <span>πŸ”Ž Try to click on:</span>
280
+ : <span>βŒ› Searching in the scene..</span>
281
  }
282
  </div>
283
  {clickables.map((clickable, i) =>
src/components/business/renderer.tsx CHANGED
@@ -36,6 +36,7 @@ export const Renderer = ({
36
  const [progressPercent, setProcessPercent] = useState(0)
37
  const progressRef = useRef(0)
38
  const isLoadingRef = useRef(isLoading)
 
39
 
40
  useEffect(() => {
41
  if (maskBase64) {
@@ -212,10 +213,15 @@ export const Renderer = ({
212
  */
213
 
214
  return (
215
- <div className="w-full py-8">
216
  <div
217
  className={[
218
- "relative w-full h-[800px] border-2 border-gray-50 rounded-xl overflow-hidden",
 
 
 
 
 
219
  isLoading
220
  ? "cursor-wait"
221
  : actionnable
@@ -236,12 +242,10 @@ export const Renderer = ({
236
  ? <SphericalImage
237
  src={assetUrl}
238
  ref={imgRef as any}
239
- width="1024px"
240
- height="512px"
241
  onEvent={handleMouseEvent}
242
  />
243
  : <CartesianImage
244
- src={assetUrl}
245
  ref={imgRef as any}
246
  width="1024px"
247
  height="512px"
 
36
  const [progressPercent, setProcessPercent] = useState(0)
37
  const progressRef = useRef(0)
38
  const isLoadingRef = useRef(isLoading)
39
+ const maskUrl = `data:image/png;base64,${maskBase64}`
40
 
41
  useEffect(() => {
42
  if (maskBase64) {
 
213
  */
214
 
215
  return (
216
+ <div className="w-full pt-2">
217
  <div
218
  className={[
219
+ "relative border-2 border-gray-50 rounded-xl overflow-hidden",
220
+ engine.type === "cartesian_video"
221
+ || engine.type === "cartesian_image"
222
+ ? "w-[1024px] h-[512px]"
223
+ : "w-full h-[800px]",
224
+
225
  isLoading
226
  ? "cursor-wait"
227
  : actionnable
 
242
  ? <SphericalImage
243
  src={assetUrl}
244
  ref={imgRef as any}
 
 
245
  onEvent={handleMouseEvent}
246
  />
247
  : <CartesianImage
248
+ src={maskUrl}
249
  ref={imgRef as any}
250
  width="1024px"
251
  height="512px"
src/components/business/spherical-image.tsx CHANGED
@@ -1,19 +1,14 @@
1
  import { ForwardedRef, forwardRef } from "react"
2
  import { ReactPhotoSphereViewer } from "react-photo-sphere-viewer"
3
- // import { CubemapAdapter } from "react-photo-sphere-viewer"
4
 
5
  import { SceneEventHandler } from "./types"
6
 
7
  export const SphericalImage = forwardRef(({
8
  src,
9
- width,
10
- height,
11
  onEvent,
12
  className,
13
  }: {
14
  src: string
15
- width: number | string
16
- height: number | string
17
  onEvent: SceneEventHandler
18
  className?: string
19
  }, ref: ForwardedRef<HTMLImageElement>) => {
 
1
  import { ForwardedRef, forwardRef } from "react"
2
  import { ReactPhotoSphereViewer } from "react-photo-sphere-viewer"
 
3
 
4
  import { SceneEventHandler } from "./types"
5
 
6
  export const SphericalImage = forwardRef(({
7
  src,
 
 
8
  onEvent,
9
  className,
10
  }: {
11
  src: string
 
 
12
  onEvent: SceneEventHandler
13
  className?: string
14
  }, ref: ForwardedRef<HTMLImageElement>) => {