This commit is contained in:
2024-01-24 18:38:31 +05:00
parent 45cd2ad16f
commit 4be266124c
19 changed files with 341 additions and 79 deletions
@@ -0,0 +1,129 @@
<linker>
<assembly fullname="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="ColorPicker" preserve="all" />
<type fullname="IndoorCameraHandler" preserve="all" />
<type fullname="OutdoorCameraHandler" preserve="all" />
</assembly>
<assembly fullname="BakeryRuntimeAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="BakeryDirectLight" preserve="all" />
<type fullname="BakeryLightMesh" preserve="all" />
<type fullname="BakeryPointLight" preserve="all" />
<type fullname="ftLightmapsStorage" preserve="all" />
<type fullname=".ftGlobalStorage/AdjustedMesh" preserve="nothing" serialized="true" />
<type fullname=".ftGlobalStorage/AtlasPacker" preserve="nothing" serialized="true" />
<type fullname=".ftLightmapsStorage/LightData" preserve="nothing" serialized="true" />
<type fullname=".ftLightmapsStorage/SectorData" preserve="nothing" serialized="true" />
</assembly>
<assembly fullname="Cinemachine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="Cinemachine.CinemachineBrain" preserve="all" />
<type fullname="Cinemachine.CinemachineHardLockToTarget" preserve="all" />
<type fullname="Cinemachine.CinemachineHardLookAt" preserve="all" />
<type fullname="Cinemachine.CinemachinePipeline" preserve="all" />
<type fullname="Cinemachine.CinemachineSameAsFollowTarget" preserve="all" />
<type fullname="Cinemachine.CinemachineTransposer" preserve="all" />
<type fullname="Cinemachine.CinemachineVirtualCamera" preserve="all" />
<type fullname="Cinemachine.CinemachineBlendDefinition" preserve="nothing" serialized="true" />
<type fullname="Cinemachine.CinemachineBrain/BrainEvent" preserve="nothing" serialized="true" />
<type fullname="Cinemachine.CinemachineBrain/VcamActivatedEvent" preserve="nothing" serialized="true" />
<type fullname="Cinemachine.CinemachineVirtualCameraBase/TransitionParams" preserve="nothing" serialized="true" />
<type fullname="Cinemachine.LensSettings" preserve="nothing" serialized="true" />
</assembly>
<assembly fullname="Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
<type fullname="UnityEngine.AddressableAssets.Addressables" preserve="all" />
</assembly>
<assembly fullname="Unity.InputSystem, Version=1.7.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="UnityEngine.InputSystem.InputActionAsset" preserve="all" />
<type fullname="UnityEngine.InputSystem.InputActionReference" preserve="all" />
<type fullname="UnityEngine.InputSystem.UI.InputSystemUIInputModule" preserve="all" />
<type fullname="UnityEngine.InputSystem.InputAction" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.InputSystem.InputActionMap" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.InputSystem.InputBinding" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.InputSystem.InputControlScheme" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.InputSystem.InputControlScheme/DeviceRequirement" preserve="nothing" serialized="true" />
</assembly>
<assembly fullname="Unity.RenderPipelines.Core.Runtime, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="UnityEngine.Rendering.Volume" preserve="all" />
<type fullname="UnityEngine.Rendering.VolumeProfile" preserve="all" />
<type fullname="UnityEngine.Rendering.BoolParameter" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.Rendering.ClampedFloatParameter" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.Rendering.ClampedIntParameter" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.Rendering.ColorParameter" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.Rendering.MinFloatParameter" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.Rendering.TextureParameter" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.Rendering.Vector2Parameter" preserve="nothing" serialized="true" />
</assembly>
<assembly fullname="Unity.RenderPipelines.Universal.Runtime, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="UnityEngine.Rendering.Universal.Bloom" preserve="all" />
<type fullname="UnityEngine.Rendering.Universal.Tonemapping" preserve="all" />
<type fullname="UnityEngine.Rendering.Universal.UniversalAdditionalCameraData" preserve="all" />
<type fullname="UnityEngine.Rendering.Universal.UniversalAdditionalLightData" preserve="all" />
<type fullname="UnityEngine.Rendering.Universal.Vignette" preserve="all" />
<type fullname="UnityEngine.Rendering.Universal.DownscaleParameter" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.Rendering.Universal.HDRACESPresetParameter" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.Rendering.Universal.NeutralRangeReductionModeParameter" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.Rendering.Universal.TemporalAA/Settings" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.Rendering.Universal.TonemappingModeParameter" preserve="nothing" serialized="true" />
</assembly>
<assembly fullname="Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider" preserve="all" />
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider" preserve="all" />
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider" preserve="all" />
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.LegacyResourcesProvider" preserve="all" />
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.SceneProvider" preserve="all" />
</assembly>
<assembly fullname="UnityEngine.AudioModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="UnityEngine.AudioListener" preserve="all" />
</assembly>
<assembly fullname="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="UnityEngine.Camera" preserve="all" />
<type fullname="UnityEngine.Cubemap" preserve="all" />
<type fullname="UnityEngine.GameObject" preserve="all" />
<type fullname="UnityEngine.Light" preserve="all" />
<type fullname="UnityEngine.LightingSettings" preserve="all" />
<type fullname="UnityEngine.LightmapSettings" preserve="all" />
<type fullname="UnityEngine.LightProbeGroup" preserve="all" />
<type fullname="UnityEngine.LightProbes" preserve="all" />
<type fullname="UnityEngine.LODGroup" preserve="all" />
<type fullname="UnityEngine.Material" preserve="all" />
<type fullname="UnityEngine.Mesh" preserve="all" />
<type fullname="UnityEngine.MeshFilter" preserve="all" />
<type fullname="UnityEngine.MeshRenderer" preserve="all" />
<type fullname="UnityEngine.Object" preserve="all" />
<type fullname="UnityEngine.RectTransform" preserve="all" />
<type fullname="UnityEngine.ReflectionProbe" preserve="all" />
<type fullname="UnityEngine.RenderSettings" preserve="all" />
<type fullname="UnityEngine.Shader" preserve="all" />
<type fullname="UnityEngine.Texture2D" preserve="all" />
<type fullname="UnityEngine.Transform" preserve="all" />
<type fullname="UnityEngine.Events.PersistentCallGroup" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.Events.UnityEvent" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.RectOffset" preserve="nothing" serialized="true" />
</assembly>
<assembly fullname="UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="UnityEngine.BoxCollider" preserve="all" />
<type fullname="UnityEngine.MeshCollider" preserve="all" />
</assembly>
<assembly fullname="UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="UnityEngine.EventSystems.EventSystem" preserve="all" />
<type fullname="UnityEngine.UI.CanvasScaler" preserve="all" />
<type fullname="UnityEngine.UI.ContentSizeFitter" preserve="all" />
<type fullname="UnityEngine.UI.GraphicRaycaster" preserve="all" />
<type fullname="UnityEngine.UI.HorizontalLayoutGroup" preserve="all" />
<type fullname="UnityEngine.UI.Image" preserve="all" />
<type fullname="UnityEngine.UI.Toggle" preserve="all" />
<type fullname="UnityEngine.UI.ToggleGroup" preserve="all" />
<type fullname="UnityEngine.UI.AnimationTriggers" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.UI.ColorBlock" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.UI.MaskableGraphic/CullStateChangedEvent" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.UI.Navigation" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.UI.SpriteState" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.UI.Toggle/ToggleEvent" preserve="nothing" serialized="true" />
</assembly>
<assembly fullname="UnityEngine.UIModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="UnityEngine.Canvas" preserve="all" />
<type fullname="UnityEngine.CanvasRenderer" preserve="all" />
</assembly>
<assembly fullname="Zenject, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="Zenject.SceneContext" preserve="all" />
</assembly>
</linker>
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
{"m_buildTarget":"WebGL","m_SettingsHash":"254e8cd717ac24c4e28f4ae82d967d4b","m_CatalogLocations":[{"m_Keys":["AddressablesMainContentCatalog"],"m_InternalId":"{UnityEngine.AddressableAssets.Addressables.RuntimePath}/catalog.json","m_Provider":"UnityEngine.AddressableAssets.ResourceProviders.ContentCatalogProvider","m_Dependencies":[],"m_ResourceType":{"m_AssemblyName":"Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null","m_ClassName":"UnityEngine.AddressableAssets.ResourceLocators.ContentCatalogData"},"SerializedData":[7,76,85,110,105,116,121,46,82,101,115,111,117,114,99,101,77,97,110,97,103,101,114,44,32,86,101,114,115,105,111,110,61,48,46,48,46,48,46,48,44,32,67,117,108,116,117,114,101,61,110,101,117,116,114,97,108,44,32,80,117,98,108,105,99,75,101,121,84,111,107,101,110,61,110,117,108,108,75,85,110,105,116,121,69,110,103,105,110,101,46,82,101,115,111,117,114,99,101,77,97,110,97,103,101,109,101,110,116,46,82,101,115,111,117,114,99,101,80,114,111,118,105,100,101,114,115,46,80,114,111,118,105,100,101,114,76,111,97,100,82,101,113,117,101,115,116,79,112,116,105,111,110,115,50,0,0,0,123,0,34,0,109,0,95,0,73,0,103,0,110,0,111,0,114,0,101,0,70,0,97,0,105,0,108,0,117,0,114,0,101,0,115,0,34,0,58,0,116,0,114,0,117,0,101,0,125,0]}],"m_ProfileEvents":false,"m_LogResourceManagerExceptions":true,"m_ExtraInitializationData":[],"m_DisableCatalogUpdateOnStart":false,"m_IsLocalCatalogInBundle":false,"m_CertificateHandlerType":{"m_AssemblyName":"","m_ClassName":""},"m_AddressablesVersion":"1.21.19","m_maxConcurrentWebRequests":3,"m_CatalogRequestsTimeout":0}
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 MiB

