From 8b3a5f9c29956e99d1f647f626ec507ced3eb078 Mon Sep 17 00:00:00 2001 From: wil Date: Tue, 26 Mar 2024 11:48:34 -0400 Subject: [PATCH 01/16] take over loading screen --- app/components/LoadingDots.tsx | 11 ++ app/components/index.tsx | 3 + app/modules/LoadingScreen/LoadingScreen.tsx | 21 ++++ app/modules/LoadingScreen/index.tsx | 1 + app/root.tsx | 43 +++++++- app/styles/base.css | 112 ++++++++++++++++++++ 6 files changed, 189 insertions(+), 2 deletions(-) create mode 100644 app/components/LoadingDots.tsx create mode 100644 app/modules/LoadingScreen/LoadingScreen.tsx create mode 100644 app/modules/LoadingScreen/index.tsx diff --git a/app/components/LoadingDots.tsx b/app/components/LoadingDots.tsx new file mode 100644 index 0000000000..b12b84e869 --- /dev/null +++ b/app/components/LoadingDots.tsx @@ -0,0 +1,11 @@ +export const LoadingDotsTyping = ()=>{ + return( +
+ ); +} + +export const LoadingDotsBricks = ()=>{ + return( +
+ ); +} \ No newline at end of file diff --git a/app/components/index.tsx b/app/components/index.tsx index b4fb1526c5..28c7eb3efc 100644 --- a/app/components/index.tsx +++ b/app/components/index.tsx @@ -6,6 +6,7 @@ import { Input } from "./Input"; import { H4 } from "./H4"; import { ItemPicker } from "./ItemPicker"; import { Textarea } from "./Textarea"; +import { LoadingDotsBricks, LoadingDotsTyping } from "./LoadingDots"; export { Button, @@ -16,4 +17,6 @@ export { ItemPicker, Textarea, Input, + LoadingDotsBricks, + LoadingDotsTyping, }; diff --git a/app/modules/LoadingScreen/LoadingScreen.tsx b/app/modules/LoadingScreen/LoadingScreen.tsx new file mode 100644 index 0000000000..0ccfe83a1f --- /dev/null +++ b/app/modules/LoadingScreen/LoadingScreen.tsx @@ -0,0 +1,21 @@ +import { LoadingDotsBricks } from "~/components"; + +export const LoadingScreen = ()=>{ + return( +
+ +
+ ); +}; \ No newline at end of file diff --git a/app/modules/LoadingScreen/index.tsx b/app/modules/LoadingScreen/index.tsx new file mode 100644 index 0000000000..edb7c50caf --- /dev/null +++ b/app/modules/LoadingScreen/index.tsx @@ -0,0 +1 @@ +export { LoadingScreen } from './LoadingScreen'; \ No newline at end of file diff --git a/app/root.tsx b/app/root.tsx index 024b82cecc..a62b912903 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -1,4 +1,4 @@ -import { useState } from "react"; +import { useState, useEffect } from "react"; import { LinksFunction } from "@remix-run/deno"; import { Links, @@ -12,6 +12,7 @@ import normalizeCss from "./styles/normalize.css?url"; import tailwindCss from "./styles/tailwind.css?url"; import baseCss from "./styles/base.css?url"; +import { LoadingDotsBricks } from "~/components"; import { TopBar } from "./modules/TopBar"; import { TopBarInnerContext } from "~/contexts/TopBarInner"; @@ -45,7 +46,13 @@ export const links: LinksFunction = () => [ export default function App() { const [topBarInnerComponent, setTopBarInnerComponent] = - useState(null); + useState(null); + const [isLoaded, setIsLoaded] = useState<'loading'|'loaded'|'completed'>('loading'); + useEffect(()=>{ + setIsLoaded('loaded'); + setTimeout(()=>setIsLoaded('completed'), 2000); + },[]); + return ( @@ -56,6 +63,15 @@ export default function App() { + {isLoaded !== 'completed' && + + } ); } + +function CompleteTakeoverLoadingScreen({className}:{className:string}){ + return( +
+ +
+ ); +}; \ No newline at end of file diff --git a/app/styles/base.css b/app/styles/base.css index 289c01a903..129268f61d 100644 --- a/app/styles/base.css +++ b/app/styles/base.css @@ -35,3 +35,115 @@ body { user-select: none; /* Standard syntax */ pointer-events: none; } + + +/*! + * three-dots - v0.3.2 + * CSS loading animations made with single element + * https://nzbin.github.io/three-dots/ + * + * Copyright (c) 2018 nzbin + * Released under MIT License + */ + +/** + * ============================================== + * Dot Typing + * ============================================== + */ +.dot-typing { + position: relative; + left: -9999px; + width: 10px; + height: 10px; + border-radius: 5px; + background-color: #393948; + color: #393948; + box-shadow: 9984px 0 0 0 #393948, 9999px 0 0 0 #393948, 10014px 0 0 0 #393948; + animation: dot-typing 1.5s infinite linear; +} + +@keyframes dot-typing { + 0% { + box-shadow: 9984px 0 0 0 #393948, 9999px 0 0 0 #393948, 10014px 0 0 0 #393948; + } + 16.667% { + box-shadow: 9984px -10px 0 0 #393948, 9999px 0 0 0 #393948, 10014px 0 0 0 #393948; + } + 33.333% { + box-shadow: 9984px 0 0 0 #393948, 9999px 0 0 0 #393948, 10014px 0 0 0 #393948; + } + 50% { + box-shadow: 9984px 0 0 0 #393948, 9999px -10px 0 0 #393948, 10014px 0 0 0 #393948; + } + 66.667% { + box-shadow: 9984px 0 0 0 #393948, 9999px 0 0 0 #393948, 10014px 0 0 0 #393948; + } + 83.333% { + box-shadow: 9984px 0 0 0 #393948, 9999px 0 0 0 #393948, 10014px -10px 0 0 #393948; + } + 100% { + box-shadow: 9984px 0 0 0 #393948, 9999px 0 0 0 #393948, 10014px 0 0 0 #393948; + } +} + + /** + * ============================================== + * Dot Bricks + * ============================================== + */ +.dot-bricks { + position: relative; + top: 8px; + left: -9999px; + width: 10px; + height: 10px; + border-radius: 5px; + background-color: #393948; + color: #393948; + box-shadow: 9991px -16px 0 0 #393948, 9991px 0 0 0 #393948, 10007px 0 0 0 #393948; + animation: dot-bricks 2s infinite ease; +} + + @keyframes dot-bricks { + 0% { + box-shadow: 9991px -16px 0 0 #393948, 9991px 0 0 0 #393948, 10007px 0 0 0 #393948; + } + 8.333% { + box-shadow: 10007px -16px 0 0 #393948, 9991px 0 0 0 #393948, 10007px 0 0 0 #393948; + } + 16.667% { + box-shadow: 10007px -16px 0 0 #393948, 9991px -16px 0 0 #393948, 10007px 0 0 0 #393948; + } + 25% { + box-shadow: 10007px -16px 0 0 #393948, 9991px -16px 0 0 #393948, 9991px 0 0 0 #393948; + } + 33.333% { + box-shadow: 10007px 0 0 0 #393948, 9991px -16px 0 0 #393948, 9991px 0 0 0 #393948; + } + 41.667% { + box-shadow: 10007px 0 0 0 #393948, 10007px -16px 0 0 #393948, 9991px 0 0 0 #393948; + } + 50% { + box-shadow: 10007px 0 0 0 #393948, 10007px -16px 0 0 #393948, 9991px -16px 0 0 #393948; + } + 58.333% { + box-shadow: 9991px 0 0 0 #393948, 10007px -16px 0 0 #393948, 9991px -16px 0 0 #393948; + } + 66.666% { + box-shadow: 9991px 0 0 0 #393948, 10007px 0 0 0 #393948, 9991px -16px 0 0 #393948; + } + 75% { + box-shadow: 9991px 0 0 0 #393948, 10007px 0 0 0 #393948, 10007px -16px 0 0 #393948; + } + 83.333% { + box-shadow: 9991px -16px 0 0 #393948, 10007px 0 0 0 #393948, 10007px -16px 0 0 #393948; + } + 91.667% { + box-shadow: 9991px -16px 0 0 #393948, 9991px 0 0 0 #393948, 10007px -16px 0 0 #393948; + } + 100% { + box-shadow: 9991px -16px 0 0 #393948, 9991px 0 0 0 #393948, 10007px 0 0 0 #393948; + } +} + From f89d9dedd4c1a8f32266c2df8c3f35143efea407 Mon Sep 17 00:00:00 2001 From: wil Date: Tue, 26 Mar 2024 13:08:22 -0400 Subject: [PATCH 02/16] loading dots done --- app/components/LoadingDots.tsx | 74 ++++++++++++++++--- app/modules/LoadingScreen/LoadingScreen.tsx | 21 ------ app/modules/LoadingScreen/index.tsx | 1 - .../PageEnigma/comps/PreviewWindow/index.tsx | 13 +++- 4 files changed, 76 insertions(+), 33 deletions(-) delete mode 100644 app/modules/LoadingScreen/LoadingScreen.tsx delete mode 100644 app/modules/LoadingScreen/index.tsx diff --git a/app/components/LoadingDots.tsx b/app/components/LoadingDots.tsx index b12b84e869..b4aa233350 100644 --- a/app/components/LoadingDots.tsx +++ b/app/components/LoadingDots.tsx @@ -1,11 +1,67 @@ -export const LoadingDotsTyping = ()=>{ - return( -
- ); +import { useState, useEffect } from 'react'; + +interface LoadingDotsProps { + show?: boolean; + transition?: boolean; + transitionDuration?: number; +}; + +interface LoadingDotsInnerProps { + show?: boolean; + transition?: boolean; + transitionDuration?: number; + children: React.ReactNode; +}; + +export const LoadingDotsTyping = (props: LoadingDotsProps)=>{ + return ( + +
+
+ ) +} +export const LoadingDotsBricks = (props: LoadingDotsProps)=>{ + return ( + +
+
+ ) } -export const LoadingDotsBricks = ()=>{ - return( -
- ); -} \ No newline at end of file +function LoadingDots({ + show=true, + transition = false, + transitionDuration = 1000, + children, +}: LoadingDotsInnerProps){ + const [state, setState] = useState<'loading'|'loaded'|'completed'>('loading'); + const transitionClasses = + (transition ? `transition-opacity duration-${transitionDuration} `: "") + + (state === 'loading' ? 'opacity-100' : 'opacity-0'); + + const classNames = "w-full h-full flex justify-center items-center bg-ui-background " + transitionClasses; + useEffect(()=>{ + if(!show){ + if(transition){ + setState((curr)=>{ + if (curr === 'loading') return 'loaded' + else return curr; + }); + setTimeout(()=>setState('completed'), 2000); + } else { + setState('completed'); + } + } + }, [show, transition]); + + if(state!== 'completed'){ + return( +
+ {children} +
+ ); + }else{ + return null; + } +}; + diff --git a/app/modules/LoadingScreen/LoadingScreen.tsx b/app/modules/LoadingScreen/LoadingScreen.tsx deleted file mode 100644 index 0ccfe83a1f..0000000000 --- a/app/modules/LoadingScreen/LoadingScreen.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { LoadingDotsBricks } from "~/components"; - -export const LoadingScreen = ()=>{ - return( -
- -
- ); -}; \ No newline at end of file diff --git a/app/modules/LoadingScreen/index.tsx b/app/modules/LoadingScreen/index.tsx deleted file mode 100644 index edb7c50caf..0000000000 --- a/app/modules/LoadingScreen/index.tsx +++ /dev/null @@ -1 +0,0 @@ -export { LoadingScreen } from './LoadingScreen'; \ No newline at end of file diff --git a/app/pages/PageEnigma/comps/PreviewWindow/index.tsx b/app/pages/PageEnigma/comps/PreviewWindow/index.tsx index 92accbd2d2..7704c68ecd 100644 --- a/app/pages/PageEnigma/comps/PreviewWindow/index.tsx +++ b/app/pages/PageEnigma/comps/PreviewWindow/index.tsx @@ -1,10 +1,15 @@ -import { useContext } from "react" +import { useContext, useEffect, useState } from "react" import { EngineContext } from "~/contexts/EngineContext" +import { LoadingDotsTyping } from "~/components"; export const PreviewWindow = ()=>{ const editorEngine = useContext(EngineContext); //take data from egine context + const [showLoader, setShowLoader] = useState(true); + useEffect(()=>{ + setTimeout(()=>setShowLoader(false), 5000); + },[]); return (
{ >

Camera View

-
+
+ +
+ +
From da8bee2be99a3b0f9c1ab167e9f22f304b78e923 Mon Sep 17 00:00:00 2001 From: wil Date: Tue, 26 Mar 2024 14:31:00 -0400 Subject: [PATCH 03/16] styling update --- app/components/ItemPicker.tsx | 17 +++++++++++++- app/components/Textarea.tsx | 9 +++++++- .../comps/SidePanelTabs/TabStyling.tsx | 23 ++++++++++++++----- 3 files changed, 41 insertions(+), 8 deletions(-) diff --git a/app/components/ItemPicker.tsx b/app/components/ItemPicker.tsx index 90eae68411..a0949916ec 100644 --- a/app/components/ItemPicker.tsx +++ b/app/components/ItemPicker.tsx @@ -1,16 +1,31 @@ +import { twMerge } from "tailwind-merge"; import { H4 } from "."; + interface ItemPickerProps extends React.ImgHTMLAttributes { label: string + selected: boolean; + onSelected : (val:string)=>void; } export const ItemPicker = ({ label, + selected = false, + onSelected, ...imgProps }:ItemPickerProps) => { + + const handleSelected = ()=>{ + onSelected(label); + }; + return ( -
+
+

{label}

) diff --git a/app/components/Textarea.tsx b/app/components/Textarea.tsx index f9ca528ab9..3b069b39ee 100644 --- a/app/components/Textarea.tsx +++ b/app/components/Textarea.tsx @@ -7,11 +7,18 @@ export const Textarea = ({ }:TextareaHTMLAttributes) => { return(