diff --git a/packages/fakeyou.com/src/components/common/MocapInput/MocapInput.tsx b/packages/fakeyou.com/src/components/common/MocapInput/MocapInput.tsx index 26e4957cf1..927fa15f75 100644 --- a/packages/fakeyou.com/src/components/common/MocapInput/MocapInput.tsx +++ b/packages/fakeyou.com/src/components/common/MocapInput/MocapInput.tsx @@ -5,7 +5,7 @@ import { MediaFile } from "@storyteller/components/src/api/media_files/GetMedia" import Iframe from "react-iframe"; import { MediaBrowser } from "components/modals"; import { FileWrapper, Label, Spinner } from "components/common"; -import { MediaFilterProp } from "components/entities/EntityTypes"; +import { EntityType, MediaFilterProp } from "components/entities/EntityTypes"; import { useFile, useMedia, useModal, useSession } from "hooks"; import { BucketConfig } from "@storyteller/components/src/api/BucketConfig"; import { faFileArrowUp, faGrid, faPersonWalking } from "@fortawesome/pro-solid-svg-icons"; @@ -65,7 +65,7 @@ const MocapInputFull = ({ media }: SlideProps) => { const MediaPickerEmpty = ({ media, onSelect, open, inputProps, type, user }: EmptySlideProps) => { const browserClick = () => open({ component: MediaBrowser, - props: { onSelect, type, username: user?.username || "" } + props: { entityType: EntityType.media, onSelect, type, username: user?.username || "" } }); return <> diff --git a/packages/fakeyou.com/src/components/common/Searcher/Searcher.tsx b/packages/fakeyou.com/src/components/common/Searcher/Searcher.tsx index c1e7a5bb69..6dc98bba21 100644 --- a/packages/fakeyou.com/src/components/common/Searcher/Searcher.tsx +++ b/packages/fakeyou.com/src/components/common/Searcher/Searcher.tsx @@ -1,5 +1,6 @@ import React, { useCallback, useEffect, useRef, useState } from "react"; -import Input from "../Input"; +import { TempInput as Input } from 'components/common'; +// import Input from "../Input"; import { faSearch } from "@fortawesome/pro-solid-svg-icons"; import MasonryGrid from "../MasonryGrid/MasonryGrid"; import "./Searcher.scss"; @@ -106,7 +107,7 @@ export default function Searcher({ placeholder="Search..." value={searchTerm[searcherKey]} onChange={handleInputChange} - className="mb-3" + type="text" />
{ + className?: string; icon?: IconDefinition; invalidReason?: string; label?: string; @@ -13,6 +14,7 @@ interface InputProps extends React.InputHTMLAttributes { } export default function TempInput({ + className, label, icon, invalidReason, @@ -28,7 +30,7 @@ export default function TempInput({ {icon && ( )} - +
); diff --git a/packages/fakeyou.com/src/components/entities/EntityInput/EntityInput.scss b/packages/fakeyou.com/src/components/entities/EntityInput/EntityInput.scss new file mode 100644 index 0000000000..a0d864315d --- /dev/null +++ b/packages/fakeyou.com/src/components/entities/EntityInput/EntityInput.scss @@ -0,0 +1,109 @@ +@import "scss/colours.scss"; +@import "scss/site-refresh.scss"; + + +.fy-slide-frame { + position: absolute; + height: 100%; + width: 100%; +} + +.fy-entity-input { + @include panel; + border-radius: .5rem; + overflow: hidden; + position: relative; + // background-color: $panel; +} + +.fy-entity-input-square { + aspect-ratio: 1/1; + height: 300px; + + .fy-entity-input-empty-controls {} +} + +.fy-entity-input-landscape { + width: 100%; + aspect-ratio: 4/3; + max-height: 66vh; +} + +.fy-entity-input-empty, .fy-entity-input-full { + // position: relative; + // overflow: hidden; + + .fy-entity-input-icon { + position: absolute; + height: 80%; + opacity: 75%; + // background-color: blue; + margin: auto; + inset: 0; + + path { fill: $panel-inner-border} + } + +} + +.fy-entity-input-label-icon { + margin-right: .5rem; + height: 1.25rem; +} + +.fy-entity-input-mocap-preview { + position: absolute; + border-radius: .5rem; + border: 1px solid rgba(#fff,.2); + display: block; + vertical-align: bottom; + height: 100%; + width: 100%; + margin: 0; +} + +.fy-entity-input-full-controls { + position: absolute; + background-color: rgba(#000, .5); + padding: 1rem; + // backdrop-filter: blur(2px); + overflow: hidden; + border-radius: .5rem .5rem 0 0; + width: 100%; +} + +.fy-entity-input-empty-controls { + // background-color: red; + position: absolute; + height: 100%; + width: 100%; + display: flex; + flex-direction: column; + justify-content: space-evenly; + padding: 1rem; + gap: 1rem; + + .fy-entity-input-row { + + height: 100%; + } + + .fy-entity-input-button { + background-color: rgba(#000,.15); + border-radius: .5rem; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + height: 100%; + transition: .25s all ease-in-out; + color: rgba(#fff, .66); + + &:hover { + background-color: rgba(#000,.1); + color: rgba(#fff, 1); + } + + label { } + } +} \ No newline at end of file diff --git a/packages/fakeyou.com/src/components/entities/EntityInput/EntityInput.tsx b/packages/fakeyou.com/src/components/entities/EntityInput/EntityInput.tsx new file mode 100644 index 0000000000..ec306800b6 --- /dev/null +++ b/packages/fakeyou.com/src/components/entities/EntityInput/EntityInput.tsx @@ -0,0 +1,159 @@ +import React, { useState } from "react"; +import { useLocation } from "react-router-dom"; +import { a, useTransition } from "@react-spring/web"; +import { MediaFile } from "@storyteller/components/src/api/media_files/GetMedia"; +import Iframe from "react-iframe"; +import { MediaBrowser } from "components/modals"; +import { FileWrapper, Label, Spinner } from "components/common"; +import { EntityType, MediaFilterProp, WeightFilterProp } from "components/entities/EntityTypes"; +import { useFile, useMedia, useModal, useSession } from "hooks"; +import { BucketConfig } from "@storyteller/components/src/api/BucketConfig"; +import { faFileArrowUp, faGrid, faPersonWalking } from "@fortawesome/pro-solid-svg-icons"; +import { FontAwesomeIcon as Icon } from "@fortawesome/react-fontawesome"; +import { UploadMedia, UploadMediaResponse } from "@storyteller/components/src/api/media_files/UploadMedia"; +import { v4 as uuidv4 } from "uuid"; +import "./EntityInput.scss"; + +interface Props { + label?: string, + onChange?: any, + mediaType?: MediaFilterProp, + aspectRatio?: "square" | "landscape" | "portrait", + weightType?: WeightFilterProp, +} + +interface SlideProps { + media?: MediaFile +}; + +interface EmptySlideProps extends SlideProps { + entityType: EntityType, + filterType: MediaFilterProp | WeightFilterProp, + inputProps?: any, + onSelect: any, + open: any, + user: any +}; + +interface AniProps { + animating: boolean, + className: string, + isLeaving: boolean, + render: any, + style: any +} + +const MediaBusy = () => { + return ; +}; + +const MocapInputFull = ({ media }: SlideProps) => { + const bucketConfig = new BucketConfig(); + const bvhUrl = media?.public_bucket_path ? bucketConfig.getGcsUrl(media.public_bucket_path) : ""; + + return <> +