+3 -2
View File
@@ -1,8 +1,9 @@
import "./App.css";
import MainView from "./views/MainView";
import Main from "./pages/Main";
import Apartment from "./pages/Apartment";
function App() {
return <MainView />;
return <Apartment />;
}
export default App;
+17
View File
@@ -0,0 +1,17 @@
import { Outlet } from "react-router-dom";
import BackIcon from "../icons/BackIcon";
const Header = () => {
return (
<>
<header className="fixed left-0 top-0 px-2 w-full bg-[#ddd8d5] z-40 h-11 flex items-center justify-between">
<BackIcon />
<div className="items-center font-medium text-lg">A1M</div>
<div></div>
</header>
{<Outlet />}
</>
);
};
export default Header;
+1 -1
View File
@@ -29,7 +29,7 @@ const LoaderModal = () => {
}, []);
return (
<div className="bg-[#F3F2F0] h-full w-full flex justify-center items-center flex-col fixed">
<div className="bg-[#F3F2F0] h-full w-full flex justify-center items-center flex-col fixed z-30">
<LoadingIcon className="animate-spin w-16" />
<div className="relative h-7 overflow-hidden">
<div
+69 -27
View File
@@ -4,16 +4,22 @@ import { Parameters as ParametersType } from "../types/appartment";
import Parameters from "./Parameters";
import Slider from "./Slider";
import { SwipeEventData, useSwipeable } from "react-swipeable";
import { HandledEvents } from "react-swipeable/es/types";
type ViewControllerProps = {
parameters: ParametersType;
};
const apartmentViews = [
{ id: 1, title: "General View" },
{ id: 2, title: "Ground Floor" },
{ id: 3, title: "First Floor" },
];
const ViewController = ({ parameters }: ViewControllerProps) => {
const { sliders } = parameters;
const [offset, setOffset] = useState(0);
const [isScroll, setIsScroll] = useState(false);
const [offset, setOffset] = useState(1);
const [selectedViewId, setSelectedViewId] = useState(apartmentViews[0].id);
// const [animationFrame, setAnimationFrame] = useState(0)
const handleOnSwiped = (eventData: SwipeEventData) => {
if (eventData.dir === "Down") {
@@ -30,8 +36,8 @@ const ViewController = ({ parameters }: ViewControllerProps) => {
setOffset(1);
};
const handleOnTouchEnd = ({ event }: { event: HandledEvents }) => {
console.log("event", event);
const handleOnViewClick = (viewId: number) => {
return () => setSelectedViewId(viewId);
};
const handlers = useSwipeable({
@@ -43,33 +49,69 @@ const ViewController = ({ parameters }: ViewControllerProps) => {
// onSwiped: () => console.log("first"),
// onTouchEndOrOnMouseUp: handleOnTouchEnd,
// swipeDuration: 300,
preventScrollOnSwipe: true,
// preventScrollOnSwipe: true,
// onSwipedDown: (e) => e.preventDefault(),
});
return (
<div
className="bg-white w-full h-screen border rounded-ss-2xl rounded-se-2xl flex flex-col transition-all duration-1000 overflow-hidden"
style={{
transform: `translateY(calc(${offset * 90}vh))`,
}}
{...handlers}
>
<div className="mx-auto flex justify-center self-start w-full">
<ButtonSwipperIcon />
</div>
<div className="h-[calc(100vh-110px)] overflow-y-scroll">
<Slider sliders={sliders} />
<Parameters parameters={parameters} />
</div>
<div className="px-6 py-3 mt-auto border">
<button
className="border flex w-full py-3 justify-center rounded-full"
onClick={handleOnBackClick}
>
Back
</button>
<div className="bg-white flex flex-col transition-all duration-1000 fixed left-0 bottom-28">
<div
className={`${
offset === 1 ? "rounded-ss-2xl rounded-se-2xl" : ""
} bg-white w-full h-[calc(100vh)] border flex flex-col transition-all duration-1000 fixed left-0 top-11`}
style={{
transform: `translateY(calc(${offset * 80}vh))`,
}}
>
<div className="absolute top-[-51px] w-full h-9 px-6 bg">
<div
className={`even bg-white rounded-[32px] flex text-sm justify-center w-fit border-2 transition-all duration-500 mx-auto`}
style={{
opacity: offset,
pointerEvents: `${offset === 0 ? "none" : "auto"}`,
}}
>
{apartmentViews.map((view) => (
<div
onClick={handleOnViewClick(view.id)}
key={view.id}
className={`${
selectedViewId === view.id ? "bg-black text-white" : ""
} py-2 px-4 w-fit rounded-[32px] `}
>
{" "}
{view.title}
</div>
))}
</div>
</div>
<div className="mx-auto flex justify-center self-start w-full">
<ButtonSwipperIcon />
</div>
<div className="h-[calc(100vh-110px)] overflow-y-scroll relative">
<div
className="absolute bg-black z-30 h-[30%] w-full opacity-0"
{...handlers}
></div>
<Slider sliders={sliders} />
<Parameters parameters={parameters} />
<div className="flex p-6 gap-2 overflow-x-scroll">
{parameters.perspectiveWorkings.map((working) => (
<img className="rounded-lg" src={working} alt="" key={working} />
))}
</div>
</div>
<div className="px-6 pt-4 pb-14 mt-auto border">
<button
className="border flex w-full py-3 justify-center rounded-full"
onClick={handleOnBackClick}
>
Back
</button>
</div>
</div>
</div>
// </div>
);
};
+18
View File
@@ -0,0 +1,18 @@
const BackIcon = () => {
return (
<svg
width="12"
height="20"
viewBox="0 0 12 20"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M0.610352 10.0068C0.610352 10.195 0.646322 10.3721 0.718262 10.5381C0.790202 10.6986 0.903646 10.8535 1.05859 11.0029L9.37598 19.0547C9.61393 19.2982 9.90723 19.4199 10.2559 19.4199C10.4883 19.4199 10.6986 19.3618 10.8867 19.2456C11.0804 19.1349 11.2326 18.9855 11.3433 18.7974C11.4595 18.6092 11.5176 18.3962 11.5176 18.1582C11.5176 17.8206 11.3875 17.519 11.1274 17.2534L3.60693 9.99854L11.1274 2.75195C11.3875 2.49186 11.5176 2.19027 11.5176 1.84717C11.5176 1.61475 11.4595 1.40446 11.3433 1.21631C11.2326 1.02816 11.0804 0.878743 10.8867 0.768066C10.6986 0.657389 10.4883 0.602051 10.2559 0.602051C9.90723 0.602051 9.61393 0.721029 9.37598 0.958984L1.05859 9.01074C0.90918 9.16016 0.798503 9.3151 0.726562 9.47559C0.654622 9.63607 0.615885 9.81315 0.610352 10.0068Z"
fill="#050409"
/>
</svg>
);
};
export default BackIcon;
+8 -2
View File
@@ -2,11 +2,17 @@ import ReactDOM from "react-dom/client";
import { createBrowserRouter, RouterProvider } from "react-router-dom";
import App from "./App.tsx";
import "./index.css";
import Header from "./components/Header.tsx";
const router = createBrowserRouter([
{
path: "/",
element: <App />,
element: <Header />,
children: [
{
path: "/",
element: <App />,
},
],
},
]);
+69
View File
@@ -0,0 +1,69 @@
import { useEffect } from "react";
import ViewController from "../components/ViewController";
import useStore from "../store/store";
import { Parameters } from "../types/appartment";
import { Unity, useUnityContext } from "react-unity-webgl";
import LoaderModal from "../components/LoaderModal";
const mainViewParams: Parameters = {
type: "A1M",
plotArea: "1080 Sq.m",
totalBuildUpArea: "472 Sq.m",
TotalCountBedroms: 5,
villaTheme: "Modern",
sliders: [
{
title: "General View",
image: "/images/apartment/A1M/A1M_P.png",
},
{
title: "Ground Floor",
image: "/images/apartment/A1M/A1M_GF.png",
},
{
title: "First Floor",
image: "/images/apartment/A1M/A1M_1F.png",
},
],
perspectiveWorkings: [
"/images/apartment/A1M/perspectiveWorking/009_Villa_A1MO_CAM_01_R05.jpg",
"/images/apartment/A1M/perspectiveWorking/009_Villa_A1MO_CAM_02_R05.jpg",
],
};
const Apartment = () => {
const { modal, setModal } = useStore();
const { unityProvider, isLoaded } = useUnityContext({
loaderUrl: "builds/estate-webgl-stable.loader.js",
dataUrl: "builds/estate-webgl-stable.data.unityweb",
frameworkUrl: "builds/estate-webgl-stable.framework.js.unityweb",
codeUrl: "builds/estate-webgl-stable.wasm.unityweb",
streamingAssetsUrl: "StreamingAssets",
});
useEffect(() => {
if (!isLoaded) {
setModal(<LoaderModal />);
} else {
setModal(null);
}
return () => {};
}, [isLoaded, setModal]);
return (
<>
{modal}
<div className="h-screen overflow-hidden relative">
<Unity
unityProvider={unityProvider}
style={{ width: "100vw", height: "100vh" }}
/>
<ViewController parameters={mainViewParams} />
</div>
</>
);
};
export default Apartment;
+23
View File
@@ -0,0 +1,23 @@
import { useEffect } from "react";
import useStore from "../store/store";
// import { isMobile } from "react-device-detect";
import ViewController from "../components/ViewController";
import { Parameters } from "../types/appartment";
import LoaderModal from "../components/LoaderModal";
const Main = () => {
const { modal, setModal } = useStore();
useEffect(() => {
// setModal(<LoaderModal />);
}, [setModal]);
return (
<div className="h-screen overflow-hidden">
{modal}
{/* <ViewController parameters={mainViewParams} /> */}
</div>
);
};
export default Main;
+1
View File
@@ -10,6 +10,7 @@ type Parameters = {
TotalCountBedroms: number;
villaTheme: string;
sliders: Slider[];
perspectiveWorkings: string[]
};
export type {Slider as SliderType, Parameters}
-47
View File
@@ -1,47 +0,0 @@
import { useEffect } from "react";
import useStore from "../store/store";
// import LoaderModal from "../components/LoaderModal";
import { isMobile } from "react-device-detect";
import ViewController from "../components/ViewController";
import { Parameters } from "../types/appartment";
const mainViewParams: Parameters = {
type: "A1M",
plotArea: "1080 Sq.m",
totalBuildUpArea: "472 Sq.m",
TotalCountBedroms: 5,
villaTheme: "Modern",
sliders: [
{
title: "General View",
image: "/images/apartment/A1M/A1M_P.png",
},
{
title: "Ground Floor",
image: "/images/apartment/A1M/A1M_GF.png",
},
{
title: "First Floor",
image: "/images/apartment/A1M/A1M_1F.png",
},
],
};
const MainView = () => {
const { modal, setModal } = useStore();
console.log("isMobile", isMobile);
useEffect(() => {
// setModal(<LoaderModal />);
}, [setModal]);
return (
<>
{modal}
{/* <div className="bg-black w-8 h-8 text-white ">add</div> */}
<ViewController parameters={mainViewParams} />
</>
);
};
export default MainView;