Skip to content

Dev #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Nov 17, 2021
Merged

Dev #69

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Sleek, powerful front-end framework for quickly creating cross-platform VR Websites.
</h5>
<p align="center">
<a href="https://muse.place?utm_source=npmjs">muse.place</a> · <a href="https://discord.gg/nFHrmUbaz5">discord</a>
<a href="https://muse.place?utm_source=npmjs">muse.place</a> · <a href="https://discord.gg/nFHrmUbaz5">discord</a> · <b><a href="https://jobs.ashbyhq.com/muse/1e73e735-3c63-4131-a04d-ff3c73f3567e">we are hiring!</a></b>
<p>
<br/>
<br/>
Expand Down
2 changes: 1 addition & 1 deletion examples/src/scenes/Starter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {

const handleClick = () => window.open("https://www.apple.com", "_blank");
export default () => {
const [open, setOpen] = useState(false);
const [open, setOpen] = useState(true);
const [url, setUrl] = useState(
"https://dwvo2npct47gg.cloudfront.net/gallery/bladi/IMG_8334.jpg"
);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spacesvr",
"version": "1.8.5",
"version": "1.8.9",
"private": true,
"description": "An Environment for WebXR Spaces",
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions src/ideas/components/Video.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useEffect, useMemo, useRef, useState } from "react";
import * as THREE from "three";
import { useThree } from "@react-three/fiber";
import Frame from "../misc/Frame";
import { DoubleSide, LinearEncoding, Material, Vector2 } from "three";
import { DoubleSide, Material, sRGBEncoding, Vector2 } from "three";

type Props = JSX.IntrinsicElements["group"] & {
src: string;
Expand Down Expand Up @@ -112,7 +112,7 @@ export const Video = (props: Props) => {
<mesh>
<planeBufferGeometry attach="geometry" args={[width, height]} />
<meshBasicMaterial side={DoubleSide}>
<videoTexture attach="map" args={[video]} encoding={LinearEncoding} />
<videoTexture attach="map" args={[video]} encoding={sRGBEncoding} />
</meshBasicMaterial>
</mesh>
{speaker && <primitive object={speaker} />}
Expand Down
2 changes: 1 addition & 1 deletion src/layers/reality/ui/LoadingScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Container = styled.div<{ finished: boolean }>`
z-index: 200;
background: white;
transition: opacity 0.75s ease-in;
transition-delay: 1.25s;
transition-delay: 0.5s;
opacity: ${(props) => (props.finished ? "0" : "1")};
pointer-events: ${(props) => (props.finished ? "none" : "all")};
display: flex;
Expand Down
37 changes: 36 additions & 1 deletion src/layers/reality/ui/PauseMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,24 @@ const Continue = styled.div<{ color: string }>`
-8px -8px 12px 0 rgba(255, 255, 255, 0.3);
`;

const Footer = styled.div`
margin-top: 15px;
width: 100%;
text-align: center;
font-size: 0.75rem;
font-family: "Quicksand", sans-serif;

& > a {
color: #333;
line-height: 1em;
transition: opacity 0.15s linear;

:hover {
opacity: 0.5;
}
}
`;

const Logo = styled.img`
height: 0.8em;
vertical-align: middle;
Expand Down Expand Up @@ -186,7 +204,7 @@ export default function PauseMenu(props: PauseMenuProps) {
)}`,
},
{
text: "v1.8.5",
text: "v1.8.9",
action: () => {
console.log("");
},
Expand Down Expand Up @@ -221,6 +239,23 @@ export default function PauseMenu(props: PauseMenuProps) {
)
)}
</Actions>
<Footer>
<a
href="https://spaces-gallery-assets.s3.us-west-1.amazonaws.com/legal/musetermsofservice.pdf"
target="_blank"
rel="noreferrer"
>
terms and conditions
</a>
&nbsp;&nbsp;•&nbsp;&nbsp;
<a
href="https://spaces-gallery-assets.s3.us-west-1.amazonaws.com/legal/museprivacypolicy.pdf"
target="_blank"
rel="noreferrer"
>
privacy policy
</a>
</Footer>
</Window>
<Continue onClick={closeOverlay} color={continueIdea.getHex()}>
continue
Expand Down
21 changes: 7 additions & 14 deletions src/layers/reality/utils/loading.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import { useProgress } from "@react-three/drei";
* - a timeout when it reaches > 50%, marked as stuck
*/
export const useControlledProgress = () => {
const TIMEOUT = 2000; // minimum time to wait before moving to 100
const AFTER_TIME = 100; // extra time to prevent bouncing at reaching 100
const STUCK_TIMEOUT = 5500; // for safari, when stuck at a value above 50
const MIN_TIME = 2000; // minimum time to wait before moving to 100
const AFTER_TIME = 300; // extra time to prevent bouncing at reaching 100

const { progress, total } = useProgress();

Expand All @@ -24,7 +23,7 @@ export const useControlledProgress = () => {
const timeElapsed = newTime.getTime() - startTime.current.getTime();
const diff = Math.min(
progress - controlledProgress.current,
timeElapsed < TIMEOUT ? 99 : 100
timeElapsed < MIN_TIME ? 99 : 100
);
if (diff > 0) {
if (progress === 100) {
Expand All @@ -41,17 +40,11 @@ export const useControlledProgress = () => {
} else {
finished.current = false;
controlledProgress.current = progress;

// once above 50, skip progress is stuck then skip loading
if (progress > 50) {
setTimeout(() => {
if (controlledProgress.current === progress) {
setSkip(true);
}
}, STUCK_TIMEOUT);
}
}
}
if (progress !== 100) {
finished.current = false;
}
}, [progress]);

// wait TIMEOUT (ms) to check if any objects are waiting to be loaded
Expand All @@ -63,7 +56,7 @@ export const useControlledProgress = () => {
} else if (counter > 0) {
setSkip(true);
} else {
setTimeout(() => setCounter(counter + 1), TIMEOUT);
setTimeout(() => setCounter(counter + 1), MIN_TIME);
}
}, [counter]);

Expand Down