Skip to content

Commit ff50ab4

Browse files
authored
Merge pull request #69 from spacesvr/dev
Dev
2 parents 90c337f + 2236d47 commit ff50ab4

File tree

7 files changed

+49
-21
lines changed

7 files changed

+49
-21
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
Sleek, powerful front-end framework for quickly creating cross-platform VR Websites.
1111
</h5>
1212
<p align="center">
13-
<a href="https://muse.place?utm_source=npmjs">muse.place</a> · <a href="https://discord.gg/nFHrmUbaz5">discord</a>
13+
<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>
1414
<p>
1515
<br/>
1616
<br/>

examples/src/scenes/Starter.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414

1515
const handleClick = () => window.open("https://www.apple.com", "_blank");
1616
export default () => {
17-
const [open, setOpen] = useState(false);
17+
const [open, setOpen] = useState(true);
1818
const [url, setUrl] = useState(
1919
"https://dwvo2npct47gg.cloudfront.net/gallery/bladi/IMG_8334.jpg"
2020
);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "spacesvr",
3-
"version": "1.8.5",
3+
"version": "1.8.9",
44
"private": true,
55
"description": "An Environment for WebXR Spaces",
66
"keywords": [

src/ideas/components/Video.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useEffect, useMemo, useRef, useState } from "react";
22
import * as THREE from "three";
33
import { useThree } from "@react-three/fiber";
44
import Frame from "../misc/Frame";
5-
import { DoubleSide, LinearEncoding, Material, Vector2 } from "three";
5+
import { DoubleSide, Material, sRGBEncoding, Vector2 } from "three";
66

77
type Props = JSX.IntrinsicElements["group"] & {
88
src: string;
@@ -112,7 +112,7 @@ export const Video = (props: Props) => {
112112
<mesh>
113113
<planeBufferGeometry attach="geometry" args={[width, height]} />
114114
<meshBasicMaterial side={DoubleSide}>
115-
<videoTexture attach="map" args={[video]} encoding={LinearEncoding} />
115+
<videoTexture attach="map" args={[video]} encoding={sRGBEncoding} />
116116
</meshBasicMaterial>
117117
</mesh>
118118
{speaker && <primitive object={speaker} />}

src/layers/reality/ui/LoadingScreen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const Container = styled.div<{ finished: boolean }>`
1010
z-index: 200;
1111
background: white;
1212
transition: opacity 0.75s ease-in;
13-
transition-delay: 1.25s;
13+
transition-delay: 0.5s;
1414
opacity: ${(props) => (props.finished ? "0" : "1")};
1515
pointer-events: ${(props) => (props.finished ? "none" : "all")};
1616
display: flex;

src/layers/reality/ui/PauseMenu.tsx

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,24 @@ const Continue = styled.div<{ color: string }>`
7878
-8px -8px 12px 0 rgba(255, 255, 255, 0.3);
7979
`;
8080

81+
const Footer = styled.div`
82+
margin-top: 15px;
83+
width: 100%;
84+
text-align: center;
85+
font-size: 0.75rem;
86+
font-family: "Quicksand", sans-serif;
87+
88+
& > a {
89+
color: #333;
90+
line-height: 1em;
91+
transition: opacity 0.15s linear;
92+
93+
:hover {
94+
opacity: 0.5;
95+
}
96+
}
97+
`;
98+
8199
const Logo = styled.img`
82100
height: 0.8em;
83101
vertical-align: middle;
@@ -186,7 +204,7 @@ export default function PauseMenu(props: PauseMenuProps) {
186204
)}`,
187205
},
188206
{
189-
text: "v1.8.5",
207+
text: "v1.8.9",
190208
action: () => {
191209
console.log("");
192210
},
@@ -221,6 +239,23 @@ export default function PauseMenu(props: PauseMenuProps) {
221239
)
222240
)}
223241
</Actions>
242+
<Footer>
243+
<a
244+
href="https://spaces-gallery-assets.s3.us-west-1.amazonaws.com/legal/musetermsofservice.pdf"
245+
target="_blank"
246+
rel="noreferrer"
247+
>
248+
terms and conditions
249+
</a>
250+
&nbsp;&nbsp;•&nbsp;&nbsp;
251+
<a
252+
href="https://spaces-gallery-assets.s3.us-west-1.amazonaws.com/legal/museprivacypolicy.pdf"
253+
target="_blank"
254+
rel="noreferrer"
255+
>
256+
privacy policy
257+
</a>
258+
</Footer>
224259
</Window>
225260
<Continue onClick={closeOverlay} color={continueIdea.getHex()}>
226261
continue

src/layers/reality/utils/loading.ts

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ import { useProgress } from "@react-three/drei";
88
* - a timeout when it reaches > 50%, marked as stuck
99
*/
1010
export const useControlledProgress = () => {
11-
const TIMEOUT = 2000; // minimum time to wait before moving to 100
12-
const AFTER_TIME = 100; // extra time to prevent bouncing at reaching 100
13-
const STUCK_TIMEOUT = 5500; // for safari, when stuck at a value above 50
11+
const MIN_TIME = 2000; // minimum time to wait before moving to 100
12+
const AFTER_TIME = 300; // extra time to prevent bouncing at reaching 100
1413

1514
const { progress, total } = useProgress();
1615

@@ -24,7 +23,7 @@ export const useControlledProgress = () => {
2423
const timeElapsed = newTime.getTime() - startTime.current.getTime();
2524
const diff = Math.min(
2625
progress - controlledProgress.current,
27-
timeElapsed < TIMEOUT ? 99 : 100
26+
timeElapsed < MIN_TIME ? 99 : 100
2827
);
2928
if (diff > 0) {
3029
if (progress === 100) {
@@ -41,17 +40,11 @@ export const useControlledProgress = () => {
4140
} else {
4241
finished.current = false;
4342
controlledProgress.current = progress;
44-
45-
// once above 50, skip progress is stuck then skip loading
46-
if (progress > 50) {
47-
setTimeout(() => {
48-
if (controlledProgress.current === progress) {
49-
setSkip(true);
50-
}
51-
}, STUCK_TIMEOUT);
52-
}
5343
}
5444
}
45+
if (progress !== 100) {
46+
finished.current = false;
47+
}
5548
}, [progress]);
5649

5750
// wait TIMEOUT (ms) to check if any objects are waiting to be loaded
@@ -63,7 +56,7 @@ export const useControlledProgress = () => {
6356
} else if (counter > 0) {
6457
setSkip(true);
6558
} else {
66-
setTimeout(() => setCounter(counter + 1), TIMEOUT);
59+
setTimeout(() => setCounter(counter + 1), MIN_TIME);
6760
}
6861
}, [counter]);
6962

0 commit comments

Comments
 (0